com.antiaction.dns.record
Interface DNSRDataInterface

All Superinterfaces:
java.lang.Cloneable
All Known Implementing Classes:
DNSRDataMD, DNSRDataMR, DNSRDataMX, DNSRDataNS, DNSRDataNULL, DNSRDataPTR, DNSRDataSOA, DNSRDataHINFO, DNSRDataGeneric, DNSRDataMINFO, DNSRDataTXT, DNSRDataCName, DNSRDataMF, DNSRDataMB, DNSRDataWKS, DNSRDataA, DNSRDataMG

public interface DNSRDataInterface
extends java.lang.Cloneable

DNS RData interface, abstract class each record data class must implemented.

Version:
2.00
Author:
Nicholas Clarke

Method Summary
 byte[] buildPacket(DNSName dnsname, int globalIdx)
          Build and return the rdata packet on the internal state.
 java.lang.Object clone()
          Overrides Cloneable.
 void disassemblePacket(DNSName dnsname, byte[] pDat, int pIdx, int pLen)
          Parses the rdata part of a record.
 int getDisassembledLen()
          Returns the length of the previously disassembled rdata part.
 int getRType()
          Get the record type.
 void setDebug(boolean b)
          Toggle debug status.
 java.lang.String toString()
          Returns a string representation of the internal state, mostly for debugging purposes.
 

Method Detail

clone

public java.lang.Object clone()
Overrides Cloneable.
Overrides:
clone in class java.lang.Object
Returns:
a clone of this instance.
Throws:
OutOfMemoryError - if there is not enough memory.
See Also:
Cloneable

setDebug

public void setDebug(boolean b)
Toggle debug status.
Parameters:
b - boolean.

buildPacket

public byte[] buildPacket(DNSName dnsname,
                          int globalIdx)
                   throws DNSNameException
Build and return the rdata packet on the internal state.
Parameters:
dnsname - used for domain name compression in the same message.
globalIdx - current index of the message being assembled. (Domain name compression)
Returns:
the rdata part of the message as a byte array.
Throws:
DNSNameException - if the domain name is invalid.

getDisassembledLen

public int getDisassembledLen()
Returns the length of the previously disassembled rdata part.
See Also:
disassemblePacket(DNSName, byte[], int, int)

disassemblePacket

public void disassemblePacket(DNSName dnsname,
                              byte[] pDat,
                              int pIdx,
                              int pLen)
                       throws DNSNameException,
                              DNSRDataException
Parses the rdata part of a record.
Parameters:
dnsname - used for domain name compression in the same message.
pDat - array containing the complete packet.
pIdx - index to where in the array the rdata part begins.
pLen - length of the whole packet.
Throws:
DNSRDataException - if the packet is corrupted.
DNSNameException - if the domain name is invalid.
See Also:
getDisassembledLen()

getRType

public int getRType()
Get the record type.
Returns:
record type.

toString

public java.lang.String toString()
Returns a string representation of the internal state, mostly for debugging purposes.
Overrides:
toString in class java.lang.Object
Returns:
debug string.