-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- centralize constants to consts.rs. - rename arpPacket to arpHeader. - remove the use of unsafe when sending arp packet. - Have ifindex defined outside the send_packet_* functions - get rid of Arpframe Signed-off-by: Paul Wekesa <paul1tw1@gmail.com>
- Loading branch information
Showing
9 changed files
with
95 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// Copyright (c) The Holo Core Contributors | ||
// | ||
// SPDX-License-Identifier: MIT | ||
// | ||
// Sponsored by NLnet as part of the Next Generation Internet initiative. | ||
// See: https://nlnet.nl/NGI0 | ||
// | ||
use std::net::Ipv4Addr; | ||
|
||
// ==== VRRP === | ||
// valid vrrp versions | ||
pub const VALID_VRRP_VERSIONS: [u8; 1] = [2]; | ||
pub const VRRP_PROTO_NUMBER: i32 = 112; | ||
// maximum size of vrrp header | ||
pub const VRRP_HDR_MAX: usize = 96; | ||
// minimum size of vrrp header. | ||
pub const VRRP_HDR_MIN: usize = 16; | ||
// maximum size of IP + vrrp header. | ||
// For when we use the layer 2 socket | ||
pub const IP_VRRP_HDR_MAX: usize = 130; | ||
pub const VRRP_MULTICAST_ADDRESS: Ipv4Addr = Ipv4Addr::new(224, 0, 0, 18); | ||
|
||
// max size of ip + vrrp header maximum | ||
// number of virtual IP addresses that can be on a VRRP header. | ||
pub const VRRP_IP_COUNT_MAX: usize = 20; | ||
|
||
// ==== ARP ==== | ||
pub const ARP_PROTOCOL_NUMBER: u16 = 0x806_u16; | ||
|
||
// ==== IP ==== | ||
pub const IP_HDR_MIN: usize = 20; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
)] | ||
#![feature(let_chains)] | ||
|
||
pub mod consts; | ||
pub mod debug; | ||
pub mod error; | ||
pub mod events; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.