net.clackrouter.packets
Class DNSPacket
java.lang.Object
net.clackrouter.protocol.data.VNSData
net.clackrouter.packets.VNSPacket
net.clackrouter.packets.DNSPacket
public class DNSPacket
- extends VNSPacket
Represents a Domain Name System (DNS) packet.
Currently supports simple requests and responses with Query,
Answer, Authority and Additional record types.
Constructor Summary |
DNSPacket(java.nio.ByteBuffer buf)
|
DNSPacket(int transactionID,
int flags)
|
Methods inherited from class net.clackrouter.packets.VNSPacket |
addToPath, get16bit, get32bit, getByteBuffer, getInputInterfaceName, getLength, getLevel2Type, getNextHopIPAddress, getNextHopMacAddress, getOutputInterfaceName, getParentHeader, getStringBuffer, isPacket, needsSourceAddress, setByteBuffer, setInputInterfaceName, setLevel2Type, setNeedsSourceAddress, setNextHopIPAddress, setNextHopMacAddress, setOutputInterfaceName, setParentHeader, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DNS_PORT
public static final int DNS_PORT
- See Also:
- Constant Field Values
HEADER_SIZE
public static final short HEADER_SIZE
- See Also:
- Constant Field Values
FLAGS_QUERY_RESPONSE_NO_ERROR
public static final int FLAGS_QUERY_RESPONSE_NO_ERROR
- See Also:
- Constant Field Values
FLAGS_QUERY_STANDARD
public static final int FLAGS_QUERY_STANDARD
- See Also:
- Constant Field Values
TYPE_A
public static final int TYPE_A
- See Also:
- Constant Field Values
TYPE_NS
public static final int TYPE_NS
- See Also:
- Constant Field Values
TYPE_CNAME
public static final int TYPE_CNAME
- See Also:
- Constant Field Values
TYPE_MX
public static final int TYPE_MX
- See Also:
- Constant Field Values
CLASS_INET
public static final int CLASS_INET
- See Also:
- Constant Field Values
DNSPacket
public DNSPacket(java.nio.ByteBuffer buf)
throws java.lang.Exception
- Throws:
java.lang.Exception
DNSPacket
public DNSPacket(int transactionID,
int flags)
throws java.lang.Exception
- Throws:
java.lang.Exception
addQueryRecord
public void addQueryRecord(DNSPacket.Query q)
addAnswerRecord
public void addAnswerRecord(DNSPacket.Answer a)
addAuthorityRecord
public void addAuthorityRecord(DNSPacket.Answer a)
addAdditionalRecord
public void addAdditionalRecord(DNSPacket.Answer a)
getQueryRecord
public DNSPacket.Query getQueryRecord(int i)
getAnswerRecord
public DNSPacket.Answer getAnswerRecord(int i)
getAuthorityRecord
public DNSPacket.Answer getAuthorityRecord(int i)
getAdditionalRecord
public DNSPacket.Answer getAdditionalRecord(int i)
getQueryRecordCount
public int getQueryRecordCount()
getAnswerRecordCount
public int getAnswerRecordCount()
getAuthorityRecordCount
public int getAuthorityRecordCount()
getAdditionalRecordCount
public int getAdditionalRecordCount()
getFlags
public short getFlags()
setFlags
public void setFlags(short f)
getID
public short getID()
setID
public void setID(short id)
pack
public void pack()
getQNameArray
public static byte[] getQNameArray(java.lang.String name)