Commit Graph

137 Commits

Author SHA1 Message Date
Ulf Lamping 45c8c7a843 fix MSVC warnings of / and set CFLAGS to block new warnings
svn path=/trunk/; revision=21098
2007-03-21 23:14:23 +00:00
Anders Broman f68d6e4c8c Ethereal->Wireshark
svn path=/trunk/; revision=18235
2006-05-28 20:28:20 +00:00
Ronnie Sahlberg 89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +00:00
Guy Harris 4ed66d9779 "help()" really just prints a usage message; it's not a full-blown help
system.  Just call it "usage()".

Also, it doesn't use the "progname" argument - it doesn't need to, it's
text2pcap-specific, and it prefers to call it "Text2pcap" anyway (and,
besides, argv[0] might well be a pathname).  Get rid of that argument.

Fix some white space.

svn path=/trunk/; revision=17431
2006-03-01 00:11:16 +00:00
Ulf Lamping 7a0e7d12d2 update usage text
svn path=/trunk/; revision=16999
2006-01-11 10:14:32 +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
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
Michael Tüxen ef36256855 fix a typo in the help text.
svn path=/trunk/; revision=11311
2004-07-04 17:36:53 +00:00
Guy Harris 5887d3d5f9 Add some sanity checking for the "-i" argument.
svn path=/trunk/; revision=9573
2004-01-06 02:58:20 +00:00
Ulf Lamping 0d9679de8d removed some MSVC warnings (level 3)
svn path=/trunk/; revision=9561
2004-01-05 19:31:44 +00:00
Jörg Mayer 3f020f582e Compiling with -pedantic:
warning: comma at end of enumerator list

svn path=/trunk/; revision=9383
2003-12-21 04:31:58 +00:00
Guy Harris 6df423d0be From Matthijs Melchior:
-  added option -m to set maximum packet length
-  added option -T to generate TCP headers
-  UDP headers now have a correct checksum
-  default capture timestamp is current time, usec field counts packets
-  UDP and TCP headers are mutually exclusive
-  changed etherenet addresses, now sends from 1 -> 2 ....

svn path=/trunk/; revision=7571
2003-04-27 00:41:52 +00:00
Guy Harris 1697aac429 From Jason Copenhaver: put the address fields in the Ethernet header in
the right order.

svn path=/trunk/; revision=7208
2003-02-27 02:31:00 +00:00
Guy Harris 0bba015d3e Don't use "unsigned long" when you mean "unsigned 32-bit integer", as
"unsigned long" is an unsigned *64-bit* integer on many platforms.

While we're at it, use "guint8" rather than "unsigned char" for
"unsigned 8-bit integer", and use "guint16" rather than "unsigned short"
for "unsigned 16-bit integer".

Make the seconds field of a libpcap time stamp signed, as it's supposed
to be.

svn path=/trunk/; revision=6445
2002-10-17 20:02:00 +00:00
Jörg Mayer 6859b2caa6 Increase addr outside of macro
svn path=/trunk/; revision=6393
2002-10-10 01:45:25 +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
Jörg Mayer 173fe5aef4 Replace the types from sys/types.h and netinet/in.h by their glib.h
equivalents for the toplevel directory. The removal of winsock2.h will
hopefully not cause any problems under MSVC++, as those files using
struct timeval still include wtap.h, which still includes winsock2.h.

svn path=/trunk/; revision=5932
2002-08-02 23:36:07 +00:00
Guy Harris 73a4f43644 "yyin" is from lex/flex, so it should be "extern", not "static" - we
have to modify lex/flex's input stream, not some private "FILE *".

Fix up the usage message to:

	mention the "-h" flag;

	not mention the non-existent "-w" flag;

	fit within 80 columns.

Add "-h" to the list of options in the "getopt()" call, as there's code
to support it, and remove "-r" and "-w", as there wasn't any code to
support them.

svn path=/trunk/; revision=5899
2002-07-21 20:27:30 +00:00
Guy Harris e0dc69929e From Joerg Mayer:
Replace our own definitions of TRUE/FALSE by their glib.h
	equivalents.  Put sys/types.h into ifdefs.

svn path=/trunk/; revision=5880
2002-07-15 20:57:13 +00:00
Guy Harris ac444e6b9d From Joerg Mayer: add some missing static declarations.
svn path=/trunk/; revision=5806
2002-06-30 20:28:54 +00:00
Guy Harris 73ef5a2753 WinPcap 2.3's <pcap.h> includes <packet32.h>, and WinPcap 2.3's
<packet32.h> includes <winsock2.h>; we include that rather than
<winsock.h>, to avoid errors due to conflicting declarations in
<winsock.h> and <winsock2.h>.

svn path=/trunk/; revision=5742
2002-06-23 10:32:36 +00:00
Guy Harris 693bcba7cb From Michael Tuexen:
- support for current SCTP checksum
	- fix a bug for the -S parameter
	- fix a bug in the displayed output for the TSN and PPI.

svn path=/trunk/; revision=5169
2002-04-15 21:53:55 +00:00
Guy Harris c3b66ffa9c From Michael Tuexen:
The -S option has been changed such that the payload protocol
	identifier can be specified instead of the verification tag.

	The error messages for -s -S have been corrected.

Update the text2pcap man page to reflect the "-S" change.

svn path=/trunk/; revision=5150
2002-04-13 18:36:24 +00:00
Guy Harris 7b4403d361 Try defining just _USE_XOPEN and see if that gets "strptime()" declared
on most platforms; it works on Solaris, at least.

svn path=/trunk/; revision=4630
2002-01-30 10:19:44 +00:00
Guy Harris e6f24ee951 Alas, on Solaris, defining _XOPEN_SOURCE causes some things not in the
X/Open specs *not* to be defined, so we also have to define
__EXTENSIONS__.

XXX - can we just define __USE_XOPEN, and not define _XOPEN_SOURCE? Is
that sufficient to get "strptime()" declared on all platforms?

svn path=/trunk/; revision=4629
2002-01-30 10:10:03 +00:00
Gilbert Ramirez 147b9e8d52 Use:
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 500
#endif
#define __USE_XOPEN
#include <time.h>

to get strptime() declared in time.h on various systems. I hope
this helps more than it hurts.

svn path=/trunk/; revision=4624
2002-01-29 22:57:31 +00:00
Guy Harris 33a5bc4772 From Hamish Moffatt: set the year to 1970 before parsing the date, in
case there's no date specified.

Set the day-of-month to 1, as well, and set the "is DST" flag to "not
known", i.e. -1.

svn path=/trunk/; revision=4602
2002-01-23 08:35:17 +00:00
Guy Harris 287425df9c From Michael Tuexen:
put a CRC32C checksum into the header of SCTP packets;

	add a new "-S" option that is similar to "-s" but that also
	includes the DATA chunk header, for input files that contain
	only SCTP payloads.

svn path=/trunk/; revision=4580
2002-01-20 22:36:03 +00:00
Guy Harris 4deaae7705 SCTP support in text2pcap, and fix to usage message for "-u", from
Michael Tuexen.

Documentation of SCTP support in text2pcap, from me.

svn path=/trunk/; revision=4553
2002-01-16 21:05:10 +00:00
Guy Harris 3ee8a76475 Fix the usage message and man page for text2pcap.
svn path=/trunk/; revision=4254
2001-11-24 08:59:39 +00:00
Guy Harris c871a24514 Support for time stamping packets in text2pcap, from Gordon McKinney.
svn path=/trunk/; revision=4252
2001-11-24 08:14:12 +00:00
Guy Harris 73fc903278 Fix the return value of a routine.
svn path=/trunk/; revision=4251
2001-11-24 07:55:07 +00:00
Guy Harris f84bce97cc If the expected "next offset" doesn't match the offset we read, it may
merely mean that we mistakenly treated stuff from the text-dump part of
the file we're reading as if it were hex byte data (e.g., if the first
non-white-space part of the text dump was a 2-digit hex number).  If the
offset we read is less than the expected next offset, assume that's the
problem, and throw away enough extra bytes to make the offset we read
the expected next offset.

"getopt()" will never, for any option that the "getopt()" string says
takes an argument, leave "optarg" null; if no argument was specified,
it'll return an error, so there's no need to check for a null "optarg".

svn path=/trunk/; revision=4250
2001-11-24 07:52:05 +00:00
Guy Harris 97a90e0f6c "getopt()" doesn't support multiple option arguments to a flag; have
"-u" take a single argument with two port numbers separated by a comma.

svn path=/trunk/; revision=3802
2001-08-01 03:22:15 +00:00
Guy Harris f7b50ca754 From Joerg Mayer:
* gcc 3.0 warning fixes:
  - text2pcap.c: The number of characters to scan should probably not be 0
  - wiretap/csids.c: using preincrement on a variable used on both
    sides of an assignment might be undefined by the C99(?) standard
 * turn on additional warnings for epan and wiretap too
  - epan/configure.in
  - wiretap/configure.in
 * Fix some warnings (missing includes, signed/unsigned, missing
    initializers) found by turning on the warnings
  - all other files :-)

svn path=/trunk/; revision=3709
2001-07-13 00:55:58 +00:00
Guy Harris 1caea2c361 Build text2pcap on Windows.
Fix text2pcap.c so that it can be compiled with Microsoft Visual C++
6.0:

	protect some includes with #ifdefs, as not all the header files
	in question exist in the MSVC++ build environment;

	include <winsock.h> if we have it, to declare "ntohs()" and the
	like;

	include "getopt.h" if we need it, to declare stuff for
	"getopt()";

	include "config.h" if we have it, so we know whether the header
	files in question exist or are needed;

	rename "BYTE" to "READ_BYTE", as <winsock.h> defines BYTE as
	well, and that definition causes a conflict;

	get rid of references to "__FUNCTION__", as MSVC++ doesn't
	define it (I suspect at least some UNIX compilers don't define
	it, either).

svn path=/trunk/; revision=3428
2001-05-21 03:17:14 +00:00
Ashok Narayanan 2914e81177 Added 'text2pcap', a utility to convert text hexdumps into pcap
files. See text2pcap.1 (built from doc/text2pcap.pod) for details.

Changed 'tethereal -x' output to match hex dump format of text2pcap,
Ethereal and others.

svn path=/trunk/; revision=3421
2001-05-16 21:32:05 +00:00