11use mockall:: mock;
22use mpsc:: channel;
3- use pnet:: util:: MacAddr ;
43use r_lanlib:: {
54 error:: Result ,
65 scanners:: { Port , PortSet , Scanner } ,
@@ -86,11 +85,8 @@ fn prints_arp_table_results() {
8685 let device = Device {
8786 hostname : "hostname" . to_string ( ) ,
8887 ip : Ipv4Addr :: new ( 192 , 168 , 1 , 1 ) ,
89- is_current_host : false ,
90- mac : MacAddr :: default ( ) ,
9188 vendor : "vendor" . to_string ( ) ,
92- open_ports : PortSet :: new ( ) ,
93- latency_ms : None ,
89+ ..Device :: default ( )
9490 } ;
9591
9692 print_arp ( & args, & vec ! [ device] ) . unwrap ( ) ;
@@ -115,11 +111,8 @@ fn prints_arp_json_results() {
115111 let device = Device {
116112 hostname : "hostname" . to_string ( ) ,
117113 ip : Ipv4Addr :: new ( 192 , 168 , 1 , 1 ) ,
118- is_current_host : false ,
119- mac : MacAddr :: default ( ) ,
120114 vendor : "vendor" . to_string ( ) ,
121- open_ports : PortSet :: new ( ) ,
122- latency_ms : None ,
115+ ..Device :: default ( )
123116 } ;
124117
125118 print_arp ( & args, & vec ! [ device] ) . unwrap ( ) ;
@@ -152,11 +145,9 @@ fn prints_syn_table_results() {
152145 let device = Device {
153146 hostname : "hostname" . to_string ( ) ,
154147 ip : Ipv4Addr :: new ( 192 , 168 , 1 , 1 ) ,
155- is_current_host : false ,
156- mac : MacAddr :: default ( ) ,
157148 vendor : "vendor" . to_string ( ) ,
158149 open_ports,
159- latency_ms : None ,
150+ .. Device :: default ( )
160151 } ;
161152
162153 let devices = HashMap :: from ( [ ( device. ip , device) ] ) ;
@@ -190,11 +181,9 @@ fn prints_syn_json_results() {
190181 let device = Device {
191182 hostname : "hostname" . to_string ( ) ,
192183 ip : Ipv4Addr :: new ( 192 , 168 , 1 , 1 ) ,
193- is_current_host : false ,
194- mac : MacAddr :: default ( ) ,
195184 vendor : "vendor" . to_string ( ) ,
196185 open_ports,
197- latency_ms : None ,
186+ .. Device :: default ( )
198187 } ;
199188
200189 let devices = HashMap :: from ( [ ( device. ip , device) ] ) ;
@@ -210,11 +199,8 @@ fn performs_arp_scan() {
210199 let device = Device {
211200 hostname : "hostname" . to_string ( ) ,
212201 ip : Ipv4Addr :: new ( 192 , 168 , 1 , 1 ) ,
213- is_current_host : false ,
214- mac : MacAddr :: default ( ) ,
215202 vendor : "vendor" . to_string ( ) ,
216- open_ports : PortSet :: new ( ) ,
217- latency_ms : None ,
203+ ..Device :: default ( )
218204 } ;
219205
220206 let device_clone = device. clone ( ) ;
@@ -255,11 +241,9 @@ fn performs_syn_scan() {
255241 let device = Device {
256242 hostname : "hostname" . to_string ( ) ,
257243 ip : Ipv4Addr :: new ( 192 , 168 , 1 , 1 ) ,
258- is_current_host : false ,
259- mac : MacAddr :: default ( ) ,
260244 vendor : "vendor" . to_string ( ) ,
261245 open_ports : ports,
262- latency_ms : None ,
246+ .. Device :: default ( )
263247 } ;
264248
265249 let device_clone = device. clone ( ) ;
0 commit comments