]> The Tcpdump Group git mirrors - tcpdump/log
tcpdump
9 years agoAvoiding conditional directives that break statements 494/head
Romero Malaquias [Sun, 13 Dec 2015 21:43:08 +0000 (18:43 -0300)] 
Avoiding conditional directives that break statements

9 years agoOSPF: Fix a segmentation fault
Francois-Xavier Le Bail [Wed, 9 Dec 2015 14:46:12 +0000 (15:46 +0100)] 
OSPF: Fix a segmentation fault

Moreover:
Fix printout of Link Protection Type sub-TLV.
Add some length checks.
Add and use istr[].
Add some comments.

9 years agoAdd missing output files for MPLS/ICMP extensions capture file
Francois-Xavier Le Bail [Fri, 27 Nov 2015 13:28:38 +0000 (14:28 +0100)] 
Add missing output files for MPLS/ICMP extensions capture file

Add the test cases accordingly.
Complete Hannes's commit fad6704f63f034e6e678e466c4094054527fa82d.

9 years agoUDLD: Fix "Unchecked return value" found by Coverity
Francois-Xavier Le Bail [Thu, 26 Nov 2015 15:45:42 +0000 (16:45 +0100)] 
UDLD: Fix "Unchecked return value" found by Coverity

The bounds check is already done before by ND_TCHECK2(*tptr, len).
So we are deliberately ignoring the return value of fn_printn with last
argument NULL (no bounds check).

9 years agoVTP: Add bounds checks
Francois-Xavier Le Bail [Sat, 21 Nov 2015 13:23:44 +0000 (14:23 +0100)] 
VTP: Add bounds checks

9 years agoLISP: Add and use istr[] and tstr[] strings
Francois-Xavier Le Bail [Sat, 21 Nov 2015 09:39:16 +0000 (10:39 +0100)] 
LISP: Add and use istr[] and tstr[] strings

Update the output of a test accordingly.

Moreover:
Delete extra blank lines.

9 years agoUDLD: Fix an infinite loop
Francois-Xavier Le Bail [Fri, 20 Nov 2015 19:23:11 +0000 (20:23 +0100)] 
UDLD: Fix an infinite loop

Moreover:
Update reference from draft to RFC5171.
Add bounds and length checks.
Fix TLV length printout. It is the length of the type, length, and value
fields.
Filter out non-printable characters.
Print the Echo TLV with fn_printn(). Note: The format of this list of ID
pairs is not documented in the RFC.
Update the output of a test accordingly.
Add and use istr[] and tstr[] strings.
Comment on the TLV format.
Update some comments.

9 years agoWe only handle 4-part addresses.
Guy Harris [Wed, 18 Nov 2015 21:29:57 +0000 (13:29 -0800)] 
We only handle 4-part addresses.

Get rid of the code to handle everything else; that code was dead, as
Coverity noted.  Add some comments to clarify what's going on.

9 years agoSquelch a Coverity warning.
Guy Harris [Wed, 18 Nov 2015 21:07:34 +0000 (13:07 -0800)] 
Squelch a Coverity warning.

See Coverity CID 1324572 for tcpdump - the unsigned octets from the IPv6
address were getting extended to ints as a result of getting shifted
left by an int, so make the loop counter unsigned.

9 years agoRemove debugging printouts.
Guy Harris [Wed, 18 Nov 2015 20:46:25 +0000 (12:46 -0800)] 
Remove debugging printouts.

9 years agoISOCLNS: Filter out non-printable characters 487/head
Francois-Xavier Le Bail [Wed, 11 Nov 2015 14:48:20 +0000 (15:48 +0100)] 
ISOCLNS: Filter out non-printable characters

Use fn_printzp().

Moreover:
Delete extra blank lines.

9 years agoVTP: Filter out non-printable characters
Francois-Xavier Le Bail [Tue, 10 Nov 2015 12:28:17 +0000 (13:28 +0100)] 
VTP: Filter out non-printable characters

Use fn_printzp().

Moreover:
Improve some comments.
Use 'type' instead of '*(tptr+1)' when possible.

9 years agoRADIUS: Filter out non-printable characters
Francois-Xavier Le Bail [Mon, 9 Nov 2015 18:53:38 +0000 (19:53 +0100)] 
RADIUS: Filter out non-printable characters

Update a test according to this change.

9 years agoCDP: Filter out non-printable characters
Francois-Xavier Le Bail [Mon, 9 Nov 2015 14:59:58 +0000 (15:59 +0100)] 
CDP: Filter out non-printable characters

Add a fn_print_char() to do filtering.

9 years agoRSVP: Add some bounds checks
Francois-Xavier Le Bail [Fri, 6 Nov 2015 17:55:56 +0000 (18:55 +0100)] 
RSVP: Add some bounds checks

Moreover:
Add and use tstr[] string.

9 years agoISOCLNS: Fix a segmentation fault
Francois-Xavier Le Bail [Wed, 4 Nov 2015 21:51:24 +0000 (22:51 +0100)] 
ISOCLNS: Fix a segmentation fault

Moreover:
Avoid two consecutive truncation messages.

9 years agoKeep our own Ethertype-to-name map.
Guy Harris [Wed, 4 Nov 2015 03:06:41 +0000 (19:06 -0800)] 
Keep our own Ethertype-to-name map.

Don't use a hack to get the table from libpcap; have our own table.
That cleans up the hack, and lets us add stuff to our table without
having to worry about libpcap.

9 years agoMerge pull request #486 from loos-br/master
Guy Harris [Sun, 1 Nov 2015 23:39:46 +0000 (15:39 -0800)] 
Merge pull request #486 from loos-br/master

Fix capsicum support to work with zerocopy buffers in bpf.

9 years agoMissing comma in list of initializers.
Guy Harris [Sun, 1 Nov 2015 21:27:32 +0000 (13:27 -0800)] 
Missing comma in list of initializers.

9 years agoBeginnings of 11ac radiotap support.
Guy Harris [Sun, 1 Nov 2015 19:41:26 +0000 (11:41 -0800)] 
Beginnings of 11ac radiotap support.

9 years agoPRIu64 includes the "u".
Guy Harris [Sat, 31 Oct 2015 17:38:09 +0000 (10:38 -0700)] 
PRIu64 includes the "u".

9 years agoWe need PRIu64 to print a uint64_t.
Guy Harris [Sat, 31 Oct 2015 17:26:06 +0000 (10:26 -0700)] 
We need PRIu64 to print a uint64_t.

9 years agoZeroMQ: avoid code duplication
Denis Ovsienko [Sat, 31 Oct 2015 16:44:22 +0000 (16:44 +0000)] 
ZeroMQ: avoid code duplication

9 years agoCoverity: Build script: Update the upload URL for the framework change
Francois-Xavier Le Bail [Fri, 30 Oct 2015 08:29:13 +0000 (09:29 +0100)] 
Coverity: Build script: Update the upload URL for the framework change

This fix the build submission error.

Moreover:
More sync with the updated default build script.

9 years agoFix some comments
Francois-Xavier Le Bail [Tue, 27 Oct 2015 10:50:07 +0000 (11:50 +0100)] 
Fix some comments

Moreover:
Fix mixed spaces/tabs.

9 years agoISOCLNS: Fix two segmentation faults
Francois-Xavier Le Bail [Sat, 17 Oct 2015 20:25:23 +0000 (22:25 +0200)] 
ISOCLNS: Fix two segmentation faults

Moreover:
Add/fix a lot of bounds and length checks.
Add and use tstr[] string.
Fix some typos.
Update the output of a test according to these changes.

9 years agoFix a test name
Gisle Vanem [Thu, 15 Oct 2015 14:55:22 +0000 (16:55 +0200)] 
Fix a test name

9 years agoFix capsicum support to work with zerocopy buffers in bpf. 486/head
Luiz Otavio O Souza [Wed, 14 Oct 2015 15:05:24 +0000 (10:05 -0500)] 
Fix capsicum support to work with zerocopy buffers in bpf.

Zerocopcy buffers in bpf was broken until recently in FreeBSD and now that
it is fixed, tcpdump is failing with insuficient capabilities when trying to
use the BIOCROTZBUF ioctl.

This commit adds BIOCROTZBUF to the list of allowed ioctls.

9 years agoAdd missing output files for LSP-Ping capture files
Francois-Xavier Le Bail [Tue, 13 Oct 2015 14:31:45 +0000 (16:31 +0200)] 
Add missing output files for LSP-Ping capture files

9 years agoFix the error handling in 'ndo_printf' function
Francois-Xavier Le Bail [Mon, 12 Oct 2015 20:17:01 +0000 (22:17 +0200)] 
Fix the error handling in 'ndo_printf' function

Moreover:
Replace strerror() calls with pcap_strerror() calls, in case some platform
lacks strerror().

9 years agoAdd test files for pcap-ng invalid versions
Francois-Xavier Le Bail [Sat, 10 Oct 2015 16:54:46 +0000 (18:54 +0200)] 
Add test files for pcap-ng invalid versions

9 years agoAdd test files for pcap invalid versions
Francois-Xavier Le Bail [Sat, 10 Oct 2015 16:22:22 +0000 (18:22 +0200)] 
Add test files for pcap invalid versions

9 years agoFix the pcap version in tests/cve2015-0261-crash.pcap
Francois-Xavier Le Bail [Sat, 10 Oct 2015 12:24:41 +0000 (14:24 +0200)] 
Fix the pcap version in tests/cve2015-0261-crash.pcap

It will be always usable with the upcoming libpcap versions sanity checks.
(old version: 12336.12336, new version: 2.4)

9 years agoGet rid of "TCPDUMP" in some libnetdissect codes
Francois-Xavier Le Bail [Thu, 8 Oct 2015 14:36:23 +0000 (16:36 +0200)] 
Get rid of "TCPDUMP" in some libnetdissect codes

9 years agoFix a comment
Francois-Xavier Le Bail [Thu, 8 Oct 2015 14:26:36 +0000 (16:26 +0200)] 
Fix a comment

Moreover:
s/tcpdump/netdissect/

9 years agoUse the nd_uintN_t types more.
Guy Harris [Wed, 7 Oct 2015 07:14:20 +0000 (00:14 -0700)] 
Use the nd_uintN_t types more.

Define them in netdissect.h.

Use them in ip.h, and *don't* mark the structures as UNALIGNED; that
should no longer be necessary.

Add a new nd_ipv4 type to use as an IPv4 address; it represents the 4
bytes of IPv4 address as an array of unsigned chars, so that its natural
alignment is only on a byte boundary.

Those changes found some places where we weren't using
UNALIGNED_MEMCPY() to extract IPv4 addresses from packets; use it.

9 years agoSquelch some "constness casted away" warnings.
Guy Harris [Wed, 7 Oct 2015 05:48:09 +0000 (22:48 -0700)] 
Squelch some "constness casted away" warnings.

9 years agoIntroduce data types to use for integral values in packet structures.
Guy Harris [Tue, 6 Oct 2015 16:41:01 +0000 (09:41 -0700)] 
Introduce data types to use for integral values in packet structures.

They are defined as arrays of bytes, so

1) no padding is inserted before them to put them on natural
   boundaries, so they can be used if the values *aren't* so
   aligned;

2) you have to use EXTRACT_ macros with them - which you should
   be doing *anyway*, to avoid explicitly or implicitly making
   assumptions about byte order or alignment safety on the
   platform for which your code is being built (it'd better work
   when built for little-endian x86 or for big-endian *and*
   strict-alignment-requiring SPARC).

Use them in the LISP (no, not the programming language!) dissector;
UNALIGNED means "this structure is not guaranteed to be aligned as a
whole, so don't generate code that assumes it is", not "this structure's
individual members shouldn't have padding to put them on natural
boundaries", so it's not sufficient to do that.  (Using these types
*might* suffice to ensure that code that assumes alignment not be
generated, but never underestimate SPARC compilers' eagerness to use
single load and store instructions to fetch big-endian 16-bit, 32-bit,
and 64-bit values from packets that really aren't guaranteed to be
aligned.)

9 years agoRSVP: Fix an infinite loop
Francois-Xavier Le Bail [Tue, 6 Oct 2015 14:21:19 +0000 (16:21 +0200)] 
RSVP: Fix an infinite loop

9 years agoFix a trailing tab
Francois-Xavier Le Bail [Mon, 5 Oct 2015 12:41:18 +0000 (14:41 +0200)] 
Fix a trailing tab

9 years agoLISP: Fix a Clang warning
Francois-Xavier Le Bail [Mon, 5 Oct 2015 09:03:15 +0000 (11:03 +0200)] 
LISP: Fix a Clang warning

The warning was:
./print-lisp.c:401:11: warning: variable 'xtr_present' is used uninitialized
      whenever 'if' condition is false [-Wsometimes-uninitialized]
        else if (type == LISP_MAP_NOTIFY)
                 ^~~~~~~~~~~~~~~~~~~~~~~

./print-lisp.c:404:9: note: uninitialized use occurs here
        return xtr_present;
               ^~~~~~~~~~~

Moreover:
Remove unused 'interface.h' include.

9 years agoLISP: We always support IPv6 addresses now
Francois-Xavier Le Bail [Sun, 4 Oct 2015 15:20:21 +0000 (17:20 +0200)] 
LISP: We always support IPv6 addresses now

INET6 is no more used.

9 years agoInitial commit for support of Type 3 and Type 4 LISP packets.
ritsz [Fri, 14 Aug 2015 16:06:52 +0000 (21:36 +0530)] 
Initial commit for support of Type 3 and Type 4 LISP packets.

Fixing Travis CI build for LISP commit

Adding testcases for lisp notify and register

Fixing build warnings

Added ND_TCHECK for relevant headers

Fixing ND_TCHECK2 issues

Adding support for multiple LOC records for same EID entry

Fixing review issues, adding detailed tests

Adding support for verbose outputs

Adding RFC information for UDP PORT defination

Removing Spaces in type names

Print EID record related flags in verbose mode

Using tok2str

Fixing -Wpedantic issues

Negative testcases, Packet structure comments, verbose mode flag printing

Printing Map Version

Print auth_data, decouple type and xtr_present extraction, handle malformed packets correctly

Tests for latest code changes

Printing useful info incase not built with IPv6 support

9 years agoCONTRIBUTING: Index the remarks with letters for later references
Francois-Xavier Le Bail [Fri, 2 Oct 2015 21:47:17 +0000 (23:47 +0200)] 
CONTRIBUTING: Index the remarks with letters for later references

9 years agoWe need -Werror when testing whether -f or -m flags work.
Guy Harris [Tue, 29 Sep 2015 08:15:53 +0000 (01:15 -0700)] 
We need -Werror when testing whether -f or -m flags work.

Thank you, clang, for treating unknown -f flags as warnings, only
failing with them if run with -Werror, and spewing out warning messages
whenever they're used.

9 years agoFix check for MCS field being present.
Guy Harris [Tue, 29 Sep 2015 03:09:53 +0000 (20:09 -0700)] 
Fix check for MCS field being present.

Fix test file while we're at it.

9 years agoUpdate tests for 11n fix.
Guy Harris [Tue, 29 Sep 2015 01:50:40 +0000 (18:50 -0700)] 
Update tests for 11n fix.

9 years agoIf we have the MCS field, it's 11n.
Guy Harris [Tue, 29 Sep 2015 01:19:31 +0000 (18:19 -0700)] 
If we have the MCS field, it's 11n.

Pass print_chaninfo() the presence flags, and, if IEEE80211_RADIOTAP_MCS
is set, report it as 11n, rather than looking at the channel flags to
figure out whether it's FHSS or 11b/11a/11g.

Fix typo while we're at it ("long GI", not "lon GI").

9 years agoMore whitespace cleanup.
Guy Harris [Mon, 28 Sep 2015 23:03:24 +0000 (16:03 -0700)] 
More whitespace cleanup.

9 years agoClean up white space.
Guy Harris [Mon, 28 Sep 2015 23:02:42 +0000 (16:02 -0700)] 
Clean up white space.

9 years agoShuffle some stuff around a bit.
Guy Harris [Mon, 28 Sep 2015 23:01:16 +0000 (16:01 -0700)] 
Shuffle some stuff around a bit.

There were two places with radiotap stuff; move them together.

9 years agoDon't check for libcrypto if we don't have its headers.
Guy Harris [Mon, 28 Sep 2015 07:41:01 +0000 (00:41 -0700)] 
Don't check for libcrypto if we don't have its headers.

Thanks, Apple.

9 years agoClean up some variable names.
Guy Harris [Thu, 24 Sep 2015 22:47:47 +0000 (15:47 -0700)] 
Clean up some variable names.

"devlist" is a pointer to the first in a list of devices; "dev" is a
pointer into that list.

9 years agoMerge pull request #483 from sinic/master
Guy Harris [Thu, 24 Sep 2015 22:06:36 +0000 (15:06 -0700)] 
Merge pull request #483 from sinic/master

Free all and entire lists pcap_findalldevs() returns

9 years agoFree the list of devices after printing it (-D) 483/head
Simon Nicolussi [Thu, 24 Sep 2015 19:45:59 +0000 (21:45 +0200)] 
Free the list of devices after printing it (-D)

It doesn't make much of a difference because of the exit(0) right
afterwards, but prevents Valgrind from complaining about a leak.

9 years agoFree the entire list of devices, not just its tail
Simon Nicolussi [Thu, 24 Sep 2015 19:42:47 +0000 (21:42 +0200)] 
Free the entire list of devices, not just its tail

9 years agoFree up lists we get from pcap_findalldevs().
Guy Harris [Mon, 21 Sep 2015 22:35:42 +0000 (15:35 -0700)] 
Free up lists we get from pcap_findalldevs().

That means we need to make a copy of a name we get from the list.

9 years agoMerge pull request #482 from sinic/master
Guy Harris [Mon, 21 Sep 2015 22:25:58 +0000 (15:25 -0700)] 
Merge pull request #482 from sinic/master

Use pcap_findalldevs() to find the default interface, if available.

This defaults to the correct interface on Windows.

It also means that, if you're unlucky enough to have only a loopback
interface, it'll find that interface.  (This is a feature, not a bug.)

9 years agoDefault to first interface from pcap_findalldevs() 482/head
Simon Nicolussi [Mon, 21 Sep 2015 20:12:20 +0000 (22:12 +0200)] 
Default to first interface from pcap_findalldevs()

Only call (deprecated) pcap_lookupdev() as a last resort, as it doesn't
necessarily agree with pcap_findalldevs() on the order of interfaces and
the -D and -i options already rely upon the latter function's behaviour.

9 years agoDTP: improve packet integrity checks
Denis Ovsienko [Sat, 5 Sep 2015 20:17:30 +0000 (21:17 +0100)] 
DTP: improve packet integrity checks

Adjust the TLV infinite loop check to require the right amount of bytes
for T and L; do it after printing the TLV header so it is easier to
understand what was wrong. Check if the TLV V is within the capture. Use
the new "invalid" exit label to indicate a packet anomaly and add more
checks for the length value into the type-specific case blocks. Print
the domain string with fn_printzp().

9 years agoAdditional Windows cleanups.
Guy Harris [Sat, 19 Sep 2015 00:24:23 +0000 (17:24 -0700)] 
Additional Windows cleanups.

Don't import stuff from WinPcap that it really shouldn't be exporting.

Define HAVE_U_INT{N}_T,to suppress definition of intN_t in bittypes.h, as
included by <pcap/pcap.h> on Windows.

Define HAVE_OS_IPV6_SUPPORT if AF_INET6 is defined, so that if we're
building with a VC+SDK combination that defines it and struct in6_addr,
we don't define them ourselves.

9 years agoEliminate remaining uses of u_int8_t and u_int16_t.
Guy Harris [Fri, 18 Sep 2015 22:15:52 +0000 (15:15 -0700)] 
Eliminate remaining uses of u_int8_t and u_int16_t.

9 years agoEliminate some remaining uses of u_int32_t.
Guy Harris [Fri, 18 Sep 2015 22:11:43 +0000 (15:11 -0700)] 
Eliminate some remaining uses of u_int32_t.

9 years agoWe don't define our own inet_aton() any more, so don't declare it.
Guy Harris [Fri, 18 Sep 2015 20:19:32 +0000 (13:19 -0700)] 
We don't define our own inet_aton() any more, so don't declare it.

9 years agoUpdate Visual Studio files.
Guy Harris [Fri, 18 Sep 2015 19:39:05 +0000 (12:39 -0700)] 
Update Visual Studio files.

Update the list of source files, and the command-line flags (for
example, don't define INET6, as we no longer check it, or WIN32, as we
no longer check it - we check the standard _WIN32 instead).

9 years agoReorganize netdissect.h
Francois-Xavier Le Bail [Fri, 18 Sep 2015 13:14:31 +0000 (15:14 +0200)] 
Reorganize netdissect.h

Group together:
- DLT printers (sorted)
- other printers (sorted)
- utilities

9 years agoRename print_data() to smb_print_data()
Francois-Xavier Le Bail [Fri, 18 Sep 2015 11:04:24 +0000 (13:04 +0200)] 
Rename print_data() to smb_print_data()

9 years agoTravis: The '--disable-ipv6' configure option was eliminated
Francois-Xavier Le Bail [Fri, 18 Sep 2015 10:00:57 +0000 (12:00 +0200)] 
Travis: The '--disable-ipv6' configure option was eliminated

9 years agoDon't require IPv6 library support in order to support IPv6 addresses.
Guy Harris [Thu, 17 Sep 2015 21:56:44 +0000 (14:56 -0700)] 
Don't require IPv6 library support in order to support IPv6 addresses.

Have our own routines to convert between IPv4/IPv6 addresses and
strings; that helps if, for example, we want to build binary versions of
tcpdump for Windows that can run both on NT 5 (W2K/WXP), which doesn't
have inet_ntop() or inet_pton(), and NT 6 (Vista/7/8/10), which do.  It
also means that we don't require IPv6 library support on UN*X to print
addresses (if somebody wants to build tcpdump for older UN*Xes lacking
IPv6 support in the system library or in add-on libraries).

Get rid of files in the missing directory that we don't need, and
various no-longer-necessary autoconf tests.

9 years agoDon't fetch statistics in verbose_stats_dump().
Guy Harris [Thu, 17 Sep 2015 19:59:12 +0000 (12:59 -0700)] 
Don't fetch statistics in verbose_stats_dump().

It only prints *our* (tcpdump's) count of packets seen, so it doesn't
need to fetch statistics from libpcap/WinPcap.

9 years agoRename a variable to avoid collision with stat().
Guy Harris [Thu, 17 Sep 2015 19:23:46 +0000 (12:23 -0700)] 
Rename a variable to avoid collision with stat().

This eliminates a warning with some compilers.

9 years agoRename variable to avoid collision with poll().
Guy Harris [Thu, 17 Sep 2015 19:19:22 +0000 (12:19 -0700)] 
Rename variable to avoid collision with poll().

That eliminates some compiler warnings.

9 years agoUse hex constants so compilers don't whine about negative initializers.
Guy Harris [Thu, 17 Sep 2015 19:17:02 +0000 (12:17 -0700)] 
Use hex constants so compilers don't whine about negative initializers.

9 years agoFix the maximum snaplen value in the man page
Francois-Xavier Le Bail [Thu, 17 Sep 2015 09:13:21 +0000 (11:13 +0200)] 
Fix the maximum snaplen value in the man page

9 years agoInclude ipproto.h to make sure IPPROTO_PIM is defined.
Guy Harris [Thu, 17 Sep 2015 08:48:36 +0000 (01:48 -0700)] 
Include ipproto.h to make sure IPPROTO_PIM is defined.

We use it, but it's not necessarily defined by OS headers; make sure
it's defined, by including our header.

9 years agoThe Option -n is useless in TESTLIST
Francois-Xavier Le Bail [Wed, 16 Sep 2015 21:37:54 +0000 (23:37 +0200)] 
The Option -n is useless in TESTLIST

This option is already set in TESTonce.

9 years agoAdd CONTRIBUTING file
Francois-Xavier Le Bail [Wed, 16 Sep 2015 17:18:56 +0000 (19:18 +0200)] 
Add CONTRIBUTING file

9 years agoNobody uses off_t, either. (ftell(), and pcap_dump_ftell(), return long.)
Guy Harris [Mon, 14 Sep 2015 23:28:37 +0000 (16:28 -0700)] 
Nobody uses off_t, either.  (ftell(), and pcap_dump_ftell(), return long.)

9 years agoWe don't use uint, so no need to define it on Windows.
Guy Harris [Mon, 14 Sep 2015 22:42:18 +0000 (15:42 -0700)] 
We don't use uint, so no need to define it on Windows.

9 years agohdrlen is never > INT_MAX, and we negate it, so make it an int.
Guy Harris [Mon, 14 Sep 2015 22:38:02 +0000 (15:38 -0700)] 
hdrlen is never > INT_MAX, and we negate it, so make it an int.

This squelches some compiler warnings.

9 years agoUse double rather than float.
Guy Harris [Mon, 14 Sep 2015 22:12:28 +0000 (15:12 -0700)] 
Use double rather than float.

That means we can fit a 32-bit integer into a floating-point value
without losing precision.

Also, put in explicit casts when we convert a floating-point value to an
integral value, to suppress compiler warnings.

9 years agoConsistently use float constants.
Guy Harris [Mon, 14 Sep 2015 22:06:33 +0000 (15:06 -0700)] 
Consistently use float constants.

9 years agoMake pduid a u_short consistently.
Guy Harris [Mon, 14 Sep 2015 22:04:12 +0000 (15:04 -0700)] 
Make pduid a u_short consistently.

9 years agoInclude <ctype.h> to make sure we have all the isXXX() functions.
Guy Harris [Mon, 14 Sep 2015 21:50:39 +0000 (14:50 -0700)] 
Include <ctype.h> to make sure we have all the isXXX() functions.

9 years agoDon't rely on uint being defined.
Guy Harris [Mon, 14 Sep 2015 21:37:52 +0000 (14:37 -0700)] 
Don't rely on uint being defined.

9 years agoFix for *pcaps without pcap_create()/pcap_activate().
Guy Harris [Mon, 14 Sep 2015 21:24:38 +0000 (14:24 -0700)] 
Fix for *pcaps without pcap_create()/pcap_activate().

9 years agoGet rid of some unneeded #defines and #includes.
Gisle Vanem [Mon, 14 Sep 2015 19:07:44 +0000 (12:07 -0700)] 
Get rid of some unneeded #defines and #includes.

Those lines are not needed since "netdissect-stdinc.h" has:

#include <winsock2.h>
#include <ws2tcpip.h>

This will ensure <winsock.h> is not included in a later <windows.h>.

SIZE_BUF is not used anywhere AFAICS.

9 years agoRemove non-dissection related fields from struct netdissect_options
Francois-Xavier Le Bail [Mon, 14 Sep 2015 17:19:43 +0000 (19:19 +0200)] 
Remove non-dissection related fields from struct netdissect_options

Remove 'ndo_dlt' and 'ndo_dltname' from netdissect_options, only
used is frontend.
Use instead 'yflag_dlt' and 'yflag_dlt_name' variables in frontend.

Moreover:
Fix style

9 years agoRemove a non-dissection related field from struct netdissect_options
Francois-Xavier Le Bail [Mon, 14 Sep 2015 15:16:26 +0000 (17:16 +0200)] 
Remove a non-dissection related field from struct netdissect_options

Remove 'ndo_immediate' from netdissect_options, only used is frontend.
Use instead 'immediate_mode' variable in frontend.

9 years agoMove if_printer to structure netdissect_options
Francois-Xavier Le Bail [Mon, 14 Sep 2015 13:34:13 +0000 (15:34 +0200)] 
Move if_printer to structure netdissect_options

The structure 'netdissect_options' can hold if_printer.
Thus the structure 'print_info' is useless now.

Moreover:
Delete useless blank lines
Fix indent

9 years agoCall pcap_wsockinit(), not wsockinit(), and print a message if it fails.
Guy Harris [Fri, 11 Sep 2015 18:09:35 +0000 (11:09 -0700)] 
Call pcap_wsockinit(), not wsockinit(), and print a message if it fails.

Get rid of w32_fzs.h while we're at it.

9 years agolibnetdissect code must include 'netdissect.h', not 'interface.h'
Francois-Xavier Le Bail [Fri, 11 Sep 2015 11:22:56 +0000 (13:22 +0200)] 
libnetdissect code must include 'netdissect.h', not 'interface.h'

Moreover:
Remove netdissect.h include in interface.h
Move thiszone declaration in netdissect.h
Update a comment

9 years agoRename 'tcpdump-stdinc.h' to 'netdissect-stdinc.h'
Francois-Xavier Le Bail [Wed, 9 Sep 2015 20:42:38 +0000 (22:42 +0200)] 
Rename 'tcpdump-stdinc.h' to 'netdissect-stdinc.h'

Get the full log via: git log --follow netdissect-stdinc.h

9 years ago'-pedantic' option is supported by Travis, '-Wpedantic' is not
Francois-Xavier Le Bail [Wed, 9 Sep 2015 06:06:39 +0000 (08:06 +0200)] 
'-pedantic' option is supported by Travis, '-Wpedantic' is not

9 years agoCompile with '-Wold-style-definition' in devel mode
Francois-Xavier Le Bail [Wed, 9 Sep 2015 05:42:39 +0000 (07:42 +0200)] 
Compile with '-Wold-style-definition' in devel mode

9 years agoFix incorrect detection of '-Wstrict-prototypes' option
Francois-Xavier Le Bail [Wed, 9 Sep 2015 05:04:28 +0000 (07:04 +0200)] 
Fix incorrect detection of '-Wstrict-prototypes' option

Revert "Simplify AC_LBL_CHECK_COMPILER_OPT a bit."
(commit 43e88cd5b8e9d9d643bbad585743123492452041)

The problem shows itself because 'configure' displays
"checking whether the compiler supports the -Wstrict-prototypes option... no"
even if '-Wstrict-prototypes' option is supported.

Moreover:
Update configure accordingly.
Fix a trailing space.

9 years agoFix warnings as "old-style function definition"
Francois-Xavier Le Bail [Wed, 9 Sep 2015 16:28:02 +0000 (18:28 +0200)] 
Fix warnings as "old-style function definition"

9 years agoUpdate a ndo flag name
Francois-Xavier Le Bail [Wed, 9 Sep 2015 11:26:34 +0000 (13:26 +0200)] 
Update a ndo flag name

Even if frontend/backend separation is ongoing, keep coherence between
option name and flag name at the moment.
Option name is 'm', thus s/ndo_sflag/ndo_mflag/.

9 years agoUpdate a comment
Francois-Xavier Le Bail [Tue, 8 Sep 2015 20:37:54 +0000 (22:37 +0200)] 
Update a comment

9 years agoGet rid of "tcpdump" in some libnetdissect codes
Francois-Xavier Le Bail [Tue, 8 Sep 2015 19:05:46 +0000 (21:05 +0200)] 
Get rid of "tcpdump" in some libnetdissect codes