///|
/// 解析 UDP 头:src port 0 / dst port 2 / len 4(含 8 字节头)
fn parse_udp(data : Bytes, off : Int, ip_payload : Int) -> (Int, Int, Int)? {
guard ip_payload >= 8 else { return None }
let sport = u16(data, off)
let dport = u16(data, off + 2)
let udp_len = u16(data, off + 4)
guard udp_len >= 8 && udp_len <= ip_payload else { return None }
Some((sport, dport, udp_len - 8))
}