summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* regenerated configure with --with-libnl switchbareMichael Richardson2015-02-151-3/+21
|
* Merge branch 'add_with-libnl_switch' of https://github.com/mcr/libpcap into ↵Michael Richardson2015-02-153-18/+34
|\ | | | | | | mcr-add_with-libnl_switch
| * Merge remote-tracking branch 'finepoint/master' into add_with-libnl_switchMichael Richardson2014-08-063-18/+33
| |\
| | * added support for finding libnl in another placeMichael Richardson2014-08-063-18/+33
| | |
* | | Merge pull request #372 from baruchsiach/config-fixesMichael Richardson2015-02-151-3/+3
|\ \ \ | | | | | | | | configure.in cross compile and noMMU fixes
| * | | configure.in: uclinux is also linuxBaruch Siach2014-07-291-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, -lpthread is needed for the test to build for noMMU targets (AKA uClinux). Signend-off-by: Baruch Siach <baruch@tkos.co.il>
| * | | configure.in: Remove hardcoded path to libnl3 include directoryThomas Petazzoni2014-07-291-1/+0
| | | | | | | | | | | | | | | | | | | | It breaks cross compilation since /usr/include/libnl3 is the host include directory that is not guaranteed to exist at all.
* | | | Merge pull request #360 from bonsaiviking/scanner-lex-topMichael Richardson2015-02-153-5/+6
|\ \ \ \ | | | | | | | | | | Move the inclusion of config.h to the top of scanner.c
| * | | | Fix an error causing scanner.h to not be generatedDaniel Miller2014-06-061-1/+2
| | | | |
| * | | | Move the inclusion of config.h to the top of scanner.cDaniel Miller2014-06-063-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This works around _LARGE_FILES difficulties on AIX. See http://seclists.org/nmap-dev/2012/q1/459 for example. This is an alternative to the flex-only solution in #359
* | | | | Merge pull request #358 from bonsaiviking/config-packet-ringMichael Richardson2015-02-152-0/+20
|\ \ \ \ \ | | | | | | | | | | | | Add the --disable-packet-ring configure option.
| * | | | | Add the --disable-packet-ring configure option.Daniel Miller2014-06-052-0/+20
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows the creation of 32-bit binaries that are compatible with 64-bit Linux kernels before version 2.6.27. Original patch credit: David Fifield of the Nmap project (https://svn.nmap.org/nmap/libpcap/NMAP_MODIFICATIONS/0002-Add-the-disable-packet-ring-configure-option.patch)
* | | | | Merge remote-tracking branch 'github/master' into boundary-masterMichael Richardson2015-02-151-5/+15
|\ \ \ \ \
| * \ \ \ \ Merge pull request #346 from atzm/linux-vlan-tpidMichael Richardson2015-02-151-5/+15
| |\ \ \ \ \ | | | | | | | | | | | | | | pcap-linux: Obtain VLAN TPID from the kernel when available
| | * | | | | pcap-linux: Fix the VLAN TPID handling for the readabilityAtzm Watanabe2014-04-091-16/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Unify the VLAN TPID selection logic into a helper macro VLAN_TPID().
| | * | | | | pcap-linux: Obtain VLAN TPID from the kernel when availableAtzm Watanabe2014-03-251-5/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The VLAN TPID was hardcoded in pcap-linux.c but recent Linux kernel supports 802.1ad Q-in-Q. Since Linux 3.14, kernel gives the TPID value to the userspace when available.
* | | | | | | Merge branch 'solofox-master'Michael Richardson2015-02-1510-3/+446
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | |
| * | | | | | issue: https://github.com/the-tcpdump-group/libpcap/pull/319Michael Richardson2015-02-1510-3/+446
| |\ \ \ \ \ \ |/ / / / / / / | | | | | | | | | | | | | | Merge branch 'master' of https://github.com/solofox/libpcap into solofox-master
| * | | | | | Add some BPF expressiones for to explore bpf_optimize().solofox2013-09-037-0/+10
| | | | | | |
| * | | | | | Add a tool parsing bpf_optimize() output to show the optimize process on ↵solofox2013-09-031-0/+309
| | | | | | | | | | | | | | | | | | | | | | | | | | | | browser.
| * | | | | | Dump BPF tree representation transformations using dot language in ↵solofox2013-09-032-1/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | bpf_optimize().
* | | | | | | Travis: running findalldevstest is now part of the build scriptFrancois-Xavier Le Bail2015-02-131-2/+0
| | | | | | |
* | | | | | | Make findalldevstest exit with an exit status of 2 on an error.Guy Harris2015-02-121-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | That'll let us make Travis builds fail if the test fails.
* | | | | | | Don't add null addresses to the address list.Guy Harris2015-02-121-8/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we don't have an address, don't add a pcap_addr_t with a null addr pointer to the list of addresses; it conveys no information. That seems to happen, at least with a venet device on Linux on the Travis build machine.
* | | | | | | findalldevstest: fix SIGSEGV (Segmentation fault) on Travis (Linux build)Francois-Xavier Le Bail2015-02-112-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This occurs with 'venet0' interface. The reason of the NULL pointer is currently unkown. There is now a message: Warning: a->addr is NULL, skipping this address. Context: Linux: 2.6.32 x86_64 $ ip link 2: venet0: <BROADCAST,POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN link/void gdb trace: -------------------------------------------------------------------------- venet0 Loopback: no Program received signal SIGSEGV, Segmentation fault. 0x0000000000403430 in ifprint (d=0x63e070) at ./tests/findalldevstest.c:69 69 switch(a->addr->sa_family) --------------------------------------------------------------------------
* | | | | | | This is the trunk, and there's a 1.7.x branch, so call it 1.8.0-PRE-GIT.Guy Harris2015-02-101-1/+1
| | | | | | |
* | | | | | | Merge pull request #415 from tbeadle/cooked-user-modeGuy Harris2015-02-101-21/+25
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Make sure the userland filtering happens correctly on cooked interfaces.
| * | | | | | | Make sure the userland filtering happens correctly on cooked interfaces.Tommy Beadle2015-02-101-21/+25
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If filtering in userland and capturing on a cooked interface, the packet buffer being sent to bpf_filter_with_aux_data did not include the sll header, so the filter was being applied improperly. The buffer would start at the layer3 header. This change moves the code to fill out the sll structure and update the bp pointer to point to it to before the call to bpf_filter_with_aux_data.
* | | | | | | Get rid of OR_MPLSPL, add OR_PREVMPLSHDR.Guy Harris2015-02-091-4/+7
| | | | | | |
* | | | | | | Rename OR_NET and OR_NET_NOSNAP to OR_LINKPL and OR_LINKPL_NOSNAP.Guy Harris2015-02-091-48/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It really means "payload of the link layer", where "link layer" includes any 802.2 LLC headers, and is used for fields not at the "network layer". The old OR_LINKPL was no longer used - either OR_LLC is used, for testing fields in the 802.2 LLC header, or OR_MPLSPL is used.
* | | | | | | Fix PPPoE session ID checks for non-Ethernet links.Guy Harris2015-02-091-1/+1
| | | | | | |
* | | | | | | Handle VLANs atop 802.11.Guy Harris2015-02-091-1/+9
| | | | | | |
* | | | | | | Have a common routine for generating absolute-offset-relative loads.Guy Harris2015-02-081-120/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That subsumes gen_load_linkhdrrel(), gen_load_prevlinkhdrrel(), and gen_load_linkplrel().
* | | | | | | Use common code for handling absolute offsets.Guy Harris2015-02-081-260/+188
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Define a structure that, for absolute offsets, has a Boolean flag indicating whether the offset has a variable part, the constant part of the offset, and the register, if any, holding the variable part of the offset. Have a routine that either generates code to load the X register with the variable part of the offset or generates no code, and use that instead of the existing routines for specific offsets. Use instances of that structure instead of individual variables. Add a macro to save the current link-layer header absolute offset and set it to a new value.
* | | | | | | Fix a comment.Guy Harris2015-02-081-1/+1
| | | | | | |
* | | | | | | Handle all link header offsets like the link payload offset.Guy Harris2015-02-081-184/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I.e., treat them as the sum of a possibly-missing variable part (stored in a "memory register") and a possibly-zero constant part. Given that, correctly handle PPPoE; that finally makes filters for protocols on top of PPPoE, when "E" stands for "Wi-Fi", generate the correct code.
* | | | | | | Fix a couple of incorrect OR_ values from the previous commit.Guy Harris2015-02-071-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Clean up some comments while we're at it.
* | | | | | | Rename some variables and enum values to make things a bit clearer.Guy Harris2015-02-071-209/+209
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace "ll"/"LL" with "linkhdr"/"LINKHDR", matching "linkpl"/"LINKPL", as it refers to the offset to the link-layer header. Use "prev", not "outer", for the link-layer information for the layer in which the current one is encapsulated (if there's any encapsulation); that name works better if there are multiple layers of encapsulation.
* | | | | | | Fix generation of the code to get the 802.11 and 802.11 radio header lengths.Guy Harris2015-02-071-6/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That code has to look at the link-layer header types and offsets for the outermost link layer when, for example, the link-layer header type and offset are changed for PPPoE session-layer packets.
* | | | | | | Use the new link-layer encapsulation stuff for PPPoE.Guy Harris2015-02-071-44/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As a side-effect, this fixes PPPoE over LANE, just in case anybody cares.
* | | | | | | Add a more general mechanism to handle encapsulating link-layer frames.Guy Harris2015-02-061-162/+184
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To handle the case where link-layer frames are encapsulated inside another protocol stack, and where we'd want to do tests on the encapsulated link-layer frame, have variables for an "outer" link-layer type, that being the link-layer type of the other protocol stack, and use those when relevant. Use that for ATM LANE; that lets us get rid of is_lane. Consolidate the code to generate tests for non-LE Control frames into a single routine while we're at it. Also, set off_ll rather than off_mac for DLT_NETANALYZER and DLT_NETANALYZER_TRANSPARENT; this lets us eliminate off_mac, simplifying things a bit.
* | | | | | | Add some more OR_ values, to make it clearer what we're doing.Guy Harris2015-02-061-20/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Distinguish between "offset from the beginning of the 802.2 LLC header", "offset from the beginning of the MPLS payload", and "offset from the beginning of the link-layer payload".
* | | | | | | Clean up some comments.Guy Harris2015-02-061-8/+8
| | | | | | |
* | | | | | | Not all link-layer protocols have a MAC layer.Guy Harris2015-02-061-156/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use "link-layer" instead of "MAC-layer", and "linkpl" instead of "macpl". (Yes, there's still off_mac; we need to handle encapsulation of link-layer protocols in other protocols better.)
* | | | | | | Update constants and variable name to reflect reality.Guy Harris2015-02-061-148/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The offset of the MAC-layer payload is, in the general case, now the sum of a variable value, computed based on the contents of various parts of the packet, and a constant value. Rename off_macpl to off_macpl_constant_part to indicate that it's the constant value in question, not necessarily the full offset, and update a lot of comments to reflect that reality.
* | | | | | | Include fixed offset when computing variable MAC headers.Jesse Gross2015-02-061-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some filters (such as VLAN) increment off_macpl as they are parsed. In the fixed MAC header case, this is handled properly since it is simply incorporated into the header length. However, currently with variable length headers we only look at the variable component and ignore the fixed part, so the VLAN stack can't be handled. This includes both pieces for variable headers; in cases where there are no VLAN filters, off_macpl is zero so things still work.
* | | | | | | Add some comments and expand some other comments.Guy Harris2015-02-061-3/+16
| | | | | | |
* | | | | | | Use gen_linktype() for VLAN EtherType check.Jesse Gross2015-02-052-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Directly using off_linktype to match the VLAN EtherType only works for basic Ethernet cases. Instead we can use gen_linktype() which is more general and is more likely to be updated to handle future protocols.
* | | | | | | Document the time stamp precision-related routines.Guy Harris2015-02-051-1/+44
| | | | | | |
* | | | | | | List the time stamp precision APIs.Guy Harris2015-02-051-0/+23
| | | | | | |