diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-06-04 23:11:43 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-06-04 23:11:43 +0000 |
commit | 2df7f6110dc24b8d55e1c6c2c825fb2e393cdfb2 (patch) | |
tree | a8308b23899504202ffb5a1925373b719ca95e59 /lib/libpcap | |
parent | 9aae5068afee870336e415b14d15b3d9dde81e34 (diff) |
add DLT_LOOP support; 4-byte header indicates proto; cstone@pobox.com
Diffstat (limited to 'lib/libpcap')
-rw-r--r-- | lib/libpcap/gencode.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/libpcap/gencode.c b/lib/libpcap/gencode.c index 068d5642105..d6d323ab1a7 100644 --- a/lib/libpcap/gencode.c +++ b/lib/libpcap/gencode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gencode.c,v 1.6 1997/07/25 20:30:18 mickey Exp $ */ +/* $OpenBSD: gencode.c,v 1.7 1998/06/04 23:11:34 deraadt Exp $ */ /* * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996 @@ -493,6 +493,11 @@ init_linktype(type) off_nl = 0; return; + case DLT_LOOP: + off_linktype = -1; + off_nl = 4; + return; + case DLT_PPP: off_linktype = 2; off_nl = 4; @@ -575,10 +580,11 @@ gen_linktype(proto) proto = 0x0021; /* XXX - need ppp.h defs */ break; + case DLT_LOOP: case DLT_NULL: /* XXX */ if (proto == ETHERTYPE_IP) - return (gen_cmp(0, BPF_W, (bpf_int32)AF_INET)); + return (gen_cmp(0, BPF_W, htonl((bpf_int32) AF_INET))); else return gen_false(); } |