Function create_dns

Source
pub fn create_dns(
    origin: &Origin,
    dst: &Address,
    worker_id: u32,
    measurement_type: u8,
    qname: &str,
) -> Vec<u8> 
Expand description

Creates a DNS packet.

§Arguments

  • ‘origin’ - the source address and port values we use for our probes

  • ‘worker_id’ - the unique worker ID of this worker

  • ‘dst’ - the destination address for the DNS packet

  • ‘measurement_type’ - the type of measurement being performed (2 = DNS/A, 4 = DNS/CHAOS)

  • ‘is_ipv6’ - whether we are using IPv6 or not

  • ‘qname’ - the DNS record to request

§Returns

A DNS packet (including the IP header) as a byte vector.

§Panics

If the measurement type is not 2 or 4