aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHimbeerserverDE <himbeerserverde@gmail.com>2023-10-15 10:50:36 +0200
committerHimbeerserverDE <himbeerserverde@gmail.com>2023-10-15 10:50:36 +0200
commitb6033362017a326589af6c1ee3758697e5d09b72 (patch)
treec749486e6f210f9a5ee23c525dc93ad4e982af07 /src
parent1d8fad5a244117202c84c0660baec32f9fa6f58e (diff)
mark tunnel structs as ipv4
Diffstat (limited to 'src')
-rw-r--r--src/tunnel.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/tunnel.rs b/src/tunnel.rs
index ac5d074..50eed04 100644
--- a/src/tunnel.rs
+++ b/src/tunnel.rs
@@ -27,14 +27,14 @@ impl Sit {
vihl.set_version(4);
vihl.set_ihl(5);
- let p = IpTunnelParm {
+ let p = IpTunnelParm4 {
name: CString::new(name)?,
link: libc::if_nametoindex(CString::new(master)?.as_ptr()),
i_flags: 0,
o_flags: 0,
i_key: 0,
o_key: 0,
- iph: IpHdr {
+ iph: IpHdr4 {
vihl,
tos: 0,
tot_len: 0,
@@ -52,7 +52,7 @@ impl Sit {
return Err(Error::LinkNotFound(master.to_owned()));
}
- let ifr = IfReq {
+ let ifr = IfReq4 {
name: CString::new("sit0")?,
ifru_data: &p,
};
@@ -146,7 +146,7 @@ bitfield! {
#[derive(Debug)]
#[repr(C)]
-struct IpHdr {
+struct IpHdr4 {
vihl: VerIhl,
tos: u8,
tot_len: u16,
@@ -161,19 +161,19 @@ struct IpHdr {
#[derive(Debug)]
#[repr(C)]
-struct IpTunnelParm {
+struct IpTunnelParm4 {
name: CString,
link: u32,
i_flags: u16,
o_flags: u16,
i_key: u32,
o_key: u32,
- iph: IpHdr,
+ iph: IpHdr4,
}
#[derive(Debug)]
#[repr(C)]
-struct IfReq {
+struct IfReq4 {
name: CString,
- ifru_data: *const IpTunnelParm,
+ ifru_data: *const IpTunnelParm4,
}