summaryrefslogtreecommitdiff
path: root/astraceroute.zsh
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2013-05-13 11:24:41 +0200
committerDaniel Borkmann <dborkman@redhat.com>2013-05-13 12:27:03 +0200
commit2b100f7515dbd01032967c2d1b81d2f8d63bf9b5 (patch)
tree968b9a17fc20f92c0d58cdd11ed49815d8b818f5 /astraceroute.zsh
parentc59245ddcc0541edca71769b3153bc13580a5bbb (diff)
zsh: add netsniff-ng zsh auto completion support
Hideo Hattori wrote a set of auto completion scripts for zsh that support netsniff-ng tools. Big thanks for that! Follow-up commits still need to address updated command-line options. Signed-off-by: Hideo Hattori <hhatto.jp@gmail.com> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Diffstat (limited to 'astraceroute.zsh')
-rw-r--r--astraceroute.zsh50
1 files changed, 50 insertions, 0 deletions
diff --git a/astraceroute.zsh b/astraceroute.zsh
new file mode 100644
index 0000000..28fa24a
--- /dev/null
+++ b/astraceroute.zsh
@@ -0,0 +1,50 @@
+#compdef astraceroute
+#
+# astraceroute.zsh -- zsh completion function for astraceroute
+#
+# Copyright (C) 2013 Hideo Hattori <hhatto.jp@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+
+typeset -A opt_args
+
+_interfaces () {
+ _wanted interfaces expl 'network interface' \
+ _net_interfaces
+ _values "Pseudo-device that captures on all interfaces" "any"
+}
+
+_arguments -s -S \
+ "(-H --host)"{-H,--host}"[Host/IPv4/IPv6 to lookup AS route to]:host:_hosts" \
+ "(-p --port)"{-p,--port}"[Hosts port to lookup AS route to]:port:_gnu_generic" \
+ "(-i -d --dev)"{-i,-d,--dev}"[Networking device i.e., eth0]:device:_interfaces" \
+ "(-4 --ipv4)"{-4,--ipv4}"[Use IPv4 requests (default)]" \
+ "(-6 --ipv6)"{-6,--ipv6}"[Use IPv6 requests]" \
+ "(-n --numeric)"{-n,--nemeric}"[Do not do reverse DNS lookup for hops]" \
+ "(-N --dns)"{-N,--dns}"[Do a reverse DNS lookup for hops]" \
+ "(-f --init-ttl)"{-f,--init-ttl}"[Set initial TTL]:ttl:_gnu_generic" \
+ "(-m --max-ttl)"{-m,--max--ttl}"[Set maximum TTL]:ttl:_gnu_generic" \
+ "(-q --num-probes)"{-q,--num-probes}"[Set maximum TTL (default: 30)]:ttl:_gnu_generic" \
+ "(-q --num-probes)"{-q,--num-probes}"[Number of max probes for each hop (default: 3)]:num:_gnu_generic" \
+ "(-x --timeout)"{-x,--timeout}"[Probe response timeout in sec (default: 3)]:timeout:_gnu_generic" \
+ "(-S --syn)"{-S,--syn}"[Set TCP SYN flag in packets]" \
+ "(-A --ack)"{-A,--ack}"[Set TCP ACK flag in packets]" \
+ "(-F --fin)"{-F,--fin}"[Set TCP FIN flag in packets]" \
+ "(-P --psh)"{-P,--psh}"[Set TCP PSH flag in packets]" \
+ "(-U --urg)"{-U,--urg}"[Set TCP URG flag in packets]" \
+ "(-R --rst)"{-R,--rst}"[Set TCP RST flag in packets]" \
+ "(-E --ecn-syn)"{-E,--ecn-syn}"[Send ECN SYN packets (RFC3168)]" \
+ "(-t --tos)"{-t,--tos}"[Set the IP TOS field]:tos:_gnu_generic" \
+ "(-G --nofrag)"{-G,--nofrag}"[Set do not fragment bit]" \
+ "(-X --payload)"{-X,--payload}"[Specify a payload string to test DPIs]:string:_gnu_generic" \
+ "(-Z --show-packet)"{-Z,--show-packet}"[Show returned packet on each hop]" \
+ "(-l --totlen)"{-l,--totlen}"[Specify total packet len]:lengths:_gnu_generic" \
+ "(-w --whois)"{-w,--whois}"[Use a different AS whois DB server (default: /etc/netsniff-ng/whois.conf)]:file:_files" \
+ "(-W --wport)"{-W,--wport}"[Use a different port to AS whois server (default: /etc/netsniff-ng/whois.conf)]:file:_files" \
+ "--city-db[Specifiy path for geoip city database]:path:_files" \
+ "--country-db[Specifiy path for geoip country database]:path:_files" \
+ {-v,--version}"[Print version]:" \
+ {-h,--help}"[Print this help]:" \
+ "*::args:_gnu_generic"