]> The Tcpdump Group git mirrors - libpcap/blobdiff - gencode.h
Make sure no read routine process more than INT_MAX packets.
[libpcap] / gencode.h
index bffb71b6264d1608696ab5ee3f7726631b438bed..9631dd02ee08e66bb254110dad0b094b3a70b919 100644 (file)
--- a/gencode.h
+++ b/gencode.h
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
+#ifndef gencode_h
+#define gencode_h
+
 #include "pcap/funcattrs.h"
+#include "pcap/bpf.h" /* bpf_u_int32 and BPF_MEMWORDS */
 
 /*
  * ATM support:
@@ -240,7 +244,7 @@ typedef bpf_u_int32 *uset;
  * It's a directed graph, so an edge has a predecessor and a successor.
  */
 struct edge {
-       int id;
+       u_int id;
        int code;               /* opcode for branch corresponding to this edge */
        uset edom;
        struct block *succ;     /* successor vertex */
@@ -254,7 +258,7 @@ struct edge {
  * branch to successor blocks.
  */
 struct block {
-       int id;
+       u_int id;
        struct slist *stmts;    /* side effect stmts */
        struct stmt s;          /* branch stmt */
        int mark;
@@ -328,6 +332,7 @@ struct block *gen_greater(compiler_state_t *, int);
 struct block *gen_byteop(compiler_state_t *, int, int, bpf_u_int32);
 struct block *gen_broadcast(compiler_state_t *, int);
 struct block *gen_multicast(compiler_state_t *, int);
+struct block *gen_ifindex(compiler_state_t *, int);
 struct block *gen_inbound(compiler_state_t *, int);
 
 struct block *gen_llc(compiler_state_t *);
@@ -399,3 +404,5 @@ int pcap_parse(void *, compiler_state_t *);
 /* XXX */
 #define JT(b)  ((b)->et.succ)
 #define JF(b)  ((b)->ef.succ)
+
+#endif /* gencode_h */