aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-snmp.c
AgeCommit message (Collapse)AuthorFilesLines
2015-02-18Some additional UAT update callback changes.Guy Harris1-6/+7
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 Mann1-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-18/+12
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-5/+7
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-6/+5
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ørlykke1-12/+12
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-28/+24
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ørlykke1-16/+22
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 Goutte1-62/+60
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-16/+5
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-318/+315
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-6/+4
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 Mann1-58/+49
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-06-22convert to proto_tree_add_subtree[_format] for ASN.1 dissectorsMichael Mann1-23/+28
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 "Fixup: tvb_* -> tvb_captured"Michael Mann1-13/+13
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html This reverts commit 246fe2ca4c67d8c98caa84e2f57694f6322e2f96. Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f Reviewed-on: https://code.wireshark.org/review/2430 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19Revert "Fixup: tvb_ensure_length_remaining -> ↵Michael Mann1-1/+1
tvb_ensure_captured_length_remaining" See https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html This reverts commit 021e7afc9fcba09094d0e2143cc434a34e3b09dc. Change-Id: I0640eabce5ce8c4ff3a88ebf848b499f8bb8ed2f Reviewed-on: https://code.wireshark.org/review/2429 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-18Fixup: tvb_ensure_length_remaining -> tvb_ensure_captured_length_remainingDario Lombardo1-1/+1
Change-Id: I0228f3b6b7067bc0ce51f9d359f99fd18feb2b66 Reviewed-on: https://code.wireshark.org/review/2378 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18Fixup: tvb_* -> tvb_capturedDario Lombardo1-13/+13
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f Reviewed-on: https://code.wireshark.org/review/2377 Reviewed-by: Anders Broman <a.broman58@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-116/+141
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-18Remove $Id$ from the ASN.1 dissectors and regenerate them.Jeff Morriss1-18/+16
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-03Fix one -fstrict-alias warning missed in g4cc69483Stig Bjørlykke1-1/+1
Change-Id: I99aa593c188ca77dd20dba8e4305cc9ffdf50416 Reviewed-on: https://code.wireshark.org/review/87 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Stig Bjørlykke <stig@bjorlykke.org>
2014-02-03Fix all -fstrict-alias warnings found by gcc 4.1.2Gilbert Ramirez1-1/+1
The majority of the fixes are for calls to uat_new(). Instead of having each caller cast its private data to (void**), we use void* in the uat_new() API itself. Inside uat_new(), we cast the void* to void**. Some dissectors use val64_string arrays, so a VALS64() macro was added for those, to avoid using VALS(), which is useful only for value_string arrays. packet-mq.c was changed because dissect_nt_sid() requires a char**, not a guint**. All other callers of dissect_nt_sid() use char*'s (and take the address of it) for their local storage. So, this was changed to follow the other practices. A confusion between gint and absolute_time_display_e in packet-time.c was cleared up. The ugliest fix is the addition of ip6_guint8_to_str(), for exactly one caller. The caller uses one type of ip6 address byte array, while ip6_to_str() expects another. This new function is in place until the various address implementations can be consolidated. Add VALS64() to the developer documentation. Change-Id: If93ff5c6c8c7cc3c9510d7fb78fa9108e4552805 Reviewed-on: https://code.wireshark.org/review/48 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
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-2/+2
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-15emem -> wmem (except uat or init routines)Pascal Quantin1-13/+16
svn path=/trunk/; revision=52087
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-3/+3
svn path=/trunk/; revision=51424
2013-08-19Do not use ephemeral memory when adding a new data sourcePascal Quantin1-2/+6
svn path=/trunk/; revision=51423
2013-08-01Move a bunch of the crypt modules and pint.h into wsutil.Jeff Morriss1-12/+10
This means wsutil now links against libcrypt. Protect a bunch of the crypt header files from multiple inclusion. svn path=/trunk/; revision=51100
2013-07-15Move report_err.{h,c} from epan into wsutil: there's nothing epan-specific ↵Jeff Morriss1-1/+0
there and moving it avoids having to recompile the file for use in editcap and capinfos (which don't link against libwireshark). svn path=/trunk/; revision=50598
2013-07-03expert_add_info_format_text + proto_tree_add_text = ↵Michael Mann1-11/+6
proto_tree_add_expert_format, where applicable. svn path=/trunk/; revision=50377
2013-06-20Back out some of the wmem conversions (r50063 and r50057).Evan Huus1-31/+31
These dissectors allocate ephemeral or seasonal memory in UAT callbacks, which really makes no sense because UAT callbacks can occur when there is no packet or file in scope, making this effectively a leak if the user is fiddling with their UAT and never opens a capture. Emem let you get away with this, wmem forces an assertion. Back out the changes so that the UATs are usable until the code can be properly fixed to not use out-of-scope allocators. svn path=/trunk/; revision=50073
2013-06-19Convert the rest of the ASN1 dissectors from emem to wmem.Evan Huus1-32/+32
svn path=/trunk/; revision=50063
2013-06-19Remove traling whitespace.Jörg Mayer1-17/+17
svn path=/trunk/; revision=50048
2013-06-12Pretify dissection of date and Time.Anders Broman1-5/+95
svn path=/trunk/; revision=49905
2013-06-12Fix a crash when oid_info->value_typem is NULLAnders Broman1-1/+1
svn path=/trunk/; revision=49894
2013-06-11Show DisplayString as a string.Anders Broman1-4/+8
svn path=/trunk/; revision=49887
2013-06-04Add subdissection of:Anders Broman1-5/+25
- SNMPv2-MIB sysDescr - SNMPv2-MIB::sysName svn path=/trunk/; revision=49774