Change in ...osmocom-bb[master]: trx_toolkit/trx_sniff.py: support additional capture filter

fixeria gerrit-no-reply at lists.osmocom.org
Wed Jul 24 11:08:58 UTC 2019


fixeria has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmocom-bb/+/14916 )

Change subject: trx_toolkit/trx_sniff.py: support additional capture filter
......................................................................

trx_toolkit/trx_sniff.py: support additional capture filter

Change-Id: I761debb2e1c411f2c6d489eac0adf32060966a4c
---
M src/target/trx_toolkit/trx_sniff.py
1 file changed, 8 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved



diff --git a/src/target/trx_toolkit/trx_sniff.py b/src/target/trx_toolkit/trx_sniff.py
index 7eea04c..0323e85 100755
--- a/src/target/trx_toolkit/trx_sniff.py
+++ b/src/target/trx_toolkit/trx_sniff.py
@@ -75,6 +75,10 @@
 			log.info("Listening on interface '%s'..." % self.argv.sniff_if)
 			sniff_args["iface"] = self.argv.sniff_if
 
+		if self.argv.cap_filter is not None:
+			log.info("Using additional capture filter '%s'" % self.argv.cap_filter)
+			sniff_args["filter"] += " and (%s)" % self.argv.cap_filter
+
 		# Start sniffing...
 		scapy.all.sniff(**sniff_args)
 
@@ -224,6 +228,10 @@
 			dest = "cap_file", type = str, metavar = "FILE",
 			help = "Read packets from a PCAP file")
 
+		trx_group.add_argument("-f", "--capture-filter",
+			dest = "cap_filter", type = str, metavar = "FILTER",
+			help = "Set additional capture filter (e.g. 'host 192.168.1.2')")
+
 		cnt_group = parser.add_argument_group("Count limitations (optional)")
 		cnt_group.add_argument("--frame-count", metavar = "N",
 			dest = "frame_count", type = int,

-- 
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/14916
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I761debb2e1c411f2c6d489eac0adf32060966a4c
Gerrit-Change-Number: 14916
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190724/1e820f50/attachment.html>


More information about the gerrit-log mailing list