Commit Graph

2083 Commits

Author SHA1 Message Date
Gilbert Ramirez 0a2817ceba Have tvbuff's keep track of cap_len and pkt_len ('length' and 'reported_length'
in tvbuff terminology). This is implemented for TVBUFF_REAL and TVBUFF_SUBSET
so far; support for TVBUFF_COMPOSITE is coming soon.

Throw either ReportedBoundsError or BoundsError.
A ReportedBoundsError is reported as "Malformed Frame" since the protocol
stated that a certain number of bytes should be available but they weren't.
A BoundsError is reported as a "Short Frame" since the snaplen was too short.

Register proto_short (BoundsError) and proto_malformed (ReportedBounds)
so searches can be made on "short" and "malformed".

svn path=/trunk/; revision=1965
2000-05-16 04:44:14 +00:00
Guy Harris 9d92bf4eeb Fix a botch that kept it from compiling if you didn't have an SNMP
library.

svn path=/trunk/; revision=1964
2000-05-15 08:02:39 +00:00
Gilbert Ramirez 06ba8a87c2 Add very basic tvbuff documentation. I still need to explain TVBUFF_COMPOSITE's,
and explain how to use exceptions.h.

svn path=/trunk/; revision=1963
2000-05-15 06:48:16 +00:00
Gilbert Ramirez ec3337ed07 Convert token-ring dissector to use tvbuffs.
Modify ethernet dissector to catch BoundsError if the attempt to
create next_tvb with the length specified in the ethernet header throws
an exception. In that case, next_tv is created with as many bytes as
are available in the frame.

Both dissect_tr() and dissect_eth() now have TRY blocks, which means
I had to fiddle with 'volatile' and 'static' storage options to get
things right (at least according to gcc).

svn path=/trunk/; revision=1962
2000-05-15 06:22:07 +00:00
Gilbert Ramirez 6c2a7af1f6 Add accessors for 24-bit integers (which get returned as guint32's).
svn path=/trunk/; revision=1961
2000-05-15 04:37:27 +00:00
Guy Harris 0d12107436 SMUX and SNMP V3 support from Jochen Friedrich.
svn path=/trunk/; revision=1960
2000-05-15 03:15:12 +00:00
Guy Harris 9befd25e50 We can't trust "cf->current_frame" to refer to the frame that was
selected before we started re-colorizing or re-filtering the display, as
when the first row is added to the clist, that may be selected and thus
made the current frame.

This means that we can't find the row corresponding to the
previously-selected frame, if any, by checking as each packet is
colorized/filtered and see whether its "frame_data" structure is equal
to "cf->current_frame", as that'll always say that the first frame in
the display is the selected frame.

Instead, we recored the value of "cf->current_frame" before we do
anything to the clist, have "add_packet_to_packet_list()" return either
the row number of the frame (if it passed the filter and thus was added
to the clist) or -1 (if it didn't pass the filter and thus wasn't added
to the clist), and, after "add_packet_to_packet_list()", if the current
frame is the one that was the selected row, remember its row number (if
any), and, when we're finished colorizing/filtering the display, make
that row the current row if it's not -1 (-1 means that the selected row
didn't pass the filter).

Also, don't do that until after we've thawed the clist, as the vertical
adjustment for the clist doesn't reflect reality until then, and
attempting to go to a given row won't work right until the vertical
adjustment for the clist reflects reality.

Shove all the code to set the selected and focus rows, and to make said
row visible, into a routine, so the "Find Frame" and "Go To Frame" code
can use it as well.

svn path=/trunk/; revision=1959
2000-05-15 01:50:16 +00:00
Guy Harris d83e4cb58c Add a comment giving the URL of the CIFS Remote Administration Protocol
spec (which covers some of what this file dissects).

Dissect the share type in NetShareEnum replies as a type value (using
values from said spec), not just as a number.

svn path=/trunk/; revision=1958
2000-05-14 20:50:03 +00:00
Guy Harris 3820e1fd77 The argument to a "proto_tree_add_item()" adding an FT_IPv4 item should
be the 32-bit IP address (in host byte order), not a pointer to the
first octet of that IP address.

svn path=/trunk/; revision=1957
2000-05-14 07:19:49 +00:00
Guy Harris e9cc5fa70c Put in some checks to make sure we don't go past the end of the frame
when fetching strings in NetShareEnum and NetServEnum2 replies.

svn path=/trunk/; revision=1956
2000-05-14 04:00:48 +00:00
Guy Harris 37315afd37 In a NetServEnum, there's only one byte of padding after the share name.
(See, for example

	ftp://ftp.microsoft.com/developr/drg/CIFS/cifsrap2.txt

.)

svn path=/trunk/; revision=1955
2000-05-14 03:17:26 +00:00
Gilbert Ramirez 67e584e2a4 Fix location of $(TETHEREAL) dependency.
svn path=/trunk/; revision=1954
2000-05-13 11:34:12 +00:00
Guy Harris a51b2e1ca6 Use "htoles()" rather than "pletohs()" to convert host-byte-order shorts
to little-endian shorts - and to convert host-byte-order longs to
little-endian shorts (if the host-byte-order long will fit into a short,
"htoles()" does the right thing; if it doesn't, there is no right thing
to do - perhaps we should return a wiretap error, although, at least at
present, it's unlikely that we'll have packets bigger than 65535 bytes,
so it's unlikely that the values won't fit into a short).

svn path=/trunk/; revision=1953
2000-05-12 22:12:21 +00:00
Gilbert Ramirez 651acccfd9 Ben Fowler <wapdev@leedsnet.com>'s "usage of fd" patch.
svn path=/trunk/; revision=1952
2000-05-12 22:03:59 +00:00
Guy Harris a29cf14f38 Fix minor typo found by Alan Harrison.
svn path=/trunk/; revision=1951
2000-05-12 21:27:04 +00:00
Gilbert Ramirez 57f3eab737 If ethernet header has 'length', create tvbuff of only that length
for next dissector. TODO: mark any remaining data as "Ethernet Trailer"

svn path=/trunk/; revision=1950
2000-05-12 19:15:53 +00:00
Guy Harris c5dfcc49e7 Doug Nazar's patch to dissect substring filters.
svn path=/trunk/; revision=1949
2000-05-12 08:04:29 +00:00
Gilbert Ramirez 76ae564b61 Fix dissect_data_tvb() so that it only appends a "Data" proto_tree label
if there are more than 0 bytes of data.

svn path=/trunk/; revision=1948
2000-05-12 06:23:33 +00:00
Gilbert Ramirez dbf648436a Add a sample Makefile for regression testing by using tethereal.
svn path=/trunk/; revision=1947
2000-05-12 05:47:00 +00:00
Gilbert Ramirez 4ec50578de In wiretap, set err to 0 before doing anything inside wtap_loop().
Tethereal was dying on me because err was initialized to some random value.

It was this section of code that would exit even if wtap_loop was successful
(returned TRUE) because err was never initialized or set to anything.

err = load_cap_file(&cf, out_file_type);
if (err != 0) {
       dissect_cleanup();
       exit(2);
}

<BIGGER sheepish grin>
Fixed even more errors in LLC dissector. I had inadvertantly used the
wrong tvbuff_t* when calling dissect_data_tvb(). There is no way we are going
to be successful in this tvbuff conversion w/o regression testing. I'm
working on setting up a simple Makefile for regression testing tonight.
That's why I'm finding so many bugs in my LLC conversion.
</BIGGER sheepish grin>

svn path=/trunk/; revision=1946
2000-05-12 05:06:33 +00:00
Gilbert Ramirez 742cb69433 <sheepish grin>
Fix error in my conversion to tvbuff routines.
Because offset was calculated based on next_tvb, which already knew to
skip 8 bytes, I don't have to use "offset+8" in calls to the next non-tvbuff
dissectors.
</sheepish grin>

svn path=/trunk/; revision=1945
2000-05-12 04:21:21 +00:00
Gilbert Ramirez af9016663d Remove proto_tree doc, as all necessary info in it is in README.developer.
Add tvbtest.c to list of packaged files.

svn path=/trunk/; revision=1944
2000-05-12 04:00:05 +00:00
Gilbert Ramirez 0c39c03bf5 Convert LLC dissector to use tvbuffs.
Non-tvbuff dissectors create a tvbuff when calling dissect_llc()
Changed name of current_proto to match string in COL_PROTO ("FDDI" instead of "fddi")
Changed short text to be: [Short Frame: %s]  where %s is current_proto.

svn path=/trunk/; revision=1943
2000-05-11 22:04:18 +00:00
Guy Harris a74c39f9b1 Put in a comment to note that "cfgattrident2str()" was put in for use
when we parse ISAKMP data attributes - we don't do that yet, which is
why it's not currently used.

svn path=/trunk/; revision=1942
2000-05-11 20:36:14 +00:00
Guy Harris bc897cf7d3 Yaniv Kaul's patch to add support for the ISAKMP Configuration Method
(draft-ietf-ipsec-isakmp-mode-cfg-04.txt).

svn path=/trunk/; revision=1941
2000-05-11 18:55:40 +00:00
Gilbert Ramirez 93cb9518ea I had moved the COL_INFO string to far forward, before fc was
being set. Fixed.

svn path=/trunk/; revision=1940
2000-05-11 16:52:15 +00:00
Gilbert Ramirez 292e38e2c6 Add tvbuff class.
Add exceptions routines.
Convert proto_tree_add_*() routines to require tvbuff_t* argument.
Convert all dissectors to pass NULL argument ("NullTVB" macro == NULL) as
the tvbuff_t* argument to proto_tree_add_*() routines.

dissect_packet() creates a tvbuff_t, wraps the next dissect call in
a TRY block, will print "Short Frame" on the proto_tree if a BoundsError
exception is caught.

The FDDI dissector is converted to use tvbuff's.

svn path=/trunk/; revision=1939
2000-05-11 08:18:09 +00:00
Guy Harris 162800efb3 In "Makefile.am" and "Makefile.nmake", have "DISSECTOR_SOURCES" include
only the dissector source files, not the header files; that way you
don't feed the header files to "make-reg-dotc", as "make-reg-dotc" won't
find any registration routines there so there's no point in feeding
header files to it.

Doing so means that we can make "DISSECTOR_OBJECTS" in "Makefile.nmake"
by doing

	DISSECTOR_OBJECTS = $(DISSECTOR_SOURCES:.c=.obj)

rather than separately enumerating the object files, as Nmake supports
System V "make"-style substitution.

This should let users who change "DISSECTOR_SOURCES" in one of those
files just copy it to the other file.

svn path=/trunk/; revision=1938
2000-05-11 07:34:32 +00:00
Guy Harris d879711966 Include an example of "wdd" output data from an Ascend trace I got ages
ago.

svn path=/trunk/; revision=1937
2000-05-10 22:20:26 +00:00
Guy Harris 0fdd93d1ce Rename the "private" member of a "wtap_dumper" structure to "dump", as
per the "capture" member of a "wtap" structure, so that it doesn't
collide with the C++ reserved word "private".

svn path=/trunk/; revision=1936
2000-05-10 22:16:31 +00:00
Guy Harris fab3967f99 "packet-giop.h" and "packet-h1.h" have joined the Choir Invisibule, so
they can just be deleted, not just commented out.

svn path=/trunk/; revision=1935
2000-05-10 21:57:47 +00:00
Gerald Combs 69daa47b26 Fix a typo in the packet counter.
svn path=/trunk/; revision=1934
2000-05-10 21:36:55 +00:00
Gilbert Ramirez c71e3de675 Fixes for building 0.8.8.
svn path=/trunk/; revision=1933
2000-05-10 15:32:09 +00:00
Guy Harris b5f25bc16d Use "F<>" rather than "B<>" for file names in the Tethereal man page.
svn path=/trunk/; revision=1932
2000-05-10 06:05:17 +00:00
Guy Harris 33f9afee30 Graham Bloice's changes to make clicking on a column header cause the
display to be sorted by the value in that column (and to reverse the sort
order the next time you click on that column).

Use "F<>" rather than "B<>" for file names in the Ethereal man page.

svn path=/trunk/; revision=1931
2000-05-10 06:00:22 +00:00
Guy Harris 914f14223b Fix from Ron Flory to suppress a warning GCC issues on at least some
platforms.

svn path=/trunk/; revision=1930
2000-05-09 17:45:02 +00:00
Guy Harris 4cbec302cd Change from Jason Lango to put timestamps in the RTP summary column.
svn path=/trunk/; revision=1929
2000-05-09 06:28:05 +00:00
Guy Harris 162470178d Fix a couple of typos.
svn path=/trunk/; revision=1928
2000-05-09 03:23:35 +00:00
Gilbert Ramirez 2bb2916ef5 One more "0.8.7" --> "0.8.8"
svn path=/trunk/; revision=1926
2000-05-09 03:09:55 +00:00
Gilbert Ramirez d96ae25070 Move to version 0.8.8
svn path=/trunk/; revision=1925
2000-05-08 20:14:03 +00:00
Guy Harris 299ae9654e Fix from Gerrit Gehnen.
svn path=/trunk/; revision=1924
2000-05-08 17:19:42 +00:00
Guy Harris 740bb55521 Make the "Preferences" dialog box use the new utilities to make the Esc
key cancel the dialog box.

svn path=/trunk/; revision=1923
2000-05-08 07:58:20 +00:00
Guy Harris 158df5470a Keep a pointer to the current "Preferences" window, if any - if not, the
pointer is NULL - so that, instead of doing nothing if the user selects
"Edit->Preferences" when there's already a "Preferences" dialog box
open, we raise and de-iconify that window.

Connect the preferences dialog box and any file selection dialog box
opened from its Print tab, so that:

	if the preferences dialog box goes away, so does the file
	selection dialog box (as it no longer has a text widget into
	which it can stuff the selected file name);

	if the "File:" button is clicked when there's already a file
	selection dialog box open, we just reactivate that existing
	dialog box rather than popping up a new one.

Catch the ESC key in the file selection dialog box popped up for the
"File:" button in the Print tab of the Preferences dialog box, and make
it cancel the file selection dialog box.

svn path=/trunk/; revision=1922
2000-05-08 07:54:54 +00:00
Guy Harris 9bb3a841e3 Catch the ESC key in the file selection dialog boxes popped up for
"File->Open", "File->Save As", and the "File:" buttons in the Capture
Preferences and Print dialog boxes, and make it cancel the file
selection dialog box.

svn path=/trunk/; revision=1921
2000-05-08 07:13:40 +00:00
Guy Harris be87df37bf Set up the buttons in the "Capture Preferences" dialog box to use
mnemonics.

Give the button, in the "Display Options" dialog box, that controls
whether name resolution is enabled or not the same label ("Enable name
resolution") as the equivalent button in the "Capture Preferencs" dialog
box.

svn path=/trunk/; revision=1920
2000-05-08 05:51:37 +00:00
Guy Harris f0991d4a51 Connect the capture preferences dialog box and any file selection dialog
box it has open, so that:

	if the capture preferences dialog box goes away, so does the
	file selection dialog box (as it no longer has a text widget
	into which it can stuff the selected file name);

	if the "File:" button is clicked when there's already a file
	selection dialog box open, we just reactivate that existing
	dialog box rather than popping up a new one.

svn path=/trunk/; revision=1919
2000-05-08 05:42:54 +00:00
Guy Harris b6f55c2966 Keep a pointer to the current "Print" window, if any - if not, the
pointer is NULL - so that, instead of doing nothing if the user selects
"File->print" when there's already a "Print" dialog box open, we raise
and de-iconify that window.

Connect the print dialog box and any file selection dialog box it has
open, so that:

	if the print dialog box goes away, so does the filter dialog box
	(as it no longer has a text widget into which it can stuff the
	selected file name);

	if the "File:" button is clicked when there's already a file
	selection dialog box open, we just reactivate that existing
	dialog box rather than popping up a new one.

svn path=/trunk/; revision=1918
2000-05-08 05:35:08 +00:00
Guy Harris 63d3730e11 Keep a pointer to the current "Display Options" window, if any - if not,
the pointer is NULL - so that, instead of doing nothing if the user
selects "Display->Options" when there's already a "Display Options"
dialog box open, we raise and de-iconify that window.

Register a "destroy" callback for the "Display Options" window, so that
no matter how it's destroyed, even if it's destroyed by a window manager
close button rather than by clicking the "OK" or "Cancel" button, we
note that fact by clearing the pointer to the current "Display Options"
window, so that if the user then selects "Display->Options", we know
that we need to pop a new "Display Options" window up.

svn path=/trunk/; revision=1917
2000-05-08 05:12:19 +00:00
Guy Harris 73d9b5f47c Set up the buttons in the "Find Frame" and "Print" dialog boxes to use
mnemonics.

svn path=/trunk/; revision=1916
2000-05-08 04:53:21 +00:00
Guy Harris e160ffa08c Add functions to create buttons whose labels specify mnemonics, i.e.
that contain an "_" preceding a letter, indicating that the letter is to
be underlined in the label, and that if the key for that letter is
pressed (either with Alt or without it) in the dialog box to which the
button belongs, and the widget with the input focus doesn't do anything
with that button, the button is sent the "clicked" signal.

Attach mnemonics to the buttons in the "Display->Options" dialog box.

svn path=/trunk/; revision=1915
2000-05-08 04:23:46 +00:00