From 3ebb62ecc76063c771bb2cf71a5e796d3ead833f Mon Sep 17 00:00:00 2001 From: itojun Date: Sun, 25 Jul 1999 00:15:22 +0000 Subject: [PATCH] support for PPP_IPV6. --- lib/libpcap/gencode.c | 16 +++++++++++++--- lib/libpcap/ppp.h | 4 +++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/lib/libpcap/gencode.c b/lib/libpcap/gencode.c index 8223719482f1..3a407a9efde5 100644 --- a/lib/libpcap/gencode.c +++ b/lib/libpcap/gencode.c @@ -1,4 +1,4 @@ -/* $NetBSD: gencode.c,v 1.15 1999/07/05 20:04:50 mjacob Exp $ */ +/* $NetBSD: gencode.c,v 1.16 1999/07/25 00:15:22 itojun Exp $ */ /* * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 @@ -26,7 +26,7 @@ static const char rcsid[] = "@(#) Header: gencode.c,v 1.93 97/06/12 14:22:47 leres Exp (LBL)"; #else -__RCSID("$NetBSD: gencode.c,v 1.15 1999/07/05 20:04:50 mjacob Exp $"); +__RCSID("$NetBSD: gencode.c,v 1.16 1999/07/25 00:15:22 itojun Exp $"); #endif #endif @@ -631,6 +631,10 @@ gen_linktype(proto) case DLT_PPP: if (proto == ETHERTYPE_IP) proto = PPP_IP; /* XXX was 0x21 */ +#ifdef INET6 + else if (proto == ETHERTYPE_IPV6) + proto = PPP_IPV6; +#endif /* INET6 */ break; case DLT_PPP_BSDOS: @@ -644,6 +648,12 @@ gen_linktype(proto) gen_or(b1, b0); return b0; +#ifdef INET6 + case ETHERTYPE_IPV6: + proto = PPP_IPV6; + break; +#endif /* INET6 */ + case ETHERTYPE_DN: proto = PPP_DECNET; break; @@ -663,7 +673,7 @@ gen_linktype(proto) if (proto == ETHERTYPE_IP) return (gen_cmp(0, BPF_W, (bpf_int32)htonl(AF_INET))); #ifdef INET6 - if (proto == ETHERTYPE_IPV6) + else if (proto == ETHERTYPE_IPV6) return (gen_cmp(0, BPF_W, (bpf_int32)htonl(AF_INET6))); #endif /* INET6 */ else diff --git a/lib/libpcap/ppp.h b/lib/libpcap/ppp.h index bd407cbb520d..a7020c61140b 100644 --- a/lib/libpcap/ppp.h +++ b/lib/libpcap/ppp.h @@ -1,4 +1,4 @@ -/* $NetBSD: ppp.h,v 1.1.1.1 1997/10/03 15:38:55 christos Exp $ */ +/* $NetBSD: ppp.h,v 1.2 1999/07/25 00:15:22 itojun Exp $ */ /* @(#) Header: ppp.h,v 1.7 95/05/04 17:52:46 mccanne Exp (LBL) */ /* @@ -32,6 +32,7 @@ #define PPP_BRPDU 0x0031 /* Bridging PDU */ #define PPP_STII 0x0033 /* Stream Protocol (ST-II) */ #define PPP_VINES 0x0035 /* Banyan Vines */ +#define PPP_IPV6 0x0057 /* Internet Protocol Version 6 */ #define PPP_HELLO 0x0201 /* 802.1d Hello Packets */ #define PPP_LUXCOM 0x0231 /* Luxcom */ @@ -45,6 +46,7 @@ #define PPP_IPXCP 0x802b /* Novell IPX Control Protocol */ #define PPP_STIICP 0x8033 /* Strean Protocol Control Protocol */ #define PPP_VINESCP 0x8035 /* Banyan Vines Control Protocol */ +#define PPP_IPV6CP 0x8057 /* IPv6 Control Protocol */ #define PPP_LCP 0xc021 /* Link Control Protocol */ #define PPP_PAP 0xc023 /* Password Authentication Protocol */