diff options
author | Rene Treffer <treffer+github@measite.de> | 2014-06-08 15:37:40 +0200 |
---|---|---|
committer | Rene Treffer <treffer+github@measite.de> | 2014-06-08 15:37:40 +0200 |
commit | f66c0db63f0c0b65ad59ac1a8aaadc1cbaf40761 (patch) | |
tree | d8f8364ccd928865b04056cdf3ac2c77812a5fa7 /src/main/java/de/measite/minidns/record/SRV.java | |
parent | 152be6eb1a22da8cebe24ac4ee05b487936c9f2a (diff) | |
parent | 52807fe7c415e9977cd2d7191b7e1251c9216256 (diff) |
Merge pull request #3 from Flowdalic/androidagnostic
Make minidns Android agnostic
Diffstat (limited to 'src/main/java/de/measite/minidns/record/SRV.java')
-rw-r--r-- | src/main/java/de/measite/minidns/record/SRV.java | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/src/main/java/de/measite/minidns/record/SRV.java b/src/main/java/de/measite/minidns/record/SRV.java new file mode 100644 index 00000000..32b70c4d --- /dev/null +++ b/src/main/java/de/measite/minidns/record/SRV.java @@ -0,0 +1,74 @@ +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; + +public class SRV implements Data { + + protected int priority; + protected int weight; + protected int port; + protected String name; + + public int getPriority() { + return priority; + } + + public void setPriority(int priority) { + this.priority = priority; + } + + public int getWeight() { + return weight; + } + + public void setWeight(int weight) { + this.weight = weight; + } + + public int getPort() { + return port; + } + + public void setPort(int port) { + this.port = port; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public byte[] toByteArray() { + // TODO Auto-generated method stub + return null; + } + + @Override + public void parse(DataInputStream dis, byte[] data, int length) + throws IOException + { + this.priority = dis.readUnsignedShort(); + this.weight = dis.readUnsignedShort(); + this.port = dis.readUnsignedShort(); + this.name = NameUtil.parse(dis, data); + } + + @Override + public String toString() { + return "SRV " + name + ":" + port + " p:" + priority + " w:" + weight; + } + + @Override + public TYPE getType() { + return TYPE.SRV; + } + +} |