summary refs log tree commit diff
diff options
context:
space:
mode:
authorJun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>2018-10-31 19:24:45 +0900
committerJun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>2018-10-31 19:24:45 +0900
commitce048aee385a21deea0cf48d86233d4b5140d930 (patch)
tree2f006b491f8b06d49d6d2901a79a54b3bc62384d
parent967c964e214ff5852a105ca84de247a4e88cc274 (diff)
downloadzsh-ce048aee385a21deea0cf48d86233d4b5140d930.tar.gz
zsh-ce048aee385a21deea0cf48d86233d4b5140d930.tar.xz
zsh-ce048aee385a21deea0cf48d86233d4b5140d930.zip
43746: _ping: update for BSD and Darwin
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Unix/Command/_ping27
2 files changed, 19 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index f75d49b4d..1766680e1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2018-10-31  Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
 
+	* 43746: Completion/Unix/Command/_ping: update for BSD and
+	Darwin
+
 	* 43744: Completion/Unix/Command/_sysctl: add support for
 	procps-ng (Linux) and NetBSD, with several other updates
 
diff --git a/Completion/Unix/Command/_ping b/Completion/Unix/Command/_ping
index 2efe545c6..78fd33d92 100644
--- a/Completion/Unix/Command/_ping
+++ b/Completion/Unix/Command/_ping
@@ -37,7 +37,7 @@ case ${variant}:${${service#ping}:-4} in
   iputils:*|((free|net)bsd|darwin|dragonfly)*:4)
     args+=( '-a[audible bell for each packet]' )
   ;|
-  iputils:*|(net|open)bsd*:4)
+  iputils:*|netbsd*:4|openbsd*)
     args+=( '-w+[specify timeout after which ping exits]:deadline (seconds)' )
   ;|
   iputils:*|openbsd*:4|solaris*)
@@ -58,10 +58,7 @@ case ${variant}:${${service#ping}:-4} in
     args+=( "-D[set the don't fragment bit]" )
   ;|
   ((free|net)bsd|darwin|dragonfly)*:4)
-    args+=(
-      '-Q[somewhat quiet]'
-      '-T+[set IP Time to Live for outgoing packets]:ttl'
-    )
+    args+=( '-Q[somewhat quiet]')
   ;|
   freebsd*:6|darwin*:6|solaris*|netbsd*)
     args+=(
@@ -84,7 +81,7 @@ case ${variant}:${${service#ping}:-4} in
   (*bsd|darwin)*:6)
     args+=( '*-m[suppress fragmenting of packets into the minimum IPv6 MTU]' )
   ;|
-  freebsd*|darwin*|dragonfly*|netbsd*:6)
+  freebsd*|darwin*|netbsd*:6)
     args+=( '-P+[specify IPsec policy to be used for the probe]:policy' )
   ;|
   solaris2.<11->)
@@ -101,17 +98,19 @@ case ${variant}:${${service#ping}:-4} in
       '-h+[specify size increment for ICMP payload for sweeping pings]:size [1]'
       '-M+[use ICMP_MASKREQ or ICMP_TSTAMP instead of ICMP_ECHO]:ICMP:(mask time)'
       '-m+[set IP Time to Live for outgoing packets]:ttl'
+      '-T+[set IP Time to Live for multicasted packets]:ttl'
       '-t+[specify timeout after which ping exits]:deadline (seconds)'
       '-W+[specify time to wait for a response]:wait time (ms)'
       '-z+[specify type of service]:type of service'
     )
-  ;;
+  ;|
   (freebsd|darwin)*:6)
     args+=(
+      '-D[disable IPv6 fragmentation]'
       '-R[audible bell for no packet]'
       '-r[audible bell for each packet]'
     )
-  ;;
+  ;|
   freebsd*:6)
     args+=(
       '-x+[specify time to wait for a response]:wait time (ms)'
@@ -124,24 +123,30 @@ case ${variant}:${${service#ping}:-4} in
       '-E+[specify IPsec policy to be used for the probe]:policy'
       '-h+[specify target host]:host:_hosts'
       '-P+[use a pseudo-random sequence for the data]'
+      '-T+[set IP Time to Live for outgoing packets]:ttl'
       '-t+[specify type of service]:type of service'
     )
   ;;
   (dragonfly|netbsd)*:6)
     args+=( '-R[inject reachability confirmation hint for target host/first hop]' )
-  ;|
+  ;;
   darwin*:4)
-    args+=( '-b+[bind the socket to specified interface for sending]:interface:_net_interfaces' )
+    args+=( '-b+[bind the socket to specified interface for sending]:interface:_net_interfaces')
   ;|
   darwin*:6)
     args+=(
       '-B+[bind the socket to specified interface for sending]:interface:_net_interfaces'
-      '-C[prohibit socket from using cellular network interface]'
+      '-G+[specify max,min,increment size for ICMP payload for sweeping pings]:max,min,incr (defalt min=0 incr=1)'
+      '-z+[specify traffic class]:traffic class'
     )
   ;|
   darwin*)
     args+=(
+      '-C[prohibit socket from using cellular network interface]'
+      '-K+[specify network service type for sending ICMP packets]:serviece type:(BK_SYS BK BE RV AV RD OAM VI SIG VO)'
       '-k+[specify traffic class to use for sending ICMP packets]:traffic class [CTL]:(BK_SYS BK BE RD OAM AV RV VI VO CTL)'
+      '--apple-connect[connects the socket to the destination address]'
+      '--apple-time[prints the time a packet was received]'
     )
   ;;
   openbsd*:4)