aboutsummaryrefslogtreecommitdiffstats
path: root/packet-snmp.c
AgeCommit message (Collapse)AuthorFilesLines
2000-07-25Use the right length when adding the "agent address" entry to the treeGuy Harris1-3/+2
for an SNMP trap PDU. svn path=/trunk/; revision=2158
2000-07-25Fix a comment.Guy Harris1-2/+2
svn path=/trunk/; revision=2157
2000-07-08The security model values 1 and 2 ("reserved for SNMPv1" and "reservedGuy Harris1-19/+1
for SNMPv2") in SNMPv3 packets shouldn't cause the security parameters to be interpreted as a character string - those values are apparently not supposed to show up in packets - so we handle those values in the default case, with the security parameters treated as opaque data. svn path=/trunk/; revision=2124
2000-07-02"asn1_octet_string_decode()" sets the pointer to the raw octets to NULLGuy Harris1-7/+19
if the octet string is zero-length; if the octets are to be interpreted as a character string, we have to check for a null pointer and replace it with a pointer to a null string. svn path=/trunk/; revision=2102
2000-06-29Make "format_oid()" allocate a buffer that's big enough, format the OIDGuy Harris1-2/+2
string into it, and return a pointer to that buffer, rather than being passed a buffer. This gets rid of some additional fixed-length string buffers (and makes it more closely resemble the "format_oid()" in the libsmi-based "packet-snmp.c" under development). svn path=/trunk/; revision=2099
2000-06-28Make "format_oid()" allocate a buffer that's big enough, format the OIDGuy Harris1-16/+24
string into it, and return a pointer to that buffer, rather than being passed a buffer. This gets rid of some additional fixed-length string buffers (and makes it more closely resemble the "format_oid()" in the libsmi-based "packet-snmp.c" under development). svn path=/trunk/; revision=2098
2000-06-26Rename "format_value()" to "format_var()", and have it dynamicallyGuy Harris1-9/+60
allocate the buffer into which it formats the variable value, and return that value. This 1) makes it more closely resemble the formatting routine in the libsmi-based "packet-snmp.c" under development; 2) makes it less likely to overrun the buffer (we can't be certain how long the string "sprint_value()" generates will be, but we can make a reasonable guess as to the maximum size based on the type and size of the object we're formatting). When *not* using "-lsnmp", dynamically allocate the buffers into which we format octet strings and OID values, based on the size of the object we're formatting, so that we don't overrun the buffer. svn path=/trunk/; revision=2091
2000-06-25Make the string buffers into which stuff is formatted larger, to handle,Guy Harris1-2/+2
for example, larger octet string values. svn path=/trunk/; revision=2089
2000-06-17Instead of calling "snmp_set_full_objid()" to cause OIDs to be displayedGuy Harris1-13/+105
symbolically as full sequences, call "snmp_set_suffix_only(2)" to cause them to be displayed symbolically as a module name and a name within that module, as that might make it easier to find the RFC or whatever that describes the object in question. Don't just statically call it, though, on Linux, as that causes binaries built on Red Hat releases prior to 6.2 to fail to run on 6.2, due to the UCD SNMP 4.1.1 library used in RH 6.2 not being 100% binary-compatible with the UCD SNMP libraries used in those prior releases. Instead, on Linux, try to "dlopen()" the "libsnmp.so" library and, if that succeeds, try to find "snmp_set_suffix_only()" in that library - if that succeeds, call it, otherwise try to find "ds_set_int()" in that library and, if *that* succeeds, call it with the arguments that, in UCD SNMP 4.1.1, the "snmp_set_suffix_only()" macro passes to it. svn path=/trunk/; revision=2077
2000-05-31Add routines for adding items to a protocol tree that take arguments ofGuy Harris1-6/+6
a particular type, rather than taking a varargs list, along the lines of the "proto_tree_add_XXX_format()" routines. Replace most calls to "proto_tree_add_item()" and "proto_tree_add_item_hidden()" with calls to those routines. Rename "proto_tree_add_item()" and "proto_tree_add_item_hidden()" to "proto_tree_add_item_old()" and "proto_tree_add_item_hidden_old()", and add new "proto_tree_add_item()" and "proto_tree_add_item_hidden()" routines that don't take the item to be added as an argument - instead, they fetch the argument from the packet whose tvbuff was handed to them, from the offset handed to them. svn path=/trunk/; revision=2031
2000-05-30Give the IPX dissector dissector hash tables for the IPX type and socketGuy Harris1-2/+5
number, and have the protocols encapsulated inside IPX register themselves with that table. svn path=/trunk/; revision=2028
2000-05-24Update a comment to reflect that only UCD SNMP 4.1.1 hasGuy Harris1-3/+3
"snmp_set_full_objid()" as a macro rather than a function - 4.1.2 has it as a function again. svn path=/trunk/; revision=1995
2000-05-19The only packets that look like SMUX packets *are* SMUX packets (unlikeGuy Harris1-4/+4
SNMP, where we let the ATM code tell the SNMP dissector to call it "ILMI"), so don't pass a protocol name string into "dissect_smux_pdu()", just have "dissect_smux_pdu()" call it "SMUX". svn path=/trunk/; revision=1983
2000-05-15Fix a botch that kept it from compiling if you didn't have an SNMPGuy Harris1-2/+2
library. svn path=/trunk/; revision=1964
2000-05-15SMUX and SNMP V3 support from Jochen Friedrich.Guy Harris1-116/+823
svn path=/trunk/; revision=1960
2000-05-11Add tvbuff class.Gilbert Ramirez1-30/+30
Add exceptions routines. Convert proto_tree_add_*() routines to require tvbuff_t* argument. Convert all dissectors to pass NULL argument ("NullTVB" macro == NULL) as the tvbuff_t* argument to proto_tree_add_*() routines. dissect_packet() creates a tvbuff_t, wraps the next dissect call in a TRY block, will print "Short Frame" on the proto_tree if a BoundsError exception is caught. The FDDI dissector is converted to use tvbuff's. svn path=/trunk/; revision=1939
2000-05-09Fix from Ron Flory to suppress a warning GCC issues on at least someGuy Harris1-3/+3
platforms. svn path=/trunk/; revision=1930
2000-04-13Change the sub-dissector handoff registration routines so that theGilbert Ramirez1-1/+3
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-08Move calls to "dissector_add()" out of the register routines for TCP andGuy Harris1-1/+11
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-03-15Treat the two integers after the request ID in a BulkPDU asGuy Harris1-13/+25
"non-repeaters" and "max-repetitions" rather than as "error status" and "error index". svn path=/trunk/; revision=1721
2000-03-15Dietmar Petras' fix to the handling of SNMPv2 TRAP PDUs.Guy Harris1-2/+4
Fix a comment. svn path=/trunk/; revision=1720
2000-02-20UCD SNMP 4.1[.x] makes "snmp_set_full_objid()" a macro that callsGuy Harris1-1/+25
"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-01-07Fix Gerald's e-mail address.Guy Harris1-2/+2
svn path=/trunk/; revision=1437
1999-12-14Sigh. Some versions of CMU SNMP appear to lack the SMI_ #defines; forGuy Harris1-26/+36
now, assume that if they lack that, they lack "sprint_value()". svn path=/trunk/; revision=1326
1999-12-14Don't try to get UCD SNMP to define the CMU SNMP SMI_ values; they mayGuy Harris1-71/+85
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-12If we have an SNMP library, use its routines for printing values; thatGuy Harris1-71/+236
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-11Fix a couple of typos.Guy Harris1-2/+3
svn path=/trunk/; revision=1290
1999-12-10Don't use MAX_NAME_LEN*6 for string buffers, define our ownGuy Harris1-4/+8
MAX_STRING_LEN and use that. svn path=/trunk/; revision=1286
1999-12-10CMU SNMP doesn't have a documented way of including *only* those headerGuy Harris1-1/+33
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-10Make the SNMP dissector use the ASN.1 code, rather than the SNMP libraryGuy Harris1-717/+711
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-05As per Nathan Leulinger's suggestion, have a stub SNMP dissector ifGuy Harris1-20/+42
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-11-18ILMI is just SNMP-over-ATM AAL5; if the SNMP dissector is available,Guy Harris1-6/+15
dissect ILMI packets with the SNMP dissector. svn path=/trunk/; revision=1054
1999-11-16Replace the ETT_ "enum" members, declared in "packet.h", withGuy Harris1-3/+9
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-10-27Arrange that "proto_register_snmp()" be defined regardless of whetherGuy Harris1-3/+12
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-25The previous patch didn't fix code used only with the CMU SNMP library;Guy Harris1-2/+2
make the equivalent fix to that code. svn path=/trunk/; revision=927
1999-10-24Tomislav Vujec's patch to squelch some complaints from GCC (hopefully,Guy Harris1-3/+3
"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-09-12Some old CPP or tools that take C code in input doLaurent Deniel1-3/+3
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-08-29Fix some compilation warnings.Gilbert Ramirez1-2/+2
svn path=/trunk/; revision=609
1999-08-20Call "init_mib()" in "proto_register_snmp()"; not doing so causes coreGuy Harris1-1/+2
dumps (probably because the SNMP libraries expect it to have been called). svn path=/trunk/; revision=533
1999-07-29Fix it to build with CMU, as well as UCD, SNMP.Guy Harris1-3/+3
svn path=/trunk/; revision=403
1999-07-29Made the protocol (but not the fields) use the new proto_tree routine,Gilbert Ramirez1-4/+18
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-07Created a new protocol tree implementation and a new display filterGilbert Ramirez1-33/+31
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-06-12Use "val_to_str()", rather than "get_XXX()" routines, to map SNMPGuy Harris1-270/+189
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-05-16Fixed to actually compile with CMU SNMP library (at least on Linux).Gilbert Ramirez1-7/+67
svn path=/trunk/; revision=289
1999-05-12Added Didier Jorand's dissect_snmp routine. This is only compiled inGilbert Ramirez1-0/+882
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