final class SMessage
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
bogusReason |
private int |
edeReason |
private static int |
EXTENDED_FLAGS_BIT_OFFSET |
private Header |
header |
private static int |
MAX_FLAGS |
private static int |
NUM_SECTIONS |
private OPTRecord |
oPTRecord |
private Record |
question |
private java.util.List<SRRset>[] |
sections |
private SecurityStatus |
securityStatus |
Constructor and Description |
---|
SMessage(Header h)
Creates a instance of this class.
|
SMessage(int id,
Record question)
Creates a new instance of this class.
|
SMessage(Message m)
Creates a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
private void |
addRRset(SRRset srrset,
int section) |
private void |
checkSectionValidity(int section) |
SRRset |
findAnswerRRset(Name qname,
int qtype,
int qclass)
Find an "answer" RRset.
|
SRRset |
findRRset(Name name,
int type,
int dclass,
int section)
Find a specific (S)RRset in a given section.
|
java.lang.String |
getBogusReason()
Gets the reason why this messages' status is bogus.
|
int |
getCount(int section)
Gets the number of records.
|
int |
getEdeReason()
Gets the
ExtendedErrorCodeOption reason why this messages' status is
bogus. |
Header |
getHeader()
Gets the header of this message.
|
Message |
getMessage()
Gets this message as a standard DNSJAVA message.
|
Record |
getQuestion()
Gets the question section of this message.
|
int |
getRcode()
Gets the result code of the response message.
|
java.util.List<SRRset> |
getSectionRRsets(int section)
Gets signed RRsets for the queried section.
|
java.util.List<SRRset> |
getSectionRRsets(int section,
int qtype)
Gets signed RRsets for the queried section.
|
SecurityStatus |
getStatus()
Gets the security status of this message.
|
void |
setBogus(java.lang.String reason)
Sets the security status of this message to bogus and sets the reason.
|
void |
setBogus(java.lang.String reason,
int edeReason)
Sets the security status of this message to bogus and sets the reason.
|
void |
setStatus(SecurityStatus status,
int edeReason)
Sets the security status for this message.
|
void |
setStatus(SecurityStatus status,
int edeReason,
java.lang.String reason)
Sets the security status for this message.
|
private static final int NUM_SECTIONS
private static final int MAX_FLAGS
private static final int EXTENDED_FLAGS_BIT_OFFSET
private final Header header
private Record question
private OPTRecord oPTRecord
private final java.util.List<SRRset>[] sections
private SecurityStatus securityStatus
private java.lang.String bogusReason
private int edeReason
public SMessage(Header h)
h
- The header of the original message.public SMessage(int id, Record question)
id
- The ID of the DNS query or response message.question
- The question section of the query or response.public SMessage(Message m)
m
- The DNS message to wrap.public Header getHeader()
public Record getQuestion()
public java.util.List<SRRset> getSectionRRsets(int section)
section
- The section whose RRsets are demanded.private void addRRset(SRRset srrset, int section)
private void checkSectionValidity(int section)
public java.util.List<SRRset> getSectionRRsets(int section, int qtype)
section
- The section whose RRsets are demanded.qtype
- Filter the results for these record types.public int getRcode()
public SecurityStatus getStatus()
public void setStatus(SecurityStatus status, int edeReason)
status
- the new security status for this message.public void setStatus(SecurityStatus status, int edeReason, java.lang.String reason)
status
- the new security status for this message.reason
- Why this message's status is set as indicated.public void setBogus(java.lang.String reason)
reason
- Why this message's status is bogus.public void setBogus(java.lang.String reason, int edeReason)
reason
- Why this message's status is bogus.public java.lang.String getBogusReason()
public int getEdeReason()
ExtendedErrorCodeOption
reason why this messages' status is
bogus.public Message getMessage()
public int getCount(int section)
section
- The section for which the records are counted.public SRRset findRRset(Name name, int type, int dclass, int section)
name
- the name of the RRset.type
- the type of the RRset.dclass
- the class of the RRset.section
- the section to look in (ANSWER to ADDITIONAL)public SRRset findAnswerRRset(Name qname, int qtype, int qclass)
qname
- The starting search name.qtype
- The search type.qclass
- The search class.