summaryrefslogtreecommitdiff
path: root/src/vrrpv2.rs
blob: 559b913c1042ce659b3ec0a96d210b0be0413e6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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!()
}