Package org.xbill.DNS
Class EDNSOption
java.lang.Object
org.xbill.DNS.EDNSOption
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ClientSubnetOption,CookieOption,DnssecAlgorithmOption,ExtendedErrorCodeOption,GenericEDNSOption,TcpKeepaliveOption
DNS extension options, as described in RFC 6891. The rdata of an OPT record is defined as a list
of options; this represents a single option.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines if two EDNS Options are identical.static EDNSOptionfromWire(byte[] b) Converts the wire format of an EDNS Option (including code and length) into the type-specific format.(package private) static EDNSOptionConverts the wire format of an EDNS Option (including code and length) into the type-specific format.intgetCode()Returns the EDNS Option's code.(package private) byte[]getData()Returns the EDNS Option's data, as a byte array.inthashCode()Generates a hash code based on the EDNS Option's data.(package private) abstract voidConverts the wire format of an EDNS Option (the option data only) into the type-specific format.(package private) abstract String(package private) abstract voidoptionToWire(DNSOutput out) Converts an EDNS Option (the type-specific option data only) into wire format.toString()byte[]toWire()Converts an EDNS Option (including code and length) into wire format.(package private) voidConverts an EDNS Option (including code and length) into wire format.
-
Field Details
-
code
private final int code
-
-
Constructor Details
-
EDNSOption
public EDNSOption(int code) Creates an option with the given option code and data.
-
-
Method Details
-
toString
-
getCode
public int getCode()Returns the EDNS Option's code.- Returns:
- the option code
-
getData
byte[] getData()Returns the EDNS Option's data, as a byte array.- Returns:
- the option data
-
optionFromWire
Converts the wire format of an EDNS Option (the option data only) into the type-specific format.- Parameters:
in- The input Stream.- Throws:
IOException
-
fromWire
Converts the wire format of an EDNS Option (including code and length) into the type-specific format.- Parameters:
in- The input stream.- Throws:
IOException
-
fromWire
Converts the wire format of an EDNS Option (including code and length) into the type-specific format.- Returns:
- The option, in wire format.
- Throws:
IOException
-
optionToWire
Converts an EDNS Option (the type-specific option data only) into wire format.- Parameters:
out- The output stream.
-
toWire
Converts an EDNS Option (including code and length) into wire format.- Parameters:
out- The output stream.
-
toWire
public byte[] toWire()Converts an EDNS Option (including code and length) into wire format.- Returns:
- The option, in wire format.
-
equals
Determines if two EDNS Options are identical. -
hashCode
public int hashCode()Generates a hash code based on the EDNS Option's data. -
optionToString
-