equal
deleted
inserted
replaced
|
1 use std::net::Ipv4Addr; |
|
2 |
|
3 pub enum VRRPv2Error {} |
|
4 |
|
5 pub enum VRRPVersion { |
|
6 V2(u8), |
|
7 } |
|
8 |
|
9 pub enum VRRPv2Type { |
|
10 VRRPv2Advertisement, |
|
11 } |
|
12 |
|
13 pub enum VRRPv2AuthType { |
|
14 VRRPv2AuthNoAuth = 0x00, |
|
15 VRRPv2AuthReserved1 = 0x01, |
|
16 VRRPv2AuthReserved2 = 0x02, |
|
17 } |
|
18 |
|
19 pub struct VRRPv2 { |
|
20 pub version: VRRPVersion, |
|
21 pub type_: VRRPv2Type, |
|
22 pub virtual_router_id: u8, |
|
23 pub priority: u8, |
|
24 pub count_ip_addrs: u8, |
|
25 pub auth_type: VRRPv2AuthType, |
|
26 pub advertisement_interval: u8, |
|
27 pub checksum: u16, |
|
28 pub ip_addrs: Vec<Ipv4Addr>, |
|
29 } |
|
30 |
|
31 pub fn from_bytes(_bytes: &[u8]) -> Result<&VRRPv2, VRRPv2Error> { |
|
32 unimplemented!() |
|
33 } |