Rename DLT_PPP_WITHDIRECTION to DLT_LINUX_PPP_WITHDIRECTION, as it's a
Linux-specific mechanism, and rename other #defines accordingly. Give more details about it in comments.
This commit is contained in:
parent
f08856ee2d
commit
d9e0597103
12
gencode.c
12
gencode.c
|
@ -21,7 +21,7 @@
|
|||
*/
|
||||
#ifndef lint
|
||||
static const char rcsid[] _U_ =
|
||||
"@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.217 2005-01-25 22:38:23 hannes Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.218 2005-01-31 01:47:27 guy Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
@ -757,7 +757,7 @@ init_linktype(p)
|
|||
return;
|
||||
|
||||
case DLT_PPP:
|
||||
case DLT_PPP_WITHDIRECTION:
|
||||
case DLT_LINUX_PPP_WITHDIRECTION:
|
||||
case DLT_C_HDLC: /* BSD/OS Cisco HDLC */
|
||||
case DLT_PPP_SERIAL: /* NetBSD sync/async serial PPP */
|
||||
off_linktype = 2;
|
||||
|
@ -1542,7 +1542,7 @@ gen_linktype(proto)
|
|||
break;
|
||||
|
||||
case DLT_PPP:
|
||||
case DLT_PPP_WITHDIRECTION:
|
||||
case DLT_LINUX_PPP_WITHDIRECTION:
|
||||
case DLT_PPP_SERIAL:
|
||||
case DLT_PPP_ETHER:
|
||||
/*
|
||||
|
@ -5117,13 +5117,13 @@ gen_inbound(dir)
|
|||
(bpf_int32)((dir == 0) ? PF_IN : PF_OUT));
|
||||
break;
|
||||
|
||||
case DLT_PPP_WITHDIRECTION:
|
||||
case DLT_LINUX_PPP_WITHDIRECTION:
|
||||
if (dir) {
|
||||
/* match outgoing packets */
|
||||
b0 = gen_cmp(0, BPF_B, PPP_WITHDIRECTION_OUT);
|
||||
b0 = gen_cmp(0, BPF_B, LINUX_PPP_WITHDIRECTION_OUT);
|
||||
} else {
|
||||
/* match incoming packets */
|
||||
b0 = gen_cmp(0, BPF_B, PPP_WITHDIRECTION_IN);
|
||||
b0 = gen_cmp(0, BPF_B, LINUX_PPP_WITHDIRECTION_IN);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
19
pcap-bpf.h
19
pcap-bpf.h
|
@ -37,7 +37,7 @@
|
|||
*
|
||||
* @(#)bpf.h 7.1 (Berkeley) 5/7/91
|
||||
*
|
||||
* @(#) $Header: /tcpdump/master/libpcap/pcap-bpf.h,v 1.31 2005-01-31 01:00:07 guy Exp $ (LBL)
|
||||
* @(#) $Header: /tcpdump/master/libpcap/pcap-bpf.h,v 1.32 2005-01-31 01:47:27 guy Exp $ (LBL)
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -522,11 +522,20 @@ struct bpf_version {
|
|||
#define DLT_BACNET_MS_TP 165
|
||||
|
||||
/*
|
||||
* another PPP variant as per request from Karsten Keil <kkeil@suse.de>
|
||||
* the first byte of the PPP header (0xff03) is modified to accomodate
|
||||
* the direction 0x00 = IN, 0x01 = OUT
|
||||
* Another PPP variant as per request from Karsten Keil <kkeil@suse.de>.
|
||||
*
|
||||
* This is used in Linux to allow a kernel socket filter to distinguish
|
||||
* between incoming and outgoing packets, on a socket intended to
|
||||
* supply pppd with outgoing packets so it can do dial-on-demand and
|
||||
* hangup-on-lack-of-demand; incoming packets are filtered out so they
|
||||
* don't cause pppd to hold the connection up (you don't want random
|
||||
* input packets such as port scans, packets from old lost connections,
|
||||
* etc. to force the connection to stay up).
|
||||
*
|
||||
* The first byte of the PPP header (0xff03) is modified to accomodate
|
||||
* the direction - 0x00 = IN, 0x01 = OUT.
|
||||
*/
|
||||
#define DLT_PPP_WITHDIRECTION 166
|
||||
#define DLT_LINUX_PPP_WITHDIRECTION 166
|
||||
|
||||
/*
|
||||
* Juniper-private data link type, as per request from
|
||||
|
|
4
pcap.c
4
pcap.c
|
@ -33,7 +33,7 @@
|
|||
|
||||
#ifndef lint
|
||||
static const char rcsid[] _U_ =
|
||||
"@(#) $Header: /tcpdump/master/libpcap/pcap.c,v 1.85 2005-01-27 18:32:28 hannes Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/libpcap/pcap.c,v 1.86 2005-01-31 01:47:27 guy Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
@ -359,7 +359,7 @@ static struct dlt_choice dlt_choices[] = {
|
|||
DLT_CHOICE(DLT_JUNIPER_ATM1, "Juniper ATM1 PIC"),
|
||||
DLT_CHOICE(DLT_JUNIPER_ATM2, "Juniper ATM2 PIC"),
|
||||
DLT_CHOICE(DLT_JUNIPER_MLPPP, "Juniper Multi-Link PPP"),
|
||||
DLT_CHOICE(DLT_PPP_WITHDIRECTION, "PPP with direction"),
|
||||
DLT_CHOICE(DLT_LINUX_PPP_WITHDIRECTION, "Linux PPP with direction flag"),
|
||||
DLT_CHOICE(DLT_JUNIPER_PPPOE, "Juniper PPPoE"),
|
||||
DLT_CHOICE(DLT_JUNIPER_PPPOE_ATM, "Juniper PPPoE/ATM"),
|
||||
DLT_CHOICE(DLT_GPRS_LLC, "GPRS LLC"),
|
||||
|
|
6
ppp.h
6
ppp.h
|
@ -1,4 +1,4 @@
|
|||
/* @(#) $Header: /tcpdump/master/libpcap/ppp.h,v 1.10 2004-08-18 14:25:01 hannes Exp $ (LBL) */
|
||||
/* @(#) $Header: /tcpdump/master/libpcap/ppp.h,v 1.11 2005-01-31 01:47:28 guy Exp $ (LBL) */
|
||||
/*
|
||||
* Point to Point Protocol (PPP) RFC1331
|
||||
*
|
||||
|
@ -18,8 +18,8 @@
|
|||
#define PPP_ADDRESS 0xff /* The address byte value */
|
||||
#define PPP_CONTROL 0x03 /* The control byte value */
|
||||
|
||||
#define PPP_WITHDIRECTION_IN 0x00 /* non-standard for DLT_PPP_WITHDIRECTION */
|
||||
#define PPP_WITHDIRECTION_OUT 0x01 /* non-standard for DLT_PPP_WITHDIRECTION */
|
||||
#define LINUX_PPP_WITHDIRECTION_IN 0x00 /* non-standard for DLT_LINUX_PPP_WITHDIRECTION */
|
||||
#define LINUX_PPP_WITHDIRECTION_OUT 0x01 /* non-standard for DLT_LINUX_PPP_WITHDIRECTION */
|
||||
|
||||
/* Protocol numbers */
|
||||
#define PPP_IP 0x0021 /* Raw IP */
|
||||
|
|
23
savefile.c
23
savefile.c
|
@ -30,7 +30,7 @@
|
|||
|
||||
#ifndef lint
|
||||
static const char rcsid[] _U_ =
|
||||
"@(#) $Header: /tcpdump/master/libpcap/savefile.c,v 1.123 2005-01-12 09:15:05 hannes Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/libpcap/savefile.c,v 1.124 2005-01-31 01:47:28 guy Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
@ -353,11 +353,20 @@ static const char rcsid[] _U_ =
|
|||
#define LINKTYPE_BACNET_MS_TP 165
|
||||
|
||||
/*
|
||||
* another PPP variant as per request from Karsten Keil <kkeil@suse.de>
|
||||
* the first byte (0xff) of the PPP header (0xff03) is tweaked to accomodate
|
||||
* the direction 0x00 = IN, 0x01 = OUT
|
||||
* Another PPP variant as per request from Karsten Keil <kkeil@suse.de>.
|
||||
*
|
||||
* This is used in Linux to allow a kernel socket filter to distinguish
|
||||
* between incoming and outgoing packets, on a socket intended to
|
||||
* supply pppd with outgoing packets so it can do dial-on-demand and
|
||||
* hangup-on-lack-of-demand; incoming packets are filtered out so they
|
||||
* don't cause pppd to hold the connection up (you don't want random
|
||||
* input packets such as port scans, packets from old lost connections,
|
||||
* etc. to force the connection to stay up).
|
||||
*
|
||||
* The first byte of the PPP header (0xff03) is modified to accomodate
|
||||
* the direction - 0x00 = IN, 0x01 = OUT.
|
||||
*/
|
||||
#define LINKTYPE_PPP_WITHDIRECTION 166
|
||||
#define LINKTYPE_LINUX_PPP_WITHDIRECTION 166
|
||||
|
||||
/*
|
||||
* Juniper-private data link type, as per request from
|
||||
|
@ -550,8 +559,8 @@ static struct linktype_map {
|
|||
/* BACnet MS/TP */
|
||||
{ DLT_BACNET_MS_TP, LINKTYPE_BACNET_MS_TP },
|
||||
|
||||
/* PPP with direction flag in the PPP header */
|
||||
{ DLT_PPP_WITHDIRECTION,LINKTYPE_PPP_WITHDIRECTION},
|
||||
/* Linux PPP with direction flag in the PPP header */
|
||||
{ DLT_LINUX_PPP_WITHDIRECTION,LINKTYPE_LINUX_PPP_WITHDIRECTION},
|
||||
|
||||
/* Juniper-internal chassis encapsulation */
|
||||
{ DLT_JUNIPER_PPPOE, LINKTYPE_JUNIPER_PPPOE },
|
||||
|
|
Reference in New Issue