@@ -29,8 +29,11 @@ const EXAMPLES_HELP: &str = "EXAMPLES:
2929 # List network interfaces
3030 arp-scan -l
3131
32+ # Launch a scan on a specific range
33+ arp-scan -i eth0 -n 10.37.3.1,10.37.4.55/24
34+
3235 # Launch a scan on WiFi interface with fake IP and stealth profile
33- arp-scan -i wlp1s0 --source-ip 192.168.0.42 --profile stealth
36+ arp-scan -i eth0 --source-ip 192.168.0.42 --profile stealth
3437
3538 # Launch a scan on VLAN 45 with JSON output
3639 arp-scan -Q 45 -o json
@@ -158,6 +161,11 @@ pub fn build_args<'a>() -> Command<'a> {
158161 . takes_value ( true ) . value_name ( "OPERATION_ID" )
159162 . help ( "Custom ARP operation ID" )
160163 )
164+ . arg (
165+ Arg :: new ( "packet_help" ) . long ( "packet-help" )
166+ . takes_value ( false )
167+ . help ( "Print details about an ARP packet" )
168+ )
161169 . after_help ( EXAMPLES_HELP )
162170}
163171
@@ -199,7 +207,8 @@ pub struct ScanOptions {
199207 pub hw_addr : Option < u8 > ,
200208 pub proto_type : Option < EtherType > ,
201209 pub proto_addr : Option < u8 > ,
202- pub arp_operation : Option < ArpOperation >
210+ pub arp_operation : Option < ArpOperation > ,
211+ pub packet_help : bool
203212}
204213
205214impl ScanOptions {
@@ -497,6 +506,8 @@ impl ScanOptions {
497506 } ,
498507 None => None
499508 } ;
509+
510+ let packet_help = matches. contains_id ( "packet_help" ) ;
500511
501512 Arc :: new ( ScanOptions {
502513 profile,
@@ -517,7 +528,8 @@ impl ScanOptions {
517528 hw_addr,
518529 proto_type,
519530 proto_addr,
520- arp_operation
531+ arp_operation,
532+ packet_help
521533 } )
522534 }
523535
@@ -531,6 +543,10 @@ impl ScanOptions {
531543 matches ! ( & self . vlan_id, Some ( _) )
532544 }
533545
546+ pub fn request_protocol_print ( & self ) -> bool {
547+ self . packet_help
548+ }
549+
534550}
535551
536552
0 commit comments