pub struct UDPPacket {
pub sport: u16,
pub dport: u16,
pub length: u16,
pub checksum: u16,
pub body: Vec<u8>,
}
Expand description
An UDPPacket (UDP packet) https://en.wikipedia.org/wiki/User_Datagram_Protocol
Fields§
§sport: u16
§dport: u16
§length: u16
§checksum: u16
§body: Vec<u8>
Implementations§
Source§impl UDPPacket
impl UDPPacket
Sourcepub fn dns_request(
src: &Address,
dst: &Address,
sport: u16,
domain_name: &str,
tx_time: u64,
tx_id: u32,
ttl: u8,
) -> Vec<u8> ⓘ
pub fn dns_request( src: &Address, dst: &Address, sport: u16, domain_name: &str, tx_time: u64, tx_id: u32, ttl: u8, ) -> Vec<u8> ⓘ
Create a UDP packet with a DNS A record request. In the domain of the A record, we encode the transmit time, source and destination addresses, sender worker ID, and source port.
Sourcefn create_a_record_request(
domain_name: &str,
tx_time: u64,
src: &Address,
dst: &Address,
tx_id: u32,
sport: u16,
) -> Vec<u8> ⓘ
fn create_a_record_request( domain_name: &str, tx_time: u64, src: &Address, dst: &Address, tx_id: u32, sport: u16, ) -> Vec<u8> ⓘ
Creating a DNS A Record Request body http://www.tcpipguide.com/free/t_DNSMessageHeaderandQuestionSectionFormat.htm
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UDPPacket
impl RefUnwindSafe for UDPPacket
impl Send for UDPPacket
impl Sync for UDPPacket
impl Unpin for UDPPacket
impl UnwindSafe for UDPPacket
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request
§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered
].