Example #1
0
  void rrFromWire(DNSInput in) throws IOException {
    int version;

    version = in.readU8();
    if (version != 0) throw new WireParseException("Invalid LOC version");

    size = parseLOCformat(in.readU8());
    hPrecision = parseLOCformat(in.readU8());
    vPrecision = parseLOCformat(in.readU8());
    latitude = in.readU32();
    longitude = in.readU32();
    altitude = in.readU32();
  }
Example #2
0
  void rrFromWire(DNSInput in) throws IOException {
    hashAlg = in.readU8();
    flags = in.readU8();
    iterations = in.readU16();

    int salt_length = in.readU8();
    if (salt_length > 0) salt = in.readByteArray(salt_length);
    else salt = null;

    int next_length = in.readU8();
    next = in.readByteArray(next_length);
    types = new TypeBitmap(in);
  }
Example #3
0
 public TypeBitmap(DNSInput in) throws WireParseException {
   this();
   int lastbase = -1;
   while (in.remaining() > 0) {
     if (in.remaining() < 2) throw new WireParseException("invalid bitmap descriptor");
     int mapbase = in.readU8();
     if (mapbase < lastbase) throw new WireParseException("invalid ordering");
     int maplength = in.readU8();
     if (maplength > in.remaining()) throw new WireParseException("invalid bitmap");
     for (int i = 0; i < maplength; i++) {
       int current = in.readU8();
       if (current == 0) continue;
       for (int j = 0; j < 8; j++) {
         if ((current & (1 << (7 - j))) == 0) continue;
         int typecode = mapbase * 256 + +i * 8 + j;
         types.add(Mnemonic.toInteger(typecode));
       }
     }
   }
 }
Example #4
0
 void rrFromWire(DNSInput in) throws IOException {
   certType = in.readU16();
   keyTag = in.readU16();
   alg = in.readU8();
   cert = in.readByteArray();
 }