1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
use core::mem; /// UDP header, which is present after the IP header. #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct UdpHdr { pub source: u16, pub dest: u16, pub len: u16, pub check: u16, } impl UdpHdr { pub const LEN: usize = mem::size_of::<UdpHdr>(); }