Class DnsResourceRecord
java.lang.Object
org.pcap4j.packet.DnsResourceRecord
- All Implemented Interfaces:
Serializable
DNS Resource record
1 1 1 1 1 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| |
/ /
/ NAME /
| |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| TYPE |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| CLASS |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| TTL |
| |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| RDLENGTH |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|
/ RDATA /
/ /
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- Since:
- pcap4j 1.7.1
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic interfaceThe interface representing an RDATA. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DnsClassprivate final DnsResourceRecordTypeprivate final DnsDomainNameprivate final DnsResourceRecord.DnsRDataprivate final shortprivate static final longprivate final int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateDnsResourceRecord(byte[] rawData, int offset, int length) private -
Method Summary
Modifier and TypeMethodDescriptionprivate StringconvertToString(String indent, byte[] headerRawData) booleangetName()byte[]getRData()shortintintgetTtl()longinthashCode()intlength()static DnsResourceRecordnewInstance(byte[] rawData, int offset, int length) A static factory method.toString()
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
name
-
dataType
-
dataClass
-
ttl
private final int ttl -
rdLength
private final short rdLength -
rData
-
-
Constructor Details
-
DnsResourceRecord
- Throws:
IllegalRawDataException
-
DnsResourceRecord
-
-
Method Details
-
newInstance
public static DnsResourceRecord newInstance(byte[] rawData, int offset, int length) throws IllegalRawDataException A static factory method. This method validates the arguments byByteArrays.validateBounds(byte[], int, int), which may throw exceptions undocumented here.- Parameters:
rawData- rawDataoffset- offsetlength- length- Returns:
- a new DnsResourceRecord object.
- Throws:
IllegalRawDataException- if parsing the raw data fails.
-
getName
- Returns:
- name
-
getDataType
- Returns:
- dataType
-
getDataClass
- Returns:
- dataClass
-
getTtl
public int getTtl()- Returns:
- ttl
-
getTtlAsLong
public long getTtlAsLong()- Returns:
- ttl
-
getRdLength
public short getRdLength()- Returns:
- rdLength
-
getRdLengthAsInt
public int getRdLengthAsInt()- Returns:
- rdLength
-
getRData
- Returns:
- rData. May be null.
-
getBuilder
- Returns:
- a new Builder object populated with this object's fields.
-
getRawData
public byte[] getRawData()- Returns:
- the raw data.
-
length
public int length()- Returns:
- length
-
toString
-
toString
-
toString
-
convertToString
-
hashCode
-
equals
-