public final class DNSOutgoing extends DNSMessage
| 限定符和类型 | 类和说明 |
|---|---|
static class |
DNSOutgoing.MessageOutputStream |
| 限定符和类型 | 字段和说明 |
|---|---|
static boolean |
USE_DOMAIN_NAME_COMPRESSION
This can be used to turn off domain name compression.
|
_additionals, _answers, _authoritativeAnswers, _questions, MULTICAST, UNICAST| 构造器和说明 |
|---|
DNSOutgoing(int flags)
Create an outgoing multicast query or response.
|
DNSOutgoing(int flags,
boolean multicast)
Create an outgoing query or response.
|
DNSOutgoing(int flags,
boolean multicast,
int senderUDPPayload)
Create an outgoing query or response.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addAdditionalAnswer(DNSIncoming in,
DNSRecord rec)
Add an additional answer to the record.
|
void |
addAnswer(DNSIncoming in,
DNSRecord rec)
Add an answer if it is not suppressed.
|
void |
addAnswer(DNSRecord rec,
long now)
Add an answer to the message.
|
void |
addAuthorativeAnswer(DNSRecord rec)
Add an authoritative answer to the message.
|
void |
addQuestion(DNSQuestion rec)
Add a question to the message.
|
int |
availableSpace()
Return the number of byte available in the message.
|
byte[] |
data()
Builds the final message buffer to be send and returns it.
|
java.net.InetSocketAddress |
getDestination()
Get the forced destination address if a specific one was set.
|
int |
getMaxUDPPayload() |
void |
setDestination(java.net.InetSocketAddress destination)
Force a specific destination address if packet is sent.
|
java.lang.String |
toString() |
getAdditionals, getAllAnswers, getAnswers, getAuthorities, getFlags, getId, getNumberOfAdditionals, getNumberOfAnswers, getNumberOfAuthorities, getNumberOfQuestions, getOperationCode, getQuestions, isAuthoritativeAnswer, isEmpty, isMulticast, isQuery, isResponse, isTruncated, isValidResponseCode, print, setFlags, setIdpublic static boolean USE_DOMAIN_NAME_COMPRESSION
public DNSOutgoing(int flags)
flags - public DNSOutgoing(int flags,
boolean multicast)
flags - multicast - public DNSOutgoing(int flags,
boolean multicast,
int senderUDPPayload)
flags - multicast - senderUDPPayload - The sender's UDP payload size is the number of bytes of the largest UDP payload that can be reassembled and delivered in the sender's network stack.public java.net.InetSocketAddress getDestination()
public void setDestination(java.net.InetSocketAddress destination)
destination - Set a destination address a packet should be sent to (instead the default one). You could use null to unset the forced destination.public int availableSpace()
public void addQuestion(DNSQuestion rec) throws java.io.IOException
rec - java.io.IOExceptionpublic void addAnswer(DNSIncoming in, DNSRecord rec) throws java.io.IOException
in - rec - java.io.IOExceptionpublic void addAnswer(DNSRecord rec, long now) throws java.io.IOException
rec - now - java.io.IOExceptionpublic void addAuthorativeAnswer(DNSRecord rec) throws java.io.IOException
rec - java.io.IOExceptionpublic void addAdditionalAnswer(DNSIncoming in, DNSRecord rec) throws java.io.IOException
in - rec - java.io.IOExceptionpublic byte[] data()
public java.lang.String toString()
toString 在类中 java.lang.Objectpublic int getMaxUDPPayload()