public class DnsHeader extends Object
Modifier and Type | Field and Description |
---|---|
static int |
OPCODE_IQUERY
Deprecated.
|
static int |
OPCODE_QUERY
Message is for a standard query.
|
static int |
TYPE_QUERY
Message type is query.
|
static int |
TYPE_RESPONSE
Message type is response.
|
Modifier and Type | Method and Description |
---|---|
int |
additionalResourceCount()
Returns the number of additional resource records in the
DnsMessage . |
int |
answerCount()
Returns the number of answer resource records in the
DnsMessage . |
int |
authorityResourceCount()
Returns the number of authority resource records in the
DnsMessage . |
int |
id()
Returns the 2 byte unsigned identifier number used for the
DnsMessage . |
boolean |
isRecursionDesired()
Returns
true if a query is to be pursued recursively. |
int |
opcode()
Returns the 4 bit opcode used for the
DnsMessage . |
int |
questionCount()
Returns the number of questions in the
DnsMessage . |
DnsHeader |
setId(int id)
Sets the id for this
DnsMessage . |
DnsHeader |
setOpcode(int opcode)
Sets the opcode for this
DnsMessage . |
DnsHeader |
setRecursionDesired(boolean recursionDesired)
Sets whether a name server is directed to pursue a query recursively or
not.
|
DnsHeader |
setType(int type)
Sets the
DnsMessage type. |
DnsHeader |
setZ(int z)
Sets the field Z.
|
int |
type()
Returns the type of
DnsMessage . |
int |
z()
Returns the 3 bit reserved field 'Z'.
|
public static final int TYPE_QUERY
public static final int TYPE_RESPONSE
public static final int OPCODE_QUERY
@Deprecated public static final int OPCODE_IQUERY
public int questionCount()
DnsMessage
.public int answerCount()
DnsMessage
.public int authorityResourceCount()
DnsMessage
.public int additionalResourceCount()
DnsMessage
.public boolean isRecursionDesired()
true
if a query is to be pursued recursively.public int opcode()
DnsMessage
.OPCODE_QUERY
,
OPCODE_IQUERY
public int type()
DnsMessage
.TYPE_QUERY
public int id()
DnsMessage
.public DnsHeader setOpcode(int opcode)
DnsMessage
.opcode
- opcode to setpublic DnsHeader setRecursionDesired(boolean recursionDesired)
recursionDesired
- if set to true
, pursues query recursivelypublic DnsHeader setType(int type)
DnsMessage
type.type
- message typepublic DnsHeader setId(int id)
DnsMessage
.id
- a unique 2 byte unsigned identifierpublic int z()
public DnsHeader setZ(int z)
z
- the value for the reserved field ZCopyright © 2008–2015 The Netty Project. All rights reserved.