Commit Graph

101 Commits

Author SHA1 Message Date
delphij
fea8707db3 MFV r276759: libpcap 1.6.2.
MFC after:	1 month
2015-01-06 22:29:12 +00:00
luigi
9012a74511 Add netmap support to libpcap. Tcpdump and other native pcap application can now
run directly on netmap ports using netmap:foo or valeXX:YY device names.
Modifications to existing code are small and trivial, the netmap-specific
code is all in a new file.

Please be aware that in netmap mode the physical interface is disconnected from
the host stack, so libpcap will steal the traffic not just make a copy.

For the full version of the code (including linux and autotools support) see
	https://code.google.com/p/netmap-libpcap/

MFC after:	3 days
2014-10-06 15:48:28 +00:00
kevlo
2d30c961db Rename definition of IEEE80211_FC1_WEP to IEEE80211_FC1_PROTECTED.
The origin of WEP comes from IEEE Std 802.11-1997 where it defines
whether the frame body of MAC frame has been encrypted using WEP
algorithm or not.
IEEE Std. 802.11-2007 changes WEP to Protected Frame, indicates
whether the frame is protected by a cryptographic encapsulation
algorithm.

Reviewed by:	adrian, rpaulo
2014-01-08 08:06:56 +00:00
sbruno
354fc81dc9 Integrate github revision 0446821e49224c6a29be28760cc9c4cc14f56d8a as
suggested by upstream

https://github.com/the-tcpdump-group/libpcap/issues/327

Quiesce assignment warnings by use of const
2013-10-31 20:03:59 +00:00
glebius
e352aa585e Move new pf includes to the pf directory. The pfvar.h remain
in net, to avoid compatibility breakage for no sake.

The future plan is to split most of non-kernel parts of
pfvar.h into pf.h, and then make pfvar.h a kernel only
include breaking compatibility.

Discussed with:		bz
2013-10-27 16:25:57 +00:00
glebius
4fe4e9732a Start splitting pfvar.h into internal and external parts.
- Provide pf_altq.h that has only stuff needed for ALTQ.
- Start pf.h, that would have all constant values and
  eventually non-kernel structures.
- Build ALTQ w/o pfvar.h, include if_var.h, that before
  came via pollution.
- Build tcpdump w/o pfvar.h.

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2013-10-26 18:59:58 +00:00
delphij
8be1d9016e MFV: libpcap 1.4.0.
MFC after:	4 weeks
2013-05-30 08:02:00 +00:00
hiren
9b71c4e88b Add tcp header flags ECE and CWR defined in RFC 3168.
PR:	140349
Submitted by:	Alan Amesbury <amesbury@umn.edu> (earlier version)
Reviewed by:	delphij
Approved by:	sbruno (mentor)
2013-05-16 05:16:56 +00:00
pfg
245e35ae97 Clean some 'svn:executable' properties in the tree.
Submitted by:	Christoph Mallon
MFC after:	3 days
2013-01-26 22:08:21 +00:00
delphij
a130b811b9 MFV: libpcap 1.3.0.
MFC after:	4 weeks
2012-10-05 18:42:50 +00:00
kevlo
98ccaea0f9 Fix typo: s/pakcet/packet 2012-09-20 03:29:43 +00:00
delphij
b6e0e7f97f Add 3 missing files that was generated but not included with the initial
commit.

Reported by:	buganini via IRC
MFC after:	2 weeks
2012-05-14 09:32:10 +00:00
delphij
a3451bb93b Merge from vendor branch: update libpcap to 1.2.1.
MFC after:	2 weeks
2012-05-14 05:12:56 +00:00
delphij
009e986666 Incorporate vendor commit ecdc5c0a7f7591a7cd4a:
In userland, sign extend the offset for JA instructions.

We currently use that to implement "ip6 protochain", and "pc" might be
wider than "pc->k", in which case we need to arrange that "pc->k" be
sign-extended, by casting it to bpf_int32.

PR:		kern/157188
Submitted by:	plosher
MFC after:	2 weeks
2011-06-28 00:58:12 +00:00
csjp
9c392f3f91 Explicitly initialize the packet buffer to NULL after we unmap the zero copy
buffers.  This fixes a segfault on exit due to calling free on a bogus pointer.
This should be considered a temporary stop gap fix to avoid the crash.  The
complete fix re-shuffles the initializations of some of the clean-up pointers.

The details of the fix can be found in the libpcap git repository:
commit bc8209b71e928870b0f172d43b174ab27ba24394

Proded by:	kevlo, rpaulo
MFC after:	2 weeks
Submitted by:	Anton Yuzhaninov
2011-06-03 14:57:38 +00:00
delphij
8c8d7206ec Merge my change against libpcap trunk revision
c65292b04b98d6a76d58c5a54ca8f81463bf24de to support new SIOCGIFDESCR
ioctl interface which was too late for libpcap 1.1.1.

Reported by:	brucec
Noticed by:	wxs
2011-03-11 00:38:07 +00:00
rpaulo
e11759c217 Remove more unused files. 2010-10-29 18:56:51 +00:00
rpaulo
e2646b8f68 Remove unused files. 2010-10-29 18:50:38 +00:00
rpaulo
22f795f2fd Merge libpcap-1.1.1. 2010-10-29 18:43:23 +00:00
delphij
d9a0cd0982 Revised revision 199201 (add interface description capability as inspired
by OpenBSD), based on comments from many, including rwatson, jhb, brooks
and others.

Sponsored by:	iXsystems, Inc.
MFC after:	1 month
2010-01-27 00:30:07 +00:00
delphij
8fed657163 Revert revision 199201 for now as it has introduced a kernel vulnerability
and requires more polishing.
2009-11-12 19:02:10 +00:00
delphij
13a19ef806 Add interface description capability as inspired by OpenBSD.
MFC after:	3 months
2009-11-11 21:30:58 +00:00
rpaulo
dc6531d9b1 Revert previous commit that commented out some bpf functions.
Unconstify arguments of bpf_image(), bpf_filter() and bpf_dump(). This
is needed because some ports rely heavely on these arguments (some of
them even roll out their own implemenentations of bpf_dump).
2009-04-11 17:36:11 +00:00
rpaulo
9d4d27efa9 Restore local change to include <sys/bpf.h> inside pcap.h. This fixes
remaining ports build problems.
2009-04-02 13:04:17 +00:00
rpaulo
4e28805a1b Remove a dangling extern "C" declaration that was missed during the
merge. Fixes C++ ports using libpcap (nmap, for example).

Submitted by:	Daniel Roethlisberger <daniel at roe.ch>
2009-03-31 11:04:51 +00:00
vanhu
d645281c28 Fixed indentation for LINKTYPE_ENC
Approved by:	gnn(mentor)
2009-03-24 15:57:35 +00:00
rpaulo
989ff00905 bpf_filter() and bpf_validate() can't live here if they already live in
bpf.h
2009-03-22 00:47:41 +00:00
rpaulo
46635ef154 Remove remaining references to BIOCSETBUFMODE ifdefs. We now have
another ifdef for zerocopy bpf.
2009-03-21 23:13:48 +00:00
rpaulo
12c773480a Finish merge of zerocopy bpf. 2009-03-21 23:08:04 +00:00
rpaulo
3f19af99ad Merge libpcap 1.0.0. 2009-03-21 22:58:08 +00:00
rpaulo
259f53ade9 Add Mac OS X stuff. 2009-03-21 20:39:22 +00:00
rpaulo
2a5dac1a1e Add a couple more paths. 2009-03-21 20:34:41 +00:00
rpaulo
fb140a5d54 Add exclude list for libpcap. 2009-03-21 20:16:15 +00:00
rpaulo
5779dabf1b Flatten vendor/libpcap and remove keyword expansion. 2009-03-20 13:44:43 +00:00
vanhu
8f8f965b49 Added DLT_ENC to map list, so it is now possible
to save dumps on enc0

Reviewed by:	gnn(mentor)
Obtained from:	NETASQ
MFC after:	1 week
2009-03-16 15:09:47 +00:00
csjp
2f23d207d3 Implement zero-copy bpf(4) buffer or "zbuf" support for libpcap. A slightly
different version has been committed upstream in the libpcap vendor branch.
This will allow people to experiment with zero-copy bpf(4) without requiring
external patches.

Note to enable this functionality:

    sysctl net.bpf.zerocopy_enable=1

By default, libpcap will use the legacy buffering method unless this sysctl
variable is set to 1.

For the details about zero-copy bpf(4) implementation see svn change r177548.

Requested by:		many
Discussed with:		sam
In collaboration with:	rwatson
2008-09-16 20:32:29 +00:00
mlaier
c89ca49410 Revert back to including the whole net/bpf.h again.
Requested by:	sam, nork
X-MFC after:	now
2007-10-20 20:23:39 +00:00
mlaier
298dfd4f74 Resolve merge conflicts
Approved by:	re (kensmith)
Obtained from:	tcpdump.org
2007-10-16 02:07:55 +00:00
mlaier
446242760e Import of libpcap v0.9.8 2007-10-16 02:02:02 +00:00
mlaier
55470a45cf This commit was generated by cvs2svn to compensate for changes in r172677,
which included commits to RCS files with non-trunk default branches.
2007-10-16 02:02:02 +00:00
jkim
2bd7382fdc Add three new ioctl(2) commands for bpf(4).
- BIOCGDIRECTION and BIOCSDIRECTION get or set the setting determining
whether incoming, outgoing, or all packets on the interface should be
returned by BPF.  Set to BPF_D_IN to see only incoming packets on the
interface.  Set to BPF_D_INOUT to see packets originating locally and
remotely on the interface.  Set to BPF_D_OUT to see only outgoing
packets on the interface.  This setting is initialized to BPF_D_INOUT
by default.  BIOCGSEESENT and BIOCSSEESENT are obsoleted by these but
kept for backward compatibility.

- BIOCFEEDBACK sets packet feedback mode.  This allows injected packets
to be fed back as input to the interface when output via the interface is
successful.  When BPF_D_INOUT direction is set, injected outgoing packet
is not returned by BPF to avoid duplication.  This flag is initialized to
zero by default.

Note that libpcap has been modified to support BPF_D_OUT direction for
pcap_setdirection(3) and PCAP_D_OUT direction is functional now.

Reviewed by:	rwatson
2007-02-26 22:24:14 +00:00
sam
6bf6a28af3 sigh, put back buffer overflow fix of 1.1.11 that seems to have
not gone into the 0.9.4 release; don't put it on the vendor branch
so we won't lose it on the next import if they continue to lose it
2006-09-04 20:12:45 +00:00
sam
aff9fbdea1 update instructions 2006-09-04 19:54:49 +00:00
sam
8bcc947abc resolve merge conflicts
MFC after:	1 month
2006-09-04 19:54:21 +00:00
sam
ffd4bfbe7b Import of libpcap v0.9.4 2006-09-04 19:43:23 +00:00
sam
d439ca5cfb This commit was generated by cvs2svn to compensate for changes in r162012,
which included commits to RCS files with non-trunk default branches.
2006-09-04 19:43:23 +00:00
sam
bf281a32a1 correct dlt buffer alloc; this goes on the vendor branch as it
will be committed there shortly

MFC after:	3 days
2006-01-16 20:33:23 +00:00
sam
0166ef9fb9 This commit was generated by cvs2svn to compensate for changes in r154439,
which included commits to RCS files with non-trunk default branches.
2006-01-16 20:33:23 +00:00
sam
b0948cc146 resolve merge conflicts
Approved by:	re (scottl)
2005-07-11 03:43:25 +00:00
sam
d1c1ca625a Virgin import of libpcap v0.9.1 (release) from tcpdump.org
Approved by:	re (scottl)
2005-07-11 03:24:53 +00:00