aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-pim.c
AgeCommit message (Collapse)AuthorFilesLines
2023-02-25Change some `wmem_packet_scope()` to `pinfo->pool`David Perry1-37/+37
As requested [here][1] by @eapache, help with removing calls to `wmem_packet_scope()` in favour of references to `pinfo->pool`. * Plugins chosen semi-randomly. * When a calling function already has a `pinfo` argument, use that. * Remove `_U_` from its signature if it was there. * If a function seems narrowly focused on getting and (possibly) returning memory, change the function signature to take a `wmem_allocator_t *`. * If it seems more focused on packet-based operations, pass in a `packet_info *` instead and use `pinfo->pool` within. * If there are several functions defined with the same call signature, add `pinfo _U_` to the argument list of similar functions in order to maintain clarity/symmetry. [1]: https://www.wireshark.org/lists/wireshark-dev/202107/msg00052.html
2022-05-08Fix the pfm-sd default caseYu Gao1-2/+2
2022-04-21fix pipeline issueYu Gao1-0/+9
2022-04-11fix the indentYu Gao1-0/+98
2021-10-07to_str: scope tvb_ip6_to_strEvan Huus1-4/+4
2021-10-07to_str: scope tvb_ip_to_strEvan Huus1-10/+10
2021-07-21First pass pinfo->pool conversionEvan Huus1-4/+4
Automated find/replace of wmem_packet_scope() with pinfo->pool in all files where it didn't cause a build failure. I also tweaked a few of the docs which got caught up.
2021-07-08check_typed_item_calls.py Some more mask checksMartin Mathieson1-1/+1
Fix a handful of (trivial) issues found.
2021-07-06Improved PIM dissector with capability to parse multiple TLVs and additional ↵Shubham jha1-2/+94
attribute types
2020-07-08PIM: Fix field abbrevJaap Keuter1-1/+1
Found by conflict check Change-Id: I4fa1ff6da2fb2823ab1f937042c05aada6eb1238 Reviewed-on: https://code.wireshark.org/review/37793 Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl> Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <gharris@sonic.net>
2020-06-19PIM: Check return value of dissect_pim_addr()Uli Heilmeier1-2/+3
Check the return value of dissect_pim_addr() Change-Id: I783afeb6302b15fbaa7af4df5aadfdf64639acbc Reviewed-on: https://code.wireshark.org/review/37496 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-06-19Fix the type of arrays of pointers to hf_ values for bitfield routines.Guy Harris1-4/+4
The static arrays are supposed to be arrays of const pointers to int, not arrays of non-const pointers to const int. Fixing that means some bugs (scribbling on what's *supposed* to be a const array) will be caught (see packet-ieee80211-radiotap.c for examples, the first of which inspired this change and the second of which was discovered while testing compiles with this change), and removes the need for some annoying casts. Also make some of those arrays static while we're at it. Update documentation and dissector-generator tools. Change-Id: I789da5fc60aadc15797cefecfd9a9fbe9a130ccc Reviewed-on: https://code.wireshark.org/review/37517 Petri-Dish: Guy Harris <gharris@sonic.net> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-06-15PIM: decoding of address encodingUli Heilmeier1-8/+279
This commit extends decoding of source/group/unicast addresses as defined in RFC4601 while preserving the existing fields. Furthermore Joint Attributes TLVs as defined in RFC5384 are added for encoded source addresses. Initial decoding of Vector Attribute TLV Format as defined in RFC5496. Bug: 16613 Change-Id: Ie2f142ef2ed48254c8483180eb4b310674d3437b Reviewed-on: https://code.wireshark.org/review/37468 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-06-06PIM: update hello options listJaap Keuter1-36/+38
Update the list of PIM Hello options based on the current IANA list of PIM parameters. Bug: 16614 Change-Id: I4147362ae554423bcc118f72c1ff43034ba3fb63 Reviewed-on: https://code.wireshark.org/review/37389 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-13Standardise IETF RFC and Draft URLs in dissectors.Martin Mathieson1-2/+2
Prefer: - html (rather than txt) - https Also includes the script check_dissector_urls.py, that can be used to find links in code and test them. Change-Id: Iafd8bb8948674a38ad5232bf5b5432ffb2b1251b Reviewed-on: https://code.wireshark.org/review/36821 Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-07-26HTTPS (almost) everywhere.Guy Harris1-1/+1
Change all wireshark.org URLs to use https. Fix some broken links while we're at it. Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c Reviewed-on: https://code.wireshark.org/review/34089 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-12dissectors: use SPDX identifiers.Dario Lombardo1-13/+1
Change-Id: I92c94448e6641716d03158a5f332c8b53709423a Reviewed-on: https://code.wireshark.org/review/25756 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-10-26Add a ws_in6_addr typedef for struct e_in6_addr.Guy Harris1-1/+1
That allows a parallel typedef of ws_in4_addr for guint32. Change-Id: I03b230247065e0e3840eb87635315a8e523ef562 Reviewed-on: https://code.wireshark.org/review/24073 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-06-17PIM: Add identification of Hello option 65004Jaap Keuter1-0/+3
Cisco uses propietary option 65004 to transmit RPF Proxy Vector information. Add the name of the option to the option identification. Change-Id: I5ee9e4d44d6326d8a457a8a4bbb24896e17216e8 Reviewed-on: https://code.wireshark.org/review/22186 Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl> Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-04-18Rename BASE_VALS_NO_UNKNOWN to BASE_SPECIAL_VALS.Guy Harris1-2/+2
It makes it a bit clearer what its purpose is - to allow a value_string to be used for numeric rather than enumerated fields, giving certain values of the field a special meaning. Change the explanation in the documentation to match as well. Change-Id: Id07b22eee996b79ea5f3473928d29adcabe09bf3 Reviewed-on: https://code.wireshark.org/review/21209 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-10Add support for BASE_VALS_NO_UNKNOWNAlexis La Goutte1-60/+33
BASE_VALS_NO_UNKNOWN is a special value_string value for only a single (maybe 2) numerical value(s). If a field has the numerical value that doesn't match anything in the value_string, just the number is supplied for the field (no "Unknown") Dissectors that had this use case have been converted in the patch. Change-Id: Ie63a36cceec2fe4436938ec7e3d7f9e690d2b8d9 Reviewed-on: https://code.wireshark.org/review/20736 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-27Follow up for proto_tree_add_checksum.Michael Mann1-10/+30
Fill in the "gaps" so that all dissectors that verify checksums have both a status and expert info field. Also address comments from original proto_tree_add_checksum patch that didn't make it. Ping-Bug: 8859 Change-Id: I2e6640108fd6bb218cb959fe9e4ba98a13e43a2f Reviewed-on: https://code.wireshark.org/review/16590 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-07-21Add proto_tree_add_checksum.Michael Mann1-23/+14
This is an attempt to standardize display/handling of checksum fields for all dissectors. The main target is for dissectors that do validation, but dissectors that just report the checksum were also included just to make them easier to find in the future. Bug: 10620 Bug: 12058 Ping-Bug: 8859 Change-Id: Ia8abd86e42eaf8ed50de6b173409e914b17993bf Reviewed-on: https://code.wireshark.org/review/16380 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-06-15Allow control of individual columns to be (un)writable.Michael Mann1-2/+2
Most protocols just want to limit COL_INFO or COL_PROTOCOL so give that level of granularity. Bug: 12144 Bug: 5117 Bug: 11144 Change-Id: I8de9b7d2c69e90d3fbfc0a52c2bd78c3de58e2f8 Reviewed-on: https://code.wireshark.org/review/15894 Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com> Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-07PIMv2 Hello packet incorrectly dissect Option 1Alexis La Goutte1-2/+2
Bug: 12493 Change-Id: I646853c6756689f9776b11c585d573c117c68cf2 Reviewed-on: https://code.wireshark.org/review/15762 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>
2016-06-07PIMv2: Enchance display of HoldtimeAlexis La Goutte1-3/+3
Change-Id: If92dd22c4ceee41bc7b0151acb09f4341b2e97f3 Reviewed-on: https://code.wireshark.org/review/15763 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-03-20Manually add protocol dependencies derived from find_dissector.Michael Mann1-2/+2
Started by grepping call_dissector_with_data, call_dissector_only and call_dissector and traced the handles passed into them to a find_dissector within the dissector. Then replaced find_dissector with find_dissector_add_dependency and added the protocol id from the dissector. "data" dissector was not considered to be a dependency. Change-Id: I15d0d77301306587ef8e7af5876e74231816890d Reviewed-on: https://code.wireshark.org/review/14509 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-02-01PIM: fix IPv4/IPv6 filters using the same name for different address typePascal Quantin1-9/+9
Bug: 12061 Change-Id: I42828e1f87abebd6d9a4f893ff28aa50ca7ccbff Reviewed-on: https://code.wireshark.org/review/13640 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-12-09new_create_dissector_handle -> create_dissector_handle for dissector directory.Michael Mann1-2/+2
Some of the ASN.1 dissectors still generate a new_create_dissector_handle from the tool itself, so leave those for now. Change-Id: Ic6e5803b1444d7ac24070949f5fd557909a5641f Reviewed-on: https://code.wireshark.org/review/12484 Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-18create_dissector_handle -> new_create_dissector_handleMichael Mann1-4/+5
Picking off "easy" dissectors that only have one or two exit points at most. Change-Id: I9c7d1c092bbae896ec0c2832617891346927f2e1 Reviewed-on: https://code.wireshark.org/review/11932 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: Anders Broman <a.broman58@gmail.com>
2015-10-14Change proto_tree_add_ipv6() to take a struct e_in6_addr pointerJoão Valverde1-6/+6
tvb_get_ipv6() takes a struct e_in6_addr *, use that here too. Change-Id: Id8b368daa05c151a61d4bc01dc88c00da13e9c88 Reviewed-on: https://code.wireshark.org/review/10953 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: Balint Reczey <balint@balintreczey.hu> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-06-11Replace tabs in files with editor modeline "expandtab"Bill Meier1-7/+7
Change-Id: I4667fd4091c510a4c798f79dae333a07dc42dad6 Reviewed-on: https://code.wireshark.org/review/8880 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-05-12PIM: Add PIM IP version field for PIMv1 tooAlexis La Goutte1-0/+2
Change-Id: I455a4f81798c7a99a48551ae362dabf2b697cf88 Reviewed-on: https://code.wireshark.org/review/8427 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-05-12PIM: Remove trailing whitespace before commaAlexis La Goutte1-32/+32
Change-Id: I7798ddd6db4a98cfe9cc96275f56837ef3bf0b1e Reviewed-on: https://code.wireshark.org/review/8399 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-05-12PIM: Enhance codeAlexis La Goutte1-82/+92
Use proto_tree_add_item when it is possible Add display of reserved field... Change-Id: Id47c237f06e28e7d5dfbd92848dc26a7496cf799 Reviewed-on: https://code.wireshark.org/review/8398 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-05-12PIM: Remove proto_tree_add_textAlexis La Goutte1-21/+52
rewrite display of PIM(v1) Address and remove last proto_tree_add_text call :) Change-Id: I020970e80338d15dbe68e32713b8ada31fd0a4e2 Reviewed-on: https://code.wireshark.org/review/8397 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-05-12PIM: Remove proto_tree_add_textAlexis La Goutte1-21/+45
only 2 proto_tree_add_text calls, (it will be remove on another patch) Change-Id: I670e37bbbe1cc3ae740a94cd620fa14f20cb9feb Reviewed-on: https://code.wireshark.org/review/8396 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-05-06PIM: Fix Dead Store (Dead assignement/Dead increment) warning found by ClangAlexis La Goutte1-3/+12
Change-Id: Ia8eca42bae42fb139bfc63232c6d9bf05811ad39 Reviewed-on: https://code.wireshark.org/review/8280 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-05-02Don't try checksumming if we didn't capture all the data to be checksummed.Guy Harris1-2/+4
Check the captured length as well as the reported length, as is done in other checksumming code paths. Change-Id: I55371d99a28ffd1325e7266037cced580077d80b Reviewed-on: https://code.wireshark.org/review/8272 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-05-02Handle PIMvN, for N > 2, by just adding the checksum and subtree and bailing.Guy Harris1-25/+27
Don't bother doing the checksum, as we don't know how much to checksum; don't assume setting pim_length to 0 will force it not to be checksummed, as it doesn't; and don't test twice for a version != 2. Change-Id: I1c2ed3ecf1572aef6c5af140c410f9cdd0e9c3a6 Reviewed-on: https://code.wireshark.org/review/8271 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-05-02No need to call tvb_reported_length() twice.Guy Harris1-2/+2
Just reuse the result we got from an earlier call. Change-Id: Icb4617d731d9e3f152ce762f56a1c32567cbde4a Reviewed-on: https://code.wireshark.org/review/8270 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-05-02Expand comments.Guy Harris1-8/+56
Update a URL, and tell The Story About PIM, or, at least, about various drafts floating around. I guess it took a while for the protocol to settle down, and a number of things changed significantly between early drafts and RFC 2117, including whether the protocol runs atop IGMP or directly atop IP. There doesn't appear to be *any* draft that corresponds to what dissect_pimv1() dissects; all have significant differences. Change-Id: Ia9c80cc384546b0a822a59fef01c1476f95ad8a6 Reviewed-on: https://code.wireshark.org/review/8269 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-3/+0
Specifically: - Set packet.h to be the first wireshark #include after config.h and "system" #includes. packet.h added as an #include in some cases when missing. - Remove some #includes included (directly/indirectly) in packet.h. E.g., glib.h. (Done only for those files including packet.h). - As needed, move "system" #includes to be after config.h and before wireshark #includes. - Rework various #include file specifications for consistency. - Misc. Change-Id: Ifaa1a14b50b69fbad38ea4838a49dfe595c54c95 Reviewed-on: https://code.wireshark.org/review/5923 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-12Change ENC_NA to ENC_BIG_ENDIAN for all fetches of integral type fields.Bill Meier1-3/+3
Change-Id: Ia4f5735c61eedcbe8354eabd5da05d02e167f25e Reviewed-on: https://code.wireshark.org/review/5734 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-11-12Fix warning: no previous prototype for function ... [-Wmissing-prototypes]Alexis La Goutte1-1/+1
warning coming after g055e4768ece and g421913b721 Change-Id: I5caeeb89c559faef8007f2946c68c7172b75dfa8 Reviewed-on: https://code.wireshark.org/review/5250 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-11-12PIM: Fix Dead Store (Dead assignement/Dead increment) warning found by ClangAlexis La Goutte1-1/+1
Change-Id: I1540c7878692625a9e38b48f8681c07bab852a64 Reviewed-on: https://code.wireshark.org/review/5234 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-11-08PIM: Fix Dead Store (Dead assignement/Dead increment) warning found by ClangAlexis La Goutte1-4/+2
Change-Id: I4bfc67705ee824e68f14e4177a3194d66bbbe165 Reviewed-on: https://code.wireshark.org/review/5188 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-11-08Create real subdissectors to the IGMP protocol.Michael Mann1-16/+9
Change-Id: I79ee9413b87722bfe4782342737cff03cfc34495 Reviewed-on: https://code.wireshark.org/review/5179 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> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-11-05pim: BIDIR support (RFC 5015)Matthieu Texier1-9/+118
Bug: 10231 Change-Id: Ia93fa76b8d381971f900de4a8ce591f03cd82da0 Reviewed-on: https://code.wireshark.org/review/5118 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-10-14PIM: Disable unused pimbdirdfvals.Stig Bjørlykke1-1/+3
Change-Id: I2b023868d9f84e891e36f2cfcfd4ad25e1e43592 Reviewed-on: https://code.wireshark.org/review/4681 Reviewed-by: Anders Broman <a.broman58@gmail.com>