Commit Graph

257 Commits

Author SHA1 Message Date
Guy Harris
6779fd3ba7 Rename configure.in to configure.ac.
This matches what was done with libpcap; it's what autoconf prefers.
2017-11-30 10:20:37 -08:00
Guy Harris
de0c7fc746 Fix mkdep invocations.
CC is not guaranteed to be space-free; quote it.

DEPENDENCY_CFLAG is also not guaranteed to be space-free; quote it.
2017-11-28 22:06:37 -08:00
Ali Abdulkadir
2db7506730 add new files as dist targets 2017-10-24 08:17:28 +03:00
Ali Abdulkadir
18568bc044 Made up for missing getservent() and endservent() 2017-10-24 08:11:33 +03:00
Guy Harris
4943adfb5f Do the version number the way it's now done for libpcap.
Use the two-argument version of AC_INIT() - which requires autoconf 2.64
or later, so require that as a minimum - and get the version string from
the VERSION file.  Use AC_CONFIG_SRCDIR() to say that the source
directory needs tcpdump.c; the two-argument version of AC_INIT() doesn't
do that.

This means that we no longer have a version.c file.
2017-10-16 14:31:14 -07:00
Guy Harris
fdd0467bcd On UN*X, always use sigaction(), and always have signal handlers return void.
Some time between the mid 1980's and 1990 called; they want their
old-fashioned UNIX signal handling back.  ANSI C has had signal handlers
returning void sincer, well, 1989, and POSIX has had sigaction() since
close to forever.  No need to worry about really old UN*Xes here.

On Windows, it's also void (as per ANSI C); use signal().
2017-10-15 22:36:07 -07:00
Guy Harris
141c1c6f49 Suppress UBSan warnings from EXTRACT_.
Yes, the behavior of an access with an improperly-aligned pointer is
undefined according to the C standard, but if we're doing that in an
EXTRACT_ function/macro, we're doing it because we know it's safe and
because it's faster than picking the bytes out one by one and assembling
them, so suppress those warnings.

Pull over libpcap's funcattrs.h and use it to do a bunch of checks for
various function attributes; that defines __has_attribute(), so we can
use it to check for the "suppress sanitizer warnings" attribute.

While we're at it, use other things it defines to specify "this function
never returns", "this function is printf-like", and "this function
argument is a printf-style format argument", rather than using various
configure-script checks.  That should let us declare some function
attributes with Microsoft Visual Studio's compilers.
2017-08-18 20:11:43 -07:00
Francois-Xavier Le Bail
5b81f98410 Add a target in Makefile.in for Exuberant Ctags use
The target name is 'extags'.
Exuberant Ctags has no -d, -t options and -w is ignored.

Moreover:
Remove a non-existent file in TAGHDR to avoid an error on Debian:
make: *** No rule to make target '/usr/include/net/slip.h',
needed by 'extags'.
2016-10-21 10:23:02 +02:00
Francois-Xavier Le Bail
e353c59542 Add missing files in Makefile.in (EXTRA_DIST) 2016-10-20 13:25:48 +02:00
Francois-Xavier Le Bail
371a55f441 Add missing files in Makefile.in (EXTRA_DIST) 2016-10-17 22:32:50 +02:00
Guy Harris
91e08f888d Move some code around.
Move stuff to initialize and clean up libraries that are used by
netdissect code into nd_init() and nd_cleanup() routines in
libnetdissect; this includes Winsock (which is used on Windows by, for
example, the code to get names for IP addresses) and libsmi.

Call nd_init() when tcpdump starts up, and call nd_cleanup() when it
exits.

Move util.c routines to tcpdump.c, and make them static.

Use ndo->ndo_error to report a failure to open a file in print-esp.c.
2016-08-04 13:19:57 -07:00
Jean-Raphaël GAGLIONE
75b7aeef9c Printer for HNCP (RFCs 7787 and 7788).
This is joint work with Antonin Décimo.
2016-07-28 21:09:41 +02:00
Andrew Darqui
fc213645d4 Initial support for the REdis Serialization Protocol known as RESP.
This commit adds support for RESP as defined in: http://redis.io/topics/protocol.
It also supports inline commands and pipelining. Due to the popularity of RESP,
numerous services are emerging that use this protocol. You may decode RESP packets
on arbitrary ports using the "-T resp" option.

Example captures can be found in tests/resp_*.

A simple way to test this parser is to start redis-server and then run
redis-cli commands such as "redis-cli set key value".

Traditionally, redis-cli monitor is used to debug redis. Unfortunately,
the "monitor" command can cause significant load on a redis-server in
production. This parser may be used as a non-invasive alternative to
redis-cli monitor.
2016-04-26 11:00:21 +02:00
Francois-Xavier Le Bail
f0b959c53e Restore alphabetical order in Makefile.in and netdissect.h 2016-03-22 17:23:40 +01:00
bugyo
ba8a8cd5a3 Add printing function for Generic Protocol Extension for VXLAN
and Network Service Header.

This code stands for following internet drafts:

- VXLAN GPE: draft-ietf-nvo3-vxlan-gpe-01
- NSH: draft-ietf-sfc-nsh-01
2016-03-22 16:59:03 +01:00
ritsz
823644a72d 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
2015-10-04 12:47:13 +02:00
Guy Harris
11f73ad248 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.
2015-09-17 14:56:44 -07:00
Guy Harris
4c19cf87e5 Call pcap_wsockinit(), not wsockinit(), and print a message if it fails.
Get rid of w32_fzs.h while we're at it.
2015-09-11 11:09:35 -07:00
Francois-Xavier Le Bail
99c91c3aec Rename 'tcpdump-stdinc.h' to 'netdissect-stdinc.h'
Get the full log via: git log --follow netdissect-stdinc.h
2015-09-10 08:50:40 +02:00
Francois-Xavier Le Bail
9d6b61de38 Fix display of timestamps with -ttt and -ttttt options
- Fix display of some nanoseconds timestamps
For example, bad print 00:-16:-2.000851566 is now 00:00:00.037851566

- Fix display of timestamp of a packet when it is lower than previous one
For example, bad print 00:00:-1.000999790 is now -00:00:00.000000210
2015-07-02 19:14:49 +02:00
Guy Harris
3dd9240cc3 Do case-insensitive comparisons assuming ASCII strings.
Do the case-insensitive comparisons in a locale-independent fashion that
only maps ASCII letters, in the standard English-language fashion; that
way, we don't get bitten by, for example, Turkish having separate "i
with dot" and "i without dot" letters, with lower-case "i with dot" being
mapped to upper-case "I with dot" rather than being mapped to "I".
2015-06-11 15:47:44 -07:00
Guy Harris
9614e9389e Make sure print.h shows up in the release tarball. 2015-04-26 18:04:26 -07:00
Andrew Lunn
d729eb478e Add support for the Marvell Extended Distributed Switch Architecture header
This header can be used with Marvell switches to direct packets in/out
of a specific port in a tree of interconnected switches. The header
uses its own Ethertype of 0xdada.

By default, only brief output is printed, showing the switch device,
port, and vlan the packet is to/from. However if -e is given, to print
the link-level header, all fields are printed.
2015-04-25 22:44:15 +02:00
Brooks Davis
115a063589 Disentangle packet dissection functionally in tcpdump from the internal
libnetdissect.  This greatly narrows the public interface and allows
libnetdissect to be more easily sandboxed.
2015-04-15 18:52:33 +00:00
Brooks Davis
7f17c777dc Move functions in util.c that are used in the dissectors into a
util-print.c.  The remaining functions are used only in the frontend.
2015-04-15 18:52:33 +00:00
Denis Ovsienko
ba05b1bf39 merge atmuni31.h into print-atm.c 2015-04-14 11:35:43 +01:00
Francois-Xavier Le Bail
d9fd6ef243 Makefile.in: delete a duplicated line 2014-11-17 11:16:09 +01:00
Jesse Gross
e240710e25 Add support for Generic Network Virtualization Encapsulation (Geneve).
Defined in http://tools.ietf.org/html/draft-gross-geneve-02
2014-11-05 21:44:29 -08:00
Guy Harris
b83e04bd09 Add a routine to print "text protocols", and add FTP/HTTP/SMTP/RTSP support.
"Text protocols" are protocols that have the general feel of FTP, with
command lines with a command name and space-separated arguments and
response lines beginning with a 3-digit reply code.  They can also
include HTTP-style headers and an entity body.

We add support for the FTP control channel, HTTP, SMTP, and RTSP.  We
also change the SIP printer to use it.
2014-10-19 11:21:44 -07:00
Guy Harris
a6f81d534d Leave it up to ip6_print() to handle non-IPv6-capable systems.
Always define and declare ip6_print(), always compile print-ip6.c, and
always call it if we recognize a payload as IPv6.  If INET6 isn't
defined, ip6_print() will just print the length and note that printing
isn't supported.

That way, we don't do weird dissection of IPv6 packets on systems
without IPv6 support, due to, for example, ethertype_print() returning 0
("not dissected") for IPv6 packets on those systems (IPv6-over-Frame
Relay was dissected weirdly due to this).
2014-10-01 15:32:11 -07:00
Denis Ovsienko
02a01bbaae merge bootp.h into print-bootp.c 2014-08-13 19:06:25 +01:00
Denis Ovsienko
35043f3507 AoE: add version 1 decoder (GH #298)
The sample capture was produced with two Linux hosts (aoetools version
36, kernel module version 85, vblade version 21). One of the hosts
exported a 1MB block device containing a freshly created filesystem and
the other mounted it, wrote a small file and then unmounted.
2014-05-04 20:48:03 +04:00
Guy Harris
a0ec52b035 We no longer have win32/Include/errno.h. 2014-05-02 14:23:03 -07:00
Guy Harris
2ff7ca8e01 Rename our getopt.h to getopt_long.h.
That way, if we *do* have getopt_long(), we don't end up including our
getopt.h rather than the system's getopt.h.
2014-05-01 17:33:46 -07:00
Guy Harris
6b9e3a5a85 Use getopt_long().
This requires us to check for it in the configure script and to include
a version of getopt_long() for the benefit of platforms that don't have
it; we pick up the FreeBSD version and tweak it a bit (eliminating some
features specific to the BSD version of getopt_long(), as we want to use
it only in a fashion portable to Linux/*BSD/Solaris/etc.)

We also get rid of the version of getopt() we supply for Windows in
favor of the version of getopt_long() we provide.
2014-04-30 15:28:06 -07:00
Guy Harris
dbddfda2c8 More getting rid of old u_intN_t. 2014-04-23 00:45:13 -07:00
Vyacheslav Trushkin
a97e56cb11 M3UA support added (GH #342)
SCTP's payload protocol identifiers added.

M3UA tests provided by wireshark
http://wiki.wireshark.org/SampleCaptures#Sigtran_Protocol_Family
But RFC4666 tells that parameter 0x0002 aren't carried by M3UA, so
it's OK that tcpdump doesn't know about this identifier.

Conflicts:
	Makefile.in
	interface.h
	print-sctp.c
	sctpConstants.h

-----------------------------------------------------------------------
The change to sctp_print() does three things:
* makes detection of ForCES consider PPID, not just port number
* verifies chunk length of all SCTP_DATA chunks, not just of ForCES
* adds PPID-specific dispatching with a particular case of M3UA

-- Denis
2014-04-21 18:53:40 +04:00
Denis Ovsienko
a20d558376 merge decnet.h into print-decnet.c 2014-04-02 12:28:24 +04:00
Guy Harris
75abb8218e Add support for Apple's DLT_PKTAP. 2014-03-30 13:29:51 -07:00
Denis Ovsienko
9eb56b6235 NDOize BGP decoder 2014-03-26 19:50:33 +04:00
Francois-Xavier Le Bail
1943325f56 Makefile.in: add strdup.o target ; remove getaddrinfo.o nonexistent target 2014-03-25 10:41:50 +01:00
Francois-Xavier Le Bail
6c78ecd7a8 Makefile.in: 'distclean' target: add files and directories to remove 2014-03-17 16:26:02 +01:00
Denis Ovsienko
b011ece874 remove unused print-netbios.c
The file had no purpose as the draft code in it wasn't compiled.
2014-03-04 13:31:52 +04:00
Denis Ovsienko
31892539e3 dismiss decode_prefix.h
The only purpose of that header file was to provide two declarations
that now fit interface.h same well.
2014-02-26 16:38:53 +04:00
Guy Harris
35d9d59de0 We don't use missing/sockstorage.h, so get rid of it. 2014-01-17 12:52:22 -08:00
Denis Ovsienko
cae43a9b0c clean LIBNETDISSECT_SRC definition up
Use one file per line syntax and sort the files by name.
2014-01-17 11:52:54 +04:00
Guy Harris
3b149607b9 Use AC_CHECK_TOOL to find ar.
On some platforms, such as at least some versions of HP-UX, AR isn't
automatically set by make.
2014-01-16 14:40:46 -08:00
Denis Ovsienko
db8077a114 add a decoder for Loopback/CTP
tcpdump used to print an empty line for a Loopback (CTP) packet, which
many Cisco switches send by default every 10 seconds. This commit adds
a decoder for the protocol and a test case, which uses the sample
capture from Wireshark wiki (configuration_test_protocol_aka_loop.pcap).
2014-01-09 16:59:33 +04:00
Guy Harris
1e506551d1 Include rpl.h in the tarball. 2014-01-08 15:21:40 -08:00
Denis Ovsienko
fe3253b9b8 remove tcpdump's own CVS keywords
Remove lots of $Header's and a few $Id's that all belong to the former
CVS repository of tcpdump itself. These keywords have been frozen since
the migration to git in late 2008.
2014-01-03 00:59:08 +04:00