dev: bail out if ifindex could not be retrieved
[netsniff-ng.git] / mausezahn.zsh
blob95a9e3595557e06cb572a1e95ea52936d4243808
1 #compdef mausezahn
3 # mausezahn.zsh -- zsh completion function for mausezahn
5 # Copyright (C) 2013 Hideo Hattori <hhatto.jp@gmail.com>
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License version 2 as
9 # published by the Free Software Foundation.
11 typeset -A opt_args
13 _packet_type () {
14 _values \
15 "arp" \
16 "bpdu" \
17 "cdp" \
18 "ip" \
19 "icmp" \
20 "udp" \
21 "tcp" \
22 "dns" \
23 "rtp" \
24 "syslog" \
25 "lldp"
28 _interface_keywords () {
29 _values "interface keyword" \
30 "rand[Use a random MAC address]" \
31 "bc[Use a broadcast MAC address]" \
32 "own[Use own interface MAC address (default for source MAC)]" \
33 "stp[Use IEEE 802.1d STP multicast address]" \
34 "cisco[Use Cisco multicast address as used for CDP, VTP, or PVST+]"
37 _interfaces () {
38 _wanted interfaces expl 'network interface' \
39 _net_interfaces
40 _values "Pseudo-device that captures on all interfaces" "any"
43 _arguments -s -S \
44 "-x[Interactive mode with telnet CLI, default port: 25542]" \
45 "(-6)-4[IPv4 mode (default)]" \
46 "(-4)-6[IPv6 mode]" \
47 "-c[Send packet count times, default:1, infinite:0]" \
48 "-d[Apply delay between transmissions. The delay value can be specified in usec (default, no additional unit needed), or in msec (e.g. 100m or 100msec), or in seconds (e.g. 100s or 100sec)]" \
49 "-r[Multiplies the specified delay with a random value]" \
50 "-p[Pad the raw frame to specified length (using random bytes)]" \
51 "-a[Use specified source mac address, no matter what has been specified with other arguments; keywords see below, Default is own interface]:keyword:_interface_keywords" \
52 "-b[Same with destination mac address; keywords]:keywords:_interface_keywords" \
53 "-A[Use specified source IP address (default is own interface IP)]" \
54 "-B[Send packet to specified destination IP or domain name]" \
55 "-P[Use the specified ASCII payload]" \
56 "-f[Read the ASCII payload from a file]:filename:_files" \
57 "-F[Read the hexadecimal payload from a file]:filename:_files" \
58 "-Q[Specify 802.1Q VLAN tag and optional Class of Service, you can specify multiple 802.1Q VLAN tags (QinQ...) by separating them via a comma or a period (e.g. '5:10,20,2:30')]" \
59 "-t[Specify packet type for autobuild (you don't need to care for encapsulations in lower layers, most packet types allow/require additional packet-specific arguments in an <arg-string>; Currently supported types: arp, bpdu, cdp, ip, icmp, udp, tcp, dns, rtp, syslog, lldp and more; For context-help use 'help' as <arg-string>!]:packet_type:_packet_type" \
60 "-T[Specify packet type for server mode, currently only rtp is supported; Enter -T help or -T rtp help for further information]" \
61 "-M[Insert a MPLS label, enter '-M help' for a syntax description]" \
62 "(-V -VV -VVV)"{-V,-VV,-VVV}"[Verbose and more verbose mode]" \
63 "-q[Quiet mode, even omit 'important' standard short messages]" \
64 "-S[Simulation mode: DOES NOT put anything on the wire, this is typically combined with one of the verbose modes (v or V)]" \
65 "-v[Show version]:" \
66 "-h[Print this help]:" \
67 "*::args:_gnu_generic"