Package org.xbill.DNS.dnssec
Class SMessage
java.lang.Object
org.xbill.DNS.dnssec.SMessage
This class represents a DNS message with validator state and some utility methods.
- Since:
- 3.5
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate intprivate static final intprivate final Headerprivate static final intprivate static final intprivate OPTRecordprivate Recordprivate SecurityStatus -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate voidcheckSectionValidity(int section) findAnswerRRset(Name qname, int qtype, int qclass) Find an "answer" RRset.Find a specific (S)RRset in a given section.Gets the reason why this messages' status is bogus.intgetCount(int section) Gets the number of records.intGets theExtendedErrorCodeOptionreason why this messages' status is bogus.Gets the header of this message.Gets this message as a standard DNSJAVA message.Gets the question section of this message.intgetRcode()Gets the result code of the response message.getSectionRRsets(int section) Gets signed RRsets for the queried section.getSectionRRsets(int section, int qtype) Gets signed RRsets for the queried section.Gets the security status of this message.voidSets the security status of this message to bogus and sets the reason.voidSets the security status of this message to bogus and sets the reason.voidsetStatus(SecurityStatus status, int edeReason) Sets the security status for this message.voidsetStatus(SecurityStatus status, int edeReason, String reason) Sets the security status for this message.
-
Field Details
-
NUM_SECTIONS
private static final int NUM_SECTIONS- See Also:
-
MAX_FLAGS
private static final int MAX_FLAGS- See Also:
-
EXTENDED_FLAGS_BIT_OFFSET
private static final int EXTENDED_FLAGS_BIT_OFFSET- See Also:
-
header
-
question
-
oPTRecord
-
sections
-
securityStatus
-
bogusReason
-
edeReason
private int edeReason
-
-
Constructor Details
-
SMessage
Creates a instance of this class.- Parameters:
h- The header of the original message.
-
SMessage
Creates a new instance of this class.- Parameters:
id- The ID of the DNS query or response message.question- The question section of the query or response.
-
SMessage
Creates a new instance of this class.- Parameters:
m- The DNS message to wrap.
-
-
Method Details
-
getHeader
Gets the header of this message.- Returns:
- The header of this message.
-
getQuestion
Gets the question section of this message.- Returns:
- The question section of this message.
-
getSectionRRsets
Gets signed RRsets for the queried section.- Parameters:
section- The section whose RRsets are demanded.- Returns:
- Signed RRsets for the queried section.
-
addRRset
-
checkSectionValidity
private void checkSectionValidity(int section) -
getSectionRRsets
Gets signed RRsets for the queried section.- Parameters:
section- The section whose RRsets are demanded.qtype- Filter the results for these record types.- Returns:
- Signed RRsets for the queried section.
-
getRcode
public int getRcode()Gets the result code of the response message.- Returns:
- The result code of the response message.
-
getStatus
Gets the security status of this message.- Returns:
- The security status of this message.
-
setStatus
Sets the security status for this message.- Parameters:
status- the new security status for this message.
-
setStatus
Sets the security status for this message.- Parameters:
status- the new security status for this message.reason- Why this message's status is set as indicated.
-
setBogus
Sets the security status of this message to bogus and sets the reason.- Parameters:
reason- Why this message's status is bogus.
-
setBogus
Sets the security status of this message to bogus and sets the reason.- Parameters:
reason- Why this message's status is bogus.
-
getBogusReason
Gets the reason why this messages' status is bogus.- Returns:
- The reason why this messages' status is bogus.
-
getEdeReason
public int getEdeReason()Gets theExtendedErrorCodeOptionreason why this messages' status is bogus. -
getMessage
Gets this message as a standard DNSJAVA message.- Returns:
- This message as a standard DNSJAVA message.
-
getCount
public int getCount(int section) Gets the number of records.- Parameters:
section- The section for which the records are counted.- Returns:
- The number of records for the queried section.
-
findRRset
Find a specific (S)RRset in a given section.- Parameters:
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)- Returns:
- The SRRset if found, null otherwise.
-
findAnswerRRset
Find an "answer" RRset. This will look for RRsets in the ANSWER section that match the <qname,qtype,qclass>, without considering CNAMEs.- Parameters:
qname- The starting search name.qtype- The search type.qclass- The search class.- Returns:
- a SRRset matching the query.
-