aboutsummaryrefslogtreecommitdiffstats
path: root/epan/address.h
AgeCommit message (Collapse)AuthorFilesLines
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-08-29Make AT_VINES a built-in typeJoão Valverde1-0/+1
Change-Id: I5c11cf4c7bee1b2b7072a6a0db5344a6b8a569ac Reviewed-on: https://code.wireshark.org/review/29326 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
2018-02-08epan: use SPDX indentifiers.Dario Lombardo1-13/+1
Skipping dissectors dir for now. Change-Id: I717b66bfbc7cc81b83f8c2cbc011fcad643796aa Reviewed-on: https://code.wireshark.org/review/25694 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-13Remove circuit APIMichael Mann1-13/+0
Replace with conversation API that limits the "endpoint" to a single uint32 value. The intention is to eventually have "layered" endpoints, because circuit_id was used in cases where src/dest port have already been populated (and are used for layers above). Those src/dest ports should just be treated as just another endpoint, but we currently only have support for one. Change-Id: Ic6aa7ef0241275aa4dfde9459194369b48c72960 Reviewed-on: https://code.wireshark.org/review/24369 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-11address(.h): fix commas at the end of enumerator lists are a C++11 extension ↵Alexis La Goutte1-1/+1
[-Wc++11-extensions] Change-Id: Ibfc95e085b2712f7a71f6559ae205de87aab12f6 Reviewed-on: https://code.wireshark.org/review/24365 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-09ISO 14443: Convert circuit API to conversation APIMichael Mann1-3/+0
Change-Id: Id007a3df5442cf4d21263acb17303b6d735aaa7d Reviewed-on: https://code.wireshark.org/review/24311 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-09DVB-CI: Convert circuit API to conversation APIMichael Mann1-1/+0
Add the few necessary conversation APIs to make conversion possible. Change-Id: I775f23005c48cacd2be342bdc704af4738f0789c Reviewed-on: https://code.wireshark.org/review/24310 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-06Convert PT_EXCHG into using conversation endpointsMichael Mann1-1/+0
Change-Id: Id5857a58513c38dd0ab5b30b61113bcc14e1ecee Reviewed-on: https://code.wireshark.org/review/24258 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-11-05Convert TIPC to use endpoint conversationsMichael Mann1-1/+0
Change-Id: Iab03ebbfc982bf7182851f63c17fa59bc71d7709 Reviewed-on: https://code.wireshark.org/review/24219 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-01Add ability to create endpoints through conversationsMichael Mann1-2/+1
Add endpoint information to the packet_info structure for dissectors to potentially use as their data to create conversations. This patch includes a simple "example" of using conversation_create_endpoint with TDMoP. The assignment of the PT_TDMOP "port type" has been replaced by setting ENDPOINT_TDMOP within the endpoint structure. Then when subdissectors of TDMoP call find_or_create_conversation(), it implicitly picks up the conversation information set by TDMoP Change-Id: I11dc29989cccd3b0f0349ee901babb455ca02d19 Reviewed-on: https://code.wireshark.org/review/24190 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Andrew Chernyh <andrew.chernyh@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-30Remove port_type values not set in pinfo->ptypeMichael Mann1-2/+0
NCP and SBCCS values used for conversation (endpoints) and not to pass "type" to subdissectors. Change-Id: I56a13d2bb7d718b340e9b5a102c43f6e0012bfb9 Reviewed-on: https://code.wireshark.org/review/24174 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-29Add conversation endpoint typeMichael Mann1-2/+2
For the moment this mirrors the port_type enumeration (PT_XXX), but the intent is to move away from using "port types", eliminating most (if not all) Added conversation_pt_to_endpoint_type() so that conversations deal with the correct enumeration. This is for dissector that use pinfo->ptype as input to conversation APIs. Explicit use of port types are converted to using ENDPOINT_XXX type. Change-Id: Ia0bf553a3943b702c921f185407e03ce93ebf0ef Reviewed-on: https://code.wireshark.org/review/24166 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-26Add a ws_in6_addr typedef for struct e_in6_addr.Guy Harris1-4/+4
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-11address(.h): fix typo adresses => addressesAlexis La Goutte1-2/+2
Change-Id: Ibc787005bb7865da55d2d8257009bace1108f181 Reviewed-on: https://code.wireshark.org/review/22082 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-06-22Add address_to_bytes API.Michael Mann1-0/+2
This will copy an address's "byte format" into a buffer. The original intended design is for export_pdu functionality, which tries to do this "manually" for many address types (and creates undesired dependencies) The default functionality if a "byte format function" isn't provided (currently the case for all address types) is a memcpy of the address data. Providing "address to byte" functions to aid export PDU functionality will be provided later. Change-Id: I3703f9e617a8cef09165ad53a0f98c6372676b9b Reviewed-on: https://code.wireshark.org/review/16070 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-06-22Move AT_VINES address type to VINES dissector.Michael Mann1-1/+0
proto.c still has to deal with FT_VINES, but maybe that can be refactored to the dissector too. Change-Id: Iee04eed3b75f91cb62bb7b625dd44baeeb9aebb3 Reviewed-on: https://code.wireshark.org/review/16069 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-22Move AT_USB to inside USB dissector.Michael Mann1-2/+0
This required some hacking in the conversation table handling, but still seemed worth it as USB address is not widely used. Maybe a "is_stringlike" property for address types... Change-Id: I628a15c17cb1f595bb292130867adbc5bea0f41a Reviewed-on: https://code.wireshark.org/review/16068 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-06-13Convert AT_SS7PC to a "dissector address type"Michael Mann1-1/+0
The formatting of the address type is determined by a preference in packet-mtp3.c, so just make MTP3 register the address type. Use address_type_get_by_name in other dissectors (and export_pdu) to use the address type. Change-Id: Ifb32d7de27aeaa23cee8e803e25ffb3c905547b5 Reviewed-on: https://code.wireshark.org/review/15856 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-06-12Handle zero-length addresses in cmp_address().Guy Harris1-0/+8
Don't compare the data if there's none to compare. Change-Id: Ib0e3541e448127869d19afddfc71bb441dba5874 Reviewed-on: https://code.wireshark.org/review/15840 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-12Add checks to address setting routines.Guy Harris1-14/+33
Fail if: 1) you have an AT_NONE address with data; 2) you have a non-AT_NONE address with a zero length and a non-null data pointer, or with a non-zero length and a null data pointer. When comparing addresses for equality, just make sure the types are the same, the lengths are the same and, if the lengths are non-zero, the data is the same; don't treat AT_NONE specially - the "lengths are non-zero" check will make sure we do the right thing. Make sure when we create an AT_NONE address it has a zero length and null data pointer. Change-Id: I5c452ef0d140c2d9aef3004f1cfd124a95b78fb2 Reviewed-on: https://code.wireshark.org/review/15839 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-03-27If setting an address from a tvb and the address length is 0, the address ↵Michael Mann1-1/+4
should be NULL. Bug: 12295 Change-Id: I875308a16b11023a691d34057c7f8561a15aa598 Reviewed-on: https://code.wireshark.org/review/14649 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>
2016-03-18Clamp down on address data structure usage and AT_NONE semanticsJoão Valverde1-7/+7
Catch errors like bug 12205 with an assertion. Change-Id: I17381c92dfb22912e53eb20f6436adfa15d67e71 Reviewed-on: https://code.wireshark.org/review/14251 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-02-26Add free_address_wmem(), fix warnings [-Wcast-qual]João Valverde1-33/+105
Try to improve address API and also fix some constness warnings by not overloading the 'data' pointer to store malloc'ed buffers (use private pointer for that instead). Second try, now passing test suite. Change-Id: Idc101cd866b6d4f13500c9d59da5c7a38847fb7f Reviewed-on: https://code.wireshark.org/review/13946 Petri-Dish: João Valverde <j@v6e.pt> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2016-02-13iso14443: verify the CRC of all messagesMartin Kaiser1-1/+4
define a function to dissect the CRC depending on the card type add a circuit for an activated card to keep track of the card type define a new circuit type CT_ISO1443 for this purpose, the circuit ID is always 0 as we support only a single active card Change-Id: I7250f834301612ba50743258ca7bdbe0199de3ea Reviewed-on: https://code.wireshark.org/review/13908 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-02-08Revert "Add free_address_wmem() and other extensions to address API"João Valverde1-99/+33
This reverts commit 13ec77a9fc3af3b0b502820d0b55796c89997896. This commit introduces a segmentation fault for Lua code (uncovered by the test suite). Change-Id: Ibc273d1915cda9632697b9f138f0ae104d3fb65e Reviewed-on: https://code.wireshark.org/review/13813 Reviewed-by: João Valverde <j@v6e.pt>
2016-02-07Add free_address_wmem() and other extensions to address APIJoão Valverde1-33/+99
Try to improve 'address' API (to be easier/safer) and also avoid some constness warnings by not overloading the 'data' pointer to store malloc'ed buffers (use private pointer for that instead). Change-Id: I7456516b12c67620ceadac447907c12f5905bd49 Reviewed-on: https://code.wireshark.org/review/13463 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>
2015-11-03Remaining ADDRESS macro to address function conversionsJoão Valverde1-15/+21
Change-Id: I8bc9af431e70243b05f4f0ce8c2b8ee451383788 Reviewed-on: https://code.wireshark.org/review/11463 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-24Remove ADDRESS macros and just have their lower-case equivalents.Michael Mann1-8/+1
Remove calls SET_ADDRESS, CMP_ADDRESS, ADDRESSES_EQUAL, COPY_ADDRESS, COPY_ADDRESS_SHALLOW, and ADD_ADDRESS_TO_HASH since they are no longer used. Change-Id: I53fa4cfda756d8cef8815ad0324a3b9d9f9cd490 Reviewed-on: https://code.wireshark.org/review/11238 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-08-20Add the WLAN statistics dialog.Gerald Combs1-0/+19
Instead of splitting the stats into two lists as with the GTK+ UI, add everything to an expandable tree. This allows viewing nodes on more than one network. Rename the top-level Bluetooth menu item to Wireless and put the WLAN stats dialog there. The Qt UI matches SSIDs (WlanNetworkTreeWidgetItem::isMatch) a bit differently than the GTK+ UI. Try to make the logic as plain as possible since we'll likely have to update it in the future. The addition of a custom BSSID address types means that we can't assume that everything is AT_ETHER. Add routines for checking for broadcast BSSIDs and comparing only the data portions of addresses. Move PercentBarDelegate into its own module. Use it in WlanStatisticsDialog. Change-Id: Ie4214eb00671a890871380c4a07213ebfb7585c6 Reviewed-on: https://code.wireshark.org/review/10171 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-19Added TDMoP protocol dissectorAndrew Chernyh1-1/+2
Bug: 11340 Change-Id: I04408db376718c7a5392f9521d7d75d0481ec30e Reviewed-on: https://code.wireshark.org/review/9514 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-07-14Don't copy zero bytes of data.Guy Harris1-2/+4
memcpy(NULL, NULL, 0) isn't guaranteed by ISO C90 to work, so don't do it. Check whether the length is zero, and don't copy if it is. (If the count is non-zero and the pointer is null, that's an error, and we should fail there, so base the test on the length, not the pointer.) Change-Id: I0b3dc1541b52670d8fef459754c9494cfcc59e5d Reviewed-on: https://code.wireshark.org/review/9633 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-04-29Address.h : fix api reference warningAlexis La Goutte1-0/+1
The following parameters of WMEM_COPY_ADDRESS(scope, to, from) are not documented: parameter 'scope' Change-Id: Ice1bddb55839f7aa839bdf6dec74211cf7e4d9dc Reviewed-on: https://code.wireshark.org/review/8227 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-09Add fixed length function for address types.Michael Mann1-3/+0
This allows for even more cleanup with respect to how address types are handled, including removing address_to_str.c. Most of the functionality was folded into address_types.c, but the remainder was just dispersed because it didn't make sense to keep the file. Change-Id: Id4e9391f0c3c26eff8c27b362e4f7a1970d718b4 Reviewed-on: https://code.wireshark.org/review/7038 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-02-09Eliminate the hf member out of the address structure.Michael Mann1-46/+7
Using the new address type registration, dissectors can create their own address types with their own (column) filters attached to them, eliminating the need for an address to keep track of a hf_ field. Change-Id: I2bbec256a056f403a7ac9880d5d76a0b2a21b221 Ping-Bug: 7728 Reviewed-on: https://code.wireshark.org/review/7037 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-02-09Add "column filter string" support to address types.Michael Mann1-3/+0
Information about dissector (filter) fields should be kept in a dissector as much as possible. Supporting "column filter string" also allows other dissectors to create their own "address types" with different column filters (because AT_ETHER isn't always an "Ethernet" address). This feature also allowed a few "dissector specific" address types to be moved to their own dissector. Change-Id: Ie9024af4db62bc2ee4f8c9d28a1d807f706f45bf Ping-Bug:7728 Reviewed-on: https://code.wireshark.org/review/7029 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-02-09Add address type registration.Michael Mann1-9/+4
Now address types are setup just like field types and must be registered with a structure that provides its string representation (and more things in the future). Address types that are limited to a single dissector are registered by the dissector. More "common" ones are globally registered. There are still a few that really belong in a dissector, but have other dependencies currently not accounted for in the address type support. Many of the "address to string" conversions that involved g_sprintf have be changed to use more "performance friendly" methods (some at the cost of needing to_str-int.h) Leaving all comments regarding this "solution" in address_to_str.c in until all have been implemented Change-Id: I494f413e016b22859c44675def11135f228796e0 Reviewed-on: https://code.wireshark.org/review/7019 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-16Update a commentPascal Quantin1-2/+2
Change-Id: I7bf1173bfb23e5f083b8aaf09476b30b4791aae0 Reviewed-on: https://code.wireshark.org/review/6577 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-01-16SE_COPY_ADDRESS -> WMEM_COPY_ADDRESSMichael Mann1-6/+6
Copy addresses with wmem-scope instead of (forced) seasonal scope. All existing instances were converted to wmem_file_scope, but the flexibility is there for other scopes. Change-Id: I8e58837b9ef574ec7dd87e278470d7063ae8c1c2 Reviewed-on: https://code.wireshark.org/review/6564 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-28Create FT_FCWWN field type.Michael Mann1-0/+1
Also, convert the "string" hf_ entries that used tvb_fcwwn_to_str as a string to use proto_tree_add_item with FT_FCWWN type. Change-Id: I4ca77870499fd8239584a70874998b5d194a7167 Reviewed-on: https://code.wireshark.org/review/6036 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-08-05Fix whitespace/indentation to match editor modelines.Bill Meier1-31/+31
Change-Id: I3445ae22f10584582d465bf632942e016f5f70ca Reviewed-on: https://code.wireshark.org/review/3452 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-05-20Fix the SET_ADDRESS_HF() macro.Guy Martin1-1/+1
Change-Id: I01ac342f791b578be0aab80ce8fe07a97ba5ed50 Reviewed-on: https://code.wireshark.org/review/1691 Reviewed-by: Anders Broman <a.broman58@gmail.com>
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-14Fix const warnings.Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=54092
2013-12-08Fix some warnings: cast discards `__attribute__((const))' qualifier from ↵Jakub Zawadzki1-1/+1
pointer target type svn path=/trunk/; revision=53875
2013-12-08../../epan/address.h:63:17: warning: comma at end of enumerator list [-pedantic]Anders Broman1-1/+1
svn path=/trunk/; revision=53856
2013-12-06Add DeviceNet and J1939 dissectors. Both run on top of CAN (not necessarily ↵Michael Mann1-1/+3
always SocketCAN, but it did provide a good test environment) svn path=/trunk/; revision=53802
2013-12-03Fix warning: argument 'out/in' of command @param is not found in the ↵Alexis La Goutte1-2/+2
argument list of SE_COPY_ADDRESS(to, from) svn path=/trunk/; revision=53747
2013-12-02Fix (-W)documentation error found by ClangAlexis La Goutte1-28/+28
error: parameter 'addr*[in]' not found in the function declaration [-Werror,-Wdocumentation] svn path=/trunk/; revision=53720
2013-09-17Switch the inline functions that use tvbuffs and emem back to macros.Gerald Combs1-33/+17
This should hopefully fix linking with Solaris Studio, which doesn't remove unused inline functions by default. Fix a copy+paste error. svn path=/trunk/; revision=52122
2013-09-16address_equal → addresses_equal. Switch from address macros to functionsGerald Combs1-2/+2
in the Qt code. svn path=/trunk/; revision=52108