pub struct Message {Show 15 fields
pub type: i32,
pub socket_family: Option<i32>,
pub socket_protocol: Option<i32>,
pub query_address: Option<Vec<u8>>,
pub response_address: Option<Vec<u8>>,
pub query_port: Option<u32>,
pub response_port: Option<u32>,
pub query_time_sec: Option<u64>,
pub query_time_nsec: Option<u32>,
pub query_message: Option<Vec<u8>>,
pub query_zone: Option<Vec<u8>>,
pub response_time_sec: Option<u64>,
pub response_time_nsec: Option<u32>,
pub response_message: Option<Vec<u8>>,
pub policy: Option<Policy>,
}Expand description
Message: a wire-format (RFC 1035 section 4) DNS message and associated metadata. Applications generating “Message” payloads should follow certain requirements based on the MessageType, see below.
Fields§
§type: i32One of the Type values described above.
socket_family: Option<i32>One of the SocketFamily values described above.
socket_protocol: Option<i32>One of the SocketProtocol values described above.
query_address: Option<Vec<u8>>The network address of the message initiator. For SocketFamily INET, this field is 4 octets (IPv4 address). For SocketFamily INET6, this field is 16 octets (IPv6 address).
response_address: Option<Vec<u8>>The network address of the message responder. For SocketFamily INET, this field is 4 octets (IPv4 address). For SocketFamily INET6, this field is 16 octets (IPv6 address).
query_port: Option<u32>The transport port of the message initiator. This is a 16-bit UDP or TCP port number, depending on SocketProtocol.
response_port: Option<u32>The transport port of the message responder. This is a 16-bit UDP or TCP port number, depending on SocketProtocol.
query_time_sec: Option<u64>The time at which the DNS query message was sent or received, depending on whether this is an AUTH_QUERY, RESOLVER_QUERY, or CLIENT_QUERY. This is the number of seconds since the UNIX epoch.
query_time_nsec: Option<u32>The time at which the DNS query message was sent or received. This is the seconds fraction, expressed as a count of nanoseconds.
query_message: Option<Vec<u8>>The initiator’s original wire-format DNS query message, verbatim.
query_zone: Option<Vec<u8>>The “zone” or “bailiwick” pertaining to the DNS query message. This is a wire-format DNS domain name.
response_time_sec: Option<u64>The time at which the DNS response message was sent or received, depending on whether this is an AUTH_RESPONSE, RESOLVER_RESPONSE, or CLIENT_RESPONSE. This is the number of seconds since the UNIX epoch.
response_time_nsec: Option<u32>The time at which the DNS response message was sent or received. This is the seconds fraction, expressed as a count of nanoseconds.
response_message: Option<Vec<u8>>The responder’s original wire-format DNS response message, verbatim.
policy: Option<Policy>Operator policy applied to the processing of this message, if any.
Implementations§
Source§impl Message
impl Message
Sourcepub fn type(&self) -> Type
pub fn type(&self) -> Type
Returns the enum value of type, or the default if the field is set to an invalid enum value.
Sourcepub fn socket_family(&self) -> SocketFamily
pub fn socket_family(&self) -> SocketFamily
Returns the enum value of socket_family, or the default if the field is unset or set to an invalid enum value.
Sourcepub fn set_socket_family(&mut self, value: SocketFamily)
pub fn set_socket_family(&mut self, value: SocketFamily)
Sets socket_family to the provided enum value.
Sourcepub fn socket_protocol(&self) -> SocketProtocol
pub fn socket_protocol(&self) -> SocketProtocol
Returns the enum value of socket_protocol, or the default if the field is unset or set to an invalid enum value.
Sourcepub fn set_socket_protocol(&mut self, value: SocketProtocol)
pub fn set_socket_protocol(&mut self, value: SocketProtocol)
Sets socket_protocol to the provided enum value.
Sourcepub fn query_address(&self) -> &[u8] ⓘ
pub fn query_address(&self) -> &[u8] ⓘ
Returns the value of query_address, or the default value if query_address is unset.
Sourcepub fn response_address(&self) -> &[u8] ⓘ
pub fn response_address(&self) -> &[u8] ⓘ
Returns the value of response_address, or the default value if response_address is unset.
Sourcepub fn query_port(&self) -> u32
pub fn query_port(&self) -> u32
Returns the value of query_port, or the default value if query_port is unset.
Sourcepub fn response_port(&self) -> u32
pub fn response_port(&self) -> u32
Returns the value of response_port, or the default value if response_port is unset.
Sourcepub fn query_time_sec(&self) -> u64
pub fn query_time_sec(&self) -> u64
Returns the value of query_time_sec, or the default value if query_time_sec is unset.
Sourcepub fn query_time_nsec(&self) -> u32
pub fn query_time_nsec(&self) -> u32
Returns the value of query_time_nsec, or the default value if query_time_nsec is unset.
Sourcepub fn query_message(&self) -> &[u8] ⓘ
pub fn query_message(&self) -> &[u8] ⓘ
Returns the value of query_message, or the default value if query_message is unset.
Sourcepub fn query_zone(&self) -> &[u8] ⓘ
pub fn query_zone(&self) -> &[u8] ⓘ
Returns the value of query_zone, or the default value if query_zone is unset.
Sourcepub fn response_time_sec(&self) -> u64
pub fn response_time_sec(&self) -> u64
Returns the value of response_time_sec, or the default value if response_time_sec is unset.
Sourcepub fn response_time_nsec(&self) -> u32
pub fn response_time_nsec(&self) -> u32
Returns the value of response_time_nsec, or the default value if response_time_nsec is unset.
Sourcepub fn response_message(&self) -> &[u8] ⓘ
pub fn response_message(&self) -> &[u8] ⓘ
Returns the value of response_message, or the default value if response_message is unset.
Trait Implementations§
Source§impl Message for Message
impl Message for Message
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self.