diff options
author | mazzoo <mazzoo@8d8ab74c-27aa-4a3d-9bde-523a2bc1f624> | 2008-12-30 12:49:26 +0000 |
---|---|---|
committer | mazzoo <mazzoo@8d8ab74c-27aa-4a3d-9bde-523a2bc1f624> | 2008-12-30 12:49:26 +0000 |
commit | 11521c89e3d43f88825251f5cbc54b9706be9f63 (patch) | |
tree | e9fb33e6837236490b9825e7fe875d8e0412445c /com-on-air_cs-linux/tools/pcapstein.c | |
parent | e994341809e6860a87452aebacd7c3ac344e2e4a (diff) |
improve pcapstein and autorec
I am about to leave 25c3 - it was lots of fun, have a nice time
and I hope to see you next year.
git-svn-id: https://dedected.org/svn/trunk@7 8d8ab74c-27aa-4a3d-9bde-523a2bc1f624
Diffstat (limited to 'com-on-air_cs-linux/tools/pcapstein.c')
-rw-r--r-- | com-on-air_cs-linux/tools/pcapstein.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/com-on-air_cs-linux/tools/pcapstein.c b/com-on-air_cs-linux/tools/pcapstein.c index a4e97f6..8caf957 100644 --- a/com-on-air_cs-linux/tools/pcapstein.c +++ b/com-on-air_cs-linux/tools/pcapstein.c @@ -26,6 +26,9 @@ struct file_info fi; +int pp_slot = -1; +int fp_slot = -1; + void usage(void) { fprintf(stderr, "usage: pcapstein <dect-pcap-file>\n"); @@ -90,10 +93,28 @@ void init(char * fname) void process_b_field(const struct pcap_pkthdr *h, const u_char *pkt) { + + if ( (pkt[0x17] == 0x16) && (pkt[0x18] == 0x75) ) - write(fi.fpp, &pkt[0x21], 40); + { + if (pp_slot < 0) + { + pp_slot = pkt[0x11]; + }else{ + if (pp_slot == pkt[0x11]) + write(fi.fpp, &pkt[0x21], 40); + } + } else - write(fi.ffp, &pkt[0x21], 40); + { + if (fp_slot < 0) + { + fp_slot = pkt[0x11]; + }else{ + if (fp_slot == pkt[0x11]) + write(fi.ffp, &pkt[0x21], 40); + } + } } void process_pcap_packet( |