aboutsummaryrefslogtreecommitdiffstats
path: root/editcap.c
AgeCommit message (Collapse)AuthorFilesLines
2005-08-24fix usec -> nsec translationulfl1-12/+12
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15521 f5534014-38df-0310-8fa8-9805f1628bb7
2005-07-26From Peter Johansson:etxrab1-1/+5
The supplied patch takes care of the following compilation warnings: editcap.c(273) : warning C4013: 'getpid' undefined; assuming extern returning int editcap.c(464) : warning C4018: '<' : signed/unsigned mismatch git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15084 f5534014-38df-0310-8fa8-9805f1628bb7
2005-06-17the -E probability parameter was missing in the usage summaryulfl1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14677 f5534014-38df-0310-8fa8-9805f1628bb7
2005-05-30Add random bit errors to the fuzz tests.gerald1-1/+9
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14489 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-10Remove debugging printf()s.gerald1-4/+0
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14048 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-10Add an option to Editcap that adds various types of errors to the capture gerald1-26/+94
file. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14046 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-03Make editcap use wtap_read(); that eliminates the last user ofguy1-97/+79
wtap_loop(), so eliminate wtap_loop(). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14006 f5534014-38df-0310-8fa8-9805f1628bb7
2004-12-29Make the tone of the error messages a bit less formal, by usingguy1-6/+6
contractions. (Safari does, at least when you're trying to open a file to which you don't have read access.) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12852 f5534014-38df-0310-8fa8-9805f1628bb7
2004-07-18Set the svn:eol-style property on all text files to "native", so thatguy1-1/+1
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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11400 f5534014-38df-0310-8fa8-9805f1628bb7
2004-02-23Another small closing bracket fixup.sharpe1-3/+3
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10196 f5534014-38df-0310-8fa8-9805f1628bb7
2004-02-23Small fix to usage text to add a trailing closed square bracket (]).sharpe1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10194 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-25Free the error info string after using it.guy1-1/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9855 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-25Have the Wiretap open, read, and seek-and-read routines return, inguy1-4/+25
addition to an error code, an error info string, for WTAP_ERR_UNSUPPORTED, WTAP_ERR_UNSUPPORTED_ENCAP, and WTAP_ERR_BAD_RECORD errors. Replace the error messages logged with "g_message()" for those errors with g_strdup()ed or g_strdup_printf()ed strings returned as the error info string, and change the callers of those routines to, for those errors, put the info string into the printed message or alert box for the error. Add messages for cases where those errors were returned without printing an additional message. Nobody uses the error code from "cf_read()" - "cf_read()" puts up the alert box itself for failures; get rid of the error code, so it just returns a success/failure indication. Rename "file_read_error_message()" to "cf_read_error_message()", as it handles read errors from Wiretap, and have it take an error info string as an argument. (That handles a lot of the work of putting the info string into the error message.) Make some variables in "ascend-grammar.y" static. Check the return value of "erf_read_header()" in "erf_seek_read()". Get rid of an unused #define in "i4btrace.c". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9852 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-18Fix warnings found by -Wstrict-prototypesjmayer1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9722 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-28Removed trailing whitespaces from .h and .c files using thejmayer1-6/+6
winapi_cleanup tool written by Patrik Stridvall for the wine project. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6117 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-02Replace the types from sys/types.h and netinet/in.h by their glib.hjmayer1-7/+3
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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5932 f5534014-38df-0310-8fa8-9805f1628bb7
2002-06-30From Joerg Mayer: add some missing static declarations.guy1-6/+6
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5806 f5534014-38df-0310-8fa8-9805f1628bb7
2002-06-23WinPcap 2.3's <pcap.h> includes <packet32.h>, and WinPcap 2.3'sguy1-3/+3
<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>. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5742 f5534014-38df-0310-8fa8-9805f1628bb7
2002-03-31From Joerg Mayer: mark function arguments as unused.guy1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5049 f5534014-38df-0310-8fa8-9805f1628bb7
2002-03-14When defining the struct select_item, don't create an instance of thatgram1-2/+2
struct, alsoc alled select_item, as it's not used. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4938 f5534014-38df-0310-8fa8-9805f1628bb7
2002-02-24From Peter Valchev: fix editcap to assign the result of "getopt()" to anguy1-3/+3
"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). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4793 f5534014-38df-0310-8fa8-9805f1628bb7
2002-02-08Have Wiretap set the snapshot length to 0 if it can't be derived fromguy1-1/+7
reading the capture file. Have callers of "wtap_snapshot_length()" treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so that, when writing a capture file in a format that *does* store the snapshot length, we can at least put *something* in the file). If we don't know the snapshot length of the current capture file, don't display a value in the summary window. Don't use "cfile.snap" as the snapshot length option when capturing - doing so causes Ethereal to default, when capturing, to the snapshot length of the last capture file that you read in, rather than to the snapshot length of the last capture you did (or the initial default of "no snapshot length"). Redo the "Capture Options" dialog box to group options into sections with frames around them, and add units to the snapshot length, maximum file size, and capture duration options, as per a suggestion by Ulf Lamping. Also add units to the capture count option. Make the snapshot length, capture count, maximum file size, and capture duration options into a combination of a check box and a spin button. If the check box is not checked, the limit in question is inactive (snapshot length of 65535, no max packet count, no max file size, no max capture duration); if it's checked, the spinbox specifies the limit. Default all of the check boxes to "not checked" and all of the spin boxes to small values. Use "gtk_toggle_button_get_active()" rather than directly fetching the state of a check box. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4709 f5534014-38df-0310-8fa8-9805f1628bb7
2001-10-04Use longs as file offsets, so that on platforms with 64-bit "long" weguy1-2/+2
can handle capture files bigger than 2GB. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3993 f5534014-38df-0310-8fa8-9805f1628bb7
2001-07-13From Scott Renfro:guy1-12/+30
- make a leading zero in the argument to -t optional; - includes the -t option in in the summary portion of of the editcap usage message. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3712 f5534014-38df-0310-8fa8-9805f1628bb7
2001-07-12"-t" flag for editcap, to adjust timestamps in frames, from Scottguy1-4/+100
Renfro. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3696 f5534014-38df-0310-8fa8-9805f1628bb7
2001-06-19More signed vs. unsigned cleanups, and initialization cleanups, fromguy1-2/+2
Joerg Mayer. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3578 f5534014-38df-0310-8fa8-9805f1628bb7
2001-04-20In ANSI C (and in pre-ANSI UNIX implementations), if you return fromguy1-3/+2
"main()", the program exits, and exits with an exit status equal to the return value of "main()", so "return 0;" is sufficient at the end of "main()". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3354 f5534014-38df-0310-8fa8-9805f1628bb7
2000-12-03Put the "-s" flag into the usage message for editcap.guy1-3/+5
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2738 f5534014-38df-0310-8fa8-9805f1628bb7
2000-08-09Make "editcap -h" give the usage message without an error message (i.e.,guy1-2/+2
specify it in the argument to "getopt()"). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2235 f5534014-38df-0310-8fa8-9805f1628bb7
2000-05-19Add wtap-int.h. Move definitions relevant to the internal workins of wiretapgram1-2/+2
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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1989 f5534014-38df-0310-8fa8-9805f1628bb7
2000-05-18Remove the "union pseudo_header" from the "frame_data" structure;guy1-4/+4
there's no need to keep it around in memory - when the frame data is read in when handing a frame, read in the information, if any, necessary to reconstruct the frame header, and reconstruct it. This saves some memory. This requires that the seek-and-read function be implemented inside Wiretap, and that the Wiretap handle remain open even after we've finished reading the file sequentially. This also points out that we can't really do X.25-over-Ethernet correctly, as we don't know where the direction (DTE->DCE or DCE->DTE) flag is stored; it's not clear how the Ethernet type 0x0805 for X.25 Layer 3 is supposed to be handled in any case. We eliminate X.25-over-Ethernet support (until we find out what we're supposed to do). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1975 f5534014-38df-0310-8fa8-9805f1628bb7
2000-04-27Add a "-s" flag to editcap, to make it truncate packets to a specifiedguy1-3/+22
snapshot length before writing them to the output file; this may come in handy if you are translating the file to a different format so that it can be read by a program that can't handle packets above a certain size (e.g., the snoop in Solaris 2.5.1 or 2.6, which reject Ethernet packets larger than the Ethernet MTU, and thus can't handle gigabit Ethernet captures using jumbo frames). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1891 f5534014-38df-0310-8fa8-9805f1628bb7
2000-04-17Remove optopt and opterr, two unused variables.gram1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1877 f5534014-38df-0310-8fa8-9805f1628bb7
2000-04-12Build tethereal and editcap on Win32.gram1-1/+20
Add RCS ID tags to Makefile.nmake's. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1836 f5534014-38df-0310-8fa8-9805f1628bb7
2000-01-17Use "strchr()" rather than "index()" - the ANSI C standard specifiesguy1-2/+3
"strchr()", and it, unlike "index()", is declared in <string.h>. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1502 f5534014-38df-0310-8fa8-9805f1628bb7
2000-01-17Small patch to editcap to allow ranges of packets to be specifiedsharpe1-6/+62
as well as individual packets. I needed to grab quite a few from the middle of a large capture file. Will eventually need to sort the extract list. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1498 f5534014-38df-0310-8fa8-9805f1628bb7
1999-12-12Another commit from a Qantas Club Lounge ... :-)sharpe1-29/+62
Update editcap to print out the type of capture file if -v specified and add a -h flag. Also fix a few compiler warnings ... git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1302 f5534014-38df-0310-8fa8-9805f1628bb7
1999-12-05Use the new routines in Wiretap to make the argument to "-T" be aguy1-5/+19
symbolic name, and to list the encapsulation types in the usage message. Note in the usage message that the default output encapsulation type is "same as the input file" and that the default output file type is "libpcap". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1213 f5534014-38df-0310-8fa8-9805f1628bb7
1999-12-04It's now called "editcap", as it can read any file format Wiretap canguy1-9/+22
read, and write any format it can write; change the error messages. Make the "-F" flag take a symbolic capture file type; use "wtap_short_string_to_file_type()" to translate it to a WTAP_FILE_ value. List, in the usage message, the capture file types we can write, and the symbolic types you use on the command line to specify them. Give it an RCS ID. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1210 f5534014-38df-0310-8fa8-9805f1628bb7
1999-12-04Adding editcap.c. This is an example of a simple wiretap editing program.sharpe1-0/+174
Will need new functions in wiretap before I can do more. Should perhaps be moved into an examples directory and have other bots added. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1206 f5534014-38df-0310-8fa8-9805f1628bb7