*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.192 2003-07-29 08:53:51 hannes Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.193 2003-08-18 22:09:30 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
u_int n;
{
struct chunk *cp;
- int k, size;
+ int k;
+ size_t size;
#ifndef __NetBSD__
/* XXX Round up to nearest long. */
*
* Therefore, if "off_linktype" is -1, there's an error.
*/
- if (off_linktype == -1)
+ if (off_linktype == (u_int)-1)
abort();
/*
case Q_DEFAULT:
b0 = gen_host(addr, mask, Q_IP, dir);
- if (off_linktype != -1) {
+ if (off_linktype != (u_int)-1) {
b1 = gen_host(addr, mask, Q_ARP, dir);
gen_or(b0, b1);
b0 = gen_host(addr, mask, Q_RARP, dir);
if (alist == NULL || *alist == NULL)
bpf_error("unknown host '%s'", name);
tproto = proto;
- if (off_linktype == -1 && tproto == Q_DEFAULT)
+ if (off_linktype == (u_int)-1 && tproto == Q_DEFAULT)
tproto = Q_IP;
b = gen_host(**alist++, 0xffffffff, tproto, dir);
while (*alist) {
case A_VPI:
if (!is_atm)
bpf_error("'vpi' supported only on raw ATM");
- if (off_vpi == -1)
+ if (off_vpi == (u_int)-1)
abort();
b0 = gen_ncmp(BPF_B, off_vpi, 0xffffffff, (u_int)jtype,
(u_int)jvalue, reverse);
case A_VCI:
if (!is_atm)
bpf_error("'vci' supported only on raw ATM");
- if (off_vci == -1)
+ if (off_vci == (u_int)-1)
abort();
b0 = gen_ncmp(BPF_H, off_vci, 0xffffffff, (u_int)jtype,
(u_int)jvalue, reverse);
break;
case A_PROTOTYPE:
- if (off_proto == -1)
+ if (off_proto == (u_int)-1)
abort(); /* XXX - this isn't on FreeBSD */
b0 = gen_ncmp(BPF_B, off_proto, 0x0f, (u_int)jtype,
(u_int)jvalue, reverse);
break;
case A_MSGTYPE:
- if (off_payload == -1)
+ if (off_payload == (u_int)-1)
abort();
b0 = gen_ncmp(BPF_B, off_payload + MSG_TYPE_POS, 0xffffffff,
(u_int)jtype, (u_int)jvalue, reverse);
case A_CALLREFTYPE:
if (!is_atm)
bpf_error("'callref' supported only on raw ATM");
- if (off_proto == -1)
+ if (off_proto == (u_int)-1)
abort();
b0 = gen_ncmp(BPF_B, off_proto, 0xffffffff, (u_int)jtype,
(u_int)jvalue, reverse);