Skip to content

Commit

Permalink
exports
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed May 21, 2024
1 parent 84414e4 commit 228d199
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 43 deletions.
4 changes: 2 additions & 2 deletions iroh-net/src/net/interfaces/bsd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ use super::DefaultRouteDetails;
#[cfg(target_os = "freebsd")]
mod freebsd;
#[cfg(target_os = "freebsd")]
pub use self::freebsd::*;
pub(crate) use self::freebsd::*;
#[cfg(target_os = "netbsd")]
mod netbsd;
#[cfg(target_os = "netbsd")]
pub use self::netbsd::*;
pub(crate) use self::netbsd::*;

#[cfg(any(target_os = "macos", target_os = "ios"))]
mod macos;
Expand Down
82 changes: 41 additions & 41 deletions iroh-net/src/net/interfaces/bsd/freebsd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,53 +5,53 @@ use libc::c_int;
// Missing constants from libc.
// https://github.com/rust-lang/libc/issues/3711

const LOCAL_PEERCRED: c_int = 1;
pub const LOCAL_PEERCRED: c_int = 1;

// net/route.h
const RTF_GATEWAY: c_int = 0x2;
pub const RTF_GATEWAY: c_int = 0x2;
pub const RTAX_DST: c_int = 0;
const RTAX_GATEWAY: c_int = 1;
const RTAX_NETMASK: c_int = 2;
pub const RTAX_GATEWAY: c_int = 1;
pub const RTAX_NETMASK: c_int = 2;
pub const RTAX_IFP: c_int = 4;
const RTAX_BRD: c_int = 7;
const RTAX_MAX: c_int = 8;
const RTM_VERSION: c_int = 5;
const RTA_DST: c_int = 0x1;
const RTA_GATEWAY: c_int = 0x2;
const RTA_NETMASK: c_int = 0x4;
const RTA_GENMASK: c_int = 0x8;
const RTA_IFP: c_int = 0x10;
const RTA_IFA: c_int = 0x20;
const RTA_AUTHOR: c_int = 0x40;
const RTA_BRD: c_int = 0x80;
pub const RTAX_BRD: c_int = 7;
pub const RTAX_MAX: c_int = 8;
pub const RTM_VERSION: c_int = 5;
pub const RTA_DST: c_int = 0x1;
pub const RTA_GATEWAY: c_int = 0x2;
pub const RTA_NETMASK: c_int = 0x4;
pub const RTA_GENMASK: c_int = 0x8;
pub const RTA_IFP: c_int = 0x10;
pub const RTA_IFA: c_int = 0x20;
pub const RTA_AUTHOR: c_int = 0x40;
pub const RTA_BRD: c_int = 0x80;

// Message types
const RTM_ADD: c_int = 0x1;
const RTM_DELETE: c_int = 0x2;
const RTM_CHANGE: c_int = 0x3;
const RTM_GET: c_int = 0x4;
const RTM_LOSING: c_int = 0x5;
const RTM_REDIRECT: c_int = 0x6;
const RTM_MISS: c_int = 0x7;
const RTM_LOCK: c_int = 0x8;
const RTM_OLDADD: c_int = 0x9;
const RTM_OLDDEL: c_int = 0xa;
const RTM_RESOLVE: c_int = 0xb;
const RTM_NEWADDR: c_int = 0xc;
const RTM_DELADDR: c_int = 0xd;
const RTM_IFINFO: c_int = 0xe;
const RTM_NEWMADDR: c_int = 0xf;
const RTM_DELMADDR: c_int = 0x10;
const RTM_IFANNOUNCE: c_int = 0x11;
const RTM_IEEE80211: c_int = 0x12;

const SHUT_RD: c_int = 0;
const SHUT_WR: c_int = 1;
const SHUT_RDWR: c_int = 2;
pub const RTM_ADD: c_int = 0x1;
pub const RTM_DELETE: c_int = 0x2;
pub const RTM_CHANGE: c_int = 0x3;
pub const RTM_GET: c_int = 0x4;
pub const RTM_LOSING: c_int = 0x5;
pub const RTM_REDIRECT: c_int = 0x6;
pub const RTM_MISS: c_int = 0x7;
pub const RTM_LOCK: c_int = 0x8;
pub const RTM_OLDADD: c_int = 0x9;
pub const RTM_OLDDEL: c_int = 0xa;
pub const RTM_RESOLVE: c_int = 0xb;
pub const RTM_NEWADDR: c_int = 0xc;
pub const RTM_DELADDR: c_int = 0xd;
pub const RTM_IFINFO: c_int = 0xe;
pub const RTM_NEWMADDR: c_int = 0xf;
pub const RTM_DELMADDR: c_int = 0x10;
pub const RTM_IFANNOUNCE: c_int = 0x11;
pub const RTM_IEEE80211: c_int = 0x12;

pub const SHUT_RD: c_int = 0;
pub const SHUT_WR: c_int = 1;
pub const SHUT_RDWR: c_int = 2;

// Hardcoded based on the generated values here: https://cs.opensource.google/go/x/net/+/master:route/zsys_freebsd_amd64.go
#[cfg(target_arch = "x86_64")]
use self::amd64::*;
pub use self::amd64::*;
#[cfg(target_arch = "x86_64")]
mod amd64 {
pub(super) const SIZEOF_IF_MSGHDRL_FREE_BSD10: usize = 0xb0;
Expand Down Expand Up @@ -103,7 +103,7 @@ mod amd64 {

// Hardcoded based on the generated values here: https://cs.opensource.google/go/x/net/+/master:route/zsys_freebsd_386.go
#[cfg(target_arch = "x86")]
use self::i686::*;
pub use self::i686::*;
#[cfg(target_arch = "x86")]
mod i686 {
pub(super) const SIZEOF_IF_MSGHDRL_FREE_BSD10: usize = 0x68;
Expand Down Expand Up @@ -158,7 +158,7 @@ mod i686 {

// Hardcoded based on the generated values here: https://cs.opensource.google/go/x/net/+/master:route/zsys_freebsd_arm.go
#[cfg(target_arch = "arm")]
use self::arm::*;
pub use self::arm::*;
#[cfg(target_arch = "arm")]
mod arm {
pub(super) const SIZEOF_IF_MSGHDRL_FREE_BSD10: usize = 0x68;
Expand Down Expand Up @@ -210,7 +210,7 @@ mod arm {

// Hardcoded based on the generated values here: https://cs.opensource.google/go/x/net/+/master:route/zsys_freebsd_arm.go
#[cfg(target_arch = "aarch64")]
use self::arm64::*;
pub use self::arm64::*;
#[cfg(target_arch = "aarch64")]
mod arm64 {
pub(super) const SIZEOF_IF_MSGHDRL_FREE_BSD10: usize = 0xb0;
Expand Down

0 comments on commit 228d199

Please sign in to comment.