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
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
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
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
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
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
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
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
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
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
resolution information between capture files so that we don't leak host
entries from one file to another (e.g. embarassing-host-name.example.com
from file1.pcapng into a name resolution block in file2.pcapng).
host_name_lookup_cleanup and host_name_lookup_init must now be called
after each call to se_free_all. As a result we now end up reading our
various name resolution files much more than we should.
svn path=/trunk/; revision=45511
host_name_lookup_process(). If, in the future, we find that we need an
argument for changes we're making, we can add it then.
svn path=/trunk/; revision=45269
Actually I suppose what was meant is more about whether tp->name[0] is the NULL character (that is, that the name is empty).
But since the result of the lookup is already there in 'found' the whole condition can probably be taken out.
svn path=/trunk/; revision=43701
resolution is NOT enabled (it's always been like this and I'm not sure why
and I was hesitant to change that). So: don't use the external name resolver
unless both network-name resolution AND use-external-resolvers are enabled.
svn path=/trunk/; revision=43645
Add a new name resolution option: whether or not use the configured (in the OS)
name resolver (e.g., DNS) to resolve network names. When this option is disabled
but network name resolution is enabled then Wireshark will resolve only those
names that it can from local sources. This includes (at least, AFAIK):
- name resolutions that Wireshark picks up on from DNS packets it decodes
- the "user hosts file" (~/.wireshark/hosts on *NIX)
- what Wireshark reads out of capture file (the PCAPNG name resolution block)
This new preference defaults to "use external resolvers" for backward
compatibility (so people turning on network name resolution will get the old
behavior).
This option can be set via Edit->Preferences and on the command line; there
remain several UIs (e.g., the "open capture file" dialog, the
View->Name Resolution menu, etc.) that don't have the new option yet.
Also expand on the "description" for the name resolution preferences: these
are used not only in the tooltips but are also written to the preferences
file. The previous text didn't include enough context when written do the
preferences file.
svn path=/trunk/; revision=43605
- prefs.name_resolve_concurrency is now just 'name_resolve_concurrency'
- add notes about possible (?) integer overflows.
svn path=/trunk/; revision=43586
which take an OUI, presumably fetched with a routine such as
tvb_get_ntoh24(), as an argument and attempt to look it up in the manuf
file.
Fix up the comments for all the get_manuf_name routines.
Get rid of "extern"s in definitions of functions (definitions, not
declarations).
svn path=/trunk/; revision=42054
the TVB.
Introduce and start using tvb_get_manuf_name() and tvb_get_manuf_name_if_known()
which do the same as the non-tvb versions but take a tvb and an offset instead
of (commonly) a pointer into a TVB.
svn path=/trunk/; revision=37317
* 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
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
support; TShark has read+write support. Additionally TShark can read a
"hosts" file and write those records to a capture file.
This uses "struct addrinfo" in many places and probably won't compile on
some platforms.
svn path=/trunk/; revision=36318
Remove the filters on IPv6 Link Local and Multicast addresses, since
these _can_ be resolved through the hosts file and manual entry.
svn path=/trunk/; revision=35651
Limit the length of manuf names to 8 characters in make-manuf (this matches
the (old) limit in addr_resolv.c).
Dynamically allocate memory to store the manuf name in epan/addr_resolv.c so
that we don't end up corrupting the UTF-8 if/when we need to truncate the
string.
svn path=/trunk/; revision=35082
- Primarily: ethernet name lookup returns either
unresolved or resolved ethernet name depending upon whether
MAC Name resolution is disabled or enabled.
Previously: Unresolved or resolved name cached at first reference
and then always returned for future references no matter whether
MAC Name Resolution was enabled or disabled.
- Also: Refactor ethernet, manuf & well-known-addr related code;
ToDo: (separately): Redisplay when 'MAC name resolution' enabled/disabled.
svn path=/trunk/; revision=33401
- Use a new hashwka_t struct (instead of hashether_t) for
"well-known-address" hash entries (saves some space);
- Remove unused variable from hashether_t;
- Reorder variables within hashether_t and hashmanuf_t to minimize padding in the structures;
- Rename some variables for clarity;
- Misc whitespace changes.
svn path=/trunk/; revision=33364
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
resolved since the last time it was called. Use this to redraw the packet
list and detail any time we have newly-resolved objects.
svn path=/trunk/; revision=31350
1) This indicates that the string has ephemeral lifetime
2) More consistent with its existing seasonal counterpart, se_address_to_str().
svn path=/trunk/; revision=29747
Extracted from optimizations patch http://wiki.wireshark.org/Development/Optimization
Optimize address handling.
The address hash should be possible to use from the new_packet_list.
svn path=/trunk/; revision=29735
* Fix memleak (df->deprecated in dfilter_free())
* Free protocol hash tables on cleanup.
* Free protocols list on cleanup.
* Free memory allocated by fgetline() in parse_services_file()
From me:
* proto.c: set gmc_hfinfo to NULL after free
* proto.c: switch order of g_free() and g_list_remove() in proto_cleanup()
svn path=/trunk/; revision=29656
VC6 plus a platform SDK), set INET6. Use that to figure out if we need
to define socklen_t for c-ares. This should fix bug 2797.
svn path=/trunk/; revision=25985
Windows build. Add support for async IPv6 lookups. Update the ADNS
code slightly.
This is not supported (yet) on the UNIX side.
svn path=/trunk/; revision=25953
epan/dissectors/packet-ncp2222.inc is a bit hard to fix, so we're not
ready to enable that warning by default yet.
Throw in some casts to handle GLib routines that take arbitrary
non-const pointers (they can later return the pointers, and some
callers might want to modify or free up those pointers in cases where
they're known to be writable or allocated).
Use ep_tvb_memdup() rather than a combination of ep_alloc() and
tvb_memcpy().
Clean up some indentation.
svn path=/trunk/; revision=25601
libwireshark (and the plugins using those functions) do not depend on
wiretap on Windows.
While doing that, rename the eth_* functions to ws_*.
svn path=/trunk/; revision=25354
configure and use more than one set of preferences and configuration files.
This can be found in the "Configuration Profiles..." menu item from the Edit
menu, or by pressing Shift-Ctrl-A. It's also possible to start wireshark
and tshark with a named profile by using the "-C ProfileName" option.
A new status pane in the main window will show the current profile.
The configuration files currently stored in the Profiles are:
- Preferences
- Capture Filters
- Display Filters
- Coloring Rules
- Disabled Protocols
- User Accessible Tables
The recent data are by design not added to the profile.
Planned future enhancements:
- make a more convenient function to switch between profiles
- add a "clone profile" button to copy an existing profile
- make the profiles list active and accept return as OK
- save users "Decode as" in the profile
- make new, clone and deletion of profiles more secure
- make some of the recent values available in the profile
This patch also fixes:
- setting default status pane sizes
- a bug setting status pane for packets when not having main lower pane.
svn path=/trunk/; revision=24089
Replace strncpy with g_strlcpy.
Add g_strlcat for GTK1 and don't use g_snprintf in GTK1 g_strlcpy
printf family is very slow.
svn path=/trunk/; revision=23273
Mikus. Add a buf_len parameter to ip_to_str_buf(), and make sure it's
enforced. Copy the release notes over from the 0.99.5 trunk and add a
note about the ISUP dissector (which is affected by the overrun).
svn path=/trunk/; revision=20607
file.c
time reference menu callback doesn't set cf->filter, it dumps a core if
you have a file big enough in find next/ find prev.
addr_resolv.c
leak memory, break list chain when snooping address.
svn path=/trunk/; revision=17419
The attached patch will fix ethereal so it will only do network address
resolution when network address resolution is enabled. Even when the
RESOLV_NETWORK flag was set ethereal would try to resolve addresses in
the add_ether_byip function.
svn path=/trunk/; revision=17227
This fixes bug 523, but exposes more of bug 658.
The TACACS and SDP dissectors don't call inet_aton(), so don't include it.
svn path=/trunk/; revision=17056
Win32 only: reading a pathname from an environment var requires us to read it in as unicode somehow and convert it to utf8. Using _wgetenv should work under all circumstances on NT, using getenv and g_locale_to_utf8 on Windows OT is the best we can do in this case.
svn path=/trunk/; revision=17024
include fails as we don't do -Iwiretap.
If we have it, include <sys/stat.h> in epan/filesystem.c - we need it
for stat() and the macros and structures it uses.
svn path=/trunk/; revision=16410
to do this, I've added file_util.h to wiretap (would file_compat.h be a better name?), and provide compat_macros like eth_open() instead of open(). While at it, move other file related things there, like #include <io.h>, definition of O_BINARY and alike, so it's all in one place.
deleted related things from config.h.win32
As of these massive changes, I'm almost certain that this will break the Unix build. I'll keep an eye on the buildbot so hopefully everything is working again soon.
svn path=/trunk/; revision=16403
-use g_snprintf instead of sprintf and snprintf
-use g_strdup_printf where appropriate
-remove #include "snprintf.h" (as only g_snprintf should be used)
-replace some more alloc/realloc/calloc/free with their glib pendants
svn path=/trunk/; revision=15264
changed the behaviour of get_addr_name:
- resolve to a name if the address supports it
- call address_to_str if it does not, but the address is valid
- return "NONE" if it is AT_NONE
svn path=/trunk/; revision=13463
OT as well as NT, while SYSTEMROOT isn't.
If it's not set, don't bother looking for the hosts file, rather than
trying a path with a fixed drive letter. If it is set, try the Windows
NT location first and, if that fails, the Windows OT location.
svn path=/trunk/; revision=13088
On Windows, if we don't get the SYSTEMROOT environment variable, try
various locations where the hosts file is known to exist.
svn path=/trunk/; revision=12972
It can return NULL, which would lead here to strcpy(hostspath, NULL);
*Very* bad.
replace g_malloc(), strcpy() and strcat() with one single g_strconcat().
svn path=/trunk/; revision=12970
to resolve it to a name.
Fix up some const-pointer-to-non-const-pointer, and
function-pointer-to-void-*, conversions.
Fix some comments.
svn path=/trunk/; revision=12863
we're using ADNS, so that we can resolve host names from the hosts file
as well as from DNS.
"fgetline()" strips newlines from the line, so don't bother looking for
them when tokenizing the line.
svn path=/trunk/; revision=12534
error in "adns_init()". (I suspect this is what's causing the crashes
somebody's seeing when they run Ethereal on a Windows system with no
networking protocols installed - no networking protocols -> no Internet
protocols probably -> no ability to set ADNS up.)
svn path=/trunk/; revision=12500
include of <resolv.h> in any system header file gets the system
<resolv.h> (needed for builds on Tru64 with GTK+ 1.2[.x]).
svn path=/trunk/; revision=11615