Commit Graph

310 Commits

Author SHA1 Message Date
Guy Harris 4caa331d21 Patch from Ronnie Sahlberg to cause the field description section of the
status bar to display nothing, rather than "Text (text)", when a
"proto_tree_add_text()" field is selected.

While we're at it, use a similar test to eliminate the text pseudo-field
from the output of "{ethereal,tethereal} -G", as well.

svn path=/trunk/; revision=3335
2001-04-19 23:06:23 +00:00
Guy Harris 2aa31bea47 Move the declaration of "etype_vals[]" from "epan/packet.h" to
"etypes.h".

svn path=/trunk/; revision=3314
2001-04-17 06:43:21 +00:00
Guy Harris c5aaac7823 Move the declaration of "ipprotostr()" out of "epan/packet.h" into a new
"ipproto.h" header file.

svn path=/trunk/; revision=3313
2001-04-17 06:29:14 +00:00
Guy Harris 77789be82e Assorted ISIS enhancements from Hannes Gredler.
When dissecting the ISIS NLPID CLV, use the "nlpid_vals" array to
convert NLPID values to protocol names.

svn path=/trunk/; revision=3308
2001-04-16 10:04:33 +00:00
Guy Harris f8c9764894 There's no "enable name resolution in captures" preference in Ethereal,
and never was - there's only an Ethereal-wide "enable name resolution"
preference.  Name it just "name_resolve".

Replace all tests of "g_resolving_actif" with tests of
"prefs.name_resolv", and replace all code that sets "g_resolving_actif"
with code that sets "prefs.name_resolv", so that the setting of
"prefs.name_resolv" actually affects whether names are resolved or not.

svn path=/trunk/; revision=3300
2001-04-15 03:37:16 +00:00
Gilbert Ramirez b6bd7af57a Improvement of 'make clean' targets.
svn path=/trunk/; revision=3297
2001-04-12 18:07:22 +00:00
Jeff Foster 4004075d48 Updated for release 0.8.17
svn path=/trunk/; revision=3289
2001-04-11 16:35:02 +00:00
Guy Harris 7f0aaa324d If the tvbuff pointer is null in "alloc_field_info()", get the data
source name from "pi.compat_top_tvb", which should always be set to the
tvbuff that refers to the data that old-style dissectors are currently
working on.

Arrange that it be so set in those dissectors that create alternate data
sources and call other dissectors, and also arrange that "pi.len" and
"pi.captured_len" be set appropriately as well.

svn path=/trunk/; revision=3286
2001-04-10 19:10:10 +00:00
Guy Harris 00be3b8f13 Don't call "register_all_plugin_handoffs()" if we don't have plugin
support.

svn path=/trunk/; revision=3262
2001-04-05 19:25:16 +00:00
Gilbert Ramirez a8d864bca7 Use sed in the Win32 build to place the version in various files.
We us $(VERSION), defined in the top-level config.nmake, to replace
@VERSION@ in various files. $(RC_VERSION) and $(WTAP_VERSION) are
similarly used.

svn path=/trunk/; revision=3258
2001-04-05 04:39:29 +00:00
Guy Harris 6270db715c Include <string.h> to declare "strlen()", and include <winsock.h> to
declare "struct timeval", so that MSVC++ 6.0 doesn't give an error.

svn path=/trunk/; revision=3247
2001-04-02 10:44:09 +00:00
Guy Harris 393b1b3e8d Don't use "u_int" and "u_char", as they're not defined in <sys/types.h>
on Windows, so we'd have to drag in <winsock.h> to define them.

svn path=/trunk/; revision=3246
2001-04-02 10:41:19 +00:00
Guy Harris 9b99fdd7ab Don't use "u_int" for IPv4 addresses in "column-utils.c", as that'll
require that it drag in <winsock.h> on Windows; instead, use "guint32".

svn path=/trunk/; revision=3245
2001-04-02 10:38:26 +00:00
Guy Harris ce01c4e7ef "to_str.c" uses "size_t"; include <stdlib.h>, to declare it (necessary
on Windows).

svn path=/trunk/; revision=3244
2001-04-02 09:59:41 +00:00
Guy Harris 0a6b7f6f39 The plugins code has an API that uses a type from "prefs.h"; include
"prefs.h", as otherwise MSVC++ 6.0 won't compile "plugins.c".

svn path=/trunk/; revision=3243
2001-04-02 09:58:15 +00:00
Guy Harris 65dc469326 "get_home_dir()", in "epan/filesystem.c", uses
"find_last_pathname_separator()" on Win32; move the other pathname
manipulation routines from "util.c" into "epan/filesystem.c".

Remove from "util.h" the declarations of routines not defined in
"util.c", and put them into "epan/filesystem.h" if they're not already
there.

Adjust #includes to make the above work.

svn path=/trunk/; revision=3241
2001-04-02 09:53:46 +00:00
Guy Harris d203637ade Use GLib types rather than "u_int" and "u_char" in "resolv.h"; "u_int"
and "u_char" aren't declared in <sys/types.h> in Win32, you have to
include <winsock.h>, which is a pain.

Throw in some "const"s while we're at it.

svn path=/trunk/; revision=3240
2001-04-02 09:41:56 +00:00
Guy Harris d2de258acb Get rid of a tab after a backslash - Microsoft Visual C++ 6.0's "nmake"
doesn't seem to treat backslash-tab as an end-of-line escape, the
backslash has to be at the end of the line.

svn path=/trunk/; revision=3239
2001-04-02 09:21:31 +00:00
Guy Harris 13681cf12b Include <sys/time.h> as well as <time.h> in "column-utils.c" and
"value_string.c", as they include "epan/to_str.h", and that uses "struct
timeval" in some function prototypes.

In "to_str.c", include <sys/types.h> before including <netinet/in.h>; on
at least some platforms, definitions in <netinet/in.h> require types
defined in <sys/types.h>.

In "to_str.c", include <sys/socket.h>, so that AF_INET6 is defined.

svn path=/trunk/; revision=3238
2001-04-02 02:30:06 +00:00
Ed Warnicke f5cf9c8dca Added two new arguments to epan_init() and proto_init() to
allow the passing of register_all_protocols() and
register_all_protocol_handoffs() through epan_init() to proto_init().
This allows the removal of the compile time dependence of proto.c
on register.h.  Modified dftest.c, tethereal.c, and gtk/main.c to
use the new style epan_init() and depend on register.h.

svn path=/trunk/; revision=3237
2001-04-02 00:38:36 +00:00
Ed Warnicke 58a096e88c Changed proto_init() to have it fetch proto_malformed at run time
using proto_get_id_by_filter_name().  Removed #include "packet-frame.h"

svn path=/trunk/; revision=3236
2001-04-01 23:11:43 +00:00
Ed Warnicke cb21a9735a Added a function proto_get_id_by_filter_name() function to proto.{c,h}
to allow the lookup of proto_ids by filter_name.

svn path=/trunk/; revision=3235
2001-04-01 22:50:08 +00:00
Ed Warnicke 10cd0c5f70 Changed packet_init() to look up the frame dissector and cache its
dissector_handle in a static variable in packet.c.  Changed dissect_packet
to call dissector from using the call_dissector() function and the cached
dissector_handle for frame_dissector.  Changed the order of function
calls in epan_init() to allow for this change ( it sucks to look up
a dissector when none are registered ).

svn path=/trunk/; revision=3234
2001-04-01 22:01:34 +00:00
Ed Warnicke 80f1da63b0 Added #include<sys/time.h> to to_str.c
svn path=/trunk/; revision=3232
2001-04-01 17:35:21 +00:00
Ed Warnicke cd6ad9d4c0 Moved the the remaining column related routines out of packet.{c,h}
and into column-utils{c,h}.

svn path=/trunk/; revision=3231
2001-04-01 07:32:35 +00:00
Ed Warnicke 21d1ad6375 Moved some ipv6 definitions from packet-ipv6.h to epan/ipv6-utils.h.
Fixed some typos.

svn path=/trunk/; revision=3230
2001-04-01 07:06:24 +00:00
Ed Warnicke 1d4e847837 Moved vines_addr_to_str() from packet-vines.{h,c} to epan/to_str.{c,h}.
svn path=/trunk/; revision=3229
2001-04-01 06:32:10 +00:00
Ed Warnicke 48421be1d2 Moved timestamp.h into epan.
svn path=/trunk/; revision=3228
2001-04-01 06:11:25 +00:00
Ed Warnicke 3bf0b09117 Added osi-utils.obj to epan/Makefile.nmake
svn path=/trunk/; revision=3227
2001-04-01 05:49:31 +00:00
Ed Warnicke 90f7f6184d Moved some definitions and functions from packet-osi.{c,h} to
epan/osi-utils.{c,h} to bring all of the epan dependencies into epan.

svn path=/trunk/; revision=3226
2001-04-01 05:48:15 +00:00
Ed Warnicke dd54ba9396 Moved the packet_info structure and supporting functions out of
packet.{h,c} and into a separate packet_info{h,c}.

svn path=/trunk/; revision=3225
2001-04-01 04:50:42 +00:00
Ed Warnicke 13cfdd7b71 Added frame_data.obj
svn path=/trunk/; revision=3224
2001-04-01 04:13:14 +00:00
Ed Warnicke 20eee44b70 Moved the frame_data structures and functions from packet.{h,c} to
frame_data{h,c}.  Added a frame_data_init to be called by epan_init.

svn path=/trunk/; revision=3223
2001-04-01 04:11:51 +00:00
Ed Warnicke 5d0c213448 Moved the column_info structure and related enum from packet.{c,h} to
column_info.h.

svn path=/trunk/; revision=3222
2001-04-01 03:42:00 +00:00
Ed Warnicke c832ac2c35 Moved the value_string structures and function from packet.{c,h} into
a separate value_string.{c,h}.

svn path=/trunk/; revision=3221
2001-04-01 03:18:41 +00:00
Ed Warnicke 7e26a1681c Added to_str.obj
svn path=/trunk/; revision=3220
2001-04-01 02:52:10 +00:00
Ed Warnicke c17e3b00c6 Moved various to_str files from packet.{c,h} to a separate
to_str.{c,h}.  Resolved strange situation where ipx_addr_to_str was
declared in packet.h but defined in packet-ipx.c by moving
ipx_addr_to_str, ipxnet_to_str_punct, and ipxnet_to_str from packet-ipx.{c,h}   to to_str.{c,h}

svn path=/trunk/; revision=3219
2001-04-01 02:47:56 +00:00
Ed Warnicke 3b6554c069 removed #include "print.h" and #include "file.h" from packet.c
svn path=/trunk/; revision=3218
2001-03-31 23:02:31 +00:00
Ed Warnicke 364fe90e17 removed #include "util.h" from filesystem.c and resolv.c
svn path=/trunk/; revision=3217
2001-03-31 22:53:09 +00:00
Ed Warnicke a73d099837 removed #include "prefs.h" from epan/plugins.h
svn path=/trunk/; revision=3216
2001-03-31 22:36:21 +00:00
Jeff Foster 486d964200 Change proto_item_add_subtree to test for NULL pi value and return NULL.
This is the same behavior as the proto_tree_add routines with NULL tree values.

svn path=/trunk/; revision=3191
2001-03-26 17:58:33 +00:00
Jeff Foster 395b68ea19 Changes required to support multiple named data sources.
Tvbuffers changed to added the data source name,
GUI and printing code changed to support these changes
and display the multiple hex views.

svn path=/trunk/; revision=3165
2001-03-23 14:44:04 +00:00
Gilbert Ramirez e108afe2bb The Win32 build builds wiretap as a DLL and requires WinPcap 2.1.
svn path=/trunk/; revision=3163
2001-03-23 02:05:29 +00:00
Gilbert Ramirez a8b0c240e6 Move appletalk- and sna-related address routines out of the dissectors
and into epan.

svn path=/trunk/; revision=3160
2001-03-22 16:24:16 +00:00
Guy Harris 022cfcf826 The other "proto_tree_add" routines will, if the "tree" argument is
null, just return NULL without doing any work; make
"proto_tree_add_item()" do so as well.

svn path=/trunk/; revision=3139
2001-03-15 22:08:41 +00:00
Guy Harris a9659200c1 Add a new AT_OSI address type.
In the CLNP dissector, set the source and destination network-layer and
"top-level" addresses; this will cause them to show up in the source and
destination columns of the summary display if you're showing the
network-layer or top-level address (although you'll probably have to
widen those columns significantly to see the entire address), and also
makes them available to subdissectors.

svn path=/trunk/; revision=3131
2001-03-15 06:41:13 +00:00
Gilbert Ramirez 5664e5887f Make tvb_get_ptr() return 'const guint8*', and clean up all the
usages of tvb_get_ptr(). packet-ieee80211.c still has one bad usage,
in which it *does* modify the tvbuff's data.

svn path=/trunk/; revision=3128
2001-03-13 21:34:28 +00:00
Gilbert Ramirez 712548da3e In the code that handles finding a field after a user clicks on
a byte in the hex dump,

1. Fix an off-by-one error when finding the field. This only showed up
if the selected byte had no field of its own and was only designated
as part of the parent protocol (like the 00-padding at the beginning of
TCP options).

2. Fix an off-by-one error when clicking on a character in the second
half of the "text dump" portion of the hex dump. I forgot about the
extra space between the first 8 characters and the second 8 characters.

svn path=/trunk/; revision=3117
2001-03-07 19:33:24 +00:00
Gilbert Ramirez 4b6b3da4e7 Add some win32-specific targets in .cvsignore's.
Replace 'nmake' with $(MAKE) /$(MAKEFLAGS), from Mike Frisch.

svn path=/trunk/; revision=3108
2001-03-06 13:08:13 +00:00
Gilbert Ramirez d21e83b98b Move version to 0.8.16.
Fix build for splitting build dir from src dir.
Note the use of updated GTK+ release for Win32 binaries.

svn path=/trunk/; revision=3107
2001-03-05 22:53:41 +00:00
Guy Harris 1773080631 Fix some places where value-to-string routines were returning FALSE,
indicating an invalid string, but not reporting the error to the user.

svn path=/trunk/; revision=3098
2001-03-03 00:33:24 +00:00
Gilbert Ramirez 540f564993 Calculate the height and width of m_r_font globally, since various
routines need it.

When a user clicks on a hex digit or on the corresponding character
(the "text dump" portion) in the hex dump, find the field in the
proto_tree that the byte corresponds to, expand the GtkCTree so that
the field is viewable, select the field, and center it vertically.
LanAlyzer has this feature, and I've missed it in Ethereal.

svn path=/trunk/; revision=3096
2001-03-02 23:10:12 +00:00
Gilbert Ramirez cf75b3f6a8 Get rid of unused method from ftypes structure.
svn path=/trunk/; revision=3093
2001-03-02 17:17:56 +00:00
Gilbert Ramirez b24dff17bd Enable slices of [i-j], where i is start offset and j is end offset,
inclusive. That is, [0-1] is a slice of 2 bytes.

svn path=/trunk/; revision=3092
2001-03-02 17:04:25 +00:00
Gilbert Ramirez 187934cad4 Create proper display filter for FT_BOOLEAN when using "Match Selected".
svn path=/trunk/; revision=3089
2001-03-01 20:24:05 +00:00
Gilbert Ramirez b864c8d80d Move the location of cppmagic.h, since the lemon-flex include files
require it. It makes more sense to either put cppmagic with lemon, or
in yet another common directory. I'll just put it with lemon.

svn path=/trunk/; revision=3083
2001-02-27 20:34:09 +00:00
Gilbert Ramirez 2a50f8af4f Add Ed Warnicke's drange code to the new dfilter system.
Not supported yet: [i-j] (offset-offset)
Supported:
	[i]	index
	[i:j]	offset:length
	[:j]	0:offset
	[i:]	offset:end
	[x,y]	concatenation of slices

svn path=/trunk/; revision=3080
2001-02-27 19:23:30 +00:00
Guy Harris a954a9d276 Fix up the handling of NBIPX packets, and of Microsoft "direct hosting"
name-server-over-IPX and mailslot-datagram-over-IPX packets, based on
stuff dredged out of a pile of documents on the Web.

svn path=/trunk/; revision=3079
2001-02-27 07:28:48 +00:00
Guy Harris c61ee2b4ad Remove the Lemon stuff from EXTRA_DIST; the Lemon source is now in
"tools/lemon", and that directory's "Makefile.am" arranges to put the
Lemon stuff into the distribution.

svn path=/trunk/; revision=3077
2001-02-26 23:56:59 +00:00
Gilbert Ramirez 728ec7f581 Actually, this works better.
svn path=/trunk/; revision=3043
2001-02-16 19:45:38 +00:00
Gilbert Ramirez 9bf1a2e8d0 Use the proper way to denote that a single operation
produces 2 files. (grammar.lemon --> grammar.c grammar.h)

svn path=/trunk/; revision=3042
2001-02-16 19:44:16 +00:00
Guy Harris 352eec3037 More prototype fun - make the Lemon parser allocate and free routines
take fully-prototyped function arguments with types appropriate to
"g_malloc()" and "g_free()", and change the calls to the functions
pointed to by those arguments not pass the extra __FILE__ and __LINE__
arguments.

svn path=/trunk/; revision=3039
2001-02-15 06:22:46 +00:00
Guy Harris bea00e22cf In a display filter expression, make a field name refer to any of the
fields with that name.

svn path=/trunk/; revision=3030
2001-02-13 18:34:51 +00:00
Guy Harris 0196634a17 If there are multiple fields with the same name, list only one of them
in the output of "{ethereal,tethereal} -G", so that it appears only once
in the documentation.

Expand some comments to give more details.

svn path=/trunk/; revision=3024
2001-02-12 10:06:51 +00:00
Gilbert Ramirez 8cd8391b9a Make boolean equality/inequality tests smarter; they don't test
for exact value matches, but just that the two values are either zero
or non-zero.

svn path=/trunk/; revision=3015
2001-02-11 03:29:53 +00:00
Gilbert Ramirez ea7ef0fb0c Remove unused variable and add copyright and RCS ID.
svn path=/trunk/; revision=3013
2001-02-11 03:12:46 +00:00
Guy Harris b1eb3635c2 In "call_dissector()", if the protocol for the dissector referred to by
the handle has been disabled, return after calling "dissect_data()",
rather than driving on and calling the dissector anyway.

svn path=/trunk/; revision=3001
2001-02-08 07:06:55 +00:00
Gilbert Ramirez 95e09f5ac3 Add Makefile.nmake files for new subdirs.
Add them to EXTRA_DIST in corresponding Makefile.am's so that they
get packaged with the distribution.

svn path=/trunk/; revision=2979
2001-02-02 04:03:43 +00:00
Gilbert Ramirez 9627904c2a Catch any exception thrown by accessing the tvbuff.
svn path=/trunk/; revision=2978
2001-02-01 23:39:18 +00:00
Guy Harris ebf6ae7cf6 Make some pointers "guchar" pointers, so that characters extracted from
strings are unsigned, so that we can hand them to "isXXX()" macros
without GCC warning us that an array subscript is "char" (as in "if this
is a character with the 8th bit set, you may not get the answer you
think you should from 'isXXX()'").

svn path=/trunk/; revision=2972
2001-02-01 21:52:16 +00:00
Guy Harris c3ad47d04c Declare "proto_tree_set_protocol_tvb()" at the top, along with the other
"proto_tree_set_XXX_tvb()" routines.

svn path=/trunk/; revision=2971
2001-02-01 21:48:02 +00:00
Gilbert Ramirez 96e0398fc6 Grumble, grumble. I forgot to add the license comment at the top
of these files.

svn path=/trunk/; revision=2968
2001-02-01 20:31:21 +00:00
Gilbert Ramirez 8f1fff2e6a Create a more modular type system for the FT_* types. Put them
into epan/ftypes.

Re-write display filter routines using Lemon parser instead of yacc.
Besides using a different tool, the new grammar is much simpler, while
the display filter engine itself is more powerful and more easily extended.

Add dftest executable, to test display filter "bytecode" generation.
Add option to "configure" to build dftest or randpkt, both of which are not
built by default.

Implement Ed Warnicke's ideas about dranges in the new display filter and
ftype code.

Remove type FT_TEXT_ONLY in favor of FT_NONE, and have protocols registered
as FT_PROTOCOL. Thus, FT_NONE is used only for simple labels in the proto tree,
while FT_PROTOCOL is used for protocols. This was necessary for being
able to make byte slices (ranges) out of protocols, like "frame[0:3]"

Win32 Makefile.nmake's will be added tonight.

svn path=/trunk/; revision=2967
2001-02-01 20:21:25 +00:00
Guy Harris 8b51643203 "Decode As" dialog, from David Hampton.
svn path=/trunk/; revision=2965
2001-02-01 07:34:33 +00:00
Gilbert Ramirez 95c0b516c1 Correct a comment.
svn path=/trunk/; revision=2963
2001-01-31 05:52:24 +00:00
Guy Harris bffa9e3075 The plugin mechanism no longer uses display filters, so "plugins.h" no
longer needs to include "dfilter.h".

svn path=/trunk/; revision=2962
2001-01-31 05:41:57 +00:00
Guy Harris cc74cc0a5f Get rid of support for old-style plugins (support for old-style plugins
requires that the dfilter code be initialized before the plugins are
added; this required us to *re*-initialize the dfilter code after
reading in all the plugins, as the plugins may themselves have added new
filterable fields - that was a bit of a mess), and make the
"Tools->Plugins" dialog box show the new-style plugins.

svn path=/trunk/; revision=2950
2001-01-28 21:17:29 +00:00
Guy Harris 7eaadf4048 Add "col_clear()" to the list of functions in the transfer vector for
plugins, as the MGCP dissector uses it.

Don't set pointers to "dfilter_init()" and "dfilter_cleanup()" in that
transfer vector, as there *aren't* any pointers to them in the transfer
vector.

svn path=/trunk/; revision=2949
2001-01-28 20:26:20 +00:00
Guy Harris e7ea7a34e9 Clean up the dissector registration up a bit - arrange that all plugins
be loaded and their initialization routines called in right after we
call the initialization routines for built-in dissectors, but don't call
their handoff registration routines yet, and then call the handoff
registration routines right after calling the handoff registration
routines for built-in dissectors.

Do all that in "proto_init()", rather than "epan_init()".

That way, we call all dissector registration routines together, and then
call all dissector handoff registration routines together; all the
registration routines are called before any handoff registration
routines, as is required, and, as "proto_init()" is called by
"epan_init()" before "dfilter_init()" is called, all filterable fields
have been registered before "dfilter_init()" is called, and no plugins
have to call "dfilter_init()" themselves to get their fields registered.

Remove pointers to "dfilter_init()" and "dfilter_cleanup()" from the
plugin address table, as plugins shouldn't be calling them any more, and
remove calls to them from plugins.

svn path=/trunk/; revision=2940
2001-01-26 06:14:53 +00:00
Guy Harris 18bfc670ec Pull the handling of trailers in Ethernet (as opposed to 802.3) frames
into "ethertype()".

svn path=/trunk/; revision=2915
2001-01-18 07:44:41 +00:00
Guy Harris 4148aac56c Automake 1.4b (which is actually a test version of 1.5, i.e. of a
*future* version, not of 1.4, which is the *current* version - i.e.,
it's newer than 1.4) complains, if "dfilter-grammar.c" and
"dfilter-scanner.c" are part of "EXTRA_libethereal_a_SOURCES", that
"dfilter-grammar.o" is built both from "dfilter-grammar.c" and
"dfilter-grammar.y", and that "dfilter-scanner.o" is built both from
"dfilter-scanner.c" and "dfilter-scanner.l", and refuses to build
"Makefile.in".

Moving them to "EXTRA_DIST" makes 1.4b happy.

Automake 1.4 allows them either to be in "EXTRA_libethereal_a_SOURCES"
or in "EXTRA_DIST"; the only difference between the generated
"Makefile.in" files is which of those two variables the files are in,
and the only difference that makes is that it keeps those two files out
of "SOURCES", which means that "make ID" doesn't include them in the
files it looks at, and "make TAGS" and "make tags" don't include them in
the files they look at.  I'm not sure whether the tags file should be
built from "dfilter-grammar.y" and "dfilter-scanner.l", or from
"dfilter-grammar.c" and "dfilter-scanner.c"; the former means you see
the real source file, not the generated source file, if you look for a
symbol defined in one of those files, while the latter means you can
look for symbols in code generated by YACC/Bison or Flex.

In either case, the generated files go into the distribution tarball,
which is what we want.

For now, we go with what makes Automake 1.4b happy.

svn path=/trunk/; revision=2909
2001-01-17 06:13:39 +00:00
Guy Harris 2072d03e78 Tvbuffify the PIM dissector.
It was the last dissector that used "old_call_dissector()", and
tvbuffifying it got rid of that, so get rid of "old_call_dissector()".

svn path=/trunk/; revision=2892
2001-01-13 06:34:35 +00:00
Guy Harris 2245c85dfe Also save and restore the value of "pinfo->match_port" in
"{old_}dissector_try_port()", so that its value doesn't get changed out
from under a dissector that calls "{old_}dissectory_try_port()".

svn path=/trunk/; revision=2890
2001-01-13 04:28:42 +00:00
Guy Harris 6c9d2c3d67 In all the routines that set "pinfo->current_proto" before calling a
dissector, save the current value of "pinfo->current_proto" and restore
it before returning; when you return, you're back in the dissector that
called the routine to call a dissector, so the current protocol is the
one for that dissector.  This may be important if a dissector calls a
subdissector and, after it returns, processes stuff in the packet after
the stuff dissected by the subdissectror.

This means it's safe for "dissector_try_heuristic()" to set it before
calling a heuristic dissector, as it'll put back the previous value when
it returns.

svn path=/trunk/; revision=2886
2001-01-12 09:25:29 +00:00
Gilbert Ramirez 180a726414 Move the libethereal version to 0.8.15, and use the C preprocessor
macro "VERSION" to create the version-specific directory name for plugins
in plugins.c

svn path=/trunk/; revision=2883
2001-01-12 04:18:49 +00:00
Gilbert Ramirez 512d0d1c23 Change version numbers to 0.8.15
svn path=/trunk/; revision=2882
2001-01-12 04:06:25 +00:00
Guy Harris bd1d96cd6f In "{old_}dissector_try_port()", check whether the protocol for the
dissector is enabled and, if not, return FALSE, just as if there hadn't
been any entry for that port number in the table.  If it is enabled, set
"pinfo->current_proto" from its short name before calling the dissector.

In "dissector_try_heuristic()", check whether the protocols for
dissectors are enabled and, if not, skip those dissectors, just as if
they hadn't been in the table.  (We don't set "pinfo->current_proto"
before calling a dissector, as we don't know whether the dissector in
question will be the one to dissect the packet.  Arguably, we should
have, for heuristic dissectors, separate "recognize" and "dissect"
routines, where the former never throws an exception and returns TRUE or
FALSE, and the latter is called only if the "recognize" routine claimed
the frame, and is just a "dissector_t" that doesn't return a value.)

In "{old_}call_dissector()", check whether the protocol for the
dissector is enabled and, if not, call "{old_}dissect_data()".  if it is
enabled, set "pinfo->current_proto" from its short name before calling
the dissector.

svn path=/trunk/; revision=2861
2001-01-10 10:44:48 +00:00
Guy Harris 0ae122c3a9 Add a new "ip_to_str_buf()" routine that takes a pointer to an IP
address and a pointer to a character buffer as arguments, and puts a
printable form of the IP address into the buffer.  Make "ip_to_str()"
use it.

Make "host_name_lookup()" use "ip_to_str_buf()", not "ip_to_str()", so
that it doesn't trash any strings that a dissector has gotten with
"ip_to_str()" (for example, the ARP dissector gets strings for the
source and target protocol addresses, and then may attempt to register
names for the source and target hardware addresses with
"add_ether_byip()"; if "host_name_lookup()" fails to find a host name
for the IP address, it shouldn't use "ip_to_str()" to generate an IP
address string to associate with the IP address, as if that's done twice
it'll run out of "ip_to_str()" buffers - there're only 3 of them - and
trash one of the IP address strings the ARP dissector got).

svn path=/trunk/; revision=2850
2001-01-09 09:57:06 +00:00
Guy Harris 43ccfd8054 Add an additional "protocol index" argument to "{old_}dissector_add()",
"{old_}heur_dissector_add()", "{old_}conv_dissector_add()", and
"register_dissector()", so that an entry in those tables has associated
with it the protocol index of the protocol the dissector handles (or -1,
if there is no protocol index for it).

This is for future use in a number of places.

(Arguably, "proto_register_protocol()" should take a dissector pointer
as an argument, but

	1) it'd have to handle both regular and heuristic dissectors;

	2) making it take either a "dissector_t" or a union of that and
	   a "heur_dissector_t" introduces some painful header-file
	   interdependencies

so I'm punting on that for now.  As with other Ethereal internal APIs,
these APIs are subject to change in the future, at least until Ethereal
1.0 comes out....)

svn path=/trunk/; revision=2849
2001-01-09 06:32:10 +00:00
Guy Harris 925ce16014 Add tables of "conversation" dissectors, which are associated with
particular protocols, and which keep track of all dissectors that could
be associated with conversations using those particular protocols - for
example, the RTP and RTCP dissectors could be assigned to UDP
conversations.

This is for future use with UI features allowing the dissector for a
given conversation to be set from the UI, to allow

	1) conversations between two ports, both of which have
	   dissectors associated with them, that have been given to the
	   wrong dissector to be given to the right dissector;

	2) conversations between two ports, neither of which have
	   dissectors associated with them, to be given to a dissector
	   (RTP and RTCP, for example, typically run on random ports,
	   and if you don't have, in a capture, traffic that would say
	   "OK, traffic between these two hosts and ports will be RTP
	   traffic", you may have to tell Ethereal explicitly what
	   protocol the conversation is).

svn path=/trunk/; revision=2848
2001-01-09 05:53:21 +00:00
Guy Harris 3613c121fe Add a new "prefs_register_protocol()" routine, which is like
"prefs_register_module()" except that it takes a protocol index as
returned by "proto_register_protocol()" as its first argument, rather
than taking two character strings as arguments as its first two
arguments, and uses the protocol's abbreviation as the name to use for
preferences in the preferences file and the "-o" flag and uses the
protocol's short name as the name to use in the tabs in the
"Edit->Preferences" window.

svn path=/trunk/; revision=2812
2001-01-03 07:53:48 +00:00
Guy Harris 0e7c1de08a Have "proto_register_protocol()" build a list of data structures for
protocols, in addition to adding structures to the list of filterable
fields.  Give it an extra argument that specifies a "short name" for the
protocol, for use in such places as

	pinfo->current_proto;

	the dialog box for constructing filters;

	the preferences tab for the protocol;

and so on (although we're not yet using it in all those places).

Make the preference name that appears in the preferences file and the
command line for the DIAMETER protocol "diameter", not "Diameter"; the
convention is that the name in question be all-lower-case.

Make some routines and variables that aren't exported static.

Update a comment in the ICP dissector to make it clear that the
dissector won't see fragments other than the first fragment of a
fragmented datagram.

svn path=/trunk/; revision=2810
2001-01-03 06:56:03 +00:00
Guy Harris 11b24c6094 Tvbuffify the RIP and OSPF dissectors.
Change them to use facilities in Ethereal that were probably not present
when they were originally written, e.g. routines to fetch 24-bit
integers and to dump a bunch of raw bytes in hex.

Redo them to extract data from the packet as they dissect it, rather
than extracting an entire data structure at once; that way, it may be
able to dissect a structure not all of which is in the packet.

Dissect a bit more of the type-of-service metrics etc. in OSPF packets.

Make "tvb_length_remaining()" return a "gint", not a "guint"; it returns
-1 if the offset is past the end of the tvbuff.

Add a "tvb_reported_length_remaining()" routine, similar to
"tvb_length_remaining()".  Use it instead of just subtracting an offset
from "tvb_reported_length()".

svn path=/trunk/; revision=2787
2000-12-27 12:48:27 +00:00
Guy Harris d46aa3d576 Add a new "tvb_strsize()" routine, which finds the size of a
NUL-terminated string, starting at a given offset.  The size includes
the terminating NUL.  If it doesn't find the terminating NUL, it throws
the appropriate exception, as either there's no terminating NUL in the
packet or there is but it's past the end of the captured data in the
packet.

Use that routine in the TFTP dissector.  As it throws an exception if
the string isn't NUL-terminated, we can just use "%s" to print option
strings; we don't need to use "%.*s" with a string length.

svn path=/trunk/; revision=2783
2000-12-25 23:48:16 +00:00
Nathan Neulinger d9c2256fa2 fix '#endif FRED' to '#endif /* FRED */'
svn path=/trunk/; revision=2771
2000-12-22 22:26:19 +00:00
Gilbert Ramirez fe8e42b58e Enable FT_BYTES dfiltering, from Ed Warnicke.
svn path=/trunk/; revision=2768
2000-12-22 12:05:38 +00:00
Guy Harris 677a1c6dc2 Add code to check the checksums of TCP segments and UDP datagrams;
replace the existing checksummer with a modified version of the BSD
checksumming code.  Add a flag to the "packet_info" structure to
indicate that a packet is the first fragment of a fragmented datagram,
so that the checksummers won't try to checksum those.

(It doesn't seem to add a lot of CPU overhead, so we don't introduce a
flag to disable it, yet.  Further checks may be necessary to see whether
the overhead is just swamped by other overheads when scanning through a
capture dissecting all frames, or if it truly is negligible.)

Make the Boolean preference option controlling whether to make the
top-level protocol tree item for TCP display a packet summary static to
the TCP dissector (it doesn't need to be accessible outside the TCP
dissector).

svn path=/trunk/; revision=2751
2000-12-13 02:24:23 +00:00
Guy Harris a3fa5541a8 Add a "col_clear()" routine, to clear a column; it appears (and it
doesn't just seem to be a profiling artifact) that, at least on FreeBSD
3.4, it's significantly more efficient to clear out a column by stuffing
a '\0' into the first byte of the column data than to do so by copying a
null string (I guess when copying one byte, the fixed overhead of the
procedure call and of "strcpy()" is significant).

Have the TCP dissector set the Protocol column, and clear the Info
column, before doing anything that might cause an exception to be
thrown, so that if we *do* get an exception thrown, the frame at least
shows up as TCP.

Instead of, in the TCP dissector, constructing a string and then
stuffing it into the Info column, just append to the Info column, which
avoids one string copy.

Pass a "frame_data" pointer to dissectors for TCP and IP (and PPP)
options, so they can use it to append to the Info column.

svn path=/trunk/; revision=2744
2000-12-04 06:37:46 +00:00
Guy Harris e152085fa8 Update a comment.
svn path=/trunk/; revision=2742
2000-12-03 22:53:09 +00:00
Guy Harris 79d456e315 Declare "proto_malformed" in "packet-frame.h", as "packet-frame.c"
exports it.

Make the pointer that points to the GMemChunk for per-frame data static
to "epan/packet.c", as it's not used outside "epan/packet.c".

svn path=/trunk/; revision=2741
2000-12-03 22:32:10 +00:00
Guy Harris 6b744058c3 Nothing in "packet.c" uses the global "cfile", so there's no need to
declare it there.

svn path=/trunk/; revision=2740
2000-12-03 22:26:26 +00:00
Guy Harris 35b1907af8 Pull the code to set the fields in the "cfile.cinfo" structure into a
common routine to initialize a "column_info()" structure, shared by
Ethereal and Tethereal.

svn path=/trunk/; revision=2739
2000-12-03 22:12:21 +00:00
Guy Harris 50f6a061a7 In "tvb_find_guint8()" and "tvb_pbrk_guint8()", correctly set the limit
of the search if the caller-supplied limit goes past the end of the
tvbuff - the limit should just be what remains in the tvbuff after the
specified starting offset.

In "tvb_find_line_end_unquoted()", after searching for the next
interesting character, check the value we got back from that search, in
"char_offset", not whatever happens to be in "cur_offset", to see if we
found a character.

svn path=/trunk/; revision=2719
2000-11-30 06:11:32 +00:00
Gilbert Ramirez a0729a25dd In tvb_set_reported_length(), don't assert on
reported_length <= tvb->reported_length, but throw a ReportedBoundsError
if that condition is not met.

svn path=/trunk/; revision=2718
2000-11-30 03:24:16 +00:00
Guy Harris 458a156913 Get the suffix for dynamically-loaded modules by means of a hack
involving "g_module_build_path()", rather than by checking the platform
- this should let us handle non-Windows platforms that don't use ".so"
(e.g., HP-UX).

Use G_DIR_SEPARATOR_S as the pathname separator character when
generating the pathname of the module.

svn path=/trunk/; revision=2712
2000-11-29 09:10:03 +00:00
Gilbert Ramirez f69e977a76 Move Win32 version to 0.8.14.1
svn path=/trunk/; revision=2705
2000-11-28 15:54:20 +00:00
Guy Harris b4219afa51 Generated Bison and Flex files test whether __STDC__ is defined
in order to check whether to use ANSI C features such as "const".

GCC defines it as 1 even if extensions that render the implementation
non-conformant are enabled; Sun's C compiler (and, I think, other
AT&T-derived C compilers) define it as 0 if extensions that render
the implementation non-conformant are enabled; Microsoft Visual C++
6.0 doesn't define it at all if extensions that render the implementation
non-conformant are enabled.

We define it as 0 in "config.h.win32", so that those generated files will use
those features (and thus not get type warnings when compiled with
MSVC++).

svn path=/trunk/; revision=2698
2000-11-22 07:20:27 +00:00
Uwe Girlich 65d9f034eb Senseless old prototype for rpc init removed.
svn path=/trunk/; revision=2686
2000-11-21 14:15:21 +00:00
Gilbert Ramirez 5a0e2a658a Move to version 0.8.14
svn path=/trunk/; revision=2682
2000-11-20 17:10:26 +00:00
Gilbert Ramirez 95efc598a0 Move tvbtest.c to EXTRA_DIST
svn path=/trunk/; revision=2679
2000-11-20 16:18:08 +00:00
Gerald Combs 0c887fd488 Check to make sure the h_addr entry returned by gethostbyname() can fit
into an in_addr struct.

svn path=/trunk/; revision=2673
2000-11-19 19:45:54 +00:00
Guy Harris 252d55d80f For each column, have both a buffer into which strings for that column
can be put, and a pointer to the string for the column, which might or
might not point to that buffer.

Add a routine "col_set_str()", which sets the string for the column to
the string passed to it as an argument; it should only be handed a
static string (a string constant would be ideal).  It doesn't do any
copying, so it's faster than "col_add_str()".

Make the routines that append to columns check whether the pointer to
the string for the column points to the buffer for the column and, if
not, copy the string for the column to the buffer for the column so that
you can append to it (so you can use "col_set_str()" and then use
"col_append_str()" or "col_append_fstr()").

Convert a bunch of "col_add_str()" calls that take a string constant as
an argument to "col_set_str()" calls.

Convert some "col_add_fstr()" calls that take a string constant as the
only argument - i.e., the format string doesn't have any "%" slots into
which to put strings for subsequent arguments to "col_set_str()" calls
(those calls are just like "col_add_str()" calls).

Replace an END_OF_FRAME reference in a tvbuffified dissector with a
"tvb_length(tvb)" call.

svn path=/trunk/; revision=2670
2000-11-19 08:54:37 +00:00
Guy Harris 74777083d3 Fix a number of problems that caused compiles to fail if
PLUGINS_NEED_ADDRESS_TABLE was defined.

svn path=/trunk/; revision=2662
2000-11-18 21:41:40 +00:00
Guy Harris ea00ad9f58 Nobody calls "old_try_conversation_dissector()" or
"old_dissector_try_heuristic()" any more, as their users have all been
tvbuffified - get rid of them.

svn path=/trunk/; revision=2660
2000-11-18 11:47:21 +00:00
Guy Harris 6bab5c02f0 Put in an empty declaration of "struct dissector_handle" before
typedeffing "dissector_handle_t" to be a pointer to it.

svn path=/trunk/; revision=2659
2000-11-18 10:51:07 +00:00
Guy Harris c8196a1d1c Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.

Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.

Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate).  Then use it in IP.

Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.

svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
Guy Harris 67f0e0b41b Do the checks for the presence of a conversation dissector the same way
in "try_conversation_dissector()" that they're done in
"old_try_conversation_dissector()".

svn path=/trunk/; revision=2656
2000-11-18 07:00:31 +00:00
Guy Harris 69ebb146e8 Don't attempt to call the dissector for a conversation if the
conversation doesn't have a dissector.

svn path=/trunk/; revision=2655
2000-11-18 06:51:42 +00:00
Guy Harris ee1b884ee9 Tvbuffify the STP dissector, have it register itself and have the LLC
dissector call it through a handle, and make it static.

Give "dissect_data()" an "offset" argument, so dissectors can use it to
dissect part of the packet without having to cook up a new tvbuff.

Go back to using "dissect_data()" to dissect the data in an IPP request.

svn path=/trunk/; revision=2651
2000-11-16 07:35:43 +00:00
Guy Harris 2fa39ce7d3 Move the table of bit-swapped byte values to "epan/bitswap.c", and
declare it, and define a "BIT_SWAP" macro that uses it, in
"epan/bitswap.h".

Use that macro to bit-swap bytes in the IEEE 802.11 dissector, rather
than the macro that was used (said macro used GCCisms and didn't compile
on Windows).

Make an "init_plugin()" routine to enable a plugin and call its init
routine, and call it from "check_plugin_status()" and
"plugins_enable_cb()", rather than having very similar code in two
places; "patable" is now part of libethereal, and, at least on Windows,
attempts to refer to it from "libui" failed.  Make "patable" static to
"epan/plugins.c".  (This may still not work, as now "libui" is calling a
routine in "libethereal"; if that fails, perhaps it's time to get rid of
the "enable/disable plugins" stuff completely, as new-style plugins, at
least, register themselves as protocols and should be controllable from
the "Edit->Protocols" window just as built-in dissectors are.)

svn path=/trunk/; revision=2649
2000-11-15 09:37:53 +00:00
Guy Harris 77ad89b12d Add a mechanism by which a dissector can be registered by name, another
dissector can get a "handle" for that dissector by name and then call
that dissector through the handle.

This allows dissectors that can't be called through a port table or a
heuristic table to be called from other dissectors without directly
referring to the dissector function - dynamically-loaded modules, under
Windows, cannot directly call functions in the main program, and
non-plugin dissectors are in the main program and thus cannot be called
from plugin dissectors unless either

	1) a pointer to the dissector is put in the Big Transfer Vector

or

	2) some other mechanism for getting a pointer to the dissector
	   is provided.

This mechanism could also support registering old-style dissectors and
calling them from new-style dissectors without the new-style dissector
having to do the argument translation itself (I didn't add support for
registering old-style dissectors because I'd prefer to have people
tvbuffify their code if they have to register a dissector...).

It could also, in the future, perhaps support

	disabling of protocols;

	setting "pinfo->current_proto";

inside "call_dissector()" - and inside "{old_}dissector_try_port()" and
"{old_"dissector_try_heuristic()" - allowing a pile of stuff that
currently has to be done in every dissector be done by common code.
(I have some ideas about how to do this, by

	having "proto_register_protocol()" take an abbreviation - of the
	sort that would be put in, for example, "pinfo->current_proto" -
	as an argument;

	having the calls to register dissectors take an index returned
	by "proto_register_protocol()" as an argument.

The abbreviation could be used elsewhere as well, e.g. in the "Decoding"
tab of the "Edit->Protocols" dialog box, and in a GUI for constructing
protocol filters.  Watch this space.)

Make "dissect_sdp()" the first client of this mechanism; it's now static
to "packet-sdp.c", and all dissectors that call it - including the MGCP
plugin - now call it through a dissector handle fetched by
"find_dissector()".  (Next step - see if Ethereal can now compile on
Windows as a result of this.)

svn path=/trunk/; revision=2647
2000-11-15 07:07:52 +00:00
Gilbert Ramirez 29a2973984 Add tvb_set_child_real_data_tvbuff(), which allows you to tell the
tvbuff routines that a particular TVBUFF_REAL_DATA tvbuff is a "child"
of another tvbuff. This link is utilized during a tvb_free_chain(), so that
the child is freed when no longer necessary.

svn path=/trunk/; revision=2642
2000-11-14 04:33:34 +00:00
Guy Harris b830fb6a5f Add "dissector_delete()", "proto_item_get_len()",
"proto_item_set_len()", "proto_item_set_text()", and the preference
routines expected to be used by dissectors to the table of function
pointers handed to dissectors on platforms where dynamically-loaded
modules can't access symbols from the main program.

svn path=/trunk/; revision=2638
2000-11-13 10:13:26 +00:00
Guy Harris ead1cadaf3 Add the tvbuff routines expected to be used by dissectors to the table
of function pointers handed to dissectors on platforms where
dynamically-loaded modules can't access symbols from the main program.

svn path=/trunk/; revision=2635
2000-11-13 08:00:12 +00:00
Guy Harris 99c98f9e74 Move "bytes_to_str()" to "strutil.c" from "packet.c" - it's just a
string formatter, like "format_text()", and, as "tvbuff.c" now calls it
(*vide infra*), we don't want to have to make "tvbuff.c" drag "packet.h"
in just to declare "bytes_to_str()".  It's now declared in "strutil.h",
so include it in modules that use "bytes_to_str()" and weren't already
including it.

Add a "tvb_bytes_to_str()" wrapper that calls "tvb_get_ptr()" to get a
pointer to a chunk of N bytes at a given offset in a tvbuff and then
hands that chunk to "bytes_to_str()".  Convert the code that was doing
that to use "tvb_bytes_to_str()" instead (which caught what I suspect is
a bug in the Q.2931 dissector, where it was handing an offset of 0 to
"tvb_get_ptr()" - a cut-and-pasteo, I think).

Tvbuffify the ARP dissector.

svn path=/trunk/; revision=2634
2000-11-13 07:19:37 +00:00
Guy Harris e8c75b74bf Add a Makefile.nmake for the MGCP plugin, and update
"plugins/Makefile.nmake" to build that plugin.

Add to the table of routines callable from plugins
"old_dissector_add()", "old_dissect_data()", and
"proto_is_protocol_enabled()", so that the Gryphon dissector can build
on Windows.

Move the includes of "plugins/plugin_api.h" and "moduleinfo.h" before
all the other includes, except for "config.h", in "plugin-mgcp.c", to
match what the Gryphon dissector does; "plugins_api.h" must be included
before any of the routines whose names it #defines in order for the
plugin to build on Windows.  (It still doesn't build on Windows, as
still more routines need to be added to the table of routines callable
from plugins, but tomorrow is another day.  Making libethereal a DLL may
obviate the need for that table, *if* all the routines called from a
plugin are in libethereal, as I think routines in a DLL, even a
run-time-loaded DLL, can call routines from another DLL as long as those
routines are exported from the other DLL.)

svn path=/trunk/; revision=2623
2000-11-12 21:20:50 +00:00
Guy Harris f8934eb9e7 Make "tvb_find_line_end()" and "tvb_find_line_end_unquoted()" treat CR
by itself as a line ending, as well as treating CR LF and LF as line
endings.

Tweak the Telnet dissector to treat LF and CR NUL as line endings, but
not to treat CR by itself as a line ending (that's not exactly what the
NVT specification in the Telnet RFC specifies, but the resulting output
may be a bit more readable that way).

svn path=/trunk/; revision=2613
2000-11-12 00:59:09 +00:00
Guy Harris b9d2dd7151 Make the string-to-compare-with arguments to "tvb_strneql()" and
"tvb_strncaseeql()" "const guint8 *", so that you can pass them pointers
to "const".

svn path=/trunk/; revision=2611
2000-11-11 19:55:48 +00:00
Guy Harris 00e5867b10 Get rid of the definitions of LITTLE_ENDIAN and BIG_ENDIAN in
"epan/pint.h" - they caused GCC to whine about them being redefined when
I compiled on FreeBSD 3.4.

Get rid of the stuff in "packet-ipv6.h" that defines various bit vectors
differently depending on the byte order of the machine; instead, define
them so that they work with items in host byte order.  This lets us use
a number of them rather than using hardwired hex values.

Put "frag.ip6f_offlg" in host byte order before using it; this means
that IP6F_MORE_FRAG can still be used even though it now works only on
items in host byte order.

svn path=/trunk/; revision=2610
2000-11-11 10:23:43 +00:00
Guy Harris b63646ecc0 Allow "tvb_find_guint8()", "tvb_pbrk_guint8()", and "tvb_strnlen()" to
take -1 as a "maxlength" value, meaning "to the end of the tvbuff".

svn path=/trunk/; revision=2598
2000-11-10 09:15:57 +00:00
Guy Harris 07eb30403d Tvbuffify the SAP and SDP dissectors.
Add "tvb_find_line_end_unquoted()" for the benefit of the SDP dissector;
get rid of "find_line_end_unquoted()" as nobody uses it any more.

Add "tvb_pbrk_guint8()" for the benefit of
"tvb_find_line_end_unquoted()"; it searches for any of a number of
characters, unlike "tvb_find_guint8()" which searches for only one.

svn path=/trunk/; revision=2595
2000-11-10 06:50:37 +00:00
Guy Harris 01a890cf95 Tvbuffify the HTTP, NNTP, RSH, RTSP, and Telnet dissectors.
Add "tvb_find_line_end()", to find a CR and/or LF-terminated line in a
tvbuff and return its length and the offset of the character after the
line end, for the use of those dissectors.

Add "tvb_strncaseeql()", which is like "tvb_strneql()" except that it
does a case-insensitive comparison.

svn path=/trunk/; revision=2590
2000-11-09 10:56:33 +00:00
Guy Harris 37ec8b1b32 Support for embedded newlines in SDP fields, from Robert Tsai.
svn path=/trunk/; revision=2584
2000-11-09 02:42:33 +00:00
Guy Harris 1964cfddf6 Allow plugins to have, instead of "protocol" and "filter_string"
variables and a "dissector" routine, a "plugin_reg_handoff()" routine,
which will act just like the "reg_handoff()" routine of a non-plugin
dissector, registering the dissector with handoff tables.

This lets them plug into both TCP and UDP, or plug into protocols other
than TCP or UDP.

Those new-style plugin are enabled and disabled using the standard
"Edit->Protocols" mechanism (and thus should use
"OLD_CHECK_DISPLAY_AS_DATA()" or "CHECK_DISPLAY_AS_DATA()"); they don't
show up in the list of plugins, aren't enabled or disabled from that
list, and, as they don't have a filter, can't have the filter changed
from that list - instead, they should register preferences for port
numbers and the like if they should be configurable to use different
ports.

Make the Gryphon protocol a new-style plugin.

svn path=/trunk/; revision=2565
2000-11-05 09:05:00 +00:00
Nathan Neulinger e636484bf2 Corrected BASE_OCT support for display formats. Note - it probably isn't
correct to display ints.

svn path=/trunk/; revision=2552
2000-11-03 17:26:47 +00:00
Guy Harris 7d663fe7b0 Add a fourth choice of time format in the packet list display, which
shows the date (in YYYY-MM-DD format) as well as the time of day when
the packet arrived.

svn path=/trunk/; revision=2547
2000-11-01 08:31:36 +00:00
Gilbert Ramirez 4386002cc3 Move to version 0.8.13.
Mention IGRP dissector in NEWS.

svn path=/trunk/; revision=2539
2000-10-27 02:22:08 +00:00
Gilbert Ramirez 1cf5db2c23 Added some autoconf- and automake-generated files to .cvsignore.
svn path=/trunk/; revision=2538
2000-10-27 02:11:09 +00:00
Guy Harris 86ceeff7db Wildcard matching is tricky - you have to try wildcarding both the
source *and* destination port and/or both the source *and* destination
address passed to "find_conversation()", because the packet for which
you're trying to find the conversation may be going in the opposite
direction to the packet for which the conversation was originally
created.

Create different hash tables for wildcarded conversations, to reduce the
number of "is this a wildcard?" tests done when doing hash lookups.

This is sufficient to allow the TFTP dissector to use conversations
rather than being special-cased in the UDP dissector, and may also be
sufficient to handle a similar problem with SMTP (request goes from
client IP X port Y to server IP Z's well-known port, reply comes back
from some other port on server Z to client IP X port Y), but further use
may reveal other changes that should be made.

svn path=/trunk/; revision=2525
2000-10-21 09:54:12 +00:00
Guy Harris 563f86ee5e Support for conversations with "wildcard" destination addresses, from
Jeff Foster.

svn path=/trunk/; revision=2523
2000-10-21 05:52:28 +00:00
Guy Harris fb84384942 Move the declaration of "g_resolving_actif" from the top-level
"globals.h" file to "epan/resolv.h", as it's exported by
"epan/resolv.c", have files that use "g_resolving_actif" include
"resolv.h", and don't have "epan/resolv.c" include "globals.h" so that
it doesn't drag in, for example, headers that, in turn, drag in GTK+
headers.

svn path=/trunk/; revision=2517
2000-10-19 22:59:24 +00:00
Guy Harris d4f5b852d9 There's no "exception.h" header file in "epan", but there is
"exceptions.h".

svn path=/trunk/; revision=2514
2000-10-19 07:18:19 +00:00
Guy Harris 9de17c39f5 Get rid of extra declaration of HAVE_DIRECT_H; one is enough.
svn path=/trunk/; revision=2510
2000-10-18 09:34:10 +00:00
Guy Harris 2030dba693 Make the top-level "config.h.win32" more closely resemble the top-level
"config.h", and update it to include stuff added to "config.h" and
remove stuff removed from "config.h".

Give libethereal a "config.h.win32" and make its "Makefile.nmake" file
copy it to "config.h".

svn path=/trunk/; revision=2504
2000-10-17 09:25:37 +00:00
Guy Harris 1a793d05ee Patch from Heikki Vatiainen to make "tvb_strnlen()" return the length of
the string rather than the offset of the end of the string, plus a patch
to "tvb_get_nstringz()" to treat the return value of "tvb_strnlen()" as
a length rather than an end offset.

svn path=/trunk/; revision=2502
2000-10-17 08:50:57 +00:00
Guy Harris fc1ed4cd4b Do checks for platform-specific compiler flags in the libethereal and
wiretap configure scripts as well as in the main configure script.

svn path=/trunk/; revision=2501
2000-10-17 07:30:35 +00:00
Guy Harris cba377df3c Give libethereal its own configuration file, and have that configuration
file, rather than the top-level Ethereal configuration file, check for
"inet_aton()", "inet_pton()", and "inet_ntop()".  Then make its
Makefile.am include the appropriate object files if necessary.
Otherwise, they don't get built and put into libethereal, and therefore
attempts to link with anything in libethereal that uses them fail on
platforms that lack ethem, causing the build to fail.

That means a bunch of things need to be fixed to cope with libethereal
having its own "config.h" file; this means removing the include of
"config.h" from some libethereal header files.  Move the definitions of
the path names used only by "resolv.c" to "resolv.c" from "resolv.h" (so
"resolv.h" doesn't need "config.h", define HAVE_PLUGINS in the configure
script (so we don't have to include it in "plugins.h" to check whether
HAVE_DLFCN_H is defined).

Unfortunately, stuff outside libethereal needs to know PLUGIN_DIR; for
now, define that in the top-level configuration file, and have Ethereal
and Tethereal pass it as an argument to "epan_init()" - that should be
cleaned up at some point.

Remove from the top-level configure script checks for things used only
in libethereal.

svn path=/trunk/; revision=2498
2000-10-16 23:18:05 +00:00
Gilbert Ramirez 26bda31ed9 Move inet_*.[ch] files to epan.
svn path=/trunk/; revision=2494
2000-10-14 04:31:26 +00:00
Gilbert Ramirez aff507ff0a While keeping the directory named 'epan' and the symbols in the library
starting with "epan_", change the name of the library from libepan.a to
libethereal.a, and from libepan.lib to ethereal.lib.

svn path=/trunk/; revision=2492
2000-10-14 03:53:25 +00:00
Guy Harris faf70584f2 Fix it to build on Windows.
svn path=/trunk/; revision=2488
2000-10-11 07:35:02 +00:00
Gilbert Ramirez e69b5278aa Implement epan_dissect_new() and epan_dissect_free(). These are the
"top-level" dissectors that libepan-users call, instead of dissect_packet().
The epan_dissect_t holds the tvbuff after dissection so that the tvbuff's
memory is not cleared until after the proto_tree is freed. (I might stuff
the proto_tree into the epan_dissect_t, too).

What remains of dissect_packet() in packet.c handles the tvbuff initialiation.
The real meat of dissect_packet() is now in dissect_frame(), in packet-frame.c
This means that "packet.c" is no longer a dissector, os it is no longer
passed to make-reg-dotc.

Once dissect_fddi() gets two wrapper functions (dissect_fddi_swapped()
and dissect_fddi_nonswapped()), the a dissector handoff routine could
be used instead of the switch statement in dissect_frame(). I'd register
a field like "wtap.encap"

svn path=/trunk/; revision=2478
2000-10-06 10:11:40 +00:00
Olivier Abad 22031f399d - HAVE_PLUGINS is defined in plugins.h so it must be included here.
- get rid of the "epan" argument for init_plugins()

svn path=/trunk/; revision=2471
2000-09-30 10:19:01 +00:00
Guy Harris 213e7d9360 If a line consists *solely* of an LF, set "*eol" to point to the LF.
svn path=/trunk/; revision=2469
2000-09-30 05:44:48 +00:00
Guy Harris bdca198efb Dynamically grow the buffer used by "format_text()", rather than cutting
the text off at 62 characters.

svn path=/trunk/; revision=2466
2000-09-29 19:02:37 +00:00
Gilbert Ramirez 0efe324371 Simple code movement.
svn path=/trunk/; revision=2463
2000-09-28 03:52:12 +00:00
Gilbert Ramirez df710d82c7 Simple code movement to epan.
svn path=/trunk/; revision=2462
2000-09-28 03:28:54 +00:00
Gilbert Ramirez 9d9850f209 More EPAN-related code movements. Get rid of usage of #include "globals.h"
and #include "util.h" from epan code. Move get_home_dir() into epan/filesystem.c
as it's used by plugins.c.

svn path=/trunk/; revision=2461
2000-09-28 03:16:29 +00:00
Gilbert Ramirez cba2930d6b Move packet.[ch] to epan
svn path=/trunk/; revision=2460
2000-09-27 05:18:06 +00:00
Gilbert Ramirez 137fa6c00e Fix for bug in lex command.
svn path=/trunk/; revision=2459
2000-09-27 05:05:32 +00:00
Gilbert Ramirez 83ec54675c First step in moving core Ethereal routines to libepan.
svn path=/trunk/; revision=2458
2000-09-27 04:55:05 +00:00