Commit Graph

63 Commits

Author SHA1 Message Date
Michael Mann 8ff944d4ab Add fixed length function for address types.
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-09 03:49:13 +00:00
Michael Mann 2875cd382f Eliminate the hf member out of the address structure.
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-09 03:48:53 +00:00
Michael Mann 2042385ac9 Add "column filter string" support to address types.
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-09 01:13:28 +00:00
Michael Mann 4497bb48fd Add address type registration.
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-02-09 01:12:01 +00:00
Pascal Quantin 1e8c6eef4a Update a comment
Change-Id: I7bf1173bfb23e5f083b8aaf09476b30b4791aae0
Reviewed-on: https://code.wireshark.org/review/6577
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-01-16 21:31:14 +00:00
Michael Mann ada1eec702 SE_COPY_ADDRESS -> WMEM_COPY_ADDRESS
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>
2015-01-16 15:25:18 +00:00
Michael Mann 71c02b20eb Create FT_FCWWN field type.
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-12-28 20:05:29 +00:00
Bill Meier f3dd7fe1eb Fix whitespace/indentation to match editor modelines.
Change-Id: I3445ae22f10584582d465bf632942e016f5f70ca
Reviewed-on: https://code.wireshark.org/review/3452
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-08-05 20:42:21 +00:00
Guy Martin 33fc6e614d Fix the SET_ADDRESS_HF() macro.
Change-Id: I01ac342f791b578be0aab80ce8fe07a97ba5ed50
Reviewed-on: https://code.wireshark.org/review/1691
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-20 19:18:47 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(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>
2014-03-04 14:27:33 +00:00
Jakub Zawadzki e0e86bab5a Fix const warnings.
svn path=/trunk/; revision=54092
2013-12-14 14:33:46 +00:00
Jakub Zawadzki f91eba752b Fix some warnings: cast discards `__attribute__((const))' qualifier from pointer target type
svn path=/trunk/; revision=53875
2013-12-08 23:16:06 +00:00
Anders Broman b7d62057f3 ../../epan/address.h:63:17: warning: comma at end of enumerator list [-pedantic]
svn path=/trunk/; revision=53856
2013-12-08 15:14:32 +00:00
Michael Mann 643f9efce2 Add DeviceNet and J1939 dissectors. Both run on top of CAN (not necessarily always SocketCAN, but it did provide a good test environment)
svn path=/trunk/; revision=53802
2013-12-06 04:33:58 +00:00
Alexis La Goutte 0940471527 Fix warning: argument 'out/in' of command @param is not found in the argument list of SE_COPY_ADDRESS(to, from)
svn path=/trunk/; revision=53747
2013-12-03 13:37:40 +00:00
Alexis La Goutte 1f3261d99a Fix (-W)documentation error found by Clang
error: parameter 'addr*[in]' not found in the function declaration [-Werror,-Wdocumentation]

svn path=/trunk/; revision=53720
2013-12-02 13:46:10 +00:00
Gerald Combs b1a7fc361f Switch the inline functions that use tvbuffs and emem back to macros.
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-17 18:42:36 +00:00
Gerald Combs 945901af70 address_equal → addresses_equal. Switch from address macros to functions
in the Qt code.

svn path=/trunk/; revision=52108
2013-09-16 21:33:26 +00:00
Gerald Combs 6079691af4 Convert each of the address.h macros to inline functions.
Document each function. Note that we now call tvb_get_ptr() before
modifying the address in tvb_set_address() and tvb_set_address_hf(). The
caller doesn't have to worry about doing that any more. Add
add_address_to_hash64().

svn path=/trunk/; revision=52106
2013-09-16 21:15:49 +00:00
Evan Huus 82c63755ab Add the new hash algorithm to the macro we were already using. Create a
temporary address structure for the port-numbers so we can use the same macro,
reducing duplication further.

Add modelines.

svn path=/trunk/; revision=52081
2013-09-15 20:11:25 +00:00
Jörg Mayer 1e762e315d Remove epan.h from ftypes.h, address.h and tpg.h,
add it to proto.h as it contains macros that require emem.h

svn path=/trunk/; revision=52001
2013-09-13 09:13:09 +00:00
Evan Huus 2e299ec910 Add modelines, use consistent indentation in address.h
Use the "do { } while (0)" trick to make the macros behave like regular function
calls syntatically.

Fix one dissector that wasn't using semicolons after the macro calls.

svn path=/trunk/; revision=51819
2013-09-07 12:51:29 +00:00
Evan Huus aee73d6d9e From Michal Labedzki via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8530
Enable "Decode As" for Bluetooth over USB.

svn path=/trunk/; revision=48605
2013-03-28 03:06:30 +00:00
Pascal Quantin aec6d0a755 From Ed Beroset via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 :
Remove C++ incompatibilities from ssl and ssh files

svn path=/trunk/; revision=48174
2013-03-07 18:37:58 +00:00
Pascal Quantin 0a17799d61 From Ed Beroset via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 :
Remove C++ incompatibilities from most of the dcerpc code

svn path=/trunk/; revision=48023
2013-03-02 22:54:39 +00:00
Martin Kaiser 974afe6319 a DVB-CI session number is not globally unique, it's only unique per
transport connection, so it's not a good choice for a circuit id

use (session number|transport connection id) as circuit id

svn path=/trunk/; revision=47499
2013-02-05 20:38:15 +00:00
Jeff Morriss 09221f45e4 When copying addresses, also copy the (new) hf field.
Use SET_ADDRESS in some dissectors that weren't using it (so that the hf field
is correctly initialized).

Introduce a COPY_ADDRESS_SHALLOW (which copies an address without copying the
contents of the data field).

svn path=/trunk/; revision=46602
2012-12-18 23:28:38 +00:00
Jeff Morriss 49466f95bc Introduce, and start using, TVB_SET_ADDRESS() and TVB_SET_ADDRESS_HF(). They
are like the non-TVB versions except that they take a TVB and an offset
instead of (frequently) a pointer into the TVB.

Calling tvb_get_ptr() before modifying the rest of the fields should help fix
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7960 (though I can't
reproduce that problem).


Replace a bunch of calls like:

SET_ADDRESS(..., AT_XXX, length, tvb_get_ptr(tvb, offset, length));

with:

TVB_SET_ADDRESS(..., AT_XXX, tvb, offset, length);

svn path=/trunk/; revision=46324
2012-12-02 04:49:13 +00:00
Evan Huus 361aedec1f Create SET_ADDRESS_HF that takes an additional hf_ value that can be
used to override the filter generated from the address column.

Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7728 (again).

svn path=/trunk/; revision=45792
2012-10-26 01:59:17 +00:00
Evan Huus c6b522bc70 Revert revision 44921.
See discussion on https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7728

svn path=/trunk/; revision=45791
2012-10-26 00:42:34 +00:00
Guy Harris 8cb31ee512 Note why there's no AT_IEEE_802_15_4_LONG (that's AT_EUI64).
svn path=/trunk/; revision=45744
2012-10-23 23:27:29 +00:00
Guy Harris 7c76ad78d3 Add an AT_ value for 802.15.4 short addresses.
Note that, if you want EUI-64's to resolve the OUI in the display,
hacking individual dissectors to do it themselves and use AT_STRINGZ is
*not* the right way to do it.

svn path=/trunk/; revision=45743
2012-10-23 21:19:02 +00:00
Anders Broman d424f3949a Get rid of ../../epan/address.h:65:19: warning: comma at end of enumerator list [-pedantic]
svn path=/trunk/; revision=45102
2012-09-24 15:08:46 +00:00
Evan Huus 826bba705b From Pontus Fuchs via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7728
Make right-click + apply-as-filter work in the packet list for non-ethernet
frames (such as ieee 802.11 frames).

svn path=/trunk/; revision=44921
2012-09-15 20:16:14 +00:00
Guy Harris 835111692f From Richard Stearn: support for AX.25, including support for
LINKTYPE_AX25.

svn path=/trunk/; revision=44211
2012-08-02 16:54:43 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Jeff Morriss 7c55e4513a From Martin Kaiser via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6890 :
The attached patch for the DVB-CI dissector creates a circuit for each DVB-CI
session, using the session number as circuit id.

The DVB-CI session commands are:

- open_session_request(resource_id)
- session_opened(resource_id, newly assigned session number)
- payload transfer(session_number, payload data)
- close session(session_number)

For now, the circuit will store the resource id and make it available (as a
generated item) to subsequent packets that contain only the session number.
Doing this, the resource id (which is like a tcp/udp port) can be used for
filtering.

svn path=/trunk/; revision=41253
2012-03-01 02:50:16 +00:00
Jeff Morriss 37d4ccff56 From Slava via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5335 :
This patch adds to Wireshark the ability to dissect Infiniband SDP (Socket
Direct Protocol) and CM MADs traffic.

It also contains various other bug-fixes and enhancements. SDP traffic can be
identified automatically (analyzing SDP CM MADs) or manually.

SDP, or Sockets Direct Protocol, is a protocol developed by the Infiniband
Trade Association which enables existing socket-based applications to
transparently utilize the Infiniband capabilities. 

This patch is submitted on behalf of Mellanox Technologies Ltd.

svn path=/trunk/; revision=34918
2010-11-17 02:57:22 +00:00
Jeff Morriss e00323a55f Fix up some indentation
svn path=/trunk/; revision=32795
2010-05-13 20:39:56 +00:00
Anders Broman 3eadb385c3 From Alexey Neyman:
Implement dissector for IPMB (DLT_IPMB_LINUX, 209).

svn path=/trunk/; revision=25986
2008-08-12 04:44:35 +00:00
Guy Harris f16cd039c9 Make ADD_ADDRESS_TO_HASH() take a pointer to an address as an argument,
as the other address macros do.

svn path=/trunk/; revision=21588
2007-04-26 04:30:41 +00:00
Guy Harris abc66d168a Use the right local variable.
svn path=/trunk/; revision=21581
2007-04-26 02:35:36 +00:00
Guy Harris 7537b3afa3 Add missing backslash.
svn path=/trunk/; revision=21579
2007-04-26 01:11:24 +00:00
Guy Harris bba0b00392 Rename HASH_ADDRESS to ADD_ADDRESS_TO_HASH, to make it clearer what it
does (i.e., it will add the address bytes to the value that's already
there - it will not initialize the value, so you have to clear it before
doing any hashing).

svn path=/trunk/; revision=21578
2007-04-26 01:01:27 +00:00
Guy Harris 1ed26d317c Add a macro for hashing the bytes of an address into a hash value.
Use it in the IAX2 dissector and in the conversation code.

svn path=/trunk/; revision=21577
2007-04-26 00:51:33 +00:00
Guy Harris c3ac6f1e71 Some types of addresses are data structures; make the address data
pointer in an address structure a "void *", to indicate that it can
point to some arbitrary type of object, rather than a "guint8 *", which
indicates that it points to an array of bytes.

For any address type where the address is a structure, this removes some
alignment warnings; the author of the code to handle a particular
address type has the responsibility of making sure you don't set up the
address structure with misaligned data.  (Yes, it matters, at least on
SPARC.)

svn path=/trunk/; revision=21563
2007-04-25 19:28:56 +00:00
Guy Harris 1bc049906a Add some GCC warnings to the standard set, and add some others to the
--enable-extra-gcc-checks set.

If we turn on -pedantic, try turning on -Wno-long-long as well, so that
it's not *so* pedantic that it rejects the 64-bit integral data types
that we explicitly require.

Constify a bunch of stuff, and make some other changes, to get rid of
warnings.

Clean up some indentation.

svn path=/trunk/; revision=21526
2007-04-23 10:59:26 +00:00
Tomas Kukosa 36fe262fa8 new SE_COPY_ADDRESS macro
svn path=/trunk/; revision=21364
2007-04-10 13:35:39 +00:00
Guy Harris 0fb0fa8794 Put
#ifdef __cplusplus
	extern "C" {
	#endif /* __cplusplus */

		...

	#ifdef __cplusplus
	}
	#endif /* __cplusplus */

wrappers into some header files, for the benefit of C++ plugins.  Also,
add multiple-include protections.

svn path=/trunk/; revision=20485
2007-01-18 18:43:30 +00:00
Ronnie Sahlberg 714ce64b12 add a new port type for usb endpoints
start introducing conversations to the usb dissector so that we can start tracking requests/responses
which we need to in order to dissect for example the data returned by a device to a GET DESCRIPTORS call



svn path=/trunk/; revision=19539
2006-10-15 06:10:59 +00:00