File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ doctest = false
1010[dependencies ]
1111libc = " >= 0.2.4"
1212time = " >=0.1.0"
13- simd = { git = " https://github.com/huonw/simd" }
1413getopts = " *"
1514byteorder = " *"
1615clippy = { version = " *" , optional = true }
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ use std::slice;
99use utils:: Flow ;
1010
1111/// IP header using SSE
12- #[ derive( Debug , Default ) ]
12+ #[ derive( Default ) ]
1313#[ repr( C , packed) ]
1414pub struct IpHeader {
1515 version_to_len : u32 ,
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ use std::fmt;
55use std:: hash:: Hash ;
66use std:: hash:: Hasher ;
77
8- #[ derive( Debug , Default ) ]
8+ #[ derive( Default ) ]
99#[ repr( C , packed) ]
1010pub struct MacAddress {
1111 pub addr : [ u8 ; 6 ] ,
@@ -66,7 +66,7 @@ impl Hash for MacAddress {
6666}
6767
6868/// A packet's MAC header.
69- #[ derive( Debug , Default ) ]
69+ #[ derive( Default ) ]
7070#[ repr( C , packed) ]
7171pub struct MacHeader {
7272 pub dst : MacAddress ,
Original file line number Diff line number Diff line change 11use super :: EndOffset ;
22use std:: fmt;
33
4- #[ derive( Debug , Default ) ]
4+ #[ derive( Default ) ]
55#[ repr( C , packed) ]
66pub struct NullHeader ;
77
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ use headers::IpHeader;
33use std:: default:: Default ;
44use std:: fmt;
55
6- #[ derive( Debug , Default ) ]
6+ #[ derive( Default ) ]
77#[ repr( C , packed) ]
88pub struct TcpHeader {
99 src_port : u16 ,
Original file line number Diff line number Diff line change @@ -4,8 +4,7 @@ use std::default::Default;
44use std:: fmt;
55
66/// UDP header using SSE
7- // #[repr(C, packed)]
8- #[ derive( Debug , Default ) ]
7+ #[ derive( Default ) ]
98#[ repr( C , packed) ]
109pub struct UdpHeader {
1110 src_port : u16 ,
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ pub fn maglev<T: 'static + Batch<Header = NullHeader>, S: Scheduler + Sized>(
9393 . parse :: < MacHeader > ( )
9494 . transform ( box move |pkt| {
9595 assert ! ( pkt. refcnt( ) == 1 ) ;
96- let mut hdr = pkt. get_mut_header ( ) ;
96+ let hdr = pkt. get_mut_header ( ) ;
9797 hdr. swap_addresses ( ) ;
9898 } )
9999 . group_by (
Original file line number Diff line number Diff line change @@ -24,7 +24,8 @@ pub fn tcp_nf<T: 'static + Batch<Header = NullHeader>>(parent: T) -> Composition
2424 "payload: {:x} {:x} {:x} {:x}" ,
2525 payload[ 0 ] , payload[ 1 ] , payload[ 2 ] , payload[ 3 ]
2626 ) ;
27- println ! ( "Src {} dst {}" , flow. src_port, flow. dst_port) ;
27+ let ( src, dst) = ( flow. src_port , flow. dst_port ) ;
28+ println ! ( "Src {} dst {}" , src, dst) ;
2829 } )
2930 . parse :: < UdpHeader > ( )
3031 . map ( box |pkt| {
You can’t perform that action at this time.
0 commit comments