Commit Graph

126 Commits

Author SHA1 Message Date
Guy Harris b06f65e9da "sprint_realloc_value()" takes a "u_char **" as an argument - pass it
one.

svn path=/trunk/; revision=9806
2004-01-23 10:25:08 +00:00
Jörg Mayer 2acfd47690 signed/unsigned warning fixes
svn path=/trunk/; revision=9790
2004-01-23 00:40:00 +00:00
Ulf Lamping 8020cdf176 splitted some of the preferences texts into more than one line,
to reduce the size of the preferences dialog.
This becoming necessary, as some of the texts were huge

svn path=/trunk/; revision=9693
2004-01-17 12:51:00 +00:00
Guy Harris 7bd2e232a9 Export "protocol_t" as an opaque type.
Make "proto_is_protocol_enabled()" and "proto_get_protocol_short_name()"
take a "protocol_t *" as an argument, so they don't have to look up the
"protocol_t" - this will probably speed them up considerably, and
they're called on almost every dissector handoff.

Get rid of a number of "proto_is_protocol_enabled()" calls that aren't
necessary (dissectors called through handles, including those called
through dissector tables, or called as heuristic dissectors, aren't even
called if their protocol isn't enabled).

Change some direct dissector calls to go through handles.

svn path=/trunk/; revision=8979
2003-11-16 23:17:27 +00:00
Gerald Combs 031db8b9c8 From Gisle Vanem:
* Added a new function get_file_in_temp() to
  epan/filesystem.c. This because of asn1.dll plugin which
  had code to write to a log-file "c:\temp\ethereal.log". I feel
  this patch makes this safer; I don't even have a c:\temp dir.

* Patched packet-asn1.c to use get_file_in_temp().

* Added some #undef to packet-snmp.c to silence gcc.

* Changed "%u" -> "%lu" formats in util.c

Rename get_file_in_temp() to get_tempfile_path() to match other function
names.

svn path=/trunk/; revision=8859
2003-11-02 23:12:35 +00:00
Guy Harris b9b73fe54c Plug that leak with a cleanup handler, so we don't leak the variable OID
if we throw an exception fetching the variable value.

svn path=/trunk/; revision=8818
2003-10-29 22:11:08 +00:00
Guy Harris 795ce752e9 ...and there's one leak we missed.
svn path=/trunk/; revision=8817
2003-10-29 22:04:57 +00:00
Guy Harris 596dfa55f0 Another leak that isn't.
svn path=/trunk/; revision=8816
2003-10-29 22:02:11 +00:00
Guy Harris e604b9e693 Actually, one of those *isn't* a leak; don't free something we haven't
allocated yet.

svn path=/trunk/; revision=8815
2003-10-29 22:00:54 +00:00
Guy Harris 04a5cb7737 Fix some memory leaks found by Steve Ford.
svn path=/trunk/; revision=8814
2003-10-29 21:54:45 +00:00
Guy Harris c324caf6aa There is no such thing as a preference that's not set - string
preferences are set to a null string if their value is null - so just
initialize "mib_modules" to DEF_MIB_MODULES and then, in the register
routine, override that with the setting of MIBS if it's set.

svn path=/trunk/; revision=8417
2003-09-08 20:45:50 +00:00
Guy Harris 62e7edc971 Don't unload the MIBs unless we've loaded them.
svn path=/trunk/; revision=8416
2003-09-08 20:21:04 +00:00
Guy Harris ecfe90744d From Kari Tiirikainen: have a preference setting giving the MIB module
list, and use that when loading MIBs.

svn path=/trunk/; revision=8415
2003-09-08 20:16:47 +00:00
Guy Harris 5fcb7af0d1 Handle SNMP-over-TCP.
svn path=/trunk/; revision=8401
2003-09-06 01:21:00 +00:00
Guy Harris 3af28de032 Back out the previous change - sometimes the newlines should be mapped
to "\n", and other control characters should be, as the strings are
text, not binary.  We really need our own routines to do the formatting
of SNMP variable values ourselves....

svn path=/trunk/; revision=8366
2003-09-04 05:16:18 +00:00
Guy Harris 29e5ea2e2a UCD SNMP sometimes puts newlines into the printable form of an SNMP
value; turn those newlines into spaces, as the text for a protocol tree
item shouldn't contain newlines (or tabs, or any other non-printable
characters).

svn path=/trunk/; revision=8124
2003-08-04 07:38:15 +00:00
Ronnie Sahlberg 8d241c2d68 make snmp request id a filterable field instead of just a text entry
svn path=/trunk/; revision=7902
2003-06-19 10:25:10 +00:00
Laurent Deniel d896d69930 SNMP dissector enhancements:
- display OID in info column

- preference added to disable such a display

- add new function new_format_oid to retrieve both
  decoded and non decoded OID strings

- add OID display filter for both decoded and non decoded strings

- add Error Status display filter

svn path=/trunk/; revision=7637
2003-05-03 15:23:15 +00:00
Laurent Deniel 4e9e699536 Replace some unchecked malloc calls by g_malloc.
svn path=/trunk/; revision=7584
2003-04-27 20:57:58 +00:00
Guy Harris 9cd871da88 Run strings through "format_text()" before putting them into items in
the protocol tree.

Give SMUX filterable fields for the version and PDU type.

svn path=/trunk/; revision=7499
2003-04-19 09:45:25 +00:00
Guy Harris e0e6edf0e8 Squelch a compiler warning.
svn path=/trunk/; revision=7497
2003-04-19 06:04:58 +00:00
Guy Harris 02f45277ed From Thierry Andry: more filterable fields in SNMP.
svn path=/trunk/; revision=7495
2003-04-18 21:05:52 +00:00
Guy Harris 3b37905e24 From Jochen Friedrich: add support for:
HP extended 802.2 LLC

	HP-UX remote management over HP extended 802.2 LLC

	SNMP over HP extended 802.2 LLC.

svn path=/trunk/; revision=7253
2003-03-02 21:52:21 +00:00
Laurent Deniel 327767a838 * Fix compilation errors with some installation of NET-SNMP
* Fix some compilation warnings (conservative changes here)

svn path=/trunk/; revision=7028
2003-01-28 22:53:22 +00:00
Guy Harris 0c61b86e30 "#ifdef" doesn't take Boolean expressions as arguments; use "#if
defined(A) && defined(B)" to check whether both A and B are defined.

svn path=/trunk/; revision=6613
2002-11-11 17:34:22 +00:00
Gerald Combs 2329ea1483 Add tethereal's tap objects to Makefile.nmake's "clean" target.
Instead of setting MIBDIRS in tethereal.c and gtk/main.c, set it in
packet-snmp.c.

svn path=/trunk/; revision=6606
2002-11-10 20:53:06 +00:00
Guy Harris ae1ebc09da Don't include the header file to get the SNMP version unless we're
building with an SNMP library.

If we have Net-SNMP, include <net-snmp/version.h>, not
<ucd-snmp/version.h>.

Don't include any of the SNMP headers unless HAVE_SOME_SNMP is defined.

Include <net-snmp/config_api.h> if we have Net-SNMP, to declare
"read_premib_configs()" and "read_configs()".

Supply the include directories for Net-SNMP in the Makefile.nmake for
GTK 1.2 and GTK 2.

svn path=/trunk/; revision=6493
2002-10-24 07:08:26 +00:00
Tim Potter d3c91154c5 This helps packet-snmp.c compile if you don't HAVE_NET_SNMP or HAVE_UCD_SNMP.
svn path=/trunk/; revision=6492
2002-10-24 06:39:09 +00:00
Guy Harris cc8a765d8e From Wes Hardaker:
Define HAVE_SOME_SNMP if either HAVE_UCD_SNMP or HAVE_NET_SNMP
	is defined, and use HAVE_SOME_SNMP, rather than HAVE_UCD_SNMP,
	in most places when testing whether we have an SNMP library or
	not.

	Be more selective when including Net-SNMP header files.

Fix up {gtk,gtk2}/main.c to do the same SNMP stuff that tethereal.c
does - including the MIB stuff that gtk/main.c was doing but gtk2/main.c
wasn't doing.

Fix the copyright date in gtk/main.c.

svn path=/trunk/; revision=6483
2002-10-23 18:24:09 +00:00
Jörg Mayer 4c80b2ac3f Wes Hardaker: Support NET-SNMP in addition to UCD-SNMP
svn path=/trunk/; revision=6475
2002-10-22 20:06:15 +00:00
Jörg Mayer 7c4176d868 Removed trailing whitespaces from .h and .c files using the
winapi_cleanup tool written by Patrik Stridvall for the wine
project.

svn path=/trunk/; revision=6117
2002-08-28 21:04:11 +00:00
Tim Potter 60e4ca9c4f Moved the generic true_false_string saying "Set", "Not set" into
epan/packet.c

It was cut and pasted into seven other dissectors!

svn path=/trunk/; revision=6052
2002-08-21 21:25:23 +00:00
Jörg Mayer 173fe5aef4 Replace the types from sys/types.h and netinet/in.h by their glib.h
equivalents for the toplevel directory. The removal of winsock2.h will
hopefully not cause any problems under MSVC++, as those files using
struct timeval still include wtap.h, which still includes winsock2.h.

svn path=/trunk/; revision=5932
2002-08-02 23:36:07 +00:00
Guy Harris 4401f1433f Don't pass "tvb_reported_length_remaining(tvb, offset)" as the fourth
argument to "tvb_new_subset()" - just use -1 if the subset tvbuff is to
run to the end of the parent tvbuff.

svn path=/trunk/; revision=5597
2002-05-30 01:56:55 +00:00
Guy Harris 12d83302b0 If variables are used only if "HAVE_UCD_SNMP" is undefined, declare them
only if "HAVE_UCD_SNMP" is undefined.

svn path=/trunk/; revision=5117
2002-04-08 01:55:05 +00:00
Guy Harris c0565b3fbe From Kikuchi Ayamura: include <ucd-snmp/ucd-snmp-config.h> to fix IRIX
compilation problems.

svn path=/trunk/; revision=5073
2002-04-01 22:00:00 +00:00
Guy Harris 2963d86afd (Conditionally) mark unused variables as such.
svn path=/trunk/; revision=5063
2002-03-31 22:43:47 +00:00
Guy Harris 4d842c13de Make the UCD SNMP library read its configuration files, so that, for
example, you can configure it to read in MIB files other than the
default ones.

svn path=/trunk/; revision=5022
2002-03-26 06:35:03 +00:00
Guy Harris 6327b456db Get rid of the "--enable-snmp" option; instead, use "--with-ucdsnmp".
Make the directory option to "--with-ucdsnmp" optional.  Handle
"--with-ucdsnmp" similar to the way "--with-pcap" is handled.

Get rid of unnecessary #defines in "packet-cops.c".

Get rid of no-longer-necessary include of "dlfcn.h" in "packet-snmp.c".

svn path=/trunk/; revision=4930
2002-03-12 10:37:04 +00:00
Guy Harris bb172432d1 "format_var()" returns a "malloc()"ed string, not a "g_malloc()"ed
string; free it with "free()", not "g_free()".

svn path=/trunk/; revision=4925
2002-03-11 01:51:37 +00:00
Guy Harris 7e8c5a1741 If we're linking with the UCD SNMP library, make "format_oid()" append a
display of the symbolic form of the OID.  Remove code that used to do
that outside of "format_oid()".

Export "format_oid()" from "packet-snmp.c" and use it in
"packet-cops.c".

Remove support for CMU SNMP and older versions of UCD SNMP from
"packet-cops.c", as it has been removed from the rest of Ethereal.

svn path=/trunk/; revision=4924
2002-03-11 01:48:08 +00:00
Guy Harris d9a00fc228 The "val_len" member of a "struct variable_list" should be set to the
length of the variable's value, in bytes, not the length of the BER
encoding of that variable's value.  The latter setting means it won't be
correct for object IDs.

svn path=/trunk/; revision=4922
2002-03-11 01:40:28 +00:00
Guy Harris bdbb567087 Use "ds_set_int()", not "snmp_set_suffix_only()", to set the "print
suffixes only" setting.

svn path=/trunk/; revision=4916
2002-03-10 23:17:00 +00:00
Guy Harris d50103f67f Use the "sprint_realloc_" routines in UCD SNMP 4.2.2 and later, rather
than the "sprint_" routines in UCD and CMU SNMP; the latter routines
have no bounds checking, and if you use them you cannot protect against
buffer overflows.

As we now require UCD SNMP 4.2.2 or later:

	1) we no longer need code to support CMU SNMP;

	2) we no longer need code to work around problems with UCD SNMP
	   4.1.1;

and, as we no longer use the "sprint_" routines, we no longer need code
to work around the changed API and ABI of those routines in some
nonstandard versions of the UCD SNMP library.

svn path=/trunk/; revision=4914
2002-03-10 22:18:12 +00:00
Guy Harris f4f14e0128 Check to make sure SNMP_IPADDR items are 4 bytes long and SNMP_COUNTER64
items are 8 bytes long.

svn path=/trunk/; revision=4882
2002-03-06 03:52:13 +00:00
Guy Harris d8a08e186c Add a routine to "asn1.c" to translate ASN1_ERR_ values to strings. Use
that in the SNMP dissector.

Check the return values of ASN.1 routines in the LDAP dissector, and
have all the subroutines in that disesctor that can return error
indications return ASN1_ERR_ values.

Have the routines that can supply a pointer to a newly-created
protocol-tree item use the right type for items ("proto_item *", not
"proto_tree *", even though they are, at least currently, typedefs for
the same type), and use "proto_item" for the type of the item a pointer
to which is passed to those routines.

Before calling those routines, set the item pointer to null, in case the
routine fails.

Don't check the return value of "parse_filter_strings()" against -1 -
that routine can't return -1.

svn path=/trunk/; revision=4833
2002-03-01 02:48:10 +00:00
Guy Harris ddf6a753f0 From Andrew Hood: translate enterprise OIDs in SNMP traps to strings if
possible.

svn path=/trunk/; revision=4758
2002-02-19 09:35:45 +00:00
Guy Harris eb2d6593dc Replace a bunch of "tvb_length()" and "tvb_length_remaining()" calls in
arguments to "proto_tree_add_text()", and to "proto_tree_add_XXX()" calls
that add FT_NONE or FT_PROTO items to the protocol tree, with -1.

Replace some calls to "tvb_length()" or "tvb_length_remaining()" with
calls to "tvb_reported_length()" and "tvb_reported_length_remaining()",
as those give the actual length of the data in the packet, not just the
data that happened to be captured.

svn path=/trunk/; revision=4605
2002-01-24 09:20:54 +00:00
Guy Harris ee5ca25d31 Include files from the "epan" directory and subdirectories thereof with
"epan/..." pathnames, so as to avoid collisions with header files in any
of the directories in which we look (e.g., "proto.h", as some other
package has its own "proto.h" file which it installs in the top-level
include directory).

Don't add "-I" flags to search "epan", as that's no longer necessary
(and we want includes of "epan" headers to fail if the "epan/" is left
out, so that we don't re-introduce includes lacking "epan/").

svn path=/trunk/; revision=4586
2002-01-21 07:37:49 +00:00
Gerald Combs 3dedae14f9 Work around changes made to recent Red Hat ucd-snmp packages. See
http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=57421

for details.

svn path=/trunk/; revision=4387
2001-12-12 05:26:53 +00:00