pub fn from_bytes_v6(packet: &[u8]) -> Result<IpAddr, StunError>Expand description
ยงTest
use std::net::IpAddr;
use turn_server::stun::attribute::*;
let bytes: [u8; 20] = [
0x00, 0x01, 0xdd, 0xac, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xFF, 0xC0, 0x0A, 0x2F, 0x0F,
];
let source: IpAddr = "::ffff:192.10.47.15".parse().unwrap();
let addr = from_bytes_v6(&bytes).unwrap();
assert_eq!(addr, source);