From b7a834b4cb6a0cdd53d4fb06c1981e8d2af1c949 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 10 Sep 2015 16:45:45 +0200 Subject: gprs: Add a custom GPRS filter Allow to inspect UDP messages and check for GPRS, NS, BSSGP and then filter LLC frames. Parsing the vL datastructure with the libpcap syntax is a pain. It could be done using BPF but we do not want to use bpf asm to specify the entire ruleset. I looked into using libepan/libwireshark but this has memory issues and is painful too. So let's parse UDP, NS, BSSGP using the info we already have. I tried a bit of editcap to generate a bit of broken data. The length check might still be bad. I used my crash_20100602.pcap file to count the LLC frames we detect and compare that to wireshark it ended with the right number. pcap add-filter gprs can be used to enable the new filtering option after the OS has received the packet. Fixes: ONW#1314 --- include/osmo-pcap/osmo_pcap_client.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/osmo-pcap/osmo_pcap_client.h b/include/osmo-pcap/osmo_pcap_client.h index 7aae7ca..30b55ee 100644 --- a/include/osmo-pcap/osmo_pcap_client.h +++ b/include/osmo-pcap/osmo_pcap_client.h @@ -36,6 +36,7 @@ struct osmo_pcap_client { struct bpf_program bpf; char *filter_string; int filter_itself; + int gprs_filtering; struct osmo_fd fd; char *srv_ip; -- cgit v1.2.3