aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/snmp
AgeCommit message (Collapse)AuthorFilesLines
2015-12-10Convert ASN.1 dissectors to remove "new" from "new-style" dissector function ↵Michael Mann2-2/+2
names that were generated from asn2wrs.py This includes: 1. new_create_dissector_handle -> create_dissector_handle 2. new_register_dissector -> register_dissector 3. new_register_ber_oid_dissector -> register_ber_oid_dissector 4. new_register_ber_syntax_dissector -> register_ber_syntax_dissector Also remove PDU_NEW, SYNTAX_NEW and REGISTER_NEW as there is no need for the distinction anymore. Change-Id: I82c7de7c8ffeeab3259d1b55bb4afc5f6a1e0329 Reviewed-on: https://code.wireshark.org/review/12491 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09"new" dissector API -> dissector API for ASN.1 dissectors.Michael Mann1-5/+5
Change-Id: I7b794cba2feda2cae40411e2b1cb9fb091d08220 Reviewed-on: https://code.wireshark.org/review/12480 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-07Spelling fixes for errors found by lintianBalint Reczey1-1/+1
Change-Id: I889283902875193f4d3f3fd59788f59f8d9bcc20 Reviewed-on: https://code.wireshark.org/review/11945 Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-11-25Require BER dissector (OID) registration to be "new style".Michael Mann1-4/+5
Both old and new style API existed, just remove the "old" one. Change-Id: If725e778a0ecad5a431d634ed5c4856b4a281013 Reviewed-on: https://code.wireshark.org/review/12107 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-04Don't allow multiple registrations of a protocol in dissector tables.Michael Mann1-1/+1
The target here is the Decode As dialog where protocols have multiple registrations into a dissector table and that shows up as multiple entries in the Decode As dialog list with the same name so users are unsure which "dissector" they are choosing. The "default" behavior (done in this commit) is to not allow duplicates for a dissector table, whether its part of Decode As or not. It's just ENFORCED for Decode As. Bug: 3949 Change-Id: Ibe14fa61aaeca0881f9cc39b78799e314b5e8127 Reviewed-on: https://code.wireshark.org/review/11405 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-02wsgcrypt.h checks internally if we HAVE_LIBGCRYPTMartin Kaiser1-2/+0
we can #include <wsutils/wsgcrypt.h> without doing the check ourselves Change-Id: I248431bdb6cfa1bd85b794ec04ce1e4fcd3a7d2d Reviewed-on: https://code.wireshark.org/review/11483 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-10-30STUN: register a new conversation dissector after receiving a ConnectionBind ↵Pascal Quantin1-1/+1
Success Response message According to RFC 6062, once the connection is established, data is sent as-is To stop the STUN dissector from interfering, add the ability to specify a starting frame for a conversation dissector and use it Bug: 11641 Change-Id: I65ca96bddacf70444009c0642ea22173fa68992e Reviewed-on: https://code.wireshark.org/review/11372 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-09-11snmp: fix 'time' var name.Dario Lombardo3-7/+7
As pointed out by checkAPI.pl Change-Id: I603465614236ec41d1050e6e3452dbf9021bf1d5 Reviewed-on: https://code.wireshark.org/review/10468 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-07-04asn1: split off cleanup routinesPeter Wu1-15/+26
General approach: 1. Split allocation (e.g. g_hash_table_new) from deallocation (g_hash_table_destroy) into functions named "init" and "cleanup". 2. Remove guards that test whether the hash tables are set as init is always called before cleanup. 3. Remove setting hash tables to NULL after destruction. 4. Copy register_init_routine function call and change init to cleanup. 5. Add cleanup function that calls reassembly_table_destroy if there is a reassembly_table_init function. Some templates were modified as follows: - snmp: split renew into init+cleanup, but keep renew for the uat_new callback. - ldap,ros: Rename init to cleanup as there was no initialization. - camel: remove init function from header, make it static. Remove debug print. - tcap: remove unused ssn_range assignment. Files in epan/ were regenerated using cmake && make asn1 Change-Id: Idac16ebf0ec304e0c8becaab5d32904e56eb69b9 Reviewed-on: https://code.wireshark.org/review/9136 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-05-09Define the SHA-1 digest length in wsutil/sha1.h and use it.Guy Harris1-4/+4
Hopefully that'll make it a little easier to make sure that we're not overflowing arrays. Change-Id: I770df045ef9a45fd486c1271ea424b3334bb39d2 Reviewed-on: https://code.wireshark.org/review/8370 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-04-10Remove depricated API tvb_length -> tvb_reported_lengthAndersBroman2-3/+3
Change-Id: I78b1d2accf4fd0b37eaa16cb8bf515422565e98a Reviewed-on: https://code.wireshark.org/review/8011 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-18Some additional UAT update callback changes.Guy Harris1-3/+4
I guess the signature mismatch must just be a warning with Clang; it's not with MSVC. Change-Id: Ic1f4cb88471f7e13019e891f111978310dfada73 Reviewed-on: https://code.wireshark.org/review/7225 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-19Convert OID APIs to use wmem.Michael Mann2-9/+9
There are a few oid functions that are only called in oids_test.c. I'll presume the APIs are used in proprietary dissectors rather than just remove them. Change-Id: I4595e00f93bf9ab8cf2493fe0432b91960f55a3f Reviewed-on: https://code.wireshark.org/review/6592 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Guy Harris <guy@alum.mit.edu> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-13UAT error string pointers should not be const pointers.Guy Harris1-1/+1
UAT error strings are usually allocated by g_strdup() or g_strdup_printf(), and must ultimately be freed by the caller. Make the pointer-to-error-string-pointer arguments to various functions be "char **", not "const char **". Fix cases that finds where a raw string was being used, as that won't work if you try to free it; g_strdup() it instead. Add a missing free of an error string. Remove some no-longer-necessary casts. Remove some unnecessary g_strdup()s (the string being handed to it was already g_malloc()ated). Change some variable declarations to match. Put in XXX comments for some cases where the error string is just freed, without being shown to the user. Change-Id: I40297746a2ef729c56763baeddbb0842386fa0d0 Reviewed-on: https://code.wireshark.org/review/6525 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-23asn1 generated dissectors: cleanup #include usageBill Meier1-13/+7
Change-Id: I36b2731d67f9345d2fd0c23800bba7d2be94c387 Reviewed-on: https://code.wireshark.org/review/6008 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-11-08SNMP: Fix warning found by -Wunused-const-variableAlexis La Goutte1-0/+2
Change-Id: If3fcab128e3e6bce04f4922568ab7ff8575b01fe warning: unused variable 'smux_types' [-Wunused-const-variable] Reviewed-on: https://code.wireshark.org/review/5194 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-10-18Get rid of unnecessary includes of ctype.h.Guy Harris1-1/+0
Change-Id: I9e2cd7a9fed33fc2f4b0c0da3603690450f6952d Reviewed-on: https://code.wireshark.org/review/4809 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-13ASN1: Register PDU-dissectors as NEWStig Bjørlykke2-9/+7
Change-Id: I1a317b19d8076588c9305dae6287bb80cc14da64 Reviewed-on: https://code.wireshark.org/review/4494 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Stig Bjørlykke <stig@bjorlykke.org>
2014-09-14Show BER identifiers and lengths in SNMP variable bindings.Guy Harris1-25/+21
If the user turns on the "show internal BER encapsulation tokens" preference, show them the tokens inside SNMP variable bindings. Change-Id: Ief9040f422cb214bbff8e4cfd45a2e05c7106480 Reviewed-on: https://code.wireshark.org/review/4105 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-30Mark Trap-PDU as obsolete for SNMP versions > 1Stig Bjørlykke2-1/+9
Change-Id: I967a1547eb97619042b620bb3d803a29cce9ebe1 Reviewed-on: https://code.wireshark.org/review/3920 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-08-13SNMP : Continue to fix indent (use tab)Alexis La Goutte2-56/+54
Change-Id: I6b92deb2dbf9b9c4be7fd75d6d788755524a7483 Reviewed-on: https://code.wireshark.org/review/3570 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-08-13SNMP: Remove some unused hf fieldAlexis La Goutte1-12/+1
Change-Id: I33c89d07af6658569df3a9a094e2865e28ed0acb Reviewed-on: https://code.wireshark.org/review/3569 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-08-11SNMP: fix mixed indent (use tab)Alexis La Goutte1-317/+314
Change-Id: I19fde26bf7d1d2b19fcb56573f6e0814d1a7b8ab Reviewed-on: https://code.wireshark.org/review/3551 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-08-11SNMP: Fix Dead Store (Dead assignement/Dead increment) warning found by ClangAlexis La Goutte1-3/+1
Change-Id: I00d66ff57fd3ea1ede692c85b2ae0286c30557b7 Reviewed-on: https://code.wireshark.org/review/3550 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-08-11SNMP: Fix Dead Store (Dead assignement/Dead increment) warning found by ClangAlexis La Goutte1-1/+1
Change-Id: Ifd4fef4ff7cc5a3197a802e0da5851370ddcd715 Reviewed-on: https://code.wireshark.org/review/3549 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-08-09Eliminate (almost all) proto_tree_add_text calls from ASN.1 dissectors.Michael Mann3-51/+42
This mostly involved adding expert info capabilities to many of the dissectors so that they could correctly flag error conditions. Only remaining proto_tree_add_text calls are in H248.cnf, which has a convoluted way of using hf_ data to make its tree. Change-Id: I6412150c2ec1977d7fa38f3f0ed416680bdfb141 Reviewed-on: https://code.wireshark.org/review/3500 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-30Add some files under asn1 to the distribution.Guy Harris1-1/+1
Include CMakeLists.txt files and the gnm subdirectory, along with the top-level Makefile.inc and Makefile.preinc files. Don't explicitly include Custom.make, as automake does that automatically given that it's included by asn1/Makefile.am. Add some files to EXTRA_DIST lists. Move some .asn files to EXTRA_DIST; they don't need to be in SRC_FILES, as SRC_FILES always includes EXTRA_DIST, and they *do* need to be in EXTRA_DIST so that they're in the distribution. Change-Id: Id91df577260fa57028d40fe098be1d79c59398e6 Reviewed-on: https://code.wireshark.org/review/3273 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-22convert to proto_tree_add_subtree[_format] for ASN.1 dissectorsMichael Mann1-20/+25
Change-Id: I753ca95e2e1b38bad2c09955317e648c525e40ef Reviewed-on: https://code.wireshark.org/review/2509 Tested-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-21batch of tvb-length conversionsEvan Huus1-11/+11
Change-Id: I76ca4d075756e3ac691070e0c05344a410ea2498 Reviewed-on: https://code.wireshark.org/review/2507 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-19Revert "Update ASN.1 source files with the API changes done in g021e7af"Pascal Quantin2-14/+14
This reverts commit e308e7c4de81c2ff7159e444b865ac59de4faa2b. Change-Id: I079616d63f643f79f1bc03ef5fdf724f36df4071 Reviewed-on: https://code.wireshark.org/review/2435 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-18Update ASN.1 source files with the API changes done in g021e7afPascal Quantin2-14/+14
Change-Id: I52ecfccbce423206242e3cf99401a8c9e1655d88 Reviewed-on: https://code.wireshark.org/review/2385 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-16Convert a bunch of time_to_str functions to wmemEvan Huus1-1/+1
Change-Id: I24fe3cc4a3589dadc4528a77fe7ff13d06b1a983 Reviewed-on: https://code.wireshark.org/review/2245 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-16Remove emem in SNMP UAT, use glib insteadEvan Huus1-113/+138
Change-Id: Ieea8c09d6a82285b0ba20f669c35394fbf195f50 Reviewed-on: https://code.wireshark.org/review/2241 Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-07tvb_new_subset -> tvb_new_subset_length when length parameters are equal.Michael Mann1-1/+1
tvb_new_subset -> tvb_new_subset_remaining it appears that's what the intention is. Change-Id: I2334bbf3f10475b3c22391392fc8b6864454de2d Reviewed-on: https://code.wireshark.org/review/1999 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-02-26Remove trailing whitespace from asn1 .cnf & template.[hc] files. Regenerate ↵Bill Meier1-2/+2
dissectors. Change-Id: I0e779b2ac2f608356649c5bbfca438141070dea4 Reviewed-on: https://code.wireshark.org/review/412 Reviewed-by: Bill Meier <wmeier@newsguy.com> Tested-by: Bill Meier <wmeier@newsguy.com>
2014-02-18Remove $Id$ from the ASN.1 dissectors and regenerate them.Jeff Morriss8-18/+0
Change-Id: Ie476c6f82f318188b41ed922b92c6fec119ea954 Reviewed-on: https://code.wireshark.org/review/244 Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com> Tested-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-02-03Apply g4cc69483 to asn1 templates.Stig Bjørlykke1-2/+2
Change-Id: Id44ef17e7293be5d713c5e9e5d55b25194b46016 Reviewed-on: https://code.wireshark.org/review/86 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Stig Bjørlykke <stig@bjorlykke.org>
2014-01-22Use tvb_get_string_enc() with an explicit encoding; it's a + or a -, soGuy Harris1-1/+1
just treat it as ASCII. svn path=/trunk/; revision=54896
2014-01-14Make a routine not used outside the SNMP dissector static.Guy Harris1-1/+1
svn path=/trunk/; revision=54751
2013-12-19Add bytestring_to_str() which takes a wmem scope and is otherwise identical toEvan Huus1-1/+1
bytestring_to_ep_str (now deprecated). Use the new one in a few obvious places. Also just print directly to the buffer when loading ethernet addresses for resolution. The straight-to-buffer bytes_to_hexstr seems useful, maybe it shouldn't be in a private header... svn path=/trunk/; revision=54270
2013-12-19Rename more to_str functions to have ep_ in the name if they return ephemeralEvan Huus1-1/+1
buffers. Remove two unused functions. svn path=/trunk/; revision=54250
2013-12-19Rename a couple of to_str functions to have ep_ in the name. This makes itEvan Huus1-1/+1
obvious that the returned string is ephemeral, and opens up the original names in the API for versions that take a wmem pool (and thus can work in any scope). svn path=/trunk/; revision=54249
2013-10-26Convert some emem to wmem. It took some manual flow analysis, but they are onlyEvan Huus1-2/+2
used during actual packet dissection. svn path=/trunk/; revision=52870
2013-10-25Add a very small hack to make the UAT update callback error string freeable, andEvan Huus1-7/+7
convert all existing UAT update callbacks to use glib memory instead of ephemeral memory for that string. UAT code paths are entirely distinct from packet dissection, so using ephemeral memory was the wrong choice, because there was no guarantees about when it would be freed. The move away from emem still needs to be propogated deeper into the UAT code itself at some point. Net effect: remove another bunch of emem calls from dissectors, where replacing with wmem would have caused assertions. svn path=/trunk/; revision=52854
2013-09-22emem -> wmem conversion:Pascal Quantin1-11/+11
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits() - tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup() - tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode() - tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string() - tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string() - tvb_get_ephemeral_string_enc() -> tvb_get_string_enc() - update docs accordingly svn path=/trunk/; revision=52172
2013-09-17One of the wmem patches only updated the generated packet-snmp.cJörg Mayer1-8/+11
but not the source. Fix that. svn path=/trunk/; revision=52123
2013-09-09expert_add_info_format_text -> expert_add_info_formatMichael Mann1-1/+1
svn path=/trunk/; revision=51852
2013-09-09expert_add_info_format_text -> expert_add_info_formatMichael Mann1-2/+2
svn path=/trunk/; revision=51851
2013-08-19Do not use ephemeral memory when adding a new data sourcePascal Quantin1-2/+6
svn path=/trunk/; revision=51424
2013-08-01Move a bunch of the crypt modules and pint.h into wsutil.Jeff Morriss1-7/+5
This means wsutil now links against libcrypt. Protect a bunch of the crypt header files from multiple inclusion. svn path=/trunk/; revision=51100