3 local tmp_proto protocols proto
5 tmp_proto=(${${(M)${(f)"$(</etc/protocols)"}##[a-z0-9]*}})
6 for proto ($tmp_proto) {
9 protocols=($protocols ${${(j: :)${=proto}}// *\# /:})
12 protocols=($protocols ${${(j: :)${=proto}}// */})
17 '-4[Show AF_INET (IPv4) sockets]' \
18 '-6[Show AF_INET6 (IPv6) sockets]' \
19 '-c[Show connected sockets]' \
20 '-l[Show listening sockets]' \
21 '-u[Show AF_LOCAL (UNIX) sockets]' \
22 '-p[Only show Internet sockets if the port number is on the specified list]' \
23 '-P[Only show sockets of the specified protocols]:protocols:(($protocols))'