Commit Graph

269 Commits

Author SHA1 Message Date
João Valverde 5823e6e50b Remove duplicate transport ports from proto tree summary
Don't display duplicate ports if transport name resolution is not
enabled (for UDP/TCP/DCCP).

Also introduce col_append_port() to handle info column port display
with name resolution in a uniform format.

Change-Id: Icb8ac45f726b7c539b4534c62061473e9b582753
Reviewed-on: https://code.wireshark.org/review/10804
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-11 23:54:28 +00:00
João Valverde a459ac72a2 Add BASE_PT_ field display types
Avoid displaying duplicate port numbers with transport name resolution disabled and
make some dissector code simpler.

Introduces port_with_resolution_to_str_buf() function and amends UDP/TCP/DCCP/SCTP to
use the new field display type.

Change-Id: Ifb97810b9c669ccbb1a310a2c0ffd6e2b63af210
Reviewed-on: https://code.wireshark.org/review/10625
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-05 18:10:48 +00:00
Peter Wu 087afc80c0 addr_resolv: cosmetic change for flags
Reduce some magic numbers and add parentheses,
change ((flags & X) == X) to simply (flags * X),
change tp->flags = tp->flags | x to tp->flags |= x.

Change-Id: Ida2d1aa59a3efc20d5fe6910d7b757277eb7e627
Reviewed-on: https://code.wireshark.org/review/10659
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2015-09-27 17:47:20 +00:00
Dario Lombardo 7a096c3844 Init values set (found by American Fuzzy Lop).
Change-Id: Iddd2b4a0ceb409db1afb1a412339134634de631c
Reviewed-on: https://code.wireshark.org/review/10104
Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-08-18 18:29:58 +00:00
Hadriel Kaplan 190e313e9d DNS: move DNS name resolution pref to Name Resolution prefs
Move the boolean flag for using captured DNS packet info for name resolution
to the Name Resolution preferences settings, as it was rather surprising to
disable Name Resolution preferences and still have names being resolved. Also
disble them all if the '-n' command line switch is used, and re-enable it for
a 'd' character in the '-N' option.

Bug: 10337
Change-Id: Ie4d47bab0100db3360cc447cd3e446b2e39aa917
Reviewed-on: https://code.wireshark.org/review/9786
Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
2015-07-25 17:05:01 +00:00
Guy Harris df5a315048 Fix address resolution for columns.
Have address_to_name() be a routine that takes an address and returns a
string with a "sufficiently long" lifetime for use in columns, using the
address type's addr_name_res_str routine for most address types, rather
than having a too-small set of address types wired into it.  It replaces
both the internal solve_address_to_name() routine and get_addr_name(),
and can, for example, handle the special WLAN address types rather than
leaving them unresolved even with an ethers file.

Change-Id: Id09bc412adf5d2752155650a14a77c5378af2e42
Reviewed-on: https://code.wireshark.org/review/9475
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-07-03 02:21:20 +00:00
Evan Huus a2e2c1f997 Fix memory leak printing eui64s
The scope that is passed in should only be used for the return value - other
temporary buffers we must alloc/free ourselves, since if the scope is NULL they
will not be managed automatically.

Bug: 11293
Change-Id: I27be856f1c5cdf47f78e766192a29523664a543e
Reviewed-on: https://code.wireshark.org/review/9007
Reviewed-by: Evan Huus <eapache@gmail.com>
Petri-Dish: Evan Huus <eapache@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-06-21 18:40:01 +00:00
Evan Huus c4fbede67a Remove the executable bit from epan/addr_resolv.c
It was added (presumably by accident) in 41ac67c.

Change-Id: If9c2daae6d9f6a0f09fc04c5332faeaa69d355c2
Reviewed-on: https://code.wireshark.org/review/8855
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-06-09 13:18:16 +00:00
Christopher Maynard 41ac67cbb2 Fix insertion of subnets read from the subnets file: append to the *end* of
the list.

The patch ensures that non-duplicate subnets are appended to the end of the
list rather than as the second element, which if there had been a second
element previously, the memory for it was effectively leaked.

It also allows /32 "subnets", even though arguably the hosts file should be
used instead, but now the test in read_subnets_file() matches the assert in
subnet_entry_set().

Bug: 11247
Change-Id: I54bf1cbb34edfcf410aa634043a377c27091df51
Reviewed-on: https://code.wireshark.org/review/8802
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-09 04:09:52 +00:00
Gerald Combs 9762c32709 Complete the fix from g6b5c71a.
Change-Id: I18360cbc50d790a22e69e85dcc16363f8c682c64
Reviewed-on: https://code.wireshark.org/review/7739
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-03-18 18:46:18 +00:00
Gerald Combs 6b5c71af0d Don't cache existing IPv4 and IPv6 hostnames.
In the Qt UI redrawing the packet list redissects our visible packets,
which might call add_ipv{4,6}_name, which sets new_resolved_objects =
TRUE, which emits the addressResolutionChanged signal, which redraws the
packet list, which ...

Break out of the loop by checking to see if we've already cached an IPv4
or IPv6 hostname.

Change-Id: Icb2841e3453fb98d4cf0ea06a0f49737e2b8f25e
Reviewed-on: https://code.wireshark.org/review/7738
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-03-18 18:40:46 +00:00
Jeff Morriss a308aef89d Look for and use gethostbyname() if we don't have getaddrinfo(). Fail to
configure if we can't find any name resolver (autotools only).

This puts back the gethostbyname()/gethostbyname2() code removed in
I3348179626e97daaddfbc89e3ed21e39915e3de4 and
If59ce8a038776eadd6cd1794ed0e2dad8bf8a22c but as a last-resort option (only
if we don't have a better or more modern name resolver).

As suggested/requested by Guy in https://code.wireshark.org/review/#/c/7423/

Change-Id: I706dbbd65135f47c67d3d8d88a61ad7273914c47
Reviewed-on: https://code.wireshark.org/review/7447
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2015-03-03 15:02:08 +00:00
Michael Mann 1a54112c1d Add tvb_get_ether_name
This is mostly to reduce tvb_get_ptr calls that were used to pass into get_ether_name.

Some optimizations were made to packet-ieee80211.c in the process of conversion.

Change-Id: I81d3c65d4c09a15237fc287c2e989eb6e6936b1f
Reviewed-on: https://code.wireshark.org/review/7492
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-03-03 07:19:42 +00:00
Jeff Morriss f9f7ff2904 Don't read aliases from the personal hosts file.
We only store the last name added (i.e., the last alias) which is the
opposite of what the name resolver does (it returns the first name in the
hosts file).

Just comment the code out for now with a comment explaining why.  Maybe some
day we'll have a reason to store the aliases.

Change-Id: I560ac05868a429d31e9d41f3a34af36c4fca1f6c
Reviewed-on: https://code.wireshark.org/review/7466
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-03-02 06:58:26 +00:00
Jeff Morriss edb5e4b7ff Use getnameinfo() instead of gethostbyaddr().
Also fix up some formatting.

Change-Id: I3348179626e97daaddfbc89e3ed21e39915e3de4
Reviewed-on: https://code.wireshark.org/review/7423
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2015-02-27 21:09:23 +00:00
Jeff Morriss e5e8af9c71 Restore synchronous name resolution (revert SVN rev52115).
These gethostbyaddr() calls should be changed to getaddrinfo() but only in
master.

Change-Id: I7e2d31ceb0e072beb7f324336d7b145c3adbe3a0
Reviewed-on: https://code.wireshark.org/review/7402
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2015-02-27 21:09:11 +00:00
Jeff Morriss 4e12b598eb Check whether we HAVE_GETADDRINFO before using it.
One spot was missing the check.

Change-Id: I72d1d3d2dec2cc71b02861ace59dc9e189721cfb
Reviewed-on: https://code.wireshark.org/review/7401
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2015-02-26 02:44:50 +00:00
Pascal Quantin 9fe9505b46 addr_resolv.c: fix a stack buffer overflow detected by ASAN
Issue reported by Alexis

Change-Id: I0ef19625b6844fbc2996b75d51e86f949e358c8d
Reviewed-on: https://code.wireshark.org/review/7273
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-02-20 11:50:14 +00:00
Alexis La Goutte f89edfd2df addr_resolv: Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: I559151afab48892c51b702d008c1583570bd8754
Reviewed-on: https://code.wireshark.org/review/7262
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-20 07:40:47 +00:00
Michael Mann 8d16ac46d5 Add name resolution support to address type.
Add address_with_resolution_to_str API that returns address string + name resolution in the format %s (%s), first string is resolved name (if available) and second string is raw address string.

Convert AT_FCWWN to using proper name resolution format

First use of address_with_resolution_to_str with field types in proto.c

Change-Id: I2ae77c29a4ffc30bb919fbec00f06629830898c2
Reviewed-on: https://code.wireshark.org/review/7196
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-19 13:09:41 +00:00
Robert Cragie edf05db347 Corrected display format for EUI-64
Change-Id: I0913337a29efac5c39e30897cad7e90195fa984a
Reviewed-on: https://code.wireshark.org/review/7198
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-02-17 18:22:17 +00:00
Guy Harris 6331755029 Get rid of duplicate typedef.
Change-Id: I389132ec27405394ca73fb9c09950d8a91ea32a7
Reviewed-on: https://code.wireshark.org/review/7180
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-16 18:38:38 +00:00
Michael Mann b2c81bb9e8 Make get_manuf_name return a const string.
Model get_manuf_name after get_ether_name so that a string (either name resolved or colon-separated bytes) is always stored in a hash table.  This will make name resolution of addresses perform a little better because it doesn't have to worry about the wmem_allocator.

Change-Id: If976fe7b0c3f9cd053225096c2ac05418f061af6
Reviewed-on: https://code.wireshark.org/review/7081
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-16 12:47:02 +00:00
Gerald Combs 5cc0ad8672 Remove a duplicate typedef.
Change-Id: Ie26785cc3577bda84cb4d244aab5a607797b99fb
Reviewed-on: https://code.wireshark.org/review/7118
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-14 17:01:21 +00:00
Michael Mann 91b5042ece "Hide" hashether_t structure.
One use in a GUI function isn't really enough to justify making the structure public.

Change-Id: Ic7dee275ba0a2bd4e19c06702a867417c5624c27
Reviewed-on: https://code.wireshark.org/review/7080
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-02-14 15:56:21 +00:00
Anders Broman 4359cb8478 Revert ""Hide" hashether_t structure."
This reverts commit 297ef07b9b.

Change-Id: Id47f5fd221b631c95ca71e3f9315f5263bab22de
Reviewed-on: https://code.wireshark.org/review/7077
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-12 08:34:30 +00:00
Anders Broman 53228c4bd8 Revert "Make get_manuf_name return a const string."
This reverts commit 797ea88aef.

Change-Id: I9bc2cef0051d88c6374c6f1868b0250cba3edbd4
Reviewed-on: https://code.wireshark.org/review/7076
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-12 08:34:05 +00:00
Michael Mann 797ea88aef Make get_manuf_name return a const string.
Model get_manuf_name after get_ether_name so that a string (either name resolved or colon-separated bytes) is always stored in a hash table.  This will make name resolution of addresses perform a little better because it doesn't have to work about the wmem_allocator.

Change-Id: I80f465ae0845290255a659ab63310ac3cc35506e
Reviewed-on: https://code.wireshark.org/review/7075
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-02-12 07:36:20 +00:00
Michael Mann 297ef07b9b "Hide" hashether_t structure.
One use in a GUI function isn't really enough to justify making the structure public.

Change-Id: I6d70b9bacbc0fa1898150f59c0c69779a6cd5d51
Reviewed-on: https://code.wireshark.org/review/7074
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-12 07:31:05 +00:00
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
Gerald Combs 881ff5df92 Remove gethostbyaddr and gethostbyaddr2.
They've been deprecated for a very long time. Replace them with
getaddrinfo. Note that we might not want to do synchronous name
resolution at all.

Add HAVE_GETADDRINFO to the KfW win-mac.h collision list.

Change-Id: If59ce8a038776eadd6cd1794ed0e2dad8bf8a22c
Reviewed-on: https://code.wireshark.org/review/6958
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-06 08:07:10 +00:00
Evan Huus 0137f9226a addr_resolv: correctly scope returned memory
*_port_to_display functions take an allocator scope, so the memory they return
must be allocated from that scope, which means we must strdup the result of
serv_name_lookup.

Bug: 10901
Change-Id: I337c8b6f9dfece966964c09023679b3e24648e48
Reviewed-on: https://code.wireshark.org/review/6842
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-01-29 15:45:20 +00:00
Guy Harris 050bc7d100 Update some comments to reflect reality.
Get rid of references to ep_ and se_ allocation in code that now uses
wmem allocation instead.

Fix API documentation of conversation_table.h routines to reflect that
as well - some APIs changed to pass wmem scopes.

Also, zbee_sec_key_hash() now takes the output buffer as an argument and
just returns it, and nobody actually uses the return value, so change it
to return void.

Change-Id: Ife1ec675a9322fd0f0be306a9d639ec17aad1c7a
Reviewed-on: https://code.wireshark.org/review/6636
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-18 21:02:40 +00:00
Guy Harris 233dc643a6 Remove some apparently-unnecessary includes of emem.h.
Change-Id: Id50ce3e707056cca8f30052f05c451ce431b39b5
Reviewed-on: https://code.wireshark.org/review/6632
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-18 19:36:36 +00:00
Michael Mann 71c21a6a46 Remove seasonal memory from address resolution.
This is the last remaining use of se_ memory APIs.

Change-Id: Ic0508a830bc5460bc743d21eb33ffdd7f4ce2eb5
Reviewed-on: https://code.wireshark.org/review/6574
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Evan Huus <eapache@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-18 18:19:34 +00:00
Michael Mann a1f2342e13 Miscellaneous ep_strdup_printf replacement.
Change-Id: I973c672e9d573ad67e9b9fd82a5610aaf8a74efa
Reviewed-on: https://code.wireshark.org/review/6605
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-01-18 04:15:18 +00:00
Michael Mann 284229c0f8 Convert EUI64 address APIs to use wmem.
Change-Id: I57d2e435ac72ea07ec9a567e0b1ce4410966e3d2
Reviewed-on: https://code.wireshark.org/review/6419
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-09 07:44:54 +00:00
Michael Mann 6a6e2efbf9 Have ipxnet addresses use wmem scoped memory.
Change-Id: I1d8eed2ceacccce2768590f0689cd2c83a5e56e9
Reviewed-on: https://code.wireshark.org/review/6418
Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-09 06:02:59 +00:00
Michael Mann 2209678149 ep_<protocol>_port_to_display -> <protocol>_port_to_display
Adjust any other ep_ related APIs related to the transition.

Change-Id: I961b371c2c4bda557e0f1817705c27eef0dae66c
Reviewed-on: https://code.wireshark.org/review/6388
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-08 05:32:32 +00:00
Michael Mann 55de46f317 Replace ep_address_to_str with address_to_str.
Change-Id: I4f1078b20f41800f72a751612703ad0d4c2ae87b
Reviewed-on: https://code.wireshark.org/review/6323
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-01-06 07:38:18 +00:00
Michael Mann 22b4ec91c0 Replace ep_display_to_address with wmem equivalent display_to_address.
Almost all instances require using "manual" memory management, but it gets some ep_ calls out of the GUI.

Change-Id: Ifa7303766b08d09442ccf3d7063cbe061578ecd9
Reviewed-on: https://code.wireshark.org/review/6318
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-05 13:55:04 +00:00
Hadriel Kaplan fac8356610 Make all Lua code use wmem not emem
Changed all remaining code in wslua that was using emem, to use wmem or
simpler methods.

Bug: 9927
Change-Id: I3d19a770e0fd77d996bdb6b61a76a722cc2bcd55
Reviewed-on: https://code.wireshark.org/review/6109
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-04 21:02:38 +00:00
Guy Harris 0e57ff2ca1 We no longer do anything signal-related, so don't include <signal.h>.
Update a comment pertaining to that, while we're at it.

Change-Id: Ic0a3f8575f8e98ca6032ed3e06e3dd76055d65a1
Reviewed-on: https://code.wireshark.org/review/6192
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-31 22:47:37 +00:00
Pascal Quantin bd19532bfb Do not use packet scope memory outside packet dissectors
Otherwise it will trigger an assert
Fixes a regression introduced in gf002332

Change-Id: I0cffa2c952b7eff085a1834ebabfec03342095bd
Reviewed-on: https://code.wireshark.org/review/5950
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-12-21 18:30:33 +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
Guy Harris 033f096ee9 Don't use ctype.h routines.
That avoids locale dependency and handles possibly-signed chars (which
we weren't always doing before).

Change-Id: Ieceb93029252f646397b6488f2df8a57c6d2a23d
Reviewed-on: https://code.wireshark.org/review/4794
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-17 23:11:18 +00:00
Pascal Quantin 6e83b38020 Get rid of g_hash_table_lookup asserts when loading an external host file
Only parse the host file syntax without trying to store the names in the hash tables (it will be done later in host_name_lookup_init())

Change-Id: I2b8c7b29220e6413c1b5c0a0fa238ecb5388c962
Reviewed-on: https://code.wireshark.org/review/4309
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-09-27 15:55:07 +00:00
Evan Huus a4a94af0f7 Fix regression introduced by gf3b631668b
I made a stupid when simplifying the bit-twiddling, and accidentally reversed
two of the bytes which completely broke MAC address name resolution.

Bug: 10344
Change-Id: I0720755fb290423150e4d84da9d45cb0b76341e4
Reviewed-on: https://code.wireshark.org/review/3522
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-08-09 17:30:44 +00:00
Guy Harris 5bfc21cf9e Clean up handling of missing functions.
With autotools, CMake, and nmake, if we have a function, #define
HAVE_{function_name_in_all_caps}, otherwise don't #define it.

If we provide our own version of a function in libwsutil, make sure we
have a header that declares it, and *ONLY* include that header if
HAVE_{function_name_in_all_caps} is *NOT* defined, so that we don't have
the system declaration and our declaration colliding.

Check for inet_aton, strncasecmp, and strptime with CMake, just as we do
with autotools.

Simplify the addition of {function_name_in_all_caps}_LO to libwsutil in
autotools.

Change-Id: Id5be5c73f79f81919a3a865324e400eca7b88889
Reviewed-on: https://code.wireshark.org/review/2903
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-06 21:03:09 +00:00
Evan Huus a452d16f2c Optimize epan_new/init_dissection
As Anders correctly pointed out in I7d8f84b2e, constantly resetting state will
turn init_dissection into a bit of a hot path. Especially as we will already
bear the overhead of switching files, we don't want to fall any further behind
than we have to.

This change includes three unrelated optimizations that reduce the cost of
init_dissection by about 40% as measured by callgrind:
 - only initialize ares/ADNS if that preference is enabled (this of course only
   applies if you specify -n to tshark or otherwise disable the preference)
 - use memcpy instead of a loop in sigcomp UDVM init
 - use memcpy instead of a loop in bootp dissector

The only remaining obvious hot spot in this path is reassembly_table_init since
it is called by so many dissectors. Suggestions (perhaps to get rid of the
GPtrArray) welcome.

Oh, and one other change to use g_strerror instead of strerror as insisted
upon by the API pre-commit hook.

Change-Id: I18a74f2b64b25498116079bd4e7fc2b335c7703a
Reviewed-on: https://code.wireshark.org/review/2738
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-01 04:21:14 +00:00