Updated Eclipse project and added a new qtype for MDNS

This commit is contained in:
ziver 2017-01-23 17:17:07 +01:00
parent db7ca23660
commit f34ac6f961
5 changed files with 18 additions and 13 deletions

View file

@ -63,13 +63,15 @@ public class DnsPacketQuestion implements BinaryStruct {
public static final int QTYPE_PTR = 12;
/** host information */
public static final int QTYPE_HINFO = 13;
/** mailbox or mail list information */
/** mailbox or mail list information */
public static final int QTYPE_MINFO = 14;
/** mail exchange */
public static final int QTYPE_MX = 15;
/** text strings */
public static final int QTYPE_TXT = 16;
/** A request for a transfer of an entire zone */
/** service location record */
public static final int QTYPE_SRV = 33;
/** A request for a transfer of an entire zone */
public static final int QTYPE_AXFR = 252;
/** A request for mailbox-related records (MB, MG or MR) */
public static final int QTYPE_MAILB = 253;

View file

@ -70,7 +70,7 @@ public class MulticastDnsClient extends ThreadedUDPNetwork implements ThreadedUD
public void sendProbe(String domain) throws IOException {
int id = (int)(Math.random() * 0xFFFF);
int id = 0;//(int)(Math.random() * 0xFFFF);
activeProbes.add(id);
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
BinaryStructOutputStream out = new BinaryStructOutputStream(buffer);
@ -80,7 +80,7 @@ public class MulticastDnsClient extends ThreadedUDPNetwork implements ThreadedUD
dnsPacket.getHeader().setDefaultQueryData();
dnsPacket.addQuestion(new DnsPacketQuestion(
domain,
DnsPacketQuestion.QTYPE_A,
DnsPacketQuestion.QTYPE_SRV,
DnsPacketQuestion.QCLASS_IN));
dnsPacket.write(out);