diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/vrrpv2.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/vrrpv2.rs b/src/vrrpv2.rs index 748f266..5f5de92 100644 --- a/src/vrrpv2.rs +++ b/src/vrrpv2.rs @@ -1,6 +1,11 @@ use std::io::{self, Cursor, Read}; use std::net::Ipv4Addr; +const VERSION: u8 = 2; +const TYPE: u8 = 1; +const VERSION_TYPE: u8 = (VERSION << 4) | TYPE; // 0x21 +const MIN_PACKET_SIZE: usize = 16; + /// A VRRP version 2 packet. /// /// Packet format @@ -25,12 +30,6 @@ use std::net::Ipv4Addr; /// | Authentication Data (2) | /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ /// ``` - -const VERSION: u8 = 2; -const TYPE: u8 = 1; -const VERSION_TYPE: u8 = (VERSION << 4) | TYPE; // 0x21 -const MIN_PACKET_SIZE: usize = 16; - #[derive(Debug, PartialEq)] pub struct VRRPv2 { pub virtual_router_id: u8, |