From c2422d78281e10beb6ce4ebda1d61c9d0ca63a09 Mon Sep 17 00:00:00 2001 From: Roland Knall Date: Thu, 5 Apr 2018 10:02:27 +0200 Subject: extcap: Tell utilities the wireshark version Add an optional argument to extcap-version, which tells the utilities the wireshark version and therefore allows them to handle different versions differently. If no version is provided, the utility has to assume it is dealing with a Wireshark 2.x version (default behavior). Change-Id: I51658300f28f503ca8050d204b73749f1a54df16 Reviewed-on: https://code.wireshark.org/review/26752 Petri-Dish: Roland Knall Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall --- doc/extcap_example.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'doc') diff --git a/doc/extcap_example.py b/doc/extcap_example.py index 12ee0cd2aa..568dc1a25b 100755 --- a/doc/extcap_example.py +++ b/doc/extcap_example.py @@ -142,6 +142,9 @@ def extcap_config(interface): print ("value {arg=%d}{value=%s}{display=%s}{default=%s}" % value) +def extcap_version(): + print ("extcap {version=1.0}{help=http://www.wireshark.org}{display=Example extcap interface}") + def extcap_interfaces(): print ("extcap {version=1.0}{help=http://www.wireshark.org}{display=Example extcap interface}") print ("interface {value=example1}{display=Example interface 1 for extcap}") @@ -404,6 +407,7 @@ if __name__ == '__main__': parser.add_argument("--fifo", help="Use together with capture to provide the fifo to dump data to") parser.add_argument("--extcap-control-in", help="Used to get control messages from toolbar") parser.add_argument("--extcap-control-out", help="Used to send control messages to toolbar") + parser.add_argument("--extcap-version", help="Shows the version of this utility", action="store_true") # Interface Arguments parser.add_argument("--verify", help="Demonstrates a verification bool flag", action="store_true" ) @@ -431,6 +435,10 @@ if __name__ == '__main__': if ( len(sys.argv) <= 1 ): parser.exit("No arguments given!") + if ( args.extcap_version ): + extcap_version() + sys.exit(0) + if ( args.extcap_interfaces == False and args.extcap_interface == None ): parser.exit("An interface must be provided or the selection must be displayed") if ( args.extcap_capture_filter and not args.capture ): -- cgit v1.2.3