|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.antiaction.dns.DNSHeader
DNS header container, contains the header portion of a DNS message. As defined in rfc1035.
| Field Summary | |
static int |
HEADER_SIZE
Header size. |
static int |
Query
Query header type. |
static int |
Response
Response header type. |
| Constructor Summary | |
DNSHeader()
Instantiate and initialize a default header object. |
|
| Method Summary | |
byte[] |
buildPacket()
Build and return the header based on the internal state. |
java.lang.Object |
clone()
Overrides Cloneable. |
void |
disassemblePacket(byte[] pDat,
int pIdx,
int pLen)
Parses the header part of a message and sets the internal state accordingly. |
int |
getAdditionalCount()
Get Additional resource record count. |
int |
getAnswerCount()
Get Answer resource record count. |
boolean |
getAuthoritativeAnswer()
Get Authoritative Answer flag. |
int |
getAuthorityCount()
Get Authority resource record count. |
int |
getDisassembledLen()
Returns the length of the previously disassembled header. |
int |
getID()
Get the message identification. |
int |
getOpcode()
Get message opcode. |
int |
getQueryResponse()
Get the type of message, Query or Response. |
int |
getQuestionCount()
Get Question count. |
boolean |
getRecursionAvailable()
Get Recursion Available flag. |
boolean |
getRecursionDesired()
Get Recursion Desired flag. |
int |
getResponseCode()
Get Response Code flag. |
boolean |
getTrunCation()
Get Truncation flag. |
void |
setAdditionalCount(int c)
Set Additional resource record count. |
void |
setAnswerCount(int c)
Set Answer resource record count. |
void |
setAuthoritativeAnswer(boolean aa)
Set Authoritative Answer flag. |
void |
setAuthorityCount(int c)
Set Authority resource record count. |
void |
setDebug(boolean b)
Toggle debug status. |
void |
setID(int id)
Set the message identification. |
void |
setOpcode(int i)
Set message opcode. |
void |
setQueryResponse(int qr)
Set the header to either Query or Response. |
void |
setQuestionCount(int c)
Set Question count. |
void |
setRecursionAvailable(boolean ra)
Set Recursion Available flag. |
void |
setRecursionDesired(boolean rd)
Set Recursion Desired flag. |
void |
setResponseCode(int rc)
Set Response Code flag. |
void |
setTrunCation(boolean tc)
Set Truncation flag. |
java.lang.String |
toString()
Returns a string representation of the internal state, mostly for debugging purposes. |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int HEADER_SIZE
public static final int Query
public static final int Response
| Constructor Detail |
public DNSHeader()
| Method Detail |
public java.lang.Object clone()
clone in class java.lang.ObjectOutOfMemoryError - if there is not enough memory.Cloneablepublic void setDebug(boolean b)
b - boolean.public byte[] buildPacket()
public int getDisassembledLen()
disassemblePacket(byte[], int, int)
public void disassemblePacket(byte[] pDat,
int pIdx,
int pLen)
throws DNSException
pDat - array containing the complete message.pIdx - index to where in the array the header begins.pLen - length of the whole message.DNSException - if the packet is corrupted.getDisassembledLen()public void setID(int id)
id - message identification.public int getID()
public void setQueryResponse(int qr)
Query or Response.qr - Query or Response.public int getQueryResponse()
Query or Response.public void setOpcode(int i)
i - opcode.public int getOpcode()
public void setAuthoritativeAnswer(boolean aa)
aa - boolean.public boolean getAuthoritativeAnswer()
public void setTrunCation(boolean tc)
aa - boolean.public boolean getTrunCation()
public void setRecursionDesired(boolean rd)
aa - boolean.public boolean getRecursionDesired()
public void setRecursionAvailable(boolean ra)
aa - boolean.public boolean getRecursionAvailable()
public void setResponseCode(int rc)
aa - boolean.public int getResponseCode()
public void setQuestionCount(int c)
c - count.public int getQuestionCount()
public void setAnswerCount(int c)
c - count.public int getAnswerCount()
public void setAuthorityCount(int c)
c - count.public int getAuthorityCount()
public void setAdditionalCount(int c)
c - count.public int getAdditionalCount()
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||