aboutsummaryrefslogtreecommitdiff
path: root/testprogs
Commit message (Collapse)AuthorAgeFilesLines
...
* Don't fail the preferred interface has no IPv4 address.Guy Harris2019-10-221-2/+18
| | | | | That's not a fatal condition, unlike, for example, pcap_lookupnet() getting a system call error trying to fetch the interface's IPv4 address.
* Linux: get ifdrop stats from sysfs.Mario Rugiero2019-10-031-0/+4
|
* Clean up some whitespacesFrancois-Xavier Le Bail2019-01-233-3/+3
|
* Attempt to deal with OSes that require you to link with -lpthread.Guy Harris2018-10-242-0/+16
| | | | | | Leave CMAKE_EXE_LINKER_FLAGS and CMAKE_SHARED_LINKER_FLAGS alone; instead, just add SANITIZER_FLAGS as the LINK_FLAGS property to shared library and executable targets.
* Lines end with NL on UN*X and CR-LF on Windows.Guy Harris2018-10-191-1/+1
| | | | They don't end with nothing.
* Get rid of unused variable.Guy Harris2018-10-161-1/+0
|
* Fuzzing libpcapPhilippe Antoine2018-10-089-0/+295
| | | | | | One target for a pcap file One target for a bpf filter One target for pcap_offline_filter
* We also need to undefine BPF_JUMP to avoid warnings.Guy Harris2018-09-151-4/+6
|
* Include varattrs.h to define _U_.Guy Harris2018-09-151-0/+1
|
* Squelch another warning.Guy Harris2018-09-151-0/+15
|
* Squelch a warning.Guy Harris2018-09-151-0/+4
| | | | | Mark argc and argv unused if we don't have remote-capture support, as the arguments are only used to specify the remote server.
* Squelch a warning.Guy Harris2018-09-151-0/+4
| | | | | | We only support the -g flag if libpap is built with support for debugging, so don't define the variable for the flag unless that support is present.
* Remove unreachable return statements.Guy Harris2018-09-152-2/+0
| | | | | | | error() never returns, so code that follows an error() is unreachable. Newer compilers support flagging routines as not returning, so the compiler won't warn of main() not returning a value.
* Fix data types.Guy Harris2018-09-154-4/+4
| | | | | | If you're accumulating the lengths of strings, as returned by strlen(), and passing the result to malloc(), it should be accumulated in a size_t.
* Use size_t to accumulate the length of a string.Guy Harris2018-09-131-1/+1
| | | | Squelches a narrowing warning.
* Squelch more narrowing warnings.Guy Harris2018-09-121-1/+1
|
* Clean up -Wshorten-64-to-32 warnings in the test programs.Guy Harris2018-09-103-13/+49
| | | | Clean up some other stuff while we're at it.
* Don't use internal routines.Guy Harris2018-08-311-1/+1
| | | | | The semi-automated conversion of bpf_validate() to pcap_validate_filter() shouldn't have been done to the test programs.
* Clean up the declaration of the packet-filtering routines.Guy Harris2018-08-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If net/bpf.h declares bpf_filter() one way and libpcap defines it another way, even pcap-bpf.c needs a declaration that matches how libpcap defines it, not how net/bpf.h (mistakenly) declares it. ("Mistakenly" because it should *not* be declaring the kernel's version of bpf_filter() unless it's being used in a *kernel* build; other *BSDs, and macOS, declare it only in kernel builds by testing for a #define such as KERNEL or KERNEL_PRIVATE, but NetBSD doesn't - it *should*, but it doesn't.) So we rename the internal-to-pcap filtering routine as pcap_filter(), which is not exported from libpcap, and have bpf_filter() be a wrapper around pcap_filter() that is exported. Use pcap_filter(), rather than bpf_filter(), for all filtering inside libpcap (except for filtering that uses bpf_filter_with_aux_data(), which we rename pcap_filter_with_aux_data()). Do the same for bpf_validate(), which is *also* declared in net/bpf.h, even for non-kernel builds, in NetBSD. As we're not exporting pcap_filter_with_aux_data(), don't even *declare* it in a public header; don't declare struct bpf_aux_data in a public header, either. That way we can change it without worrying about breaking APIs or ABIs; we may do that if, for example, we want to support the "inbound" and "outbound" filters when reading pcapng files, adding a direction indicator to that structure. Declare bpf_filter() in pcap/bpf.h even on NetBSD and QNX; pcap-bpf.c doesn't include pcap/bpf.h (it sets a #define to force pcap/pcap.h not to include it), so we won't get any collisions if net/bpf.h (which it does include) declares it. The only collisions will occur in programs that include *both* pcap/pcap.h or pcap/bpf.h *and* net/bpf.h, and that will occur only if net/bpf.h declares bpf_filter() even when building userland code, and the correct fix for *that* is to fix net/bpf.h not to declare them in non-kernel builds.
* Remove trailing spaces/tabsFrancois-Xavier Le Bail2018-05-251-1/+1
|
* Add -Wformat-nonliteral and fix most warnings that come upJoerg Mayer2018-05-032-2/+2
| | | | | | The remaining ocurrences are genuine and intentional. warning: format string is not a string literal [-Wformat-nonliteral]
* Have separate flags for "optimizer debug" and "print DOT graph".Guy Harris2018-05-032-17/+28
| | | | | | | | | | | Instead of having -dddd mean "-ddd and print the CFG as a DOT graph", have a separate -g flag to request the CFG. Also, put the routines to set the "optimizer debug" and "print DOT graph" flags into optimize.c, and make the flags in question static. (And "CFG graph" is redundant, like "ATM machine", "PIN number", and "NT technology"....)
* Update comments to reflect current reality.Guy Harris2018-05-031-5/+5
|
* Use pcap_set_optimizer_debug() to set the optimizer debug level.Guy Harris2018-05-021-6/+14
|
* Clean up descriptions.Guy Harris2018-04-301-2/+2
|
* Add more interface flags to pcap_findalldevs().Guy Harris2018-04-291-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We add: PCAP_IF_WIRELESS, which indicates whether the interface is "wireless" or not. PCAP_IF_CONNECTION_STATUS, which is a bitmask for a two-bit field that can have one of the values: PCAP_IF_CONNECTION_STATUS_UNKNOWN if the status of whether the interface is "connected" or "disconnected" is unknown; PCAP_IF_CONNECTION_STATUS_CONNECTED if the interface is "connected"; PCAP_IF_CONNECTION_STATUS_DISCONNECTED if the interface is "disconnected"; PCAP_IF_CONNECTION_STATUS_NOT_APPLICABLE if the notion of "connected" or "disconnected" doesn't apply to this interface. Take that into account when sorting interfaces in the interface list, penalizing "disconnected" interfaces, as you won't see traffic on them if they're not wireless and you'd have to be in some form of "monitor mode" to see traffic on them if they're wireless. This should address GitHub issue #700.
* Fix a few warnings that came up after turning on a dozen more warningsJoerg Mayer2018-04-042-2/+2
|
* Fix a set of trivial unused warningsJoerg Mayer2018-04-043-4/+4
|
* Decorate the declaration, not the later definition, with PCAP_NORETURN.Guy Harris2018-03-312-4/+4
|
* Squelch warnings in test programs.Guy Harris2018-03-312-2/+2
|
* Check for no-additional-compiler-flags in the subdirectories as well.Guy Harris2018-03-271-2/+4
|
* Use the COMPILE_FLAGS property, not the COMPILE_OPTIONS property.Guy Harris2018-03-271-1/+1
| | | | | The 2.8.6 documentation doesn't mention COMPILE_OPTIONS, just COMPILE_FLAGS.
* Rename the test program directory to testprogs.Guy Harris2018-02-0622-0/+3178
We may have a directory of test files in the future, and we'd want to call it "tests", paralleling tcpdump's directory of test files.