diff options
author | James <> | 2013-03-17 12:16:37 +0000 |
---|---|---|
committer | James <> | 2013-03-17 12:16:37 +0000 |
commit | 27b76ab0671089c47506615a796a261e993896a7 (patch) | |
tree | 61213d67e7fa87b20356b23798558e2c4212c42f /package/network/services/ppp/utils/.svn | |
download | trunk-36060-master.tar.gz trunk-36060-master.tar.bz2 trunk-36060-master.zip |
Diffstat (limited to 'package/network/services/ppp/utils/.svn')
3 files changed, 118 insertions, 0 deletions
diff --git a/package/network/services/ppp/utils/.svn/entries b/package/network/services/ppp/utils/.svn/entries new file mode 100644 index 0000000..c9cbdd1 --- /dev/null +++ b/package/network/services/ppp/utils/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +36060 +svn://svn.openwrt.org/openwrt/trunk/package/network/services/ppp/utils +svn://svn.openwrt.org/openwrt + + + +2007-03-04T04:41:46.644094Z +6501 +pavlov + + + + + + + + + + + + + + +3c298f89-4303-0410-b956-a3cf2f4a3e73 + +pfc.c +file + + + + +2013-03-17T12:13:19.000000Z +2fb1a3037c5662c67f4ca968a9f15781 +2007-03-04T04:41:46.644094Z +6501 +pavlov +has-props + + + + + + + + + + + + + + + + + + + + +1061 + diff --git a/package/network/services/ppp/utils/.svn/prop-base/pfc.c.svn-base b/package/network/services/ppp/utils/.svn/prop-base/pfc.c.svn-base new file mode 100644 index 0000000..bdbd305 --- /dev/null +++ b/package/network/services/ppp/utils/.svn/prop-base/pfc.c.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:eol-style +V 6 +native +END diff --git a/package/network/services/ppp/utils/.svn/text-base/pfc.c.svn-base b/package/network/services/ppp/utils/.svn/text-base/pfc.c.svn-base new file mode 100644 index 0000000..5476be1 --- /dev/null +++ b/package/network/services/ppp/utils/.svn/text-base/pfc.c.svn-base @@ -0,0 +1,51 @@ +/* + * Taken from fli4l 3.0 + * Make sure you compile it against the same libpcap version used in OpenWrt + */ + +#include <stdlib.h> +#include <sys/types.h> +#include <sys/time.h> +#include <string.h> + +#include <linux/types.h> +#include <linux/ppp_defs.h> + +#include <pcap.h> +#include <pcap-bpf.h> + +int main (int argc, char ** argv) +{ + pcap_t *pc; /* Fake struct pcap so we can compile expr */ + struct bpf_program filter; /* Filter program for link-active pkts */ + u_int32_t netmask=0; + + int dflag = 3; + if (argc == 4) + { + if (!strcmp (argv[1], "-d")) + { + dflag = atoi (argv[2]); + argv += 2; + argc -=2; + } + } + if (argc != 2) + { + printf ("usage; %s [ -d <debug_level> ] expression\n", argv[0]); + return 1; + } + + pc = pcap_open_dead(DLT_PPP_PPPD, PPP_HDRLEN); + if (pcap_compile(pc, &filter, argv[1], 1, netmask) == 0) + { + printf ("#\n# Expression: %s\n#\n", argv[1]); + bpf_dump (&filter, dflag); + return 0; + } + else + { + printf("error in active-filter expression: %s\n", pcap_geterr(pc)); + } + return 1; +} |