diff options
author | Rene Treffer <treffer@measite.de> | 2014-07-22 23:22:35 +0200 |
---|---|---|
committer | Rene Treffer <treffer@measite.de> | 2014-07-22 23:22:35 +0200 |
commit | 6eda21b4162d8a57c26da5b38595581490fbe2d2 (patch) | |
tree | c19fae655079a684e52a4b15ce5d55a462be19a5 /src/main/java/de/measite | |
parent | bc621bfcfbede74251a29c7ef7513498baa4062d (diff) |
Add PTR record parsing
Diffstat (limited to 'src/main/java/de/measite')
-rw-r--r-- | src/main/java/de/measite/minidns/DNSMessage.java | 2 | ||||
-rw-r--r-- | src/main/java/de/measite/minidns/Record.java | 4 | ||||
-rw-r--r-- | src/main/java/de/measite/minidns/record/PTR.java | 19 |
3 files changed, 24 insertions, 1 deletions
diff --git a/src/main/java/de/measite/minidns/DNSMessage.java b/src/main/java/de/measite/minidns/DNSMessage.java index fbee3b19..01c09645 100644 --- a/src/main/java/de/measite/minidns/DNSMessage.java +++ b/src/main/java/de/measite/minidns/DNSMessage.java @@ -424,7 +424,7 @@ public class DNSMessage { message.authenticData = ((header >> 5) & 1) == 1; message.checkDisabled = ((header >> 4) & 1) == 1; message.responseCode = RESPONSE_CODE.getResponseCode(header & 0xf); - message.receiveTimestamp = System.currentTimeMillis(); + message.receiveTimestamp = System.currentTimeMillis(); int questionCount = dis.readUnsignedShort(); int answerCount = dis.readUnsignedShort(); int nameserverCount = dis.readUnsignedShort(); diff --git a/src/main/java/de/measite/minidns/Record.java b/src/main/java/de/measite/minidns/Record.java index 8f8d0d0e..f14aa0b8 100644 --- a/src/main/java/de/measite/minidns/Record.java +++ b/src/main/java/de/measite/minidns/Record.java @@ -9,6 +9,7 @@ import de.measite.minidns.record.AAAA; import de.measite.minidns.record.CNAME; import de.measite.minidns.record.Data; import de.measite.minidns.record.NS; +import de.measite.minidns.record.PTR; import de.measite.minidns.record.SRV; import de.measite.minidns.util.NameUtil; @@ -250,6 +251,9 @@ public class Record { case CNAME: this.payloadData = new CNAME(); break; + case PTR: + this.payloadData = new PTR(); + break; default: System.out.println("Unparsed type " + type); this.payloadData = null; diff --git a/src/main/java/de/measite/minidns/record/PTR.java b/src/main/java/de/measite/minidns/record/PTR.java new file mode 100644 index 00000000..6e200655 --- /dev/null +++ b/src/main/java/de/measite/minidns/record/PTR.java @@ -0,0 +1,19 @@ +package de.measite.minidns.record; + +import java.io.DataInputStream; +import java.io.IOException; + +import de.measite.minidns.Record.TYPE; +import de.measite.minidns.util.NameUtil; + +/** + * A PTR record is handled like a CNAME + */ +public class PTR extends CNAME { + + @Override + public TYPE getType() { + return TYPE.PTR; + } + +} |