aboutsummaryrefslogtreecommitdiffstats
path: root/packet-snmp.c
AgeCommit message (Collapse)AuthorFilesLines
2004-01-23"sprint_realloc_value()" takes a "u_char **" as an argument - pass itguy1-3/+3
one. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9806 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-23signed/unsigned warning fixesjmayer1-18/+18
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9790 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-17splitted some of the preferences texts into more than one line,ulfl1-2/+2
to reduce the size of the preferences dialog. This becoming necessary, as some of the texts were huge git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9693 f5534014-38df-0310-8fa8-9805f1628bb7
2003-11-16Export "protocol_t" as an opaque type.guy1-2/+2
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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8979 f5534014-38df-0310-8fa8-9805f1628bb7
2003-11-02From Gisle Vanem:gerald1-1/+15
* 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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8859 f5534014-38df-0310-8fa8-9805f1628bb7
2003-10-29Plug that leak with a cleanup handler, so we don't leak the variable OIDguy1-3/+15
if we throw an exception fetching the variable value. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8818 f5534014-38df-0310-8fa8-9805f1628bb7
2003-10-29...and there's one leak we missed.guy1-1/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8817 f5534014-38df-0310-8fa8-9805f1628bb7
2003-10-29Another leak that isn't.guy1-2/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8816 f5534014-38df-0310-8fa8-9805f1628bb7
2003-10-29Actually, one of those *isn't* a leak; don't free something we haven'tguy1-2/+1
allocated yet. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8815 f5534014-38df-0310-8fa8-9805f1628bb7
2003-10-29Fix some memory leaks found by Steve Ford.guy1-1/+4
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8814 f5534014-38df-0310-8fa8-9805f1628bb7
2003-09-08There is no such thing as a preference that's not set - stringguy1-28/+20
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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8417 f5534014-38df-0310-8fa8-9805f1628bb7
2003-09-08Don't unload the MIBs unless we've loaded them.guy1-6/+10
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8416 f5534014-38df-0310-8fa8-9805f1628bb7
2003-09-08From Kari Tiirikainen: have a preference setting giving the MIB moduleguy1-6/+83
list, and use that when loading MIBs. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8415 f5534014-38df-0310-8fa8-9805f1628bb7
2003-09-06Handle SNMP-over-TCP.guy1-38/+184
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8401 f5534014-38df-0310-8fa8-9805f1628bb7
2003-09-04Back out the previous change - sometimes the newlines should be mappedguy1-13/+1
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.... git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8366 f5534014-38df-0310-8fa8-9805f1628bb7
2003-08-04UCD SNMP sometimes puts newlines into the printable form of an SNMPguy1-1/+13
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). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8124 f5534014-38df-0310-8fa8-9805f1628bb7
2003-06-19make snmp request id a filterable field instead of just a text entrysahlberg1-3/+7
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7902 f5534014-38df-0310-8fa8-9805f1628bb7
2003-05-03SNMP dissector enhancements:deniel1-18/+116
- 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 git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7637 f5534014-38df-0310-8fa8-9805f1628bb7
2003-04-27Replace some unchecked malloc calls by g_malloc.deniel1-6/+6
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7584 f5534014-38df-0310-8fa8-9805f1628bb7
2003-04-19Run strings through "format_text()" before putting them into items inguy1-44/+68
the protocol tree. Give SMUX filterable fields for the version and PDU type. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7499 f5534014-38df-0310-8fa8-9805f1628bb7
2003-04-19Squelch a compiler warning.guy1-7/+8
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7497 f5534014-38df-0310-8fa8-9805f1628bb7
2003-04-18From Thierry Andry: more filterable fields in SNMP.guy1-23/+59
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7495 f5534014-38df-0310-8fa8-9805f1628bb7
2003-03-02From Jochen Friedrich: add support for:guy1-1/+3
HP extended 802.2 LLC HP-UX remote management over HP extended 802.2 LLC SNMP over HP extended 802.2 LLC. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7253 f5534014-38df-0310-8fa8-9805f1628bb7
2003-01-28* Fix compilation errors with some installation of NET-SNMPdeniel1-7/+61
* Fix some compilation warnings (conservative changes here) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7028 f5534014-38df-0310-8fa8-9805f1628bb7
2002-11-11"#ifdef" doesn't take Boolean expressions as arguments; use "#ifguy1-2/+2
defined(A) && defined(B)" to check whether both A and B are defined. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6613 f5534014-38df-0310-8fa8-9805f1628bb7
2002-11-10Add tethereal's tap objects to Makefile.nmake's "clean" target.gerald1-2/+26
Instead of setting MIBDIRS in tethereal.c and gtk/main.c, set it in packet-snmp.c. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6606 f5534014-38df-0310-8fa8-9805f1628bb7
2002-10-24Don't include the header file to get the SNMP version unless we'reguy1-5/+6
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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6493 f5534014-38df-0310-8fa8-9805f1628bb7
2002-10-24This helps packet-snmp.c compile if you don't HAVE_NET_SNMP or HAVE_UCD_SNMP.tpot1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6492 f5534014-38df-0310-8fa8-9805f1628bb7
2002-10-23From Wes Hardaker:guy1-4/+5
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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6483 f5534014-38df-0310-8fa8-9805f1628bb7
2002-10-22Wes Hardaker: Support NET-SNMP in addition to UCD-SNMPjmayer1-29/+43
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6475 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-28Removed trailing whitespaces from .h and .c files using thejmayer1-45/+45
winapi_cleanup tool written by Patrik Stridvall for the wine project. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6117 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-21Moved the generic true_false_string saying "Set", "Not set" intotpot1-6/+1
epan/packet.c It was cut and pasted into seven other dissectors! git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6052 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-02Replace the types from sys/types.h and netinet/in.h by their glib.hjmayer1-14/+6
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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5932 f5534014-38df-0310-8fa8-9805f1628bb7
2002-05-30Don't pass "tvb_reported_length_remaining(tvb, offset)" as the fourthguy1-2/+3
argument to "tvb_new_subset()" - just use -1 if the subset tvbuff is to run to the end of the parent tvbuff. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5597 f5534014-38df-0310-8fa8-9805f1628bb7
2002-04-08If variables are used only if "HAVE_UCD_SNMP" is undefined, declare themguy1-2/+3
only if "HAVE_UCD_SNMP" is undefined. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5117 f5534014-38df-0310-8fa8-9805f1628bb7
2002-04-01From Kikuchi Ayamura: include <ucd-snmp/ucd-snmp-config.h> to fix IRIXguy1-1/+2
compilation problems. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5073 f5534014-38df-0310-8fa8-9805f1628bb7
2002-03-31(Conditionally) mark unused variables as such.guy1-3/+13
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5063 f5534014-38df-0310-8fa8-9805f1628bb7
2002-03-26Make the UCD SNMP library read its configuration files, so that, forguy1-2/+15
example, you can configure it to read in MIB files other than the default ones. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5022 f5534014-38df-0310-8fa8-9805f1628bb7
2002-03-12Get rid of the "--enable-snmp" option; instead, use "--with-ucdsnmp".guy1-26/+22
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". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4930 f5534014-38df-0310-8fa8-9805f1628bb7
2002-03-11"format_var()" returns a "malloc()"ed string, not a "g_malloc()"edguy1-5/+6
string; free it with "free()", not "g_free()". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4925 f5534014-38df-0310-8fa8-9805f1628bb7
2002-03-11If we're linking with the UCD SNMP library, make "format_oid()" append aguy1-45/+35
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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4924 f5534014-38df-0310-8fa8-9805f1628bb7
2002-03-11The "val_len" member of a "struct variable_list" should be set to theguy1-7/+6
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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4922 f5534014-38df-0310-8fa8-9805f1628bb7
2002-03-10Use "ds_set_int()", not "snmp_set_suffix_only()", to set the "printguy1-2/+2
suffixes only" setting. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4916 f5534014-38df-0310-8fa8-9805f1628bb7
2002-03-10Use the "sprint_realloc_" routines in UCD SNMP 4.2.2 and later, ratherguy1-419/+128
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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4914 f5534014-38df-0310-8fa8-9805f1628bb7
2002-03-06Check to make sure SNMP_IPADDR items are 4 bytes long and SNMP_COUNTER64guy1-3/+38
items are 8 bytes long. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4882 f5534014-38df-0310-8fa8-9805f1628bb7
2002-03-01Add a routine to "asn1.c" to translate ASN1_ERR_ values to strings. Useguy1-29/+5
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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4833 f5534014-38df-0310-8fa8-9805f1628bb7
2002-02-19From Andrew Hood: translate enterprise OIDs in SNMP traps to strings ifguy1-1/+13
possible. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4758 f5534014-38df-0310-8fa8-9805f1628bb7
2002-01-24Replace a bunch of "tvb_length()" and "tvb_length_remaining()" calls inguy1-5/+3
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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4605 f5534014-38df-0310-8fa8-9805f1628bb7
2002-01-21Include files from the "epan" directory and subdirectories thereof withguy1-4/+4
"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/"). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4586 f5534014-38df-0310-8fa8-9805f1628bb7
2001-12-12Work around changes made to recent Red Hat ucd-snmp packages. Seegerald1-1/+17
http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=57421 for details. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4387 f5534014-38df-0310-8fa8-9805f1628bb7