dhcp/
dhcp.rs

1
2fn main() -> () {
3    use catnip::*;
4
5    let dhcp_inform = DhcpFixedPayload::new_inform(
6        IpV4Addr::new([1, 2, 3, 4]),
7        MacAddr::new([5, 6, 7, 8, 9, 10]),
8        12345
9    );
10
11    // Serialize
12    let bytes = dhcp_inform.to_be_bytes();
13    // Deserialize
14    let msg_parsed = DhcpFixedPayload::read_bytes(&bytes);
15
16    assert_eq!(msg_parsed, dhcp_inform);
17}