diff -urN a/include/interface.h b/include/interface.h --- a/include/interface.h 2008-02-21 10:20:29.000000000 +0300 +++ b/include/interface.h 2010-12-03 23:58:15.000000000 +0300 @@ -21,7 +21,14 @@ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * @(#) $Header: /cvsroot/trafd/trafd/include/interface.h,v 1.3 2008/02/21 07:20:29 lorf Exp $ (LBL) + * @(#) $Header: /cvsroot/trafd/trafd/include/interface.h,v 1.4 2010/10/31 02:40:00 Serg79 Exp $ (LBL) + * + * Revision 1.4 2010/10/31 02:40:00 Serg79 + * Added support for PPP interfaces in Linux. + * + * Revision 1.3 2008/02/21 07:20:29 lorf + * Initial revision + * */ #ifndef tcpdump_interface_h @@ -132,6 +139,10 @@ #endif extern void processing_ip(const uint8_t *, u_int); +#ifdef __linux__ +extern void linux_sll_if_print(u_char *, const struct pcap_pkthdr *, + const u_char *); +#endif extern void ether_if_print(u_char *, const struct pcap_pkthdr *, const u_char *); extern void null_if_print(u_char *, const struct pcap_pkthdr *, const u_char *); diff -urN a/lib/interfaces.c b/lib/interfaces.c --- a/lib/interfaces.c 2004-11-17 12:06:31.000000000 +0300 +++ b/lib/interfaces.c 2010-12-04 00:01:02.000000000 +0300 @@ -17,6 +17,15 @@ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $id: interfaces.c,v 1.1 2010/10/31 02:40:00 Serg79 Exp $ + * + * Revision 1.1 2010/10/31 02:40:00 Serg79 + * Added support for PPP interfaces in Linux. + * + * Revision 1.0 + * Initial revision + * */ #include @@ -47,6 +56,9 @@ #include #include +#ifdef __linux__ +#include +#endif #include "ethertype.h" #include "interface.h" @@ -70,6 +82,9 @@ { ppp_bsdos_if_print, DLT_PPP_BSDOS }, { null_if_print, DLT_NULL }, { raw_if_print, DLT_RAW }, +#ifdef DLT_LINUX_SLL + { linux_sll_if_print, DLT_LINUX_SLL }, +#endif { NULL, 0 }, }; @@ -87,6 +102,28 @@ return NULL; } +#ifdef DLT_LINUX_SLL +/* Linux specific PPP printer */ +void +linux_sll_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p) +{ + u_int caplen = h->caplen; + u_int length = h->len; + const struct sll_header *sp = (const struct sll_header *)p; + + if (caplen < SLL_HDR_LEN) + return; + + packetp = p; + snapend = p + caplen; + + length -= SLL_HDR_LEN; + + if (ntohs(sp->sll_protocol) == ETHERTYPE_IP) + processing_ip((const u_char *)(p + SLL_HDR_LEN), length); +} +#endif + /* * This is the top level routine of the printer. 'p' is the points * to the ether header of the packet, 'tvp' is the timestamp,