Example #1
0
  // 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);
  }
Example #2
0
  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);
  }