aboutsummaryrefslogtreecommitdiffstats
path: root/packet-snmp.c
AgeCommit message (Collapse)AuthorFilesLines
2003-04-27Replace some unchecked malloc calls by g_malloc.Laurent Deniel1-6/+6
svn path=/trunk/; revision=7584
2003-04-19Run strings through "format_text()" before putting them into items inGuy Harris1-44/+68
the protocol tree. Give SMUX filterable fields for the version and PDU type. svn path=/trunk/; revision=7499
2003-04-19Squelch a compiler warning.Guy Harris1-7/+8
svn path=/trunk/; revision=7497
2003-04-18From Thierry Andry: more filterable fields in SNMP.Guy Harris1-23/+59
svn path=/trunk/; revision=7495
2003-03-02From Jochen Friedrich: add support for:Guy Harris1-1/+3
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-01-28* Fix compilation errors with some installation of NET-SNMPLaurent Deniel1-7/+61
* Fix some compilation warnings (conservative changes here) svn path=/trunk/; revision=7028
2002-11-11"#ifdef" doesn't take Boolean expressions as arguments; use "#ifGuy Harris1-2/+2
defined(A) && defined(B)" to check whether both A and B are defined. svn path=/trunk/; revision=6613
2002-11-10Add tethereal's tap objects to Makefile.nmake's "clean" target.Gerald Combs1-2/+26
Instead of setting MIBDIRS in tethereal.c and gtk/main.c, set it in packet-snmp.c. svn path=/trunk/; revision=6606
2002-10-24Don't include the header file to get the SNMP version unless we'reGuy Harris1-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. svn path=/trunk/; revision=6493
2002-10-24This helps packet-snmp.c compile if you don't HAVE_NET_SNMP or HAVE_UCD_SNMP.Tim Potter1-2/+2
svn path=/trunk/; revision=6492
2002-10-23From Wes Hardaker:Guy Harris1-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. svn path=/trunk/; revision=6483
2002-10-22Wes Hardaker: Support NET-SNMP in addition to UCD-SNMPJörg Mayer1-29/+43
svn path=/trunk/; revision=6475
2002-08-28Removed trailing whitespaces from .h and .c files using theJörg Mayer1-45/+45
winapi_cleanup tool written by Patrik Stridvall for the wine project. svn path=/trunk/; revision=6117
2002-08-21Moved the generic true_false_string saying "Set", "Not set" intoTim Potter1-6/+1
epan/packet.c It was cut and pasted into seven other dissectors! svn path=/trunk/; revision=6052
2002-08-02Replace the types from sys/types.h and netinet/in.h by their glib.hJörg Mayer1-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. svn path=/trunk/; revision=5932
2002-05-30Don't pass "tvb_reported_length_remaining(tvb, offset)" as the fourthGuy Harris1-2/+3
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-04-08If variables are used only if "HAVE_UCD_SNMP" is undefined, declare themGuy Harris1-2/+3
only if "HAVE_UCD_SNMP" is undefined. svn path=/trunk/; revision=5117
2002-04-01From Kikuchi Ayamura: include <ucd-snmp/ucd-snmp-config.h> to fix IRIXGuy Harris1-1/+2
compilation problems. svn path=/trunk/; revision=5073
2002-03-31(Conditionally) mark unused variables as such.Guy Harris1-3/+13
svn path=/trunk/; revision=5063
2002-03-26Make the UCD SNMP library read its configuration files, so that, forGuy Harris1-2/+15
example, you can configure it to read in MIB files other than the default ones. svn path=/trunk/; revision=5022
2002-03-12Get rid of the "--enable-snmp" option; instead, use "--with-ucdsnmp".Guy Harris1-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". svn path=/trunk/; revision=4930
2002-03-11"format_var()" returns a "malloc()"ed string, not a "g_malloc()"edGuy Harris1-5/+6
string; free it with "free()", not "g_free()". svn path=/trunk/; revision=4925
2002-03-11If we're linking with the UCD SNMP library, make "format_oid()" append aGuy Harris1-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. svn path=/trunk/; revision=4924
2002-03-11The "val_len" member of a "struct variable_list" should be set to theGuy Harris1-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. svn path=/trunk/; revision=4922
2002-03-10Use "ds_set_int()", not "snmp_set_suffix_only()", to set the "printGuy Harris1-2/+2
suffixes only" setting. svn path=/trunk/; revision=4916
2002-03-10Use the "sprint_realloc_" routines in UCD SNMP 4.2.2 and later, ratherGuy Harris1-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. svn path=/trunk/; revision=4914
2002-03-06Check to make sure SNMP_IPADDR items are 4 bytes long and SNMP_COUNTER64Guy Harris1-3/+38
items are 8 bytes long. svn path=/trunk/; revision=4882
2002-03-01Add a routine to "asn1.c" to translate ASN1_ERR_ values to strings. UseGuy Harris1-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. svn path=/trunk/; revision=4833
2002-02-19From Andrew Hood: translate enterprise OIDs in SNMP traps to strings ifGuy Harris1-1/+13
possible. svn path=/trunk/; revision=4758
2002-01-24Replace a bunch of "tvb_length()" and "tvb_length_remaining()" calls inGuy Harris1-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. svn path=/trunk/; revision=4605
2002-01-21Include files from the "epan" directory and subdirectories thereof withGuy Harris1-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/"). svn path=/trunk/; revision=4586
2001-12-12Work around changes made to recent Red Hat ucd-snmp packages. SeeGerald Combs1-1/+17
http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=57421 for details. svn path=/trunk/; revision=4387
2001-12-10Move the pointer to the "column_info" structure in the "frame_data"Guy Harris1-23/+23
structure to the "packet_info" structure; only stuff that's permanently stored with each frame should be in the "frame_data" structure, and the "column_info" structure is not guaranteed to hold the column values for that frame at all times - it was only in the "frame_data" structure so that it could be passed to dissectors, and, as all dissectors are now passed a pointer to a "packet_info" structure, it could just as well be put in the "packet_info" structure. That saves memory, by shrinking the "frame_data" structure (there's one of those per frame), and also lets us clean up the code a bit. svn path=/trunk/; revision=4370
2001-12-03Make "dissector_add()", "dissector_delete()", and "dissector_change()"Guy Harris1-9/+10
take a dissector handle as an argument, rather than a pointer to a dissector function and a protocol ID. Associate dissector handles with dissector table entries. svn path=/trunk/; revision=4308
2001-11-27Change "conversation_set_dissector()" to take a dissector handle, ratherGuy Harris1-11/+4
than a pointer to a dissector function, as an argument. This means that the conversation dissector is called through "call_dissector()", so the dissector itself doesn't have to worry about checking whether the protocol is enabled or setting "pinfo->current_proto", so get rid of the code that does that in conversation dissectors. Also, make the conversation dissectors static. Get rid of some direct calls to dissectors; replace them with calls through handles, and, again, get rid of code to check whether a protocol is enabled and set "pinfo->current_proto" where that code isn't needed. Make those dissectors static if they aren't already static. Add a routine "create_dissector_handle()" to create a dissector handle without registering it by name, if the dissector isn't used outside the module in which it's defined. svn path=/trunk/; revision=4281
2001-11-26Switched from using CHECK_DISPLAY_AS_DATA to using CHECK_DISPLAY_AS_XEd Warnicke1-2/+2
which also takes a handle as an argument and thus doesn't call dissect_data directly. svn path=/trunk/; revision=4270
2001-11-26Moved from using dissect_data() to using call_dissector()Ed Warnicke1-3/+6
svn path=/trunk/; revision=4269
2001-09-03Instead of having a single datum attached to a conversation, have a listGuy Harris1-3/+2
of protocol-id-plus-datum pairs, so that multiple protocols can attach information to the same conversation. Dissectors that attach information to a conversation should not assume that if they find a conversation it has one of its data attached to it; the conversation might've been created by another dissector. svn path=/trunk/; revision=3901
2001-09-03Squelch some compiler warnings.Guy Harris1-3/+4
svn path=/trunk/; revision=3899
2001-06-18From Joerg Mayer: explicitly fill in all members of aGuy Harris1-5/+5
"header_field_info" structure, including the ones that are later set by the routines to register fields. svn path=/trunk/; revision=3561
2001-06-10Rename the arguments and flags for the conversation routines, so as notGuy Harris1-11/+15
to imply that 1) conversations have source and destination addresses and ports - they don't (if they did, they'd be monologues, not conversations), they just have two address/port pairs for the two endpoints, with one or more of the address or port in the second pair possibly being wildcarded; 2) the first and second address or port argument to "find_conversation()" or "try_conversation_dissector()" have anything to do with the first or second address/port pair in a conversation - they don't, the two arguments to those routines are matched against *both* address/port pairs for a conversation; as otherwise people might think that they need to add flags to wildcard the first arguments "conversation_new()" or "find_conversation()" (they don't, they just have to pass the non-wildcarded address/port first and then pass the wildcarded one, even if that means passing the destination first and source second). svn path=/trunk/; revision=3537
2001-04-23Get rid of END_OF_FRAME references in tvbuffified dissectors.Guy Harris1-3/+3
svn path=/trunk/; revision=3364
2001-04-15Conversation dissectors are called through a mechanism that doesn'tGuy Harris1-1/+10
check for disabled protocols or set "pinfo->current_proto", so they have to do that for themselves. svn path=/trunk/; revision=3306
2001-04-15Fix up a pile of NullTVB uses that were left in the previous checkin.Guy Harris1-32/+32
svn path=/trunk/; revision=3304
2001-04-15Tvbuffify the ASN.1 code and the Kerberos, LDAP, and SNMP dissectors.Guy Harris1-197/+186
Clean up some problems that revealed. svn path=/trunk/; revision=3301
2001-04-07At least with UCD SNMP 4.1.2, you can safely pass to "sprint_value()" aGuy Harris1-2/+2
variable with a null pointer-to-value and a zero length, so we don't need to protect the assignment to "variable.val.string" with "SAFE_STRING()" - and doing so causes complaints from the compiler about assigning a pointer to a "const gchar" to the non-const pointer "variable.val.string". svn path=/trunk/; revision=3267
2001-04-07Don't blow up if "asn1_string_value_decode()" supplies a null pointer asGuy Harris1-5/+15
the string because the string value is zero-length. Don't try to treat an agent address in a V1 trap as an IP address if it's not 4 bytes long. svn path=/trunk/; revision=3265
2001-04-06In "dissect_snmp_parse_error()" and "dissect_snmp_error()", put an errorGuy Harris1-76/+84
indication into the protocol tree as well as the summary line, so people don't get confused if, say, doing "tethereal -V". Pass those routines the subtree for the packet, rather than the top-level tree, so that the error indication and the item for the rest of the packet show up there rather than at the top level. svn path=/trunk/; revision=3264
2001-02-27Do a better job of #ifdef'ing out 3 variables in the case of non-UCD-SNMPGilbert Ramirez1-2/+2
and linux. svn path=/trunk/; revision=3081
2001-01-30Work around a CMU SNMP bug wherein "sprint_value()" dumps core if thereGuy Harris1-47/+88
are no entries in any of the MIBs for any of the components of the variable's OID. svn path=/trunk/; revision=2961