trafgen: proto: Rename proto_field_xxx -> proto_hdr_field_xxx
[netsniff-ng-new.git] / mausezahn.zsh
blob57a56a19710456ca153154c40bb43436841052f1
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 "-l[Listen address in interactive mode, default: 0.0.0.0]" \
46 "(-6)-4[IPv4 mode (default)]" \
47 "(-4)-6[IPv6 mode]" \
48 "-c[Send packet count times, default:1, infinite:0]" \
49 "-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)]" \
50 "-r[Multiplies the specified delay with a random value]" \
51 "-p[Pad the raw frame to specified length (using random bytes)]" \
52 "-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" \
53 "-b[Same with destination mac address; keywords]:keywords:_interface_keywords" \
54 "-A[Use specified source IP address (default is own interface IP)]" \
55 "-B[Send packet to specified destination IP or domain name]" \
56 "-P[Use the specified ASCII payload]" \
57 "-f[Read the ASCII payload from a file]:filename:_files" \
58 "-F[Read the hexadecimal payload from a file]:filename:_files" \
59 "-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')]" \
60 "-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" \
61 "-T[Specify packet type for server mode, currently only rtp is supported; Enter -T help or -T rtp help for further information]" \
62 "-M[Insert a MPLS label, enter '-M help' for a syntax description]" \
63 "(-V -VV -VVV)"{-V,-VV,-VVV}"[Verbose and more verbose mode]" \
64 "-q[Quiet mode, even omit 'important' standard short messages]" \
65 "-S[Simulation mode: DOES NOT put anything on the wire, this is typically combined with one of the verbose modes (v or V)]" \
66 "-v[Show version and exit]:" \
67 "-h[Print help and exit]:" \
68 "*::args:_gnu_generic"