*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.237 2005-05-01 04:13:52 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.238 2005-05-01 08:37:04 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
bpf_u_int32);
static struct block *gen_bcmp(enum e_offrel, u_int, u_int, const u_char *);
static struct block *gen_ncmp(enum e_offrel, bpf_u_int32, bpf_u_int32,
- bpf_u_int32, bpf_u_int32, int, bpf_u_int32);
+ bpf_u_int32, bpf_u_int32, int, bpf_int32);
static struct slist *gen_load_a(enum e_offrel, u_int, u_int);
static struct block *gen_uncond(int);
static inline struct block *gen_true(void);
static struct block *
gen_ncmp(offrel, offset, size, mask, jtype, reverse, v)
enum e_offrel offrel;
- bpf_u_int32 offset, size, mask, jtype, v;
+ bpf_int32 v;
+ bpf_u_int32 offset, size, mask, jtype;
int reverse;
{
- struct slist *s;
+ struct slist *s, *s2;
struct block *b;
s = gen_load_a(offrel, offset, size);
if (mask != 0xffffffff) {
- s->next = new_stmt(BPF_ALU|BPF_AND|BPF_K);
- s->next->s.k = mask;
+ s2 = new_stmt(BPF_ALU|BPF_AND|BPF_K);
+ s2->s.k = mask;
+ sappend(s, s2);
}
b = new_block(JMP(jtype));
struct block *
gen_atmfield_code(atmfield, jvalue, jtype, reverse)
int atmfield;
- bpf_u_int32 jvalue;
+ bpf_int32 jvalue;
bpf_u_int32 jtype;
int reverse;
{
bpf_error("'vpi' supported only on raw ATM");
if (off_vpi == (u_int)-1)
abort();
- b0 = gen_ncmp(OR_LINK, off_vpi, BPF_B, 0xffffffff, (u_int)jtype,
- (u_int)jvalue, reverse);
+ b0 = gen_ncmp(OR_LINK, off_vpi, BPF_B, 0xffffffff, jtype,
+ reverse, jvalue);
break;
case A_VCI:
bpf_error("'vci' supported only on raw ATM");
if (off_vci == (u_int)-1)
abort();
- b0 = gen_ncmp(OR_LINK, off_vci, BPF_H, 0xffffffff, (u_int)jtype,
- reverse, (u_int)jvalue);
+ b0 = gen_ncmp(OR_LINK, off_vci, BPF_H, 0xffffffff, jtype,
+ reverse, jvalue);
break;
case A_PROTOTYPE:
if (off_proto == (u_int)-1)
abort(); /* XXX - this isn't on FreeBSD */
- b0 = gen_ncmp(OR_LINK, off_proto, BPF_B, 0x0f, (u_int)jtype,
- reverse, (u_int)jvalue);
+ b0 = gen_ncmp(OR_LINK, off_proto, BPF_B, 0x0f, jtype,
+ reverse, jvalue);
break;
case A_MSGTYPE:
if (off_payload == (u_int)-1)
abort();
b0 = gen_ncmp(OR_LINK, off_payload + MSG_TYPE_POS, BPF_B,
- 0xffffffff, (u_int)jtype, reverse, (u_int)jvalue);
+ 0xffffffff, jtype, reverse, jvalue);
break;
case A_CALLREFTYPE:
if (off_proto == (u_int)-1)
abort();
b0 = gen_ncmp(OR_LINK, off_proto, BPF_B, 0xffffffff,
- (u_int)jtype, reverse, (u_int)jvalue);
+ jtype, reverse, jvalue);
break;
default:
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /tcpdump/master/libpcap/gencode.h,v 1.62 2005-04-23 22:26:52 guy Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/libpcap/gencode.h,v 1.63 2005-05-01 08:37:06 guy Exp $ (LBL)
*/
/*
struct block *gen_vlan(int);
struct block *gen_mpls(int);
-struct block *gen_atmfield_code(int atmfield, bpf_u_int32 jvalue, bpf_u_int32 jtype, int reverse);
+struct block *gen_atmfield_code(int atmfield, bpf_int32 jvalue, bpf_u_int32 jtype, int reverse);
struct block *gen_atmtype_abbrev(int type);
struct block *gen_atmmulti_abbrev(int type);
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/libpcap/grammar.y,v 1.87 2005-04-19 04:25:01 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/grammar.y,v 1.88 2005-05-01 08:37:06 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
| VCI { $$.atmfieldtype = A_VCI; }
;
atmvalue: atmfieldvalue
- | relop NUM { $$.b = gen_atmfield_code($<blk>0.atmfieldtype, (u_int)$2, (u_int)$1, 0); }
- | irelop NUM { $$.b = gen_atmfield_code($<blk>0.atmfieldtype, (u_int)$2, (u_int)$1, 1); }
+ | relop NUM { $$.b = gen_atmfield_code($<blk>0.atmfieldtype, (bpf_int32)$2, (bpf_u_int32)$1, 0); }
+ | irelop NUM { $$.b = gen_atmfield_code($<blk>0.atmfieldtype, (bpf_int32)$2, (bpf_u_int32)$1, 1); }
| paren atmlistvalue ')' { $$.b = $2.b; $$.q = qerr; }
;
atmfieldvalue: NUM {
$$.atmfieldtype = $<blk>0.atmfieldtype;
if ($$.atmfieldtype == A_VPI ||
$$.atmfieldtype == A_VCI)
- $$.b = gen_atmfield_code($$.atmfieldtype, (u_int) $1, BPF_JEQ, 0);
+ $$.b = gen_atmfield_code($$.atmfieldtype, (bpf_int32) $1, BPF_JEQ, 0);
}
;
atmlistvalue: atmfieldvalue