Commit Graph

48 Commits

Author SHA1 Message Date
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
Michael Mann 1d598bbff7 Replace ip6_to_str and ip6_guint8_to_str with address_to_str and tvb_ip_to_str.
Change-Id: I1d258923a7a63539ec8456d3e306bca5016a1e4b
Reviewed-on: https://code.wireshark.org/review/6060
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-28 14:09:27 +00:00
Michael Mann 3d3f97320b Replace ip_to_str with [ep_]address_to_str and tvb_ip_to_str.
Change-Id: I40d0c8253743183aecef252040b7dd6742ae5c71
Reviewed-on: https://code.wireshark.org/review/5934
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-26 21:17:10 +00:00
Michael Mann e03ffe2583 Replace fc_to_str with address_to_str or tvb_fc_to_str.
Change-Id: I69bf25f5abb9d6ad325f922fab73b6f0cf8ca2ea
Reviewed-on: https://code.wireshark.org/review/6035
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>
2014-12-24 18:59:14 +00:00
Michael Mann f002332d88 Replace ether_to_str with either address_to_str or tvb_ether_to_str.
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-21 15:13:30 +00:00
Michael Mann cdaa669829 Replace ax25_to_str and get_ax25_name with address_to_str.
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-21 15:12:58 +00:00
Michael Mann c347eb965b Eliminate proto_tree_add_text from packet-ipx.c
Change-Id: Ie084a33be94d91eec7f5f70ef31fcb0835ad266c
Reviewed-on: https://code.wireshark.org/review/4829
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-19 03:01:54 +00:00
Jeff Morriss 2497482e34 Don't print non-printable characters in AX.25 addresses.
Add a new routine to wsutil to make this easy: printable_char_or_period().

Bug: 10439
Change-Id: I0eb2bb6bc0676a1035c3d845b5e20276fa04de60
Reviewed-on: https://code.wireshark.org/review/3981
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: 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-09-04 12:46:06 +00:00
Sean O. Stalley bbb3e2f7af Add Bus ID to USB Address Column
USB Addresses are now in the format of: bus_id.device_address.endpoint
This makes it much easier to read traces that captured traffic on
more than one bus.

Change-Id: I264db2ceea712d94632d5d08d05d3af22a4a03fe
Reviewed-on: https://code.wireshark.org/review/2833
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-04 02:20:38 +00:00
Guy Harris 09bf1702a6 Get rid of some uses of tvb_get_ptr().
Introduce a new tvb_ipxnet_to_string() routine to help that.

Change-Id: Icb27f7cdd6e6e7de67e765715e450063d7de6072
Reviewed-on: https://code.wireshark.org/review/1647
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-15 03:16:15 +00:00
Guy Harris 80011ec03c Don't se_ allocate strings when mapping addresses to column strings.
This should significantly reduce memory usage, without increasing the
CPU time required to process a capture file in TShark or Wireshark.

As a result, se_address_to_str() is no longer used; eliminate it.

Fixes bug #9949.

Change-Id: I65a112a426c82cc73a957b81384c765c3d14f2c3
Reviewed-on: https://code.wireshark.org/review/1213
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-19 14:20:06 +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
Gilbert Ramirez 4cc694839d Fix all -fstrict-alias warnings found by gcc 4.1.2
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-02-03 09:26:10 +00:00
Guy Harris c6c1887a0b Have ip6_to_str() and tvb_ip6_to_str() return const pointers, as the
ip_to_str equivalents do.

Don't cast away constness, and don't make it necessary to do so.

svn path=/trunk/; revision=54767
2014-01-14 05:39:57 +00:00
Guy Harris 198ce0b6c7 Fix indentation.
svn path=/trunk/; revision=54289
2013-12-20 10:30:57 +00:00
Evan Huus a6415ece0a Rename a couple of to_str functions to have ep_ in the name. This makes it
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-12-19 15:49:09 +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
Jakub Zawadzki 5ac6474c94 Rename some of pint.h macros to match common style (bits number on the end).
pntohs  -> pntoh16
   pntohl  -> pntoh32
   pletohs -> pletoh16
   pletohl -> pletoh32
   phtons  -> phton16
   phtonl  -> phton32


svn path=/trunk/; revision=53652
2013-11-29 18:59:06 +00:00
Evan Huus d97c9e2ff4 Implement address_to_str which is like ep_address_to_str and se_address_to_str
except it takes a wmem scope instead. Add the two emem equivalents to checkAPI
as (weakly) deprecated.

svn path=/trunk/; revision=53528
2013-11-23 22:17:27 +00:00
Evan Huus df1aec4a6b Remove old (2009) and no-longer-necessary compatibility macro.
svn path=/trunk/; revision=53527
2013-11-23 22:03:48 +00:00
Jakub Zawadzki 9aac55472c Put "private" to_str.c functions to to_str-int.h
svn path=/trunk/; revision=53187
2013-11-09 11:26:41 +00:00
Alexis La Goutte f079ce9117 Fix indent (use 4 spaces) And add modelines info
svn path=/trunk/; revision=51550
2013-08-27 21:12:52 +00:00
Jeff Morriss 2df54da6e2 Move a bunch of the crypt modules and pint.h into wsutil.
This means wsutil now links against libcrypt.

Protect a bunch of the crypt header files from multiple inclusion.

svn path=/trunk/; revision=51100
2013-08-01 23:34:47 +00:00
Guy Harris 74b6c59499 There are many types that eventually turn into "signed byte"; for calls
to g_strlcpy(), use the one of them that it's documented as using.

svn path=/trunk/; revision=50771
2013-07-21 22:01:22 +00:00
Jörg Mayer 270cf97b25 Fix
/home/jmayer/work/wireshark/svn/trunk/epan/address_to_str.c:595:20: error: passing
      'const guint8 *' (aka 'const unsigned char *') to parameter of type
      'const gchar *' (aka 'const char *') converts between pointers to integer types
      with different sign [-Werror,-Wpointer-sign]
    g_strlcpy(buf, (const guint8 *)addr->data, buf_len);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gstrfuncs.h:110:20: note: passing argument to parameter 'src'
      here
                                        const gchar  *src,
                                                      ^

svn path=/trunk/; revision=50756
2013-07-21 14:28:08 +00:00
Anders Broman aa3ebebefe From beroset:
remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48312
2013-03-15 05:42:50 +00:00
Guy Harris 8ed7a73e22 Fix a bunch of warnings.
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
sizeof.

Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
strtol() and strtoul().

Change some data types to avoid those implicit conversion warnings.

When assigning a constant to a float, make sure the constant isn't a
double, by appending "f" to the constant.

Constify a bunch of variables, parameters, and return values to
eliminate warnings due to strings being given const qualifiers.  Cast
away those warnings in some cases where an API we don't control forces
us to do so.

Enable a bunch of additional warnings by default.  Note why at least
some of the other warnings aren't enabled.

randpkt.c and text2pcap.c are used to build programs, so they don't need
to be in EXTRA_DIST.

If the user specifies --enable-warnings-as-errors, add -Werror *even if
the user specified --enable-extra-gcc-flags; assume they know what
they're doing and are willing to have the compile fail due to the extra
GCC warnings being treated as errors.

svn path=/trunk/; revision=46748
2012-12-26 05:57:06 +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
Jeff Morriss 3729335973 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45016
2012-09-20 01:48:30 +00:00
Guy Harris dfe0389590 Move the AX.25 address routines to address_to_str.c, where they belong;
hopefully this will fix some of the build errors.

svn path=/trunk/; revision=44219
2012-08-02 18:51:40 +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
Guy Harris 3a62afcfed Attempt to squelch some compiler warnings.
svn path=/trunk/; revision=37679
2011-06-16 07:02:23 +00:00
Stig Bjørlykke e4d168c5dc Please don't use prohibited APIs in new code:
sprintf -> g_snprintf

Fixes coverity 1197 & 1198.

svn path=/trunk/; revision=37664
2011-06-14 20:37:53 +00:00
Guy Harris f153eb070b Cast away some warnings about alignment; ep_alloc() guarantees
sufficient alignment for all types of data.

svn path=/trunk/; revision=37190
2011-05-16 21:42:49 +00:00
Alexis La Goutte 7d317e553b Add FT_EUI64 Field Type
* Remove proto_tree_add_eui64 function from 802.15.4 Dissector 
* Replace print_eui64/print_eui64 by eui64_to_str/get_eui64_name
* Update Documentation (README.dev)
* Add new function in libwireshark.def
* Support of encoding for tvb_eui64_to_str
* Use FT_EUI64 for ICMPv6, CAPWAP, Zbee ... dissector

svn path=/trunk/; revision=37015
2011-05-08 10:23:53 +00:00
Jakub Zawadzki 4194ee7f89 Add note about ::/96 being deprecated.
svn path=/trunk/; revision=37008
2011-05-06 11:39:11 +00:00
Jakub Zawadzki d079e29cac Fix false positive compiler warnings:
address_to_str.c:157: warning: 'cur.len' may be used uninitialized in this function
	address_to_str.c:157: warning: 'best.len' may be used uninitialized in this function


svn path=/trunk/; revision=37001
2011-05-05 21:15:33 +00:00
Jakub Zawadzki 453d0a8568 Introduce ip6_to_str_buf_len (little cleaner version of inet_ntop6 from wsutil/inet_ntop.c)
and use it instead of inet_ntop(AF_INET6, ...)

- Add MAX_IP6_STR_LEN define.
- use MAX_IP6_STR_LEN as a buffer size when ip6_to_str_buf() is used.

svn path=/trunk/; revision=37000
2011-05-05 20:48:21 +00:00
Jakub Zawadzki 892da10a29 Subtract (not add!) preamble length from remaining buffer length.
svn path=/trunk/; revision=36998
2011-05-05 16:41:52 +00:00
Jeff Morriss 0f59bc7c45 Rename vines_to_str() to tvb_vines_to_str() and make it take a pointer a TVB
and an offset instead of (generally) a pointer into a TVB.

Move most of the contents of packet-vines.h into packet-vines.c: the moved
content is only needed in that file.

svn path=/trunk/; revision=35912
2011-02-11 03:13:24 +00:00
Jeff Morriss 6e0fcb7ab5 Introduce, and start using, tvb_eth_to_str().
Export tvb_*_to_str() and put them in alphabetical order.

svn path=/trunk/; revision=35602
2011-01-21 02:48:55 +00:00
Jeff Morriss 77b3392e72 Introduce, and start using, tvb_fc_to_str() and tvb_fcwwm_to_str(): these
functions act like their non-tvb counterparts except that they take a tvb and
and offset instead of a pointer to a byte array.

This basically saves the dissectors from having to call tvb_get_ptr()--which in
this case eliminates a couple of typos in the length given to tvb_get_ptr().

svn path=/trunk/; revision=35549
2011-01-16 04:33:42 +00:00
Jeff Morriss a167206685 Introduce, and start using, tvb_ip_to_str() and tvb_ip6_to_str(). These
do the same as the non-tvb equivalents but take a TVB and an offset instead
of a pointer to an array of bytes.

Their purpose is to prevent (many) dissectors from doing:
ip_to_str(tvb_get_ptr(...)).

(About the names and the location: I like the names as they are but the names
imply that they should live in tvbuff.c.  That would make some sense but
I didn't want to pull to_str.h into tvbuff.c...)

svn path=/trunk/; revision=35519
2011-01-13 15:53:30 +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 47e2d75820 Move some code (including the optional objects) into libwsutil
svn path=/trunk/; revision=33012
2010-05-28 20:19:55 +00:00
Bill Meier 6812b68eb1 From Yaniv Kaul: constify parameters
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4422

 From me: Fix a number of instances where the function prototype or
  the function definition wasn't changed so there was a mismatch 
  thus causing Windows (but not gcc) compilation errors.

svn path=/trunk/; revision=32365
2010-04-03 18:18:50 +00:00
Guy Harris adde80ad43 From Jakub Zawadzki: split off the address-to-string functions, except
for ip_to_str_buf(), into address_to_str.c.

Fix up the SVN attributes for time_fmt.h while we're at it.

svn path=/trunk/; revision=32038
2010-02-27 21:41:12 +00:00