aboutsummaryrefslogtreecommitdiffstats
path: root/epan/addr_resolv.c
AgeCommit message (Collapse)AuthorFilesLines
2013-10-05Invert NEED_INET_ATON_H to HAVE_INET_ATON_HJörg Mayer1-1/+1
Remove unused NEED_G_ASCII_STRTOULL_H svn path=/trunk/; revision=52385
2013-09-22Fix some typos, indentation. Don't try to write the NRB if the pointer to ourEvan Huus1-3/+3
two lists is itself NULL. svn path=/trunk/; revision=52181
2013-09-22Fix -Wshadow, indentationEvan Huus1-15/+15
svn path=/trunk/; revision=52179
2013-09-22Get rid of struct addrinfo, use the hastables for name resolution instead.Anders Broman1-81/+38
svn path=/trunk/; revision=52176
2013-09-17Don't call gethostbyaddr() we have already read the local hosts file, settle ↵Anders Broman1-30/+0
for that. svn path=/trunk/; revision=52115
2013-09-16Read the local services file.Anders Broman1-0/+24
svn path=/trunk/; revision=52104
2013-09-16Don't call getservbyport() on unresolved ports - it's expensive.Anders Broman1-30/+8
We should read the services file in initialize_services instead. svn path=/trunk/; revision=52103
2013-08-29Revert revision=51577.Anders Broman1-11/+19
Ref https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9082 Since this commit the IP (source and destination) address in the GUI will be replaced with some date after I click on the entry, reverting this commit fixes the problem. This looks like a memory corruption. I imported an older pcap file. svn path=/trunk/; revision=51579
2013-08-29Don't store address in the hastable when name resolution is off.Anders Broman1-19/+11
svn path=/trunk/; revision=51577
2013-08-20Clean-up ipxnet hash table in host_name_lookup_cleanup. Should fix the buildbotEvan Huus1-0/+5
test suite failures. svn path=/trunk/; revision=51447
2013-08-20Fix for Jörg Mayer1-0/+5
[ 6%] Building C object epan/CMakeFiles/epan.dir/addr_resolv.c.o /home/jmayer/work/wireshark/svn/trunk/epan/addr_resolv.c:1927:1: error: unused function 'get_ipxnetbyname' [-Werror,-Wunused-function] get_ipxnetbyname(const gchar *name) ^ /home/jmayer/work/wireshark/svn/trunk/epan/addr_resolv.c:2009:1: error: unused function 'add_ipxnet_name' [-Werror,-Wunused-function] by #if 0/#endif the functions. If they really are not needed any more they should be removed. svn path=/trunk/; revision=51438
2013-08-20Mark an unused parameter.Anders Broman1-1/+1
svn path=/trunk/; revision=51437
2013-08-20Use g_hash_table() for ipxnet name resolution.Anders Broman1-41/+41
svn path=/trunk/; revision=51436
2013-08-18Use g_hastable() for IPv6 name reslution.Anders Broman1-61/+80
svn path=/trunk/; revision=51415
2013-08-15Split the code to convert an ethernet address into an int64 into a functionEvan Huus1-50/+24
since it's used in several places. Don't allocate a key just to do a hash-table lookup, we only need to do that if we're actually inserting. Fixes another ~1KB of leaks. svn path=/trunk/; revision=51364
2013-08-15Free the old name before we add the new one in case the services file hasEvan Huus1-0/+4
duplicates (it does). Fixes about 2KB of leaks. svn path=/trunk/; revision=51363
2013-08-13Fix name resolution tests:Evan Huus1-12/+12
- if we find a name during lookup, return it even if it's not a dummy - read personal hosts after global hosts so that they take precedence Neither of these problems appear to be new - the recent work did not change this logic, so I have no idea how come name resolution wasn't failing before, but I guess the old hash table was weirder than I thought... svn path=/trunk/; revision=51326
2013-08-12Move initalisation of IPv4 hastable to the host_name_lookup_init() rotine.Anders Broman1-17/+8
svn path=/trunk/; revision=51319
2013-08-11Use g_hashtable for IPv4 name resolution.Anders Broman1-53/+70
svn path=/trunk/; revision=51301
2013-08-11Modelines and consistent indentation.Evan Huus1-2103/+2127
Also tweak some ifdefs of function signatures. The multiple braces were confusing my folder and my indenter, so ifdef *only* the changed parameters and leave the bracing alone. This has the benefit of being a bit clearer too, I think. svn path=/trunk/; revision=51291
2013-08-11Fix 130KB of leaked memory exposed (or caused?) by the conversion to glib hashEvan Huus1-1/+15
tables. svn path=/trunk/; revision=51290
2013-08-08Don't call eth_addr_resolve() unconditionally.Anders Broman1-1/+3
svn path=/trunk/; revision=51207
2013-08-07Ensure we have both _initialize() and a corresponding _cleanup() routines forJeff Morriss1-273/+233
the various name resolvers; put those two routines next to each other. Add generic addr_resolv_init() and addr_resolv_cleanup() routines which call all of those internal routines. Call the generic init/cleanup routine from epan_init() and epan_cleanup(). Create the hash tables for each name resolver in those initialization routines in order to avoid having to repeatedly check if the table is already created or not (and to avoid glib warnings if we neglected to perform that check): http://www.wireshark.org/lists/wireshark-dev/201308/msg00012.html Don't clean up hostnames in init_dissection(): it's done already in cleanup_dissection(). Don't initialize hostnames in cleanup_dissection(): it's done already in init_dissection(). svn path=/trunk/; revision=51191
2013-08-06Store the port number as a string for the unresolved ports to avoid repeated ↵Anders Broman1-28/+30
calls to getservbyport() for all unresolved ports. svn path=/trunk/; revision=51170
2013-08-05Make sure serv_proto is set to the appropriate string value in allGuy Harris1-61/+72
cases; set it before we do the hash table lookup. Don't initialize serv_proto to null when we declare it - that covers up cases where we fail to set it correctly. Clean up indentation. svn path=/trunk/; revision=51164
2013-08-05it's and, not or ;-)Martin Kaiser1-1/+1
this fixes CC libwireshark_la-addr_resolv.lo addr_resolv.c: In function 'serv_name_lookup': addr_resolv.c:666:3: error: logical 'or' of collectively exhaustive tests is always true [-Werror=logical-op] svn path=/trunk/; revision=51160
2013-08-05Try to make the OSX build bot happy.Anders Broman1-0/+3
svn path=/trunk/; revision=51155
2013-08-05Use a hastable for port resolution. Currently one table for the 4 protocols ↵Anders Broman1-120/+137
with resolution. SCTP and DCCP should perhaps be splited out to their own tables. svn path=/trunk/; revision=51153
2013-08-04Ensure eth_hashtable exists when doing a lookup. Not sure I'm running into ↵Michael Mann1-3/+11
the same situation as Jeff (http://www.wireshark.org/lists/wireshark-dev/201308/msg00012.html), but tshark is complaining so I can't do fuzz-testing. Also corrected copy/pasteo when cleaning up eth_hashtable. svn path=/trunk/; revision=51133
2013-08-02Add some casts to keep C++ happy.Jeff Morriss1-3/+5
Mark an unused parameter as such. #if out a currently unused function. svn path=/trunk/; revision=51121
2013-08-02g_int64_equal() and g_int64_hash() exist *after* glib 2.22, not before.Jeff Morriss1-1/+1
svn path=/trunk/; revision=51120
2013-08-02- Use a hashtable for eth lookup.Anders Broman1-47/+100
Currently broken get_ether_addr(). - Show hastable content in address dlg.(temp solution). svn path=/trunk/; revision=51119
2013-08-02g_int64_hash() and g_int64_equal() first appear in GLib 2.22, make a local copy.Anders Broman1-0/+45
svn path=/trunk/; revision=51118
2013-08-01Squelch a warning by explicitly casting to throw away the upper 32 bitsGuy Harris1-2/+2
of a result. svn path=/trunk/; revision=51088
2013-08-01remove unused function hash_eth_wka()Martin Kaiser1-39/+0
in order to fix the compile error addr_resolv.c:1250:1: error: 'hash_eth_wka' defined but not used [-Werror=unused-function] svn path=/trunk/; revision=51085
2013-08-01Use glibs hastables rather than home grown variants for manuf an wka(well ↵Anders Broman1-162/+177
known addresses). https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9000 svn path=/trunk/; revision=51084
2013-07-16"man inet_pton" only says that it returns a negative value, zero or a ↵Chris Maynard1-8/+8
postive value, and not specifically -1, 0, or 1, so even though we know that's what wsutil's inet_pton will return, we shouldn't test against those exact values. svn path=/trunk/; revision=50670
2013-07-15Move report_err.{h,c} from epan into wsutil: there's nothing epan-specific ↵Jeff Morriss1-2/+3
there and moving it avoids having to recompile the file for use in editcap and capinfos (which don't link against libwireshark). svn path=/trunk/; revision=50598
2013-07-12Move bitmask array from ipv4_addr_set_netmask_bits() to ip_get_subnet_mask() Jakub Zawadzki1-62/+2
Use it in subnet_mask_lookup_init(). svn path=/trunk/; revision=50527
2013-06-16Add some comments around looking up names for port numbers.Martin Mathieson1-1/+8
(calling getservbyname() is really slow, but only called once per port number...) svn path=/trunk/; revision=49953
2013-06-09Don't put zero-length names into our tables of resolved IPv4 and IPv6Guy Harris1-3/+17
addresses; they look weird, and can cause problems with existing versions of Wireshark when written in a Name Resolution Block. Should fix bug 8763. svn path=/trunk/; revision=49852
2013-05-31nameres.hosts_file_handling shouldn't affect loading the profile "hosts"Gerald Combs1-7/+5
file. That should be loaded no matter what if we have name resolution enabled. Add a name resolution test suite. Currently disabled until I can test it on Windows. svn path=/trunk/; revision=49657
2013-05-29Fix and clarify name resolution preference tooltips. Print theGerald Combs1-5/+5
description before the name+type since that's presumably what people are looking for. svn path=/trunk/; revision=49622
2013-05-19Fix a memory leak by using seasonal memory for building all parts of one ofEvan Huus1-1/+1
the address resolution tables. Showed up with https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8670 although I doubt it's the cause of the crash. svn path=/trunk/; revision=49413
2013-04-09Don't try to open <home>/.wireshark on Windows: Wireshark hasn't written toJeff Morriss1-5/+5
that directory since 2001 and reading from that directory was only left in for backwards compatibility with versions prior to r4702. I think it's now safe to remove that backwards compatibility. This eliminates the last argument of get_persconffile_path(). https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8437 svn path=/trunk/; revision=48797
2013-03-25Fix compilation with C++ warnings enabled: use enum values instead of rawJeff Morriss1-2/+2
numbers in adns_init() and adns_submit(). (I haven't checked how long these enums have been there; hopefully for a long time.) svn path=/trunk/; revision=48549
2013-03-21[-Wmissing-prototypes]Anders Broman1-6/+6
Use explicit casts. svn path=/trunk/; revision=48457
2013-03-17From beroset:Anders Broman1-1/+1
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48383
2013-03-17From beroset:Anders Broman1-17/+17
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48356
2013-02-08Add a ModulePreferencesScrollArea widget which builds a scrollable frameGerald Combs1-13/+15
for a preferences module. Use it to fill in the remaining preferences. Don't show the printing preferences since they're not used here. Change the titles and tooltips for some of the name resolution preferences. Disable the capture preferences if we can't capture. This is different from the GTK+ version which hides it completely. Thus concludes the preferences dialog (for the time being). svn path=/trunk/; revision=47545