mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-25 10:12:18 -05:00
Merge branch 'v0.1'
Conflicts: src/main/java/de/measite/minidns/Record.java
This commit is contained in:
commit
1665f2e1b3
@ -515,7 +515,10 @@ public class DNSMessage {
|
|||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "-- DNSMessage " + id + " --\n" +
|
return "-- DNSMessage " + id + " --\n" +
|
||||||
Arrays.toString(answers);
|
"Q" + Arrays.toString(questions) +
|
||||||
|
"NS" + Arrays.toString(nameserverRecords) +
|
||||||
|
"A" + Arrays.toString(answers) +
|
||||||
|
"ARR" + Arrays.toString(additionalResourceRecords);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -134,4 +134,9 @@ public class Question {
|
|||||||
byte o[] = ((Question)other).toByteArray();
|
byte o[] = ((Question)other).toByteArray();
|
||||||
return Arrays.equals(t, o);
|
return Arrays.equals(t, o);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Question/" + clazz + "/" + type + ": " + name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -222,6 +222,11 @@ public class Record {
|
|||||||
*/
|
*/
|
||||||
protected Data payloadData;
|
protected Data payloadData;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MDNS defines the highest bit of the class as the unicast query bit.
|
||||||
|
*/
|
||||||
|
protected boolean unicastQuery;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse a given record based on the full message data and the current
|
* Parse a given record based on the full message data and the current
|
||||||
* stream position.
|
* stream position.
|
||||||
@ -233,7 +238,8 @@ public class Record {
|
|||||||
this.name = NameUtil.parse(dis, data);
|
this.name = NameUtil.parse(dis, data);
|
||||||
this.type = TYPE.getType(dis.readUnsignedShort());
|
this.type = TYPE.getType(dis.readUnsignedShort());
|
||||||
int clazzValue = dis.readUnsignedShort();
|
int clazzValue = dis.readUnsignedShort();
|
||||||
this.clazz = CLASS.getClass(clazzValue);
|
this.clazz = CLASS.getClass(clazzValue & 0x7fff);
|
||||||
|
this.unicastQuery = (clazzValue & 0x8000) > 0;
|
||||||
if (this.clazz == null) {
|
if (this.clazz == null) {
|
||||||
System.out.println("Unknown class " + clazzValue);
|
System.out.println("Unknown class " + clazzValue);
|
||||||
}
|
}
|
||||||
@ -298,6 +304,14 @@ public class Record {
|
|||||||
(q.getName().equals(name));
|
(q.getName().equals(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* See if this query/response was a unicast query (highest class bit set).
|
||||||
|
* @return True if it is a unicast query/response record.
|
||||||
|
*/
|
||||||
|
public boolean isUnicastQuery() {
|
||||||
|
return unicastQuery;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The generic record name, e.g. "measite.de".
|
* The generic record name, e.g. "measite.de".
|
||||||
* @return The record name.
|
* @return The record name.
|
||||||
|
Loading…
Reference in New Issue
Block a user