Commit Graph

89 Commits

Author SHA1 Message Date
Kovarththanan Rajaratnam c629dde8b6 Constify some functions
svn path=/trunk/; revision=29773
2009-09-07 16:17:58 +00:00
Kovarththanan Rajaratnam 98d18343c8 Whitespace changes
svn path=/trunk/; revision=29772
2009-09-07 16:07:04 +00:00
Kovarththanan Rajaratnam 72c9662da6 ntroduce some seasonal address name lookup functions which we use when NEW_PACKET_LIST is defined. This change partially reverts some parts of r29768, which didn't seem to work because it assumed that get_addr_name() would always return a seasonal string. This wasn't the case if the adddress type was AT_STRINGZ.
svn path=/trunk/; revision=29771
2009-09-07 16:05:37 +00:00
Kovarththanan Rajaratnam ea0ab046e0 Tigthen scope of local variables
svn path=/trunk/; revision=29770
2009-09-07 15:49:14 +00:00
Anders Broman 3abd049a9b Use constant strings for Addresses saves some memory.
svn path=/trunk/; revision=29768
2009-09-07 14:03:05 +00:00
Anders Broman a4ce0d3d69 Put back
http://anonsvn.wireshark.org/viewvc?view=rev&revision=29656
http://anonsvn.wireshark.org/viewvc?view=rev&revision=29658
http://anonsvn.wireshark.org/viewvc?view=rev&revision=29661
Reverted by my previous checkin.

svn path=/trunk/; revision=29749
2009-09-06 14:53:21 +00:00
Kovarththanan Rajaratnam 8c48c6835f Rename address_to_str() to ep_address_to_str() because:
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
2009-09-06 14:25:47 +00:00
Anders Broman 137b886960 From Didier Gautheron:
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
2009-09-06 08:59:30 +00:00
Anders Broman f0ea776605 From : Didier Gautheron
Addresse hash is slow on little endian CPU.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3973

svn path=/trunk/; revision=29692
2009-09-04 10:53:37 +00:00
Guy Harris 5dd678f0a7 Check whether "size" points to something positive, not whether "size"
itself is positive (which makes no sense for a pointer).

svn path=/trunk/; revision=29661
2009-09-01 19:31:41 +00:00
Kovarththanan Rajaratnam f8f4f0fb6b Remove superfluous NULL pointer checks wrt. g_malloc() and g_realloc()
svn path=/trunk/; revision=29658
2009-09-01 18:44:08 +00:00
Kovarththanan Rajaratnam 17f010119a From Jakub Zawadzki via. Bug 3330:
* 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
2009-09-01 18:16:55 +00:00
Anders Broman 3278582767 From Kovarththanan Rajaratnam:
Optimize column fill path.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3701

svn path=/trunk/; revision=29130
2009-07-17 08:24:06 +00:00
Stig Bjørlykke e03ac6b82e From Kovarththanan Rajaratnam via bug 3555:
Cancel hostname lookup timers if c-ares is not initialized.

svn path=/trunk/; revision=28837
2009-06-24 19:10:50 +00:00
Gerald Combs 9c5ca83acf Only #undef inet_aton if we're using ADNS on Windows.
svn path=/trunk/; revision=27920
2009-04-01 00:30:45 +00:00
Stig Bjørlykke 62f60df6b4 From Jakub Zawadzki (bug 3331):
g_free() is NULL safe, so we don't need check against it.

svn path=/trunk/; revision=27718
2009-03-13 22:06:48 +00:00
Gerald Combs f5ee6caa67 From Frederic Leroy: Update c-ares version handling.
svn path=/trunk/; revision=27169
2009-01-06 18:31:57 +00:00
Gerald Combs dc3ed1f1e6 C-ares version check fix from Frederic Leroy, modified by me.
svn path=/trunk/; revision=27112
2008-12-24 18:12:07 +00:00
Gerald Combs 8f375871c1 Allow compilation with c-ares <= 1.4.0 (untested). While we're at it, fix
c-ares name resolution.

svn path=/trunk/; revision=27096
2008-12-23 18:15:09 +00:00
Jörg Mayer 4149a23cc5 Trivial warning fixes
svn path=/trunk/; revision=26899
2008-12-02 08:11:23 +00:00
Stig Bjørlykke 0a66244589 Do not leak the port range in parse_service_line().
svn path=/trunk/; revision=26240
2008-09-20 14:24:29 +00:00
Stig Bjørlykke a7e6165f15 Avoid an indefinite loop freeing the same data over and over again
in host_name_lookup_cleanup() when HAVE_C_ARES.

svn path=/trunk/; revision=25989
2008-08-12 16:47:54 +00:00
Gerald Combs 5906f69b88 On Windows, if we're running anything but plain Visual C++ 6 (including
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
2008-08-11 21:59:59 +00:00
Gerald Combs 021a926793 Add support for the c-ares asynchronous DNS resolution library to the
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
2008-08-07 21:41:48 +00:00
Bill Meier 44efa0ed2e Fix some simple cases of GTK2 deprecated API usage by using a renamed or equivalent API
gtk_timeout_add()     ==> g_timeout_add
   gtk_timeout_remove()  ==> g_source_remove()

Also: timer callback should return gboolean (not void or gint)

svn path=/trunk/; revision=25672
2008-07-08 02:25:30 +00:00
Guy Harris 83fc9d5e09 Constify a bunch of stuff, to squelch -Wwrite-strings warnings.
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
2008-06-25 09:12:35 +00:00
Anders Broman 36d89bb79c Fix some of the Errors/warnings detected by checkapi.
svn path=/trunk/; revision=25368
2008-05-23 05:55:34 +00:00
Jeff Morriss a5cee04fad Move the file utility functions from wiretap to libwsutil so that
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
2008-05-22 15:46:27 +00:00
Stig Bjørlykke 74766c736a From Andrew Feren (bug 2433):
Add support for port ranges in services.

svn path=/trunk/; revision=24934
2008-04-12 14:08:19 +00:00
Stig Bjørlykke 51060a1b5c Removed C++ style comment.
svn path=/trunk/; revision=24178
2008-01-24 18:51:54 +00:00
Stig Bjørlykke a88efc9325 From Douglas Pratley (bug 1445):
Add a "subnets" file defining a named list of subnets.

svn path=/trunk/; revision=24154
2008-01-21 21:44:34 +00:00
Stig Bjørlykke a2d1e9005d This patch adds support for configuration profiles, which can be used to
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
2008-01-14 16:40:23 +00:00
Stig Bjørlykke 8b4e80384a Fixed a few "statement not reached" warnings and a "assignment type mismatch" warning.
svn path=/trunk/; revision=24085
2008-01-14 09:39:55 +00:00
Anders Broman b325ef4878 Apply yet another set of the optimization patches:
Don't use g_snprintf for temporary unsigned int to ascii conversion.

svn path=/trunk/; revision=23409
2007-11-09 05:55:33 +00:00
Anders Broman 3a16fb20a3 Apply yet another set of the optimization patches:
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
2007-10-26 05:42:12 +00:00
Mike Duigou 6aeb75c3f0 Changes get_addr_name_buf() to use the more common convention where the provided buffer size is the entire size of the buffer including the space for the terminating \0
svn path=/trunk/; revision=23016
2007-09-28 18:23:59 +00:00
Jörg Mayer 4793614e27 Mask out only the bc/mc bit, not the locally assigned bit.
Update comment accordingly.

svn path=/trunk/; revision=22507
2007-08-15 13:21:23 +00:00
Ulf Lamping 60e81cd141 if the manuf address could not be resolved, strip off special bits (multicast, locally administered) and try again to find it
svn path=/trunk/; revision=22503
2007-08-14 23:52:51 +00:00
Ulf Lamping 1bab78bfdf remove an unused variable
svn path=/trunk/; revision=22458
2007-08-06 09:12:18 +00:00
Ulf Lamping 2aef54275a add a way to read a personal /etc/services file for TCP/UDP/... port service name resolution.
svn path=/trunk/; revision=22457
2007-08-06 08:44:26 +00:00
Bill Meier a6dab6d644 (Minor) Use _WIN32 (instead of WIN32) like the rest of Wireshark
svn path=/trunk/; revision=22030
2007-06-03 16:07:07 +00:00
Stephen Fisher 8fd3ee0560 Remove almost all of the casts I committed recently and in place of
them, add -Wno-pointer-sign to CFLAGS when gcc will accept it.


svn path=/trunk/; revision=21253
2007-03-28 21:55:11 +00:00
Stephen Fisher 46b8669566 Fix a bunch more warnings. Add -Werror when using --with-warnings-as-errors
under gcc to tools/lemon, plugins/mate and epan/


svn path=/trunk/; revision=21204
2007-03-26 06:10:52 +00:00
Gerald Combs 063621f11b Fix potential buffer overruns in address_to_str_buf() found by Andrej
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
2007-01-29 20:25:26 +00:00
Jaap Keuter 05aa18b522 Fix for bug 795: handle CR as line end as well
svn path=/trunk/; revision=19075
2006-08-29 16:54:39 +00:00
Anders Broman 996d4db495 Ethereal->Wireshark
svn path=/trunk/; revision=18234
2006-05-28 19:49:07 +00:00
Ronnie Sahlberg 89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +00:00
Ulf Lamping b38db335d3 I don't see any reason why we should only have to look for a hosts file in the personal preferences file, but not in the datafile path, as we doing it for a lot of other config files at runtime.
Add a try to use a global hosts file if one is available ...

svn path=/trunk/; revision=17441
2006-03-02 00:06:15 +00:00
Anders Broman 0fc74ff335 From dider
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
2006-02-27 09:01:10 +00:00
Jörg Mayer 118e05db0b Ricardo Muggli:
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
2006-02-09 09:18:15 +00:00