Commit Graph

54 Commits

Author SHA1 Message Date
Graham Bloice 97546165fa Modify includes of config.h so that out-of-tree builds, i.e. CMake
don't pick up the in-tree copy.

Change-Id: I7ec473876cdba1a025c52362d7f6adc62d24ce71
Reviewed-on: https://code.wireshark.org/review/3798
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2014-08-24 08:04:08 +00:00
Guy Harris 6db77b000f Allow wtap_read() and wtap_seek_read() to return records other than packets.
Add a "record type" field to "struct wtap_pkthdr"; currently, it can be
REC_TYPE_PACKET, for a record containing a packet, or
REC_TYPE_FILE_TYPE_SPECIFIC, for records containing file-type-specific
data.

Modify code that reads packets to be able to handle non-packet records,
even if that just means ignoring them.

Rename some routines to indicate that they handle more than just
packets.

We don't yet have any libwiretap code that supplies records other than
REC_TYPE_PACKET or that supporting writing records other than
REC_TYPE_PACKET, or any code to support plugins for handling
REC_TYPE_FILE_TYPE_SPECIFIC records; this is just the first step for bug
8590.

Change-Id: Idb40b78f17c2c3aea72031bcd252abf9bc11c813
Reviewed-on: https://code.wireshark.org/review/1773
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-24 18:31:25 +00:00
Guy Harris 9e2db542a2 Set the presence flags.
If we're going to stuff a time stamp in there, let's at least indicate
that it's there.

Change-Id: Idc3d4ba5fdc109b21b5c6034906664a763b2ddda
Reviewed-on: https://code.wireshark.org/review/1767
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23 23:24:21 +00:00
Guy Harris a1b1c8bed5 Revert "Refactor Wiretap"
This reverts commit 1abeb277f5.

This isn't building, and looks as if it requires significant work to fix.

Change-Id: I622b1bb243e353e874883a302ab419532b7601f2
Reviewed-on: https://code.wireshark.org/review/1568
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-09 05:21:01 +00:00
Michael Mann 1abeb277f5 Refactor Wiretap
Start of refactoring Wiretap and breaking structures down into "generally useful fields for dissection" and "capture specific". Since this in intended as a "base" for Wiretap and Filetap, the "wft" prefix is used for "common" functionality.

The "architectural" changes can be found in cfile.h, wtap.h, wtap-int.h and (new file) wftap-int.h. Most of the other (painstaking) changes were really just the result of compiling those new architecture changes.

bug:9607
Change-Id: Ife858a61760d7a8a03be073546c0e7e582cab2ae
Reviewed-on: https://code.wireshark.org/review/1485
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-09 03:04:39 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(Using sed : sed -i '/^ \* \$Id\$/,+1 d')

Fix manually some typo (in export_object_dicom.c and crc16-plain.c)

Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04 14:27:33 +00:00
Bill Meier 6b4944eced Follow convention for -h option:
Output to stdout & then exit(0).
Add editor modelines.

svn path=/trunk/; revision=54513
2013-12-31 16:17:09 +00:00
Guy Harris 853da2eb9b The "file types" we have are actually combinations of types and
subtypes, e.g. Network Monitor version 1 and Network Monitor version 2
are separate "file types", even though they both come from Network
Monitor.

Rename various functions, #defines, and variables appropriately.

svn path=/trunk/; revision=53166
2013-11-08 09:53:01 +00:00
Chris Maynard c2a54d11d0 Trivial change so all longnames are aligned.
svn path=/trunk/; revision=49417
2013-05-19 15:12:01 +00:00
Gerald Combs bd4cffae58 When any of our executables start on Windows create or open a "Wireshark
is running" mutex. Have the NSIS installer check for this mutex and ask
the user to close Wireshark if it's found. While not perfect this makes
the WinSparkle update process much less annoying.

svn path=/trunk/; revision=47758
2013-02-20 01:19:42 +00:00
Jakub Zawadzki 78631020b8 Add wtap_pseudo_header union to wtap_pkthdr structure.
Use pkthdr instead of pseudo_header as argument for dissecting.

svn path=/trunk/; revision=45601
2012-10-16 21:50:57 +00:00
Jeff Morriss 3551a86c36 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45015
2012-09-20 01:29:52 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Jeff Morriss bf95c7b5e4 Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5608 :
getopt() can/should normally be found in unistd.h, so:

- When testing for getopt(), define that we HAVE_GETOPT instead of
  HAVE_GETOPT_H (to avoid confusion).
- Don't attempt to include getopt.h: not all OS's have it (for example,
  Solaris 9 does not).
- (All the places which need getopt already include unistd.h (if we have it).)

If this breaks things on some OS, we might need (a real) HAVE_GETOPT_H check.

svn path=/trunk/; revision=38437
2011-08-09 21:02:10 +00:00
Stig Bjørlykke 8443bbbf75 Replace all strerror() with g_strerror().
Remove our local strerror implementation.
Mark strerror as locale unsafe API.

This fixes bug 5715.

svn path=/trunk/; revision=37812
2011-06-28 09:00:11 +00:00
Stig Bjørlykke 30c6c1fb9d Use ws_open/ws_read to avoid prohibited APIs.
Close file handle after usage.

svn path=/trunk/; revision=37769
2011-06-23 13:51:26 +00:00
Gerald Combs a24687ce8e Move the Windows argument list conversion code to a common routine.
svn path=/trunk/; revision=37372
2011-05-24 00:07:56 +00:00
Gerald Combs 3bc1fc3802 On Windows, convert all of our command-line arguments from UTF-16 to
UTF-8 where we don't already do so. In Wireshark use g_utf16_to_utf8
instead of utf_16to8. This should fix bug 5520.

svn path=/trunk/; revision=35411
2011-01-06 23:28:58 +00:00
Jeff Morriss 47e2d75820 Move some code (including the optional objects) into libwsutil
svn path=/trunk/; revision=33012
2010-05-28 20:19:55 +00:00
Gerald Combs 066dd47c52 Use /dev/urandom (which is non-blocking) instead of /dev/random (which
can block forever) for our seed. This fixes a problem with our new Linux
build slave, which is running Linux 2.6 as a VM guest, and which was
timing out waiting for entropy.

Add a comment about using CryptGenRandom on Windows.

svn path=/trunk/; revision=31456
2010-01-06 17:18:57 +00:00
Stig Bjørlykke 98024a007f Invert check for getopt: NEED_GETOPT_H -> HAVE_GETOPT_H
Rename getopt.[ch] -> wsgetopt.[ch] to avoid name collision.

svn path=/trunk/; revision=30370
2009-10-06 16:01:18 +00:00
Gerald Combs 82b0574415 From Márton Németh via bug 2137:
Currently the randpkt random packet generator does not have support to
generate WTAP_ENCAP_USB and WTAP_ENCAP_USB_LINUX type packets.

svn path=/trunk/; revision=28388
2009-05-17 21:41:23 +00:00
Gerald Combs 9b3a726bef Make "-h" a valid flag.
svn path=/trunk/; revision=26799
2008-11-17 21:46:57 +00:00
Guy Harris 64612f34ac On non-Windows systems, try /dev/random and, if it exists, use it,
otherwise fall back on time().

Print error messages to stderr, and put the name of the program in them.
Exit with 1 on command-line syntax errors, 2 on other errors.

Fix indentation.

svn path=/trunk/; revision=26661
2008-10-31 20:11:14 +00:00
Stig Bjørlykke 841e3a0a3f Fixed some "ignoring return value" warnings.
This is the last commit to make it compile clean on Ubuntu 8.10.

svn path=/trunk/; revision=26654
2008-10-31 17:43:51 +00:00
Gerald Combs a491fec183 From Mike Harvey: Support for WiMAX and the WiMAX M2M encapsulation protocol.
Add support for WiMAX and M2M to various makefiles and installer files.  Add
basic support for M2M to randpkt.

svn path=/trunk/; revision=21945
2007-05-25 23:40:42 +00:00
Gilbert Ramirez 1c57b51e9e Check for NULL return value from wtap_dump_open().
Fixes coverity bug 159.

svn path=/trunk/; revision=18005
2006-04-26 17:31:56 +00:00
Ulf Lamping 84cf7ce767 added compression support for capture file output. The Save/As dialog now has a checkbox "Compress with gzip"
currently limited to Ethereal and all the variants of libpcap filetypes only.

We might want to add output compression support to the other tools as well (tethereal, mergecap, ...).

We might also want to add support for the other filetypes, but this is only possible if the filetype functions doesn't use special output operations like fseek.

One bug is still left: if the input and output filetypes while saving are the same, Ethereal currently optimizes this by simply copy the binary file instead of using wiretap (so it will be faster but it will ignore the compress setting). 

Don't know a good workaround for this, as I don't know a way to find out if the input file is currently compressed or not. One idea might be to use a heuristic on the filesize (compared to the packet size summmary). Another workaround I see is to remove this optimization, which is of course not the way I like to do it ...

svn path=/trunk/; revision=15804
2005-09-14 21:57:30 +00:00
Guy Harris 72e862b129 The time stamp in a Wiretap packet header is now a wtap_nstime, not a
"struct timeval".

svn path=/trunk/; revision=15522
2005-08-24 23:53:40 +00:00
Gerald Combs db5add1cc3 From Brice Augustin: Use the correct packet length in randpkt.
Build randpkt.exe by default under Windows.

svn path=/trunk/; revision=15092
2005-07-26 16:54:08 +00:00
Jörg Mayer 30a8557868 More 'char*' -> 'const char*' changes to fix warnings.
svn path=/trunk/; revision=15015
2005-07-23 11:41:25 +00:00
Gerald Combs 573c77f51f Add SCTP and MEGACO types, so that we can add SCTP to the "random" test.
svn path=/trunk/; revision=13931
2005-03-27 04:43:49 +00:00
Gerald Combs 73163bf8c5 Insert "%s" at various points in an attempt to trigger format string bugs.
svn path=/trunk/; revision=13792
2005-03-17 16:06:20 +00:00
Gerald Combs eadb365e2a For UDP output, set the length to 65535 instead of 0.
svn path=/trunk/; revision=13768
2005-03-16 16:44:06 +00:00
Guy Harris 8a8b883450 Set the svn:eol-style property on all text files to "native", so that
they have LF at the end of the line on UN*X and CR/LF on Windows;
hopefully this means that if a CR/LF version is checked in on Windows,
the CRs will be stripped so that they show up only when checked out on
Windows, not on UN*X.

svn path=/trunk/; revision=11400
2004-07-18 00:24:25 +00:00
Jörg Mayer 75456a5bbe Remove a comma at end of enum
svn path=/trunk/; revision=10198
2004-02-23 14:37:59 +00:00
Gerald Combs b823ff306a Clean up the TDS dissector a bit. Change a lot of signed ints to
unsigned, and set their size to match the protocol data assigned to
them.  Make sure the number of columns read doesn't exceed MAX_COLUMNS.
Explicitly check for integer values > 0.  Switch from using memcpy with
tvb_get_ptr to tvb_memcpy.  Make indentation consistent.

Add TDS support to randpkt.  Most of the generated packets won't pass
the heuristic checks, but enough should make it through to adequately
test the dissector.

svn path=/trunk/; revision=6653
2002-11-17 21:47:41 +00:00
Gerald Combs e0cf132365 Add support for building randpkt under Windows.
svn path=/trunk/; revision=6433
2002-10-16 14:45:27 +00:00
Gerald Combs 9afeafe88e Fix signed/unsigned type mismatches, as pointed out by Silvio.
Add BGP output to randpkt.

svn path=/trunk/; revision=6420
2002-10-15 02:29:54 +00:00
Jörg Mayer 7c4176d868 Removed trailing whitespaces from .h and .c files using the
winapi_cleanup tool written by Patrik Stridvall for the wine
project.

svn path=/trunk/; revision=6117
2002-08-28 21:04:11 +00:00
Gerald Combs 0d33d7280f Add initial support for GIOP.
svn path=/trunk/; revision=5501
2002-05-18 14:58:00 +00:00
Guy Harris 309e86246e From Peter Valchev: fix editcap to assign the result of "getopt()" to an
"int" and to check "getopt()"s return value with -1 rather than EOF.

Fix other "getopt()" loops to check against -1 as well (EOF is -1 on
most if not all platforms, but the Single UNIX Specification says
"getopt()" returns -1, so we should check against -1, not EOF).

svn path=/trunk/; revision=4793
2002-02-24 01:26:45 +00:00
Gilbert Ramirez 558d570073 Add ncp2222 as a type of packet than randpkt can produce.
If type passed in with -t option is unknown, die instead of using
Ethernet as a default.

svn path=/trunk/; revision=4737
2002-02-14 17:45:07 +00:00
Gilbert Ramirez f14a6b8b91 Hopefully the last time I have to change my e-mail address.
svn path=/trunk/; revision=4199
2001-11-13 23:55:44 +00:00
Guy Harris 9c1502e3e0 BACNET support, from Hartmut Mueller.
svn path=/trunk/; revision=3214
2001-03-31 10:13:13 +00:00
Gilbert Ramirez c312f69abc Make sure to pass the sent/received direction from pppdump.c in
pseudo_header.
Use generic "p2p_phdr" instead of "lapd_phdr". Modify toshiba.c and
packet-lapd.c to take that into account.
Add frame.p2p_dir, a filterable field, 0=sent, 1=recvd
Make p2p_dir available in packe_info, as I think it will be needed
in VJ COMP and UNCOMP dissection.

Rename WTAP_ENCAP_TR to WTAP_ENCAP_TOKEN_RING.

Mention pppd-log support in man page.
Mention atmsnoop in README.

svn path=/trunk/; revision=2455
2000-09-21 04:41:37 +00:00
Gerald Combs 1d97f13307 Add syslog support to randpkt.
Fix problems revealed by randpkt, add OS-specific info.

svn path=/trunk/; revision=2056
2000-06-11 15:54:03 +00:00
Gilbert Ramirez d7e6e0e384 Add wtap-int.h. Move definitions relevant to the internal workins of wiretap
to that file, leave public definitions in wtap.h.

Rename "union pseudo_header" to "union wtap_pseudo_header".
Make the wtap_pseudo_header pointer available in packet_info struct.

svn path=/trunk/; revision=1989
2000-05-19 23:07:04 +00:00
Gilbert Ramirez c43db40dc1 Use new-style wtap_dump().
svn path=/trunk/; revision=1978
2000-05-19 02:42:16 +00:00
Guy Harris db5f4239dc Add NBNS support.
svn path=/trunk/; revision=780
1999-10-07 07:55:12 +00:00