diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-09-07 19:19:51 +0200 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-09-07 19:19:51 +0200 |
commit | eae915b2e8aacb86392239a984ca2028b4d93630 (patch) | |
tree | 44a52a75f319937368f985ace410e1b4df14ab62 /src/router/ip.rs | |
parent | Write inbound packets to TUN device (diff) | |
download | wireguard-rs-eae915b2e8aacb86392239a984ca2028b4d93630.tar.xz wireguard-rs-eae915b2e8aacb86392239a984ca2028b4d93630.zip |
Fixed outbound unittest
Diffstat (limited to 'src/router/ip.rs')
-rw-r--r-- | src/router/ip.rs | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/router/ip.rs b/src/router/ip.rs index 6eb303c..e66144f 100644 --- a/src/router/ip.rs +++ b/src/router/ip.rs @@ -1,21 +1,10 @@ use byteorder::BigEndian; use zerocopy::byteorder::U16; -use zerocopy::{AsBytes, ByteSlice, FromBytes, LayoutVerified}; - -pub const SIZE_IP4_HEADER: usize = 16; -pub const SIZE_IP6_HEADER: usize = 36; +use zerocopy::{AsBytes, FromBytes}; pub const VERSION_IP4: u8 = 4; pub const VERSION_IP6: u8 = 6; -pub const OFFSET_IP4_SRC: usize = 12; -pub const OFFSET_IP6_SRC: usize = 8; - -pub const OFFSET_IP4_DST: usize = 16; -pub const OFFSET_IP6_DST: usize = 24; - -pub const TYPE_TRANSPORT: u8 = 4; - #[repr(packed)] #[derive(Copy, Clone, FromBytes, AsBytes)] pub struct IPv4Header { @@ -29,7 +18,7 @@ pub struct IPv4Header { #[repr(packed)] #[derive(Copy, Clone, FromBytes, AsBytes)] pub struct IPv6Header { - _f_pre: [u8; 4], + _f_space1: [u8; 4], pub f_len: U16<BigEndian>, _f_space2: [u8; 2], pub f_source: [u8; 16], |