Skip to main content

create_tcp

Function create_tcp 

Source
pub fn create_tcp(
    src: &Address,
    dst: &Address,
    sport: u16,
    dport: u16,
    worker_id: u32,
    is_discovery: bool,
    info_url: Option<&str>,
) -> Vec<u8> 
Expand description

Creates a TCP packet.

§Arguments

  • origin - the source address and port values we use for our probes
  • dst - the destination address for the TCP packet
  • worker_id - the unique worker ID of this worker
  • is_discovery - whether this is a measurement (False) or discovery (True) probe
  • info_url - Optional URL to encode in packet payload (e.g., opt-out URL)

§Returns

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