vrrp_packet/lib.rs
1use pnet_macros::packet;
2use pnet_macros_support::types::*;
3
4
5///
6/// header of VRRP packet
7/// as described in RFC 3768 (5.1)
8///
9#[packet]
10pub struct Vrrp {
11 version: u4,
12 header_type: u4,
13 vrid: u8,
14 priority: u8,
15 count_ip: u8,
16 auth_type: u8,
17 advert_int: u8,
18 checksum: u16be,
19
20 #[length="(count_ip * 4)"]
21 ip_addresses: Vec<u8>,
22
23 // the following two are only used for backward compatibility.
24 auth_data: u32be,
25 auth_data2: u32be,
26 #[length="0"]
27 #[payload]
28 pub payload: Vec<u8>
29}
30
31