summaryrefslogtreecommitdiff
path: root/tethereal.c
AgeCommit message (Collapse)AuthorFilesLines
2000-07-09Turn the code of "colorize_packet()" into a static routine that is givenGuy Harris1-1/+6
a word to use in the progress dialog, and a flag indicating whether the display filter is to be reevaluated or not, and: have "colorize_packet()" call that routine with "Colorizing" and FALSE as those arguments; have the filtering code call that routine with "Filtering" and TRUE as those arguments; add an exported routine to call that routine with "Reprocessing" and TRUE as those arguments, to use to re-generate the packet list and to re-filter the packets if a protocol preference has been changed. Keep track of whether preferences are changed from their initial value by a preferences file or a command-line option, or from their previous value by the "Preferences" dialog box; have "prefs_apply_all()" only call the "apply" callback for a module if they have. Call "prefs_apply_all()" after the command-line arguments have been parsed and after "OK" has been clicked in the "Preferences" dialog box, to notify modules of preference changes if they've registered a callback for that. After "OK" has been clicked in the "Preferences" dialog box, if any preferences have changed, call the reprocessing routine, as the summary line for some frames and/or the current display filter's value when applied to some frames may have changed as a result of a preference change. Do the same after "OK" or "Apply" has been clicked in the "Display Options" dialog box (as it controls a protocol preferences item. svn path=/trunk/; revision=2126
2000-07-05Add support for a global "ethereal.conf" preferences file, stored in theGuy Harris1-15/+42
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most likely). Add a mechanism to allow modules (e.g., dissectors) to register preference values, which: can be put into the global or the user's preference file; can be set from the command line, with arguments to the "-o" flag; can be set from tabs in the "Preferences" dialog box. Use that mechanism to register the "Decode IPv4 TOS field as DiffServ field" variable for IP as a preference. Stuff that still needs to be done: documenting the API for registering preferences; documenting the "-o" values in the man page (probably needs a flag similar to "-G", and a Perl script to turn the output into documentation as is done with the list of field); handling error checking for numeric values (range checking, making sure that if the user changes the variable from the GUI they change it to a valid numeric value); using the callbacks to, for example, update the display when preferences are changed (could be expensive); panic if the user specifies a numeric value with a base other than 10, 8, or 16. We may also want to clean up the existing wired-in preferences not to take effect the instant you tweak the widget, and to add an "Apply" button to the "Preferences" dialog. svn path=/trunk/; revision=2117
2000-07-05Set the locale for Tethereal to the native environment; Ethereal alreadyGuy Harris1-1/+5
does so, as a side-effect of calling "gtk_set_locale()". svn path=/trunk/; revision=2111
2000-07-03Remove the progress bar from the status line, and, instead, for anyGuy Harris1-2/+1
potentially long-running operation that has a progress indicator, pop up a modal dialog box with an indication of what is being done; a progress bar; a "Cancel" button to stop the operation. This: leaves more room on the status line for a filter expression; provides a mechanism to allow the user to cancel long-running operations (although the way we do so may not back out of them as nicely as the user might like, if it's not obvious what the "right" way is or if the "right" way is difficult to implement or involves doing as much work as letting the operation continue); means that, because the dialog box is modal, we don't have to worry about the user performing arbitrary UI operations out from under the operation and changing arbitrary bits of state being used by that operation. svn path=/trunk/; revision=2103
2000-06-27Patch from Ben Fowler to rename the global variable "cf" to "cfile", toGuy Harris1-60/+60
make it easier to use grep to find all references to it without getting a lot of false hits and to check, after allocating the memory chunk for "frame_data" structures, that the allocation succeeded. svn path=/trunk/; revision=2092
2000-06-15Patch from Joerg Mayer:Guy Harris1-5/+5
Make "tethereal -h" look as similar to "ethereal -h" as possible. The ethereal help was the "better" of the two. svn path=/trunk/; revision=2073
2000-05-19Add wtap-int.h. Move definitions relevant to the internal workins of wiretapGilbert Ramirez1-6/+6
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-18Remove the "union pseudo_header" from the "frame_data" structure;Guy Harris1-17/+15
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). svn path=/trunk/; revision=1975
2000-05-18Have "proto_tree_is_visible" false except when we're in the middle ofGuy Harris1-1/+7
doing something that requires that the text for protocol tree entries be generated, i.e. 1) initialize it to FALSE; 2) have every routine that sets it clear it when it's done; 3) when printing packets, set it to TRUE only if we're not just printing packet summary lines; and then get rid of settings to FALSE made unnecessary as a result of those changes. This makes sure it's not set when it doesn't have to be (which causes the protocol tree code to format the text when it doesn't have to, wasting CPU time). svn path=/trunk/; revision=1973
2000-04-14Change dfilter_apply() to 4-argument function. 4th argument is not yet used,Gilbert Ramirez1-3/+3
but will be in the future, and it's easier for me to keep my local branch in sync with the source with the calls to dfilter_apply() already modified tothe 4-arg format. Add a CPP macro to ipv4.h to define ipv4_addr_ne(). Use it in dfilter.c svn path=/trunk/; revision=1854
2000-04-13Consolidate flags in struct frame_data, and add "visited" flag. UseGilbert Ramirez1-3/+4
it in SOCKS dissector. (Okay, how many times am I going to modify packet.h today, forcing you to re-compile everything? :-) svn path=/trunk/; revision=1850
2000-04-04Turn "ethereal_proto_init()" and "ethereal_proto_cleanup()" intoGuy Harris1-23/+7
"dissect_init()" and "dissect_cleanup()", in "packet.c", so that we don't duplicate those routines in Ethereal and Tethereal (and so on), and don't have to remember to update N different versions of them if we have to change the way we do one-time initialization and cleanup. svn path=/trunk/; revision=1790
2000-04-04Use the new split between protocol registration and protocol handoffGuy Harris1-2/+1
registration routines to get rid of the special handling of ONC RPC protocols - dissectors for ONC RPC-based protocols should register their protocol, fields, and ETT values in a protocol registration routine, and register themselves with the ONC RPC dissector in their protocol handoff routine, so that the latter is done after the ONC RPC dissector's protocol registration routine is called, so that the data structures needed when dissectors for ONC RPC protocols register themselves with the ONC RPC dissector have been initialized. Get rid of "init_dissect_rpc()", which initializes said data structures; do that in "proto_register_rpc()" instead. svn path=/trunk/; revision=1789
2000-04-03Move the creation of, and registration of protocols known to UDP in, theGuy Harris1-2/+1
hash table attached to "udp.port" out of "init_dissect_udp()" into "proto_register_udp()", so that it's done the way TCP does it, and then get rid of "init_dissect_udp()". svn path=/trunk/; revision=1781
2000-03-28Add getopt.c (from GNU libc) for use on Win32.Gilbert Ramirez1-1/+11
Ethereal/win32 now supports command-line options. Tethereal now compiles on win32, except for the fact that I haven't put the Makefile.nmake changes in for that yet. svn path=/trunk/; revision=1758
2000-02-22In Tethereal, allow capture filters and read filters either to beGuy Harris1-1/+29
specifies with "-f" and "-R" flags, respectively, or specified with non-flag command-line arguments, as tcpdump and snoop allow. svn path=/trunk/; revision=1663
2000-02-19Use WTAP_ERR_UNSUPPORTED_ENCAP for all attempts to open or read aGuy Harris1-3/+10
capture file for an unsupported link-layer encapsulation type (as the nettl reader does), and report it correctly if it occurs on an open or read attempt rather than a save attempt. svn path=/trunk/; revision=1647
2000-02-16Allow for non-"struct timeval" ts's in phdr just like we didGilbert Ramirez1-2/+3
in capture.c. Copy the members of the struct instead of the entire struct. svn path=/trunk/; revision=1640
2000-02-11Say "Tethereal", rather than "Ethereal", in messages from Tethereal.Guy Harris1-6/+6
svn path=/trunk/; revision=1617
2000-01-26Initialize per-dissection data structures before doing a capture, asGuy Harris1-1/+7
well as before reading a capture file - if the user didn't specify that the capture should be saved to a file, it'll be dissected as it arrives. svn path=/trunk/; revision=1568
2000-01-24Make the Tethereal usage message reflect whether libpcap support wasGuy Harris1-3/+8
compiled in or not. svn path=/trunk/; revision=1536
2000-01-24Keep the sample command line in the usage message within 80 characters.Guy Harris1-4/+5
svn path=/trunk/; revision=1534
2000-01-24Heikki Vatiainen's patch to add a flag to control whether to interpretGuy Harris1-4/+7
the IPv4 TOS field as a TOS field or as a DiffServ field, and allow that field to be controlled by a command-line option or an option in the "Display:Options" dialog box. svn path=/trunk/; revision=1532
2000-01-22Allow "-w" and/or "-R" to be specified either when doing a live captureGuy Harris1-80/+181
or when reading a saved capture file; if "-w" is specified, the packets captured or read from the file are written to the specified file rather than being dissected and printed, and if "-R" is specified, only packets that pass the specified read filter are dissected and printed or written. svn path=/trunk/; revision=1523
2000-01-22Fix files that had Gilbert's old e-mail address or that didn't have myGuy Harris1-2/+2
forwarding e-mail address. svn path=/trunk/; revision=1522
2000-01-17Add a "-F" flag, to allow the format of a file being written to beGuy Harris1-16/+43
specified. This will be of more use when I allow "-w" to be used when reading an existing capture file rather than doing a live capture (which will also allow you to specify a read filter, and thus to write a capture file containing those packets from an existing capture file that match a given display filter). Fix up some messages to say "tethereal" rather than "ethereal". svn path=/trunk/; revision=1499
2000-01-17Add a "-x" flag to Tethereal, to make it print a hex and ASCII dump ofGuy Harris1-5/+19
the packet data. svn path=/trunk/; revision=1497
2000-01-16Move the routine to get a list of the network interfaces on the systemGuy Harris1-6/+18
to "util.c", and provide a routine to free that list as well. When picking an interface on which to do a capture (if no "-i" flag was specified), use that routine, and pick the first interface on the list. svn path=/trunk/; revision=1495
2000-01-15Add a call to init_plugins() in order to read the plugins.status file andOlivier Abad1-1/+5
enable plugins if their saved status is "active". svn path=/trunk/; revision=1487
2000-01-15Pass the number of packets to be captured to "capture()" as an argument,Guy Harris1-8/+9
rather than making it static. Don't print the "Capturing on <interface>" message until you actually start capturing, and print it regardless of whether the interface was explicitly specified or not (that's what snoop and tcpdump do). svn path=/trunk/; revision=1485
2000-01-15If no "-i" flag is specified to Tethereal when no file is to be read,,Guy Harris1-8/+24
or to Ethereal when the "-k" flag is specified, i.e. when a capture is to be started immediately, use "pcap_lookupdev()" to pick an interface, just as tcpdump does. svn path=/trunk/; revision=1482
2000-01-14better command line syntax descriptionNathan Neulinger1-4/+5
svn path=/trunk/; revision=1478
2000-01-14Set an initial (blank) filter to get around the peculiarities in RHGerald Combs1-2/+2
6.1's libpcap. svn path=/trunk/; revision=1476
2000-01-14Check for existence of cf.iface before calling capture(). ChangeGilbert Ramirez1-2/+7
usage statement accordingly. svn path=/trunk/; revision=1474
2000-01-14Add "tethereal", a tty-oriented derivative of Ethereal that works likeGuy Harris1-0/+845
Sun's snoop or like tcpdump. svn path=/trunk/; revision=1468