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 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(Object obj)
Indicates whether some other object is "equal to" this one using
return values of
getRawData() . |
List<DnsResourceRecord> |
getAdditionalInfo() |
short |
getAnCount() |
int |
getAnCountAsInt() |
List<DnsResourceRecord> |
getAnswers() |
short |
getArCount() |
int |
getArCountAsInt() |
List<DnsResourceRecord> |
getAuthorities() |
short |
getId() |
short |
getNsCount() |
int |
getNsCountAsInt() |
DnsOpCode |
getOpCode() |
short |
getQdCount() |
int |
getQdCountAsInt() |
List<DnsQuestion> |
getQuestions() |
protected 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, toString
public 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 List<DnsQuestion> getQuestions()
public List<DnsResourceRecord> getAnswers()
public List<DnsResourceRecord> getAuthorities()
public List<DnsResourceRecord> getAdditionalInfo()
protected List<byte[]> getRawFields()
AbstractPacket.AbstractHeader
calcLength()
and buildRawData()
.getRawFields
in class AbstractPacket.AbstractHeader
public int length()
AbstractPacket.AbstractHeader
calcLength()
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.Header
length
in class AbstractPacket.AbstractHeader
protected String buildString()
AbstractPacket.AbstractHeader
toString()
will return.buildString
in class AbstractPacket.AbstractHeader
public boolean equals(Object obj)
AbstractPacket.AbstractHeader
getRawData()
.
This method should be overridden so that it does more strict comparisons
more efficiently.equals
in class AbstractPacket.AbstractHeader
protected int calcHashCode()
AbstractPacket.AbstractHeader
hashCode()
will return using
the byte array getRawData()
returns.
This method may be better to be overridden for performance reason.calcHashCode
in class AbstractPacket.AbstractHeader
Copyright © 2011–2017 Pcap4J.org. All rights reserved.