public class OPTRecord extends Record
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.
Modifier and Type | Field and Description |
---|---|
private java.util.List<EDNSOption> |
options |
Constructor and Description |
---|
OPTRecord() |
OPTRecord(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,
EDNSOption... options)
Creates an OPT Record.
|
OPTRecord(int payloadSize,
int xrcode,
int version,
int flags,
java.util.List<EDNSOption> options)
Creates an OPT Record.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object arg)
Determines if two OPTRecords are identical.
|
int |
getExtendedRcode()
Returns the extended Rcode
|
int |
getFlags()
Returns the EDNS flags
|
java.util.List<EDNSOption> |
getOptions()
Gets all options in the OPTRecord.
|
java.util.List<EDNSOption> |
getOptions(int code)
Gets all options in the OPTRecord with a specific code.
|
int |
getPayloadSize()
Returns the maximum allowed payload size.
|
int |
getVersion()
Returns the highest supported EDNS version
|
int |
hashCode()
Generates a hash code based on the Record's data.
|
(package private) void |
printPseudoSection(java.lang.StringBuilder sb) |
protected void |
rdataFromString(Tokenizer st,
Name origin)
Converts the text format of an RR to the internal format - must be overriden
|
protected void |
rrFromWire(DNSInput in)
Converts the type-specific RR to wire format - must be overridden
|
protected java.lang.String |
rrToString()
Converts rdata to a String
|
protected void |
rrToWire(DNSOutput out,
Compression c,
boolean canonical)
Converts the type-specific RR to wire format - must be overridden.
|
java.lang.String |
toString()
Converts this record to a String representation
|
byteArrayFromString, byteArrayToString, checkByteArrayLength, checkName, checkU16, checkU32, checkU8, cloneRecord, compareTo, fromString, fromString, fromWire, fromWire, fromWire, getAdditionalName, getDClass, getName, getRRsetType, getTTL, getType, newRecord, newRecord, newRecord, newRecord, rdataToString, rdataToWireCanonical, sameRRset, setTTL, toWire, toWire, toWireCanonical, unknownToString, withDClass, withName, writeReplace
private java.util.List<EDNSOption> options
OPTRecord()
public OPTRecord(int payloadSize, int xrcode, int version, int flags, EDNSOption... options)
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.flags
- Additional message flags.version
- The EDNS version that this DNS implementation supports. This should be 0 for
dnsjava.options
- The options that comprise the data field.ExtendedFlags
public OPTRecord(int payloadSize, int xrcode, int version, int flags, java.util.List<EDNSOption> options)
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.flags
- Additional message flags.version
- The EDNS version that this DNS implementation supports. This should be 0 for
dnsjava.options
- The list of options that comprise the data field.ExtendedFlags
public OPTRecord(int payloadSize, int xrcode, int version, int flags)
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.flags
- Additional message flags.version
- The EDNS version that this DNS implementation supports. This should be 0 for
dnsjava.ExtendedFlags
public OPTRecord(int payloadSize, int xrcode, int version)
protected void rrFromWire(DNSInput in) throws java.io.IOException
Record
rrFromWire
in class Record
java.io.IOException
protected void rdataFromString(Tokenizer st, Name origin) throws java.io.IOException
Record
rdataFromString
in class Record
java.io.IOException
protected java.lang.String rrToString()
rrToString
in class Record
public java.lang.String toString()
void printPseudoSection(java.lang.StringBuilder sb)
public int getPayloadSize()
public int getExtendedRcode()
Rcode
public int getVersion()
public int getFlags()
protected void rrToWire(DNSOutput out, Compression c, boolean canonical)
Record
public java.util.List<EDNSOption> getOptions()
public java.util.List<EDNSOption> getOptions(int code)
public boolean equals(java.lang.Object arg)