Skip to main content

ip_to_bytes

Function ip_to_bytes 

Source
pub fn ip_to_bytes(ip: IpAddr) -> [u8; 16]
Expand description

Convert an IpAddr to the 16-byte PVA wire representation.

IPv4 addresses are stored as IPv4-mapped IPv6 (::ffff:a.b.c.d). Native IPv6 addresses are stored as-is.