summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CREDITS1
-rw-r--r--FILES1
-rw-r--r--gencode.c44
-rw-r--r--gencode.h6
-rw-r--r--grammar.y6
-rw-r--r--nlpid.h43
-rw-r--r--scanner.l8
7 files changed, 104 insertions, 5 deletions
diff --git a/CREDITS b/CREDITS
index 24c76c07..56eb8703 100644
--- a/CREDITS
+++ b/CREDITS
@@ -23,6 +23,7 @@ Additional people who have contributed patches:
Peter Jeremy <peter.jeremy@alcatel.com.au>
Rafal Maszkowski <rzm@icm.edu.pl>
Rick Jones <raj@cup.hp.com>
+ Tony Li <tli@jnx.com>
The original LBL crew:
Steve McCanne
diff --git a/FILES b/FILES
index 2588bb4b..d558b294 100644
--- a/FILES
+++ b/FILES
@@ -35,6 +35,7 @@ linux-include/netinet/if_ether.h
linux-include/netinet/ip_var.h
mkdep
nametoaddr.c
+nlpid.h
optimize.c
pcap-bpf.c
pcap-dlpi.c
diff --git a/gencode.c b/gencode.c
index 394290b5..ea844903 100644
--- a/gencode.c
+++ b/gencode.c
@@ -21,7 +21,7 @@
*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.128 2000-10-28 09:06:06 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.129 2000-10-28 09:30:21 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -50,6 +50,7 @@ struct rtentry;
#include "pcap-int.h"
#include "ethertype.h"
+#include "nlpid.h"
#include "gencode.h"
#include "ppp.h"
#include <pcap-namedb.h>
@@ -58,6 +59,10 @@ struct rtentry;
#include <sys/socket.h>
#endif /*INET6*/
+#define LLC_ISO_LSAP 0xfe
+
+#define ETHERMTU 1500
+
#ifdef HAVE_OS_PROTO_H
#include "os-proto.h"
#endif
@@ -730,6 +735,17 @@ gen_linktype(proto)
*/
switch (proto) {
+ case LLC_ISO_LSAP:
+ /*
+ * OSI protocols always use 802.2 encapsulation.
+ */
+ b0 = gen_cmp_gt(off_linktype, BPF_H, ETHERMTU);
+ gen_not(b0);
+ b1 = gen_cmp(off_linktype + 2, BPF_H, (long)
+ ((LLC_ISO_LSAP << 8) | LLC_ISO_LSAP));
+ gen_and(b0, b1);
+ return b1;
+
case ETHERTYPE_ATALK:
case ETHERTYPE_AARP:
/*
@@ -742,7 +758,7 @@ gen_linktype(proto)
* we check for an Ethernet type field less than
* 1500, which means it's an 802.3 length field.
*/
- b0 = gen_cmp_gt(off_linktype, BPF_H, 1500);
+ b0 = gen_cmp_gt(off_linktype, BPF_H, ETHERMTU);
gen_not(b0);
/*
@@ -1143,6 +1159,9 @@ gen_dnhostop(addr, dir, base_off)
gen_or(b0, b1);
return b1;
+ case Q_ISO:
+ bpf_error("ISO host filtering not implemented");
+
default:
abort();
}
@@ -1528,6 +1547,18 @@ gen_proto_abbrev(proto)
#endif
break;
+ case Q_ISO:
+ b1 = gen_linktype(LLC_ISO_LSAP);
+ break;
+
+ case Q_ESIS:
+ b1 = gen_proto(ISO9542_ESIS, Q_ISO, Q_DEFAULT);
+ break;
+
+ case Q_ISIS:
+ b1 = gen_proto(ISO10589_ISIS, Q_ISO, Q_DEFAULT);
+ break;
+
default:
abort();
}
@@ -2099,6 +2130,12 @@ gen_proto(v, proto, dir)
gen_and(b0, b1);
return b1;
+ case Q_ISO:
+ b0 = gen_linktype(LLC_ISO_LSAP);
+ b1 = gen_cmp(off_nl + 3, BPF_B, (long)v);
+ gen_and(b0, b1);
+ return b1;
+
case Q_ARP:
bpf_error("arp does not encapsulate another protocol");
/* NOTREACHED */
@@ -2914,6 +2951,9 @@ gen_greater(n)
return gen_len(BPF_JGE, n);
}
+/*
+ * Actually, this is less than or equal.
+ */
struct block *
gen_less(n)
int n;
diff --git a/gencode.h b/gencode.h
index d022d901..345fe62e 100644
--- a/gencode.h
+++ b/gencode.h
@@ -18,7 +18,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /tcpdump/master/libpcap/gencode.h,v 1.44 2000-10-28 08:19:29 guy Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/libpcap/gencode.h,v 1.45 2000-10-28 09:30:21 guy Exp $ (LBL)
*/
/* Address qualifiers. */
@@ -60,6 +60,10 @@
#define Q_AARP 21
+#define Q_ISO 22
+#define Q_ESIS 23
+#define Q_ISIS 24
+
/* Directional qualifiers. */
#define Q_SRC 1
diff --git a/grammar.y b/grammar.y
index f441ad33..9ca8e02f 100644
--- a/grammar.y
+++ b/grammar.y
@@ -22,7 +22,7 @@
*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/libpcap/grammar.y,v 1.62 2000-10-28 08:19:30 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/grammar.y,v 1.63 2000-10-28 09:30:22 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -117,6 +117,7 @@ pcap_parse()
%token LEN
%token IPV6 ICMPV6 AH ESP
%token VLAN
+%token ISO ESIS ISIS
%type <s> ID
%type <e> EID
@@ -258,6 +259,9 @@ pname: LINK { $$ = Q_LINK; }
| ICMPV6 { $$ = Q_ICMPV6; }
| AH { $$ = Q_AH; }
| ESP { $$ = Q_ESP; }
+ | ISO { $$ = Q_ISO; }
+ | ESIS { $$ = Q_ESIS; }
+ | ISIS { $$ = Q_ISIS; }
;
other: pqual TK_BROADCAST { $$ = gen_broadcast($1); }
| pqual TK_MULTICAST { $$ = gen_multicast($1); }
diff --git a/nlpid.h b/nlpid.h
new file mode 100644
index 00000000..87ee3810
--- /dev/null
+++ b/nlpid.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 1996
+ * Juniper Networks, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that: (1) source code distributions
+ * retain the above copyright notice and this paragraph in its entirety, (2)
+ * distributions including binary code include the above copyright notice and
+ * this paragraph in its entirety in the documentation or other materials
+ * provided with the distribution. The name of Juniper Networks may not
+ * be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * 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.
+ *
+ * @(#) $Header: /tcpdump/master/libpcap/nlpid.h,v 1.1 2000-10-28 09:30:22 guy Exp $ (Juniper)
+ */
+
+/* Types missing from some systems */
+
+/*
+ * Network layer prototocol identifiers
+ */
+#ifndef ISO8473_CLNP
+#define ISO8473_CLNP 0x81
+#endif
+#ifndef ISO9542_ESIS
+#define ISO9542_ESIS 0x82
+#endif
+#ifndef ISO9542X25_ESIS
+#define ISO9542X25_ESIS 0x8a
+#endif
+#ifndef ISO10589_ISIS
+#define ISO10589_ISIS 0x83
+#endif
+#ifndef ISO8878A_CONS
+#define ISO8878A_CONS 0x84
+#endif
+#ifndef ISO10747_IDRP
+#define ISO10747_IDRP 0x85
+#endif
diff --git a/scanner.l b/scanner.l
index 98841c53..1bf1965c 100644
--- a/scanner.l
+++ b/scanner.l
@@ -22,7 +22,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/libpcap/scanner.l,v 1.68 2000-10-28 08:19:30 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/scanner.l,v 1.69 2000-10-28 09:30:22 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -190,6 +190,12 @@ sca return SCA;
moprc return MOPRC;
mopdl return MOPDL;
+iso return ISO;
+esis return ESIS;
+es-is return ESIS;
+isis return ISIS;
+is-is return ISIS;
+
host return HOST;
net return NET;
mask return MASK;