Commit Graph

29 Commits

Author SHA1 Message Date
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
Gilbert Ramirez db187f965c Change the sub-dissector handoff registration routines so that the
sub-dissector table is not stored in the header_field_info struct, but
in a separate namespace. Dissector tables are now registered by name
and not by field ID. For example:

        udp_dissector_table = register_dissector_table("udp.port");

Because of this different namespace, dissector tables can have names
that are not field names.  This is useful for ethertype, since multiple
fields are "ethertypes".

packet-ethertype.c replaces ethertype.c (the name was changed so that it
would be named in the same fashion as all the filenames passed to make-reg-dotc)

Although it registers no protocol or field, it registers one dissector table:

	ethertype_dissector_table = register_dissector_table("ethertype");

All protocols that can be called because of an ethertype field now register
that fact with dissector_add() calls.

In this way, one dissector_table services all ethertype fields
(hf_eth_type, hf_llc_type, hf_null_etype, hf_vlan_etype)

Furthermore, the code allows for names of protocols to exist in the
etype_vals, yet a dissector for that protocol doesn't exist. The name
of the dissector is printed in COL_INFO. You're welcome, Richard. :-)

svn path=/trunk/; revision=1848
2000-04-13 18:18:56 +00:00
Guy Harris 42107e8614 Move calls to "dissector_add()" out of the register routines for TCP and
UDP and into the handoff registration routines for the protocols in
question.

Make the dissectors for those protocols static if they're not called
outside the dissector's source file.

Get rid of header files if all they did was declare dissectors that are
now static; remove declarations of now-static dissectors from header
files that do more than just declare the dissector.

svn path=/trunk/; revision=1823
2000-04-08 07:07:42 +00:00
Guy Harris 3fa89a91c3 Treat the two integers after the request ID in a BulkPDU as
"non-repeaters" and "max-repetitions" rather than as "error status" and
"error index".

svn path=/trunk/; revision=1721
2000-03-15 07:12:55 +00:00
Guy Harris 777335fcc3 Dietmar Petras' fix to the handling of SNMPv2 TRAP PDUs.
Fix a comment.

svn path=/trunk/; revision=1720
2000-03-15 07:05:10 +00:00
Guy Harris cbadb570b2 UCD SNMP 4.1[.x] makes "snmp_set_full_objid()" a macro that calls
"ds_set_boolean()" with the first two arguments being DS_LIBRARY_ID and
DS_LIB_PRINT_FULL_OID; this means that, when building with 4.1[.x]
(which we assume is the case if "snmp_set_full_objid" is defined, we
need to include <ucd-snmp/default_store.h>, to define those two values
and to declare "ds_set_boolean()".

svn path=/trunk/; revision=1657
2000-02-20 03:32:29 +00:00
Guy Harris 7a943b7810 Fix Gerald's e-mail address.
svn path=/trunk/; revision=1437
2000-01-07 22:05:43 +00:00
Guy Harris dbc4cd9530 Sigh. Some versions of CMU SNMP appear to lack the SMI_ #defines; for
now, assume that if they lack that, they lack "sprint_value()".

svn path=/trunk/; revision=1326
1999-12-14 10:16:11 +00:00
Guy Harris a5ce81c250 Don't try to get UCD SNMP to define the CMU SNMP SMI_ values; they may
not have been supported in older versions of CMU SNMP.  Instead, pick
our own names for the values, and define them appropriately for UCD and
CMU SNMP.

svn path=/trunk/; revision=1322
1999-12-14 05:59:16 +00:00
Guy Harris 4a08c26dff If we have an SNMP library, use its routines for printing values; that
way, it checks that the type of the variable matches the type it's
claimed to have in the MIB (and indicates if it isn't), it can decode
enumerated types, and it may also use the DISPLAY-HINT string in the
MIB.

Handle unknown types better.

svn path=/trunk/; revision=1293
1999-12-12 01:51:47 +00:00
Guy Harris 4b41f91139 Fix a couple of typos.
svn path=/trunk/; revision=1290
1999-12-11 06:58:41 +00:00
Guy Harris d300a2bb04 Don't use MAX_NAME_LEN*6 for string buffers, define our own
MAX_STRING_LEN and use that.

svn path=/trunk/; revision=1286
1999-12-10 21:00:53 +00:00
Guy Harris 81c1c2b119 CMU SNMP doesn't have a documented way of including *only* those header
files you need for the MIB-related routines, so I'm including
<snmp/snmp.h>; unfortunately, that "helpfully" defines a pile of things
we later define, giving rise to a bunch of compiler complaints, so we
undefine them after including <snmp/snmp.h>.

svn path=/trunk/; revision=1285
1999-12-10 20:45:37 +00:00
Guy Harris 78b64f0262 Make the SNMP dissector use the ASN.1 code, rather than the SNMP library
code, to dissect SNMP PDUs; use the SNMP library code only to translate
OIDs into strings.

Put into the ASN.1 code an annoying hack to cope with the fact that UCD
SNMP makes an OID out of "u_long"s whilst CMU SNMP makes it out of
"u_int"s - have the ASN.1 code make it out of "subid_t"s, and typedef
"subid_t" appropriately depending on the SNMP library you have.

Eventually, we should be able to use "libsmi" instead of a full-blown
SNMP library, and thus possibly work around various aggravations with
the SNMP libraries.

svn path=/trunk/; revision=1280
1999-12-10 09:49:29 +00:00
Guy Harris 272505c220 As per Nathan Leulinger's suggestion, have a stub SNMP dissector if
there are no SNMP libraries to use in a real dissector; this means that
other dissectors don't have to care if there are SNMP libraries, they
can just call "dissect_snmp()" - and this also simplifies "Makefile.am"
and "configure.in" a bit, as they just treat "packet-snmp.c" and
"packet-snmp.h" the same way they treat other dissector source files.

svn path=/trunk/; revision=1214
1999-12-05 02:33:52 +00:00
Guy Harris f5831f290a ILMI is just SNMP-over-ATM AAL5; if the SNMP dissector is available,
dissect ILMI packets with the SNMP dissector.

svn path=/trunk/; revision=1054
1999-11-18 07:29:55 +00:00
Guy Harris a7aba0a288 Replace the ETT_ "enum" members, declared in "packet.h", with
dynamically-assigned "ett_" integer values, assigned by
"proto_register_subtree_array()"; this:

	obviates the need to update "packet.h" whenever you add a new
	subtree type - you only have to add a call to
	"proto_register_subtree_array()" to a "register" routine and an
	array of pointers to "ett_", if they're not already there, and
	add a pointer to the new "ett_" variable to the array, if they
	are there;

	would allow run-time-loaded dissectors to allocate subtree types
	when they're loaded.

svn path=/trunk/; revision=1043
1999-11-16 11:44:20 +00:00
Guy Harris ca5bfca312 Arrange that "proto_register_snmp()" be defined regardless of whether
SNMP dissection is enabled or not, so that if "register.c" was generated
by scanning a list of files that include "packet-snmp.c" even though
SNMP dissection isn't enabled (the standard "Makefile.in" and
"configure" script won't cause that to happen, but source distributions
such as BSD ports may be set up to do that), and thus includes a call to
"proto_register_snmp()", that won't cause the link to fail.

svn path=/trunk/; revision=931
1999-10-27 02:05:09 +00:00
Guy Harris d0844608c5 The previous patch didn't fix code used only with the CMU SNMP library;
make the equivalent fix to that code.

svn path=/trunk/; revision=927
1999-10-25 20:50:19 +00:00
Guy Harris 4d3e30133d Tomislav Vujec's patch to squelch some complaints from GCC (hopefully,
"asn_parse_header()" and "snmp_constr_parse()" don't actually modify the
data to which their first arguments point - if so, we have bigger
problems; I have no reason to believe they would modify it...).

svn path=/trunk/; revision=921
1999-10-24 07:36:20 +00:00
Laurent Deniel 35d5e37a82 Some old CPP or tools that take C code in input do
not like #preprocessor_macros that do not start at
the first column.

So write:

#ifdef FOO
#  include <dummy1.h>
#  define DUMMY 1
#else
#  include <dummy2.h>
#  define DUMMY 2
#endif

instead of

#ifdef FOO
  #include <dummy1.h>
  #define DUMMY 1
#else
  #include <dummy2.h>
  #define DUMMY 2
#endif

svn path=/trunk/; revision=668
1999-09-12 14:34:36 +00:00
Gilbert Ramirez af5f43fb70 Fix some compilation warnings.
svn path=/trunk/; revision=609
1999-08-29 04:15:31 +00:00
Guy Harris a6a41e0b59 Call "init_mib()" in "proto_register_snmp()"; not doing so causes core
dumps (probably because the SNMP libraries expect it to have been
called).

svn path=/trunk/; revision=533
1999-08-20 21:26:37 +00:00
Guy Harris da1baa7d22 Fix it to build with CMU, as well as UCD, SNMP.
svn path=/trunk/; revision=403
1999-07-29 07:11:23 +00:00
Gilbert Ramirez 7bd6c15378 Made the protocol (but not the fields) use the new proto_tree routine,
allowing users to filter on the existence of these protocols. I also
added packet-clip.c to the Nmake makefile.

svn path=/trunk/; revision=402
1999-07-29 05:47:07 +00:00
Gilbert Ramirez 07f42b5b31 Created a new protocol tree implementation and a new display filter
mechanism that is built into ethereal. Wiretap is now used to read all
file formats. Libpcap is used only for capturing.

svn path=/trunk/; revision=342
1999-07-07 22:52:57 +00:00
Guy Harris 34178557c8 Use "val_to_str()", rather than "get_XXX()" routines, to map SNMP
versions, PDU types, error statuses, and trap types to strings.

Set the protocol column to "SNMP", and set the info column to an error
message if the parse fails (rather than printing a message to the
standard error) and to the PDU type if it succeeds.

svn path=/trunk/; revision=305
1999-06-12 04:17:19 +00:00
Gilbert Ramirez 7f11c8a6d7 Fixed to actually compile with CMU SNMP library (at least on Linux).
svn path=/trunk/; revision=289
1999-05-16 04:13:29 +00:00
Gilbert Ramirez c50d66ba7c Added Didier Jorand's dissect_snmp routine. This is only compiled in
if you have the UCD or CMU SNMP library available. If you have the SNMP
library but do not with to have SNMP support, use the
	./configure --disable-snmp
option. Otherwise 'configure' finds the SNMP library and uses it.

svn path=/trunk/; revision=281
1999-05-12 05:56:42 +00:00