Package org.xbill.DNS
Class OPTRecord
java.lang.Object
org.xbill.DNS.Record
org.xbill.DNS.OPTRecord
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<Record>
Options - describes Extended DNS (EDNS) properties of a Message. No specific options are defined
other than those specified in the header. An OPT should be generated by Resolver.
EDNS is a method to extend the DNS protocol while providing backwards compatibility and not significantly changing the protocol. This implementation of EDNS is mostly complete at level 0.
- Author:
- Brian Wellington
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionOPTRecord(int payloadSize, int xrcode, int version) Creates an OPT Record with no data.OPTRecord(int payloadSize, int xrcode, int version, int flags) Creates an OPT Record with no data.OPTRecord(int payloadSize, int xrcode, int version, int flags, List<EDNSOption> options) Creates an OPT Record.OPTRecord(int payloadSize, int xrcode, int version, int flags, EDNSOption... options) Creates an OPT Record. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines if two OPTRecords are identical.intReturns the extended RcodeintgetFlags()Returns the EDNS flagsGets all options in the OPTRecord.getOptions(int code) Gets all options in the OPTRecord with a specific code.intReturns the maximum allowed payload size.intReturns the highest supported EDNS versioninthashCode()Generates a hash code based on the Record's data.protected voidrdataFromString(Tokenizer st, Name origin) Converts the text format of an RR to the internal format - must be overridenprotected voidrrFromWire(DNSInput in) Converts the type-specific RR to wire format - must be overriddenprotected StringConverts rdata to a Stringprotected voidrrToWire(DNSOutput out, Compression c, boolean canonical) Converts the type-specific RR to wire format - must be overridden.toString()Converts this record to a String representationMethods inherited from class org.xbill.DNS.Record
byteArrayFromString, byteArrayToString, compareTo, fromString, fromString, fromWire, getAdditionalName, getDClass, getName, getRRsetType, getTTL, getType, newRecord, newRecord, newRecord, newRecord, rdataToString, rdataToWireCanonical, sameRRset, sameRRset, toWire, toWireCanonical, unknownToString, withName
-
Constructor Details
-
OPTRecord
Creates an OPT Record. This is normally called by SimpleResolver, but can also be called by a server.- Parameters:
payloadSize- The size of a packet that can be reassembled on the sending host.xrcode- The value of the extended rcode field. This is the upper 16 bits of the full rcode.version- The EDNS version that this DNS implementation supports. This should be 0 for dnsjava.flags- Additional message flags.options- The options that comprise the data field.- See Also:
-
OPTRecord
Creates an OPT Record. This is normally called by SimpleResolver, but can also be called by a server.- Parameters:
payloadSize- The size of a packet that can be reassembled on the sending host.xrcode- The value of the extended rcode field. This is the upper 16 bits of the full rcode.version- The EDNS version that this DNS implementation supports. This should be 0 for dnsjava.flags- Additional message flags.options- The list of options that comprise the data field.- See Also:
-
OPTRecord
public OPTRecord(int payloadSize, int xrcode, int version, int flags) Creates an OPT Record with no data. This is normally called by SimpleResolver, but can also be called by a server.- Parameters:
payloadSize- The size of a packet that can be reassembled on the sending host.xrcode- The value of the extended rcode field. This is the upper 16 bits of the full rcode.version- The EDNS version that this DNS implementation supports. This should be 0 for dnsjava.flags- Additional message flags.- See Also:
-
OPTRecord
public OPTRecord(int payloadSize, int xrcode, int version) Creates an OPT Record with no data. This is normally called by SimpleResolver, but can also be called by a server.
-
-
Method Details
-
rrFromWire
Description copied from class:RecordConverts the type-specific RR to wire format - must be overridden- Specified by:
rrFromWirein classRecord- Throws:
IOException
-
rdataFromString
Description copied from class:RecordConverts the text format of an RR to the internal format - must be overriden- Specified by:
rdataFromStringin classRecord- Throws:
IOException
-
rrToString
Converts rdata to a String- Specified by:
rrToStringin classRecord
-
toString
Converts this record to a String representation -
getPayloadSize
public int getPayloadSize()Returns the maximum allowed payload size. -
getExtendedRcode
public int getExtendedRcode()Returns the extended Rcode- See Also:
-
getVersion
public int getVersion()Returns the highest supported EDNS version -
getFlags
public int getFlags()Returns the EDNS flags -
rrToWire
Description copied from class:RecordConverts the type-specific RR to wire format - must be overridden. -
getOptions
Gets all options in the OPTRecord. This returns a list of EDNSOptions. -
getOptions
Gets all options in the OPTRecord with a specific code. This returns a list of EDNSOptions. -
equals
Determines if two OPTRecords are identical. This compares the name, type, class, and rdata (with names canonicalized). Additionally, because TTLs are relevant for OPT records, the TTLs are compared. -
hashCode
public int hashCode()Description copied from class:RecordGenerates a hash code based on the Record's data.
-