public static final class DnsPacket.DnsHeader extends AbstractPacket.AbstractHeader
+---------------------+
| Header |
+---------------------+
| Question | the question for the name server
+---------------------+
| Answer | RRs answering the question
+---------------------+
| Authority | RRs pointing toward an authority
+---------------------+
| Additional | RRs holding additional information
+---------------------+
Header:
1 1 1 1 1 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ID |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|QR| Opcode |AA|TC|RD|RA| Z|AD|CD| RCODE |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| QDCOUNT |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ANCOUNT |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| NSCOUNT |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ARCOUNT |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
buildString()
This method builds the value
toString() will return. |
protected int |
calcHashCode()
This method builds the value
hashCode() will return using
the byte array getRawData() returns. |
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one using
return values of
getRawData(). |
java.util.List<DnsResourceRecord> |
getAdditionalInfo() |
short |
getAnCount() |
int |
getAnCountAsInt() |
java.util.List<DnsResourceRecord> |
getAnswers() |
short |
getArCount() |
int |
getArCountAsInt() |
java.util.List<DnsResourceRecord> |
getAuthorities() |
short |
getId() |
short |
getNsCount() |
int |
getNsCountAsInt() |
DnsOpCode |
getOpCode() |
short |
getQdCount() |
int |
getQdCountAsInt() |
java.util.List<DnsQuestion> |
getQuestions() |
protected java.util.List<byte[]> |
getRawFields()
Returns a list of byte arrays which represents this header's fields.
|
DnsRCode |
getrCode() |
boolean |
getReservedBit() |
boolean |
isAuthenticData() |
boolean |
isAuthoritativeAnswer() |
boolean |
isCheckingDisabled() |
boolean |
isRecursionAvailable() |
boolean |
isRecursionDesired() |
boolean |
isResponse() |
boolean |
isTruncated() |
int |
length()
Returns the header length in bytes.
|
buildHexString, buildRawData, calcLength, getRawData, hashCode, toHexString, toStringpublic short getId()
public boolean isResponse()
public DnsOpCode getOpCode()
public boolean isAuthoritativeAnswer()
public boolean isTruncated()
public boolean isRecursionDesired()
public boolean isRecursionAvailable()
public boolean getReservedBit()
public boolean isAuthenticData()
public boolean isCheckingDisabled()
public DnsRCode getrCode()
public short getQdCount()
public int getQdCountAsInt()
public short getAnCount()
public int getAnCountAsInt()
public short getNsCount()
public int getNsCountAsInt()
public short getArCount()
public int getArCountAsInt()
public java.util.List<DnsQuestion> getQuestions()
public java.util.List<DnsResourceRecord> getAnswers()
public java.util.List<DnsResourceRecord> getAuthorities()
public java.util.List<DnsResourceRecord> getAdditionalInfo()
protected java.util.List<byte[]> getRawFields()
AbstractPacket.AbstractHeadercalcLength()
and buildRawData().getRawFields in class AbstractPacket.AbstractHeaderpublic int length()
AbstractPacket.AbstractHeadercalcLength() and caches the return value
when it is called for the first time,
and then, this method returns the cached value from the second time.length in interface Packet.Headerlength in class AbstractPacket.AbstractHeaderprotected java.lang.String buildString()
AbstractPacket.AbstractHeadertoString() will return.buildString in class AbstractPacket.AbstractHeaderpublic boolean equals(java.lang.Object obj)
AbstractPacket.AbstractHeadergetRawData().
This method should be overridden so that it does more strict comparisons
more efficiently.equals in class AbstractPacket.AbstractHeaderprotected int calcHashCode()
AbstractPacket.AbstractHeaderhashCode() will return using
the byte array getRawData() returns.
This method may be better to be overridden for performance reason.calcHashCode in class AbstractPacket.AbstractHeaderCopyright © 2011 - 2018 Pcap4J.org. All rights reserved.