diff options
-rw-r--r-- | src/lib.rs | 1 | ||||
-rw-r--r-- | src/vrrpv2.rs | 33 |
2 files changed, 34 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..ae2ba80 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1 @@ +pub mod vrrpv2; diff --git a/src/vrrpv2.rs b/src/vrrpv2.rs new file mode 100644 index 0000000..559b913 --- /dev/null +++ b/src/vrrpv2.rs @@ -0,0 +1,33 @@ +use std::net::Ipv4Addr; + +pub enum VRRPv2Error {} + +pub enum VRRPVersion { + V2(u8), +} + +pub enum VRRPv2Type { + VRRPv2Advertisement, +} + +pub enum VRRPv2AuthType { + VRRPv2AuthNoAuth = 0x00, + VRRPv2AuthReserved1 = 0x01, + VRRPv2AuthReserved2 = 0x02, +} + +pub struct VRRPv2 { + pub version: VRRPVersion, + pub type_: VRRPv2Type, + pub virtual_router_id: u8, + pub priority: u8, + pub count_ip_addrs: u8, + pub auth_type: VRRPv2AuthType, + pub advertisement_interval: u8, + pub checksum: u16, + pub ip_addrs: Vec<Ipv4Addr>, +} + +pub fn from_bytes(_bytes: &[u8]) -> Result<&VRRPv2, VRRPv2Error> { + unimplemented!() +} |