コード例 #1
0
ファイル: Record.java プロジェクト: jonbodner/hopper
  // this is needed for overriding in the OPTRecord, which needs to reuse the CLASS as payload.
  protected void toWireCanonical(DNSOutput out, Name inName, int inType, int inClass, long inTtl) {

    inName.toWireCanonical(out);
    out.writeU16(inType);
    out.writeU16(inClass);
    out.writeU32(inTtl);

    int lengthPosition = out.current();
    out.writeU16(0); /* until we know better */
    rrToWire(out, null, true);
    int rrlength = out.current() - lengthPosition - 2;
    out.writeU16At(rrlength, lengthPosition);
  }
コード例 #2
0
ファイル: Record.java プロジェクト: jonbodner/hopper
  protected void toWire(
      DNSOutput out, int section, Compression c, Name inName, int inType, int inClass, long inTtl) {

    inName.toWire(out, c);
    out.writeU16(inType);
    out.writeU16(inClass);
    if (section == Section.QUESTION) {
      return;
    }
    out.writeU32(inTtl);
    int lengthPosition = out.current();
    out.writeU16(0); /* until we know better */
    rrToWire(out, c, false);
    int rrlength = out.current() - lengthPosition - 2;
    out.writeU16At(rrlength, lengthPosition);
  }
コード例 #3
0
ファイル: Record.java プロジェクト: jonbodner/hopper
 /**
  * Converts the rdata in a Record into canonical DNS uncompressed wire format (all names are
  * converted to lowercase).
  */
 public byte[] rdataToWireCanonical() {
   DNSOutput out = new DNSOutput();
   rrToWire(out, null, true);
   return out.toByteArray();
 }
コード例 #4
0
ファイル: Record.java プロジェクト: jonbodner/hopper
 /*
  * Converts a Record into canonical DNS uncompressed wire format (all names
  * are converted to lowercase), optionally ignoring the TTL.
  */
 protected byte[] toWireCanonical(boolean noTTL) {
   DNSOutput out = new DNSOutput();
   toWireCanonical(out, noTTL);
   return out.toByteArray();
 }
コード例 #5
0
ファイル: Record.java プロジェクト: jonbodner/hopper
 /** Converts a Record into DNS uncompressed wire format. */
 public byte[] toWire(int section) {
   DNSOutput out = new DNSOutput();
   toWire(out, section, null);
   return out.toByteArray();
 }