Package org.pcap4j.packet
Class DnsQuestion
- java.lang.Object
-
- org.pcap4j.packet.DnsQuestion
-
- All Implemented Interfaces:
java.io.Serializable
public final class DnsQuestion extends java.lang.Object implements java.io.Serializable
DNS Question1 1 1 1 1 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | | / QNAME / / / +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | QTYPE | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | QCLASS | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- Since:
- pcap4j 1.7.1
- Author:
- Kaito Yamada
- See Also:
- RFC 1035, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DnsQuestion.Builder
-
Method Summary
Modifier and Type Method Description boolean
equals(java.lang.Object obj)
DnsQuestion.Builder
getBuilder()
DnsClass
getQClass()
DnsDomainName
getQName()
DnsResourceRecordType
getQType()
byte[]
getRawData()
int
hashCode()
int
length()
static DnsQuestion
newInstance(byte[] rawData, int offset, int length)
A static factory method.java.lang.String
toString()
java.lang.String
toString(java.lang.String indent)
java.lang.String
toString(java.lang.String indent, byte[] headerRawData)
-
-
-
Method Detail
-
newInstance
public static DnsQuestion 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 DnsQuestion object.
- Throws:
IllegalRawDataException
- if parsing the raw data fails.
-
getQName
public DnsDomainName getQName()
- Returns:
- qName
-
getQType
public DnsResourceRecordType getQType()
- Returns:
- qType
-
getQClass
public DnsClass getQClass()
- Returns:
- qClass
-
getBuilder
public DnsQuestion.Builder 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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toString
public java.lang.String toString(java.lang.String indent)
- Parameters:
indent
- indent- Returns:
- String representation of this object.
-
toString
public java.lang.String toString(java.lang.String indent, byte[] headerRawData)
- Parameters:
indent
- indentheaderRawData
- the raw data of the DNS header including this question.- Returns:
- String representation of this object.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-