java.lang.Object
org.minidns.record.Data
org.minidns.record.NSEC
DNS NSEC (Next Secure) record payload for DNSSEC.
Provides authenticated denial of existence for DNS records and links to the next valid name in the zone.
Provides authenticated denial of existence for DNS records and links to the next valid name in the zone.
Field Summary
Modifier and TypeFieldDescriptionprivate static final LoggerLogger for this class.final DnsNameThe next owner name that contains a authoritative data or a delegation point.private final byte[]the type bitmapfinal List<Record.TYPE> The RR types existing at the owner name.Constructor Summary
ConstructorsConstructorDescriptionNSEC(String next, List<Record.TYPE> types) Builds a record from a textual next owner name and its type list.NSEC(String next, Record.TYPE... types) Builds a record from a textual next owner name and its types.NSEC(DnsName next, List<Record.TYPE> types) Builds a record from a next owner name and its type list.Method Summary
Modifier and TypeMethodDescription(package private) static byte[]createTypeBitMap(List<Record.TYPE> types) Create type bitmapgetType()Reports the NSEC record type.static NSECparse(DataInputStream dis, byte[] data, int length) Reads a record from the wire, deriving the type bitmap length from the payload.(package private) static List<Record.TYPE> readTypeBitMap(byte[] typeBitmap) Read type bitmapvoidWrites the next owner name and type bitmap to the stream.toString()Renders the next owner name followed by its type list.private static voidwriteOutBlock(byte[] values, DataOutputStream dos) Writes the block, stopping after its last non-zero byte.Methods inherited from class Data
equals, hashCode, length, toByteArray, toOutputStream, toOutputStreamModifier and TypeMethodDescriptionfinal booleanfinal inthashCode()final intlength()Serialize this record, if that has not been done already, and report the resulting wire size.final byte[]Serialize this record, if that has not been done already, and return a copy of the result so callers cannot mutate the cached bytes.final voidWrite the binary representation of this payload to the givenDataOutputStream.final voidtoOutputStream(OutputStream outputStream) Write the binary representation to the given OutputStream.
Field Details
LOGGER
Logger for this class.next
The next owner name that contains a authoritative data or a delegation point.typeBitmap
private final byte[] typeBitmapthe type bitmaptypes
The RR types existing at the owner name.
Constructor Details
NSEC
Builds a record from a textual next owner name and its type list.- Parameters:
next- the next owner name, as a textual DNS nametypes- the RR types present at the owner name
NSEC
Builds a record from a textual next owner name and its types.- Parameters:
next- the next owner name, as a textual DNS nametypes- the RR types present at the owner name
NSEC
Builds a record from a next owner name and its type list.- Parameters:
next- the next owner nametypes- the RR types present at the owner name
Method Details
parse
Reads a record from the wire, deriving the type bitmap length from the payload.- Parameters:
dis- the stream positioned at the start of the record payloaddata- the buffer backing the whole record, used to parse the next owner namelength- the payload length in bytes- Returns:
- the parsed record
- Throws:
IOException- if length is shorter than the next owner name, or if the type bitmap is truncated
getType
Reports the NSEC record type.serialize
Writes the next owner name and type bitmap to the stream.- Specified by:
serializein classData- Parameters:
dos- the output stream to serialize to.- Throws:
IOException- if an I/O error occurs.
toString
createTypeBitMap
Create type bitmap- Parameters:
types- the RR types to encode, sorted into window blocks internally- Returns:
- the bitmap in RFC 4034 window block form
writeOutBlock
Writes the block, stopping after its last non-zero byte.- Parameters:
values- the block's bytesdos- where to write- Throws:
IOException- if the write fails
readTypeBitMap
Read type bitmap- Parameters:
typeBitmap- the bitmap in RFC 4034 window block form- Returns:
- the RR types it sets, with unknown types logged and skipped
- Throws:
IOException- if the window blocks end before their declared bitmap bytes