summaryrefslogtreecommitdiff
path: root/lib/libpcap/gencode.h
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1996-07-12 13:19:14 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1996-07-12 13:19:14 +0000
commit315030ef409756aa4e3157c7812a81792c64aed3 (patch)
tree3653ad97954580a6d932f9a7c2da2b25da87dbae /lib/libpcap/gencode.h
parentc7a13b78b636f513ae61e3cb593d0e5a543a3977 (diff)
bring it to the latest 0.2 LBL release.
Diffstat (limited to 'lib/libpcap/gencode.h')
-rw-r--r--lib/libpcap/gencode.h47
1 files changed, 22 insertions, 25 deletions
diff --git a/lib/libpcap/gencode.h b/lib/libpcap/gencode.h
index 608ad0aef3b..b90d5bc70a2 100644
--- a/lib/libpcap/gencode.h
+++ b/lib/libpcap/gencode.h
@@ -1,8 +1,7 @@
-/* $OpenBSD */
-/* $NetBSD: gencode.h,v 1.2.6.1 1996/06/05 18:04:30 cgd Exp $ */
+/* $OpenBSD: gencode.h,v 1.4 1996/07/12 13:19:08 mickey Exp $ */
/*
- * Copyright (c) 1990, 1991, 1992, 1993, 1994
+ * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -21,14 +20,10 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) Header: gencode.h,v 1.20 94/06/12 14:29:30 leres Exp (LBL)
+ * @(#) Header: gencode.h,v 1.33 96/06/23 02:21:09 leres Exp (LBL)
*/
-/*
- * filter.h must be included before this file.
- */
-
-/* Address qualifers. */
+/* Address qualifiers. */
#define Q_HOST 1
#define Q_NET 2
@@ -45,13 +40,14 @@
#define Q_TCP 5
#define Q_UDP 6
#define Q_ICMP 7
+#define Q_IGMP 8
-#define Q_DECNET 8
-#define Q_LAT 9
-#define Q_MOPRC 10
-#define Q_MOPDL 11
+#define Q_DECNET 9
+#define Q_LAT 10
+#define Q_MOPRC 11
+#define Q_MOPDL 12
-/* Directional qualifers. */
+/* Directional qualifiers. */
#define Q_SRC 1
#define Q_DST 2
@@ -63,7 +59,7 @@
struct stmt {
int code;
- int32_t k;
+ bpf_int32 k;
};
struct slist {
@@ -75,14 +71,14 @@ struct slist {
* A bit vector to represent definition sets. We assume TOT_REGISTERS
* is smaller than 8*sizeof(atomset).
*/
-typedef u_int32_t atomset;
+typedef bpf_u_int32 atomset;
#define ATOMMASK(n) (1 << (n))
#define ATOMELEM(d, n) (d & ATOMMASK(n))
/*
* An unbounded set.
*/
-typedef u_int32_t *uset;
+typedef bpf_u_int32 *uset;
/*
* Total number of atomic entities, including accumulator (A) and index (X).
@@ -104,6 +100,8 @@ struct block {
struct slist *stmts; /* side effect stmts */
struct stmt s; /* branch stmt */
int mark;
+ int longjt; /* jt branch requires long jump */
+ int longjf; /* jf branch requires long jump */
int level;
int offset;
int sense;
@@ -117,8 +115,8 @@ struct block {
atomset def, kill;
atomset in_use;
atomset out_use;
- int32_t oval;
- int32_t val[N_ATOMS];
+ int oval;
+ int val[N_ATOMS];
};
struct arth {
@@ -134,10 +132,6 @@ struct qual {
unsigned char pad;
};
-#ifndef __GNUC__
-#define volatile
-#endif
-
struct arth *gen_loadi(int);
struct arth *gen_load(int, struct arth *, int);
struct arth *gen_loadlen(void);
@@ -150,7 +144,7 @@ void gen_not(struct block *);
struct block *gen_scode(char *, struct qual);
struct block *gen_ecode(u_char *, struct qual);
-struct block *gen_ncode(u_int32_t, struct qual);
+struct block *gen_ncode(bpf_u_int32, struct qual);
struct block *gen_proto_abbrev(int);
struct block *gen_relation(int, struct arth *, struct arth *, int);
struct block *gen_less(int);
@@ -161,7 +155,10 @@ struct block *gen_multicast(int);
struct block *gen_inbound(int);
void bpf_optimize(struct block **);
-volatile void bpf_error(char *, ...);
+#if __STDC__
+__dead void bpf_error(const char *, ...)
+ __attribute__((volatile, format (printf, 1, 2)));
+#endif
void finish_parse(struct block *);
char *sdup(char *);