aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorRoland Knall <roland.knall@br-automation.com>2018-04-05 10:02:27 +0200
committerRoland Knall <rknall@gmail.com>2018-04-05 08:40:04 +0000
commitc2422d78281e10beb6ce4ebda1d61c9d0ca63a09 (patch)
tree47bf7d32733d50da52e5adab94776c07dc175a06 /doc
parent5d8964cd3b6362615571831ef1bbe5c8cc972516 (diff)
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 <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'doc')
-rwxr-xr-xdoc/extcap_example.py8
1 files changed, 8 insertions, 0 deletions
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 ):