aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-arp.c
AgeCommit message (Collapse)AuthorFilesLines
2017-03-31Fix incorrect NSAP AFI values.Guy Harris1-3/+3
Change-Id: I302041f5a08973229317455d8df8690256557e76 Reviewed-on: https://code.wireshark.org/review/20803 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-03-31Distinguish between the two flavors of ITU-T AFIs.Guy Harris1-5/+5
As ISO 8348/X.213 Annex A says: A.5.2.1.2 Format and allocation of the IDI A specific combination of IDI format and DSP abstract syntax is associated with each allocated AFI value, as summarized for use in individual addresses in Table A.4 (the corresponding AFI values for use in group addresses is found via Table A.2). Two AFI values are associated with each combination that involves a variable-length IDI format. In each case, both of the AFI values identify the same combination of IDI format and DSP abstract syntax. The numerically lower AFI value is used when the first significant digit in the IDI is non-zero. The numerically greater AFI value is used when the first significant digit in the IDI is zero. and A.5.3 talks further about this. Change-Id: I3fdad04064451b3c891731dc8f107bc57586eb84 Reviewed-on: https://code.wireshark.org/review/20802 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-03-30Add a bunch of #defines for OSI NSAP AFI values, and use them.Guy Harris1-17/+18
Have the ISUP value_string for those AFI values show "decimal" and "binary" indicators. Update some references. Change-Id: I07797455f5ffa5fa9cd4e0702a6f5db831054937 Reviewed-on: https://code.wireshark.org/review/20798 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-03-30Make some routines static.Guy Harris1-1/+1
Change-Id: I04860f058345cb633ab379c83dcfc24b6cf1a846 Reviewed-on: https://code.wireshark.org/review/20797 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-03-22Netlink: update some values used in netlinkJaap Keuter1-0/+4
Change-Id: Id12caf9d40b0f53880ea4cc9200c340086e0b39b Reviewed-on: https://code.wireshark.org/review/20661 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>
2017-02-02GHashtable -> wmem_map conversionsMichael Mann1-28/+9
Many of the register_init_routine/register_cleanup_routine functions are for initializing and cleaning up a GHashtable. wmem_map_new_autoreset can do that automatically, so convert many of the simple cases. Change-Id: I93e1f435845fd5a5e5286487e9f0092fae052f3e Reviewed-on: https://code.wireshark.org/review/19912 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com> Tested-by: Dario Lombardo <lomato@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-11-12fix no previous prototype for ‘capture_*’ [-Wmissing-prototypes]Alexis La Goutte1-1/+1
Change-Id: Ie5bfe4d366a679ebcb561716f23d174e7b9bf487 Reviewed-on: https://code.wireshark.org/review/18754 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>
2016-10-28Implement registration of capture dissectors by nameJoão Valverde1-2/+6
Mirror it after protocol dissector API. Change-Id: I7985bcfa9e07654c7cf005efec94efc205d7a304 Reviewed-on: https://code.wireshark.org/review/18496 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-05-18GRE: add support for ARPPascal Quantin1-0/+1
Protocol type 0x0806 is registered for ARP according to RFC 1701 Bug: 12456 Change-Id: Iccdf582b16c54817a977b87be9f2b03c2f650d2a Reviewed-on: https://code.wireshark.org/review/15498 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-05-17Replace tvb_get_ptr with tvb_memdup.Michael Mann1-2/+2
The number of bytes allocated is small enough not to matter. Change-Id: I44c2103a87bd41f21e61d0f27648266fdc2be557 Reviewed-on: https://code.wireshark.org/review/15470 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-02-06Add ARP protocol preference to register MAC to IP bindings for name resolutionJoão Valverde1-2/+14
Applies to the resolve Physical Addresses to names preference. Change-Id: Ib1f484afc940eb6a022e03a1766c18449b2dfed3 Reviewed-on: https://code.wireshark.org/review/13400 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2016-01-25Move the proto data stuff out of frame_data.[ch].Guy Harris1-0/+1
It's not tied to the frame_data structure any more, so it belongs by itself. Clean up some #includes while we're at it; in particular, frame_data.h doesn't use anything related to tvbuffs, so don't have it gratuitiously include tvbuff.h. Change-Id: Ic32922d4a3840bac47007c5d4c546b8842245e0c Reviewed-on: https://code.wireshark.org/review/13518 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-24Add the packet number to the packet_info structure, and use it.Guy Harris1-4/+4
That removes most of the uses of the frame number field in the frame_data structure. Change-Id: Ie22e4533e87f8360d7c0a61ca6ffb796cc233f22 Reviewed-on: https://code.wireshark.org/review/13509 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-23Add more fields to packet_info structure and use them.Guy Harris1-7/+7
Add fields for the absolute time stamp (and another field for a presence flag for the absolute time stamp) and the packet encapsulation for the packet. This lets us remove the field for the packet encapsulation in the frame_data structure; do so. Change-Id: Ifb910a9a192414e2a53086f3f7b97f39ed36aa39 Reviewed-on: https://code.wireshark.org/review/13499 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-22Don't limit capture packet counts to a fixed set of protocols.Michael Mann1-1/+1
Kept backwards compatibility with GTK+ capture info dialog by keeping the protocols tracked hardcoded, but Qt should have more freedom. Change-Id: I497be71ec761d53f312e14858daa7152d01b8c72 Reviewed-on: https://code.wireshark.org/review/12724 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-12-17Create capture dissector "info" structure (capture_packet_info_t)Michael Mann1-2/+2
While it currently only contains packet_counts, it will hopefully stabilize the capture function signature if more fields are added. Change-Id: I003552c58043c7c2d67aec458187b12b233057e2 Reviewed-on: https://code.wireshark.org/review/12690 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-12-14Create some more capture dissector tables.Michael Mann1-0/+1
These were created from capture dissector functions that had switch statements determine "next" protocol/dissector. The registration decreases the need for function declarations in header files. Added new capture dissection tables for IP, IPv6, TCP and UDP as that seems like the next logical place to expand Change-Id: I1ec0cd54eecda4f400669ee5b026bf6e2b46545a Reviewed-on: https://code.wireshark.org/review/12634 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-12-14Create capture dissector tables.Michael Mann1-0/+9
They are modeled after dissection dissector tables, but for the moment, don't have/need the flexibility. They are intended to be much simpler/faster than full dissection. The two most used/needed are "wtap_encap" and "ethertype", so they were the basis of starting to use and test capture dissector table API. Others may be added in the future. The "capture dissector" function signature needed a bit of tweeking to handling "claiming" of a packet. The current application of this is capture functions returning TRUE if they affected a "type" of packet count. Returning FALSE ends up considering the packet an "other" type. Change-Id: I81d06a6ccb2c03665f087258a46b9d78d513d6cd Reviewed-on: https://code.wireshark.org/review/12607 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-12-09new_register_dissector -> register_dissector for dissector directory.Michael Mann1-1/+1
Change-Id: Ie39ef054a4a942687bd079f3a4d8c2cc55d5f22c Reviewed-on: https://code.wireshark.org/review/12485 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
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-27Remove manual setting of pinfo->current_proto.Michael Mann1-4/+5
Calling a protocol dissection function will properly set/restore pinfo->current_proto, so there's no need to duplicate it. Change-Id: Ic2ec0b35fa4d46a98f3410bf238056425076e4a9 Reviewed-on: https://code.wireshark.org/review/12205 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-23register_dissector -> new_register_dissectorMichael Mann1-5/+6
Change-Id: Ic368dd8e83cf39e0c934da0ae2744778e2d54ce6 Reviewed-on: https://code.wireshark.org/review/12050 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-11-16create_dissector_handle -> new_create_dissector_handleMichael Mann1-6/+8
Picking off "easy" dissectors that only have one or two exit points at most. Change-Id: Ie514f126352e7598acc4f7c38db9c61d105d5e48 Reviewed-on: https://code.wireshark.org/review/11850 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-10-22Use address functions instead of ADDRESS macros in asn1 and epanGerald Combs1-4/+4
Replace CMP_ADDRESS, COPY_ADDRESS, et al with their lower-case equivalents in the asn1 and epan directories. Change-Id: I4043b0931d4353d60cffbd829e30269eb8d08cf4 Reviewed-on: https://code.wireshark.org/review/11200 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> 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>
2015-10-02arp: fix typo in switch (CID 1250809)Dario Lombardo1-1/+1
Change-Id: I4679861383e9548d1cc042d084443a73f73a30de Reviewed-on: https://code.wireshark.org/review/10743 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-09ARP: Remove double space before TellAlexis La Goutte1-6/+6
Change-Id: I5d8f79e01912c010ca74a0134a0f397c62f1e106 Reviewed-on: https://code.wireshark.org/review/9556 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-03Call reassembly_table_destroy and move g_hash_table_destroyPeter Wu1-10/+8
This patch moves g_hash_table_destroy calls from the init routine to the cleanup routine. Besides that, the conditional check for the hash table has been removed, assuming that init is always paired with a cleanup call. If reassembly_table_init is found, a reassembly_table_destroy call is prepended to the cleanup function as well. Comments have been removed from the init function as well as these did not seem to have additional value ("destroy hash table" is clear from the context). The changes were automatically generated using https://git.lekensteyn.nl/peter/wireshark-notes/diff/one-off/cleanup-rewrite.py?id=4d11f07180d9c115eb14bd860e9a47d82d3d1dcd Manually edited files (for assignment auditing): dvbci, ositp, sccp, tcp. Other files that needed special attention due to the use of register_postseq_cleanup_routine: - ipx: keep call, do not add another cleanup routine. - ncp: remove empty mncp_postseq_cleanup. mncp_hash_lookup is used even if a frame is visited before (see dissect_ncp_common), hence the hash table cannot be destroyed here. Do it in cleanup instead. - ndps: add cleanup routine to kill reassembly table, but do not destroy the hash table as it is already done in ndps_postseq_cleanup. Change-Id: I95a72b3df2978b2c13fefff6bd6821442193d0ed Reviewed-on: https://code.wireshark.org/review/9223 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-03-03Reduce the number tvb_get_ptr calls in packet-arp.cMichael Mann1-84/+52
Change-Id: Ic91088c38833be2463f069a646fbfea6b87b33aa Reviewed-on: https://code.wireshark.org/review/7489 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-08bytes_to_ep_str -> bytes_to_strMichael Mann1-3/+3
Change-Id: Ifcda8328dedec0ef4104c3a124d6246f99493750 Reviewed-on: https://code.wireshark.org/review/6389 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-07tvb_bytes_to_ep_str -> tvb_bytes_to_strMichael Mann1-1/+1
Change-Id: I79c613cbdd8dc939dd4c29ebc477fb6eefd5bfc4 Reviewed-on: https://code.wireshark.org/review/6371 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-26Replace ip_to_str with [ep_]address_to_str and tvb_ip_to_str.Michael Mann1-6/+6
Change-Id: I40d0c8253743183aecef252040b7dd6742ae5c71 Reviewed-on: https://code.wireshark.org/review/5934 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-22First batch of unincludes. Last attempt...Martin Mathieson1-2/+0
Change-Id: I3681462aeb98ca62ed3ec5eb226b2553317391a9 Reviewed-on: https://code.wireshark.org/review/5997 Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com> Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-21Replace ether_to_str with either address_to_str or tvb_ether_to_str.Michael Mann1-2/+6
Change-Id: I8cce9fddbfe950e27e96ea8a5a6d2e0921ff4260 Reviewed-on: https://code.wireshark.org/review/5933 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-12-21Replace ax25_to_str and get_ax25_name with address_to_str.Michael Mann1-2/+9
Change-Id: I74ddb6fc629ef32b217dede7a3ba652cbbf5ab12 Reviewed-on: https://code.wireshark.org/review/5932 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-2/+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-13Use ENC_BIG_ENDIAN when fetching FT_U?INT8 fields ...Bill Meier1-4/+4
(for some dissectors which fetch all other integral fields using ENC_BIG_ENDIAN). Change-Id: Ic18e3172aad76af12b12d6732c88497be22aed56 Reviewed-on: https://code.wireshark.org/review/5748 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-19Eliminate proto_tree_add_text from packet-arp.cMichael Mann1-46/+60
Change-Id: Ie9596df97a135b411693eefc39fdbd03316166a0 Reviewed-on: https://code.wireshark.org/review/4828 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-09-29Add editor modelines; fix indentation as needed.Bill Meier1-0/+13
Change-Id: I1ad94654343e5a018a0b3159481d45ffb3a91263 Reviewed-on: https://code.wireshark.org/review/4363 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-11Eliminate proto_tree_add_text from some dissectors.Michael Mann1-7/+1
Change-Id: Ie41ac30f8edaeee75b23717ef1d5147d804a65b3 Reviewed-on: https://code.wireshark.org/review/4074 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>
2014-06-24Restore correct tree assignment.Michael Mann1-1/+1
Change-Id: Id06bd486114a80fb899f8dc148d48928e99e775e Reviewed-on: https://code.wireshark.org/review/2602 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-22Get rid of set-but-not-used variable.Guy Harris1-2/+1
Change-Id: Ic0f2c79b4bd9fc737bf33ef64512f4142d74de6b Reviewed-on: https://code.wireshark.org/review/2568 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-22convert to proto_tree_add_subtree[_format]Michael Mann1-10/+10
Change-Id: Ib60ca75b7da8cfa21cfe2999c9b9448a02c332df Reviewed-on: https://code.wireshark.org/review/2560 Tested-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(Using sed : sed -i '/^ \* \$Id\$/,+1 d') Fix manually some typo (in export_object_dicom.c and crc16-plain.c) Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8 Reviewed-on: https://code.wireshark.org/review/497 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2013-12-19Rename a couple of to_str functions to have ep_ in the name. This makes itEvan Huus1-12/+12
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-11-23Create the ability to have packet scoped "proto" data. Bug 9470 ↵Michael Mann1-6/+6
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9470) I'm not sold on the name or module the proto_data functions live in, but I believe the function arguments are solid and gives us the most flexibility for the future. And search/replace of a function name is easy enough to do. The big driving force for getting this in sooner rather than later is the saved memory on ethernet packets (and IP packets soon), that used to have file_scope() proto data when all it needed was packet_scope() data (technically packet_info->pool scoped), strictly for Decode As. All dissectors that use p_add_proto_data() only for Decode As functionality have been converted to using packet_scope(). All other dissectors were converted to using file_scope() which was the original scope for "proto" data. svn path=/trunk/; revision=53520
2013-10-13Minor whitespace, formatting & etc changes.Bill Meier1-201/+199
svn path=/trunk/; revision=52588
2013-09-29Convert several proto_tree_add_bytes_format calls to ↵Michael Mann1-4/+4
proto_tree_add_bytes_format_value. svn path=/trunk/; revision=52272
2013-09-12More wmem.Evan Huus1-6/+6
svn path=/trunk/; revision=51968
2013-09-09expert_add_info_format_text -> expert_add_info_formatMichael Mann1-2/+2
svn path=/trunk/; revision=51852
2013-08-05Keep result of [new_]register_dissector in some dissectors.Jakub Zawadzki1-6/+3
svn path=/trunk/; revision=51156