@@ -14,7 +14,6 @@ use s2n_quic::{
1414 provider:: {
1515 endpoint_limits,
1616 event:: { events, Subscriber } ,
17- io,
1817 } ,
1918 Server ,
2019} ;
@@ -27,12 +26,6 @@ use tokio::spawn;
2726
2827#[ derive( Debug , StructOpt ) ]
2928pub struct Interop {
30- #[ structopt( short, long, default_value = "::" ) ]
31- ip : std:: net:: IpAddr ,
32-
33- #[ structopt( short, long, default_value = "443" ) ]
34- port : u16 ,
35-
3629 #[ structopt( long) ]
3730 certificate : Option < PathBuf > ,
3831
@@ -45,18 +38,14 @@ pub struct Interop {
4538 #[ structopt( long, default_value = "." ) ]
4639 www_dir : PathBuf ,
4740
48- #[ structopt( long) ]
49- disable_gso : bool ,
50-
5141 #[ structopt( long, env = "TESTCASE" , possible_values = & Testcase :: supported( is_supported_testcase) ) ]
5242 testcase : Option < Testcase > ,
5343
5444 #[ structopt( long, default_value) ]
5545 tls : TlsProviders ,
5646
57- #[ cfg( feature = "xdp" ) ]
5847 #[ structopt( flatten) ]
59- xdp : crate :: xdp :: Xdp ,
48+ io : crate :: io :: Server ,
6049}
6150
6251impl Interop {
@@ -89,28 +78,6 @@ impl Interop {
8978 Err ( crate :: CRASH_ERROR_MESSAGE . into ( ) )
9079 }
9180
92- #[ cfg( feature = "xdp" ) ]
93- fn io ( & self ) -> Result < impl io:: Provider > {
94- // GSO isn't currently supported for XDP so just read it to avoid a dead_code warning
95- let _ = self . disable_gso ;
96-
97- let addr = ( self . ip , self . port ) . into ( ) ;
98-
99- self . xdp . server ( addr)
100- }
101-
102- #[ cfg( not( feature = "xdp" ) ) ]
103- fn io ( & self ) -> Result < impl io:: Provider > {
104- let mut io_builder =
105- io:: Default :: builder ( ) . with_receive_address ( ( self . ip , self . port ) . into ( ) ) ?;
106-
107- if self . disable_gso {
108- io_builder = io_builder. with_gso_disabled ( ) ?;
109- }
110-
111- Ok ( io_builder. build ( ) ?)
112- }
113-
11481 fn server ( & self ) -> Result < Server > {
11582 let mut max_handshakes = 100 ;
11683 if let Some ( Testcase :: Retry ) = self . testcase {
@@ -121,7 +88,7 @@ impl Interop {
12188 . with_inflight_handshake_limit ( max_handshakes) ?
12289 . build ( ) ?;
12390
124- let io = self . io ( ) ?;
91+ let io = self . io . build ( ) ?;
12592
12693 let server = Server :: builder ( )
12794 . with_io ( io) ?
@@ -157,7 +124,7 @@ impl Interop {
157124 }
158125 } ;
159126
160- eprintln ! ( "Server listening on port {}" , self . port) ;
127+ eprintln ! ( "Server listening on port {}" , self . io . port) ;
161128
162129 Ok ( server)
163130 }
0 commit comments