equal
deleted
inserted
replaced
1 #compdef snoop |
|
2 |
|
3 _snoop() { |
|
4 local -a t_opt exp |
|
5 |
|
6 t_opt=( |
|
7 "r"\:"time relative to first packet" |
|
8 "a"\:"absolute time" |
|
9 "d"\:"delta time - time since receiving previous packet" |
|
10 ) |
|
11 |
|
12 exp=( |
|
13 "ether" |
|
14 "ethertype" |
|
15 "host" |
|
16 "from" |
|
17 "to" |
|
18 "ip" |
|
19 "ip6" |
|
20 "arp" |
|
21 "rarp" |
|
22 "pppoe" |
|
23 "pppoed" |
|
24 "pppoes" |
|
25 "vlan" |
|
26 "vlan-id" |
|
27 "broadcast" |
|
28 "multicast" |
|
29 "bootp" |
|
30 "dhcp" |
|
31 "dhcp6" |
|
32 "apple" |
|
33 "decnet" |
|
34 "greater" |
|
35 "less" |
|
36 "udp" |
|
37 "tcp" |
|
38 "icmp" |
|
39 "icmp6" |
|
40 "ah" |
|
41 "esp" |
|
42 "net" |
|
43 "port" |
|
44 "rpc" |
|
45 "zone" |
|
46 "ldap" |
|
47 "gateway" |
|
48 "nofrag" |
|
49 ">" |
|
50 ">=" |
|
51 "<" |
|
52 "<=" |
|
53 "=" |
|
54 "!=" |
|
55 "and" |
|
56 "or" |
|
57 "not" |
|
58 "slp" |
|
59 "sctp" |
|
60 "ospf" |
|
61 ) |
|
62 |
|
63 _arguments \ |
|
64 '-a[generate audio signal on receiving packets]' \ |
|
65 '-c[quit after capturing maxcount packets]:maxcount' \ |
|
66 '-d[capture packets from specified device]:device:_net_interfaces' \ |
|
67 '-i[display packets previously captured to file]:file:_files' \ |
|
68 '-n[use file as IP address-to-name mapping table]:file:_files' \ |
|
69 '-o[save captured packets to file]:file:_files' \ |
|
70 '-p[display one or more packets from captured file]:first packet number [ , last packet number]' \ |
|
71 '-q[do not display packet counter when capturing to file]' \ |
|
72 '-r[do not resolve IP addresses to names]' \ |
|
73 '-s[truncate each packet after snaplen bytes]:snaplen' \ |
|
74 '-t[time-stamp presentation]:time-stamp mode:(($t_opt))' \ |
|
75 '-C[list code generated from filter expression]' \ |
|
76 '-D[display number of packets dropped on the summary line]' \ |
|
77 '-N[create IP-address-to-name mapping table file (used with -i)]' \ |
|
78 '-I[capture packets from specified interface]:interface:_net_interfaces' \ |
|
79 '-P[capture packets in non-promiscuous mode]' \ |
|
80 '-S[display size of the entire link layer frame in bytes]' \ |
|
81 '-V[verbose summary mode]' \ |
|
82 '-v[verbose mode]' \ |
|
83 '-x[display offset and length of packet in HEX and ASCII]:offset [ , length]' \ |
|
84 '*:expression:(($exp))' \ |
|
85 } |
|
86 |
|
87 _snoop "$@" |
|