about summary refs log tree commit diff
path: root/Completion/Solaris/Command/_netstat
blob: bf8e5aaa4ecbbb6f7fa6a99fe05dd7d6e4ad9ce1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#compdef netstat

_netstat() {
	local -a f_rules

	f_rules=(
		'af\::specify address family: inet, inet6, unix, number'
		'outif\::specify output interface: ifName, ifIndex, any, none'
		'dst\::specify destination IP: ip-addr[/mask], any, none'
		'flags\::select routes tagged with flags: [+ -]?[ABDGHLMSU]+' 
	)

	_arguments \
		- set1 \
		'-a[show state of all sockets, all routing tables or all interfaces]' \
		'-R[show extended security attributes for sockets and routing tables]' \
		'-n[do not resolve addresses to names]' \
		'-v[verbose]' \
		'-f[specify address family]:address family:(inet inet6 unix)' \
		'-P[specify protocol]:protocol:(ip ipv6 icmp icmpv6 igmp udp tcp rawip)' \
		- set2 \
		'-r[show routing table]' \
		'-f[filter routing table]:rule:(($f_rules))' \
		'-a[show state of all sockets, all routing tables or all interfaces]' \
		'-v[verbose]' \
		'-n[do not resolve addresses to names]' \
		'-R[show extended security attributes for sockets and routing tables]' \
		- set3 \
		'-g[show multicast group memberships]' \
		'-n[do not resolve addresses to names]' \
		'-v[verbose]' \
		'-f[specify address family]:address family:(inet inet6 unix)' \
		- set4 \
		'-i[show state of interfaces]' \
		'-a[show state of all sockets, all routing tables or all interfaces]' \
		'-f[specify address family]:address family:(inet inet6 unix)' \
		'-n[do not resolve addresses to names]' \
		'-I[select interface]:interface:_net_interfaces' \
		- set5 \
		'-m[show STREAMS memory statistics]' \
		'-v[verbose]' \
		- set6 \
		'-p[show net to media tables]' \
		'-n[do not resolve addresses to names]' \
		'-f[specify address family]:address family:(inet inet6 unix)' \
		- set7 \
		'-s[show per protocol statistics]' \
		'-f[specify address family]:address family:(inet inet6 unix)' \
		'-P[specify protocol]:protocol:(ip ipv6 icmp icmpv6 igmp udp tcp rawip)' \
		- set8 \
		'-M[show multicast routing tables]' \
		'-f[specify address family]:address family:(inet inet6 unix)' \
		'-n[do not resolve addresses to names]' \
		'-s[show per protocol statistics]' \
		- set9 \
		'-D[show status of DHCP configured interfaces]' \
		'-f[specify address family]:address family:(inet inet6 unix)' \
		'-I[select interface]:interface:_net_interfaces' \
}

_netstat "$@"