Commit Graph

48171 Commits

Author SHA1 Message Date
Guy Harris 9e47411488 Include config.h first; it defines _FILE_OFFSET_BITS, and if some system
header later causes it to be redefined - as happens on my Solaris 11
virtual machine - we get a redefinition warning, which gets treated as
an error.

svn path=/trunk/; revision=51349
2013-08-14 01:15:59 +00:00
Guy Harris 34108edbd1 Get rid of -Wshadow warning - I guess we're including something that
gets <getopt.h>, so we get the optarg global.

svn path=/trunk/; revision=51348
2013-08-14 00:41:02 +00:00
Guy Harris b65e9e9618 UN*X pathnames + PL/I's comment syntax = surprises. Yay C++ (and C99).
svn path=/trunk/; revision=51347
2013-08-14 00:37:14 +00:00
Guy Harris 5dcd6daba7 Get rid of -Wshadow warning - I guess we're including something that
gets <getopt.h>, so we get the optarg global.

svn path=/trunk/; revision=51346
2013-08-14 00:35:27 +00:00
Guy Harris 14fe8951b7 Use 4-space indentation consistently.
svn path=/trunk/; revision=51345
2013-08-14 00:33:36 +00:00
Guy Harris e8f42c6b48 Include config.h first; it defines _FILE_OFFSET_BITS, and if some system
header later causes it to be redefined - as happens on my Solaris 11
virtual machine - we get a redefinition warning, which gets treated as
an error.

svn path=/trunk/; revision=51344
2013-08-14 00:31:14 +00:00
Guy Harris cfa2dc5f6e Add in more comments on the whole "get the path of the executable from
the kernel" thing, and add the NetBSD and DragonFly BSD /proc links (if
they don't mount /proc, that doesn't work, but it doesn't get in the
way).

On Solaris, check for getexecname, just in case somebody tries to build
on an old Solaris that doesn't support it (that could well end up being
the least of their problems, but at least they won't ask us to diagnose
that one).

svn path=/trunk/; revision=51343
2013-08-13 23:37:32 +00:00
Evan Huus d8f00e22e1 As suggested in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9033
Make epan_free a no-op if the pointer is NULL. This fixes 99% of the cases
causing problems for wmem_leave_file_scope() - remove that XXX comment and add
back the assertion.

Remove the cleanup_dissection call from epan_cleanup, it doesn't make sense
there. init_dissection is only called from epan_new, so cleanup_dissection
should only be called from epan_free.

Add one missing epan_free call to tshark revealed by the above changes.

svn path=/trunk/; revision=51342
2013-08-13 22:41:34 +00:00
Evan Huus 1eab806d9b Make what appear to be the intended changes so that all variables are used or
removed and it compiles.

svn path=/trunk/; revision=51341
2013-08-13 22:24:59 +00:00
Guy Harris 4771fdbb7e Fix intended proto_tree_add_item() call that mistakenly called
proto_tree_add_uint(); caught by the checkAPI script run in a Windows
build.

svn path=/trunk/; revision=51340
2013-08-13 18:03:17 +00:00
Alexis La Goutte 02462c7310 From Mark Phillips via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9038
802.11 HT Extended Capabilities B10 decode incorrect

#Backport 1.10 and 1.8

Within the 802.11 HT Capabilities IE the "HT Extended Capabilities" B10's name is incorrect.

It is currently titled "High Throughput". This is incorrect/missleading. It should be something like "High Throughput Control (+HTC)". The field indicates if the "High Throughput Control (HTC)" field is supported - not if HT itself is supported.

svn path=/trunk/; revision=51339
2013-08-13 17:50:22 +00:00
Evan Huus 69e9d50a23 Use start_offset to set the item length in the usual pattern (assuming this was
intended). Fixes the unused variable warning on start_offset.

svn path=/trunk/; revision=51338
2013-08-13 13:28:14 +00:00
Michael Mann 0776754488 Some improvements to the bundle protocol:
1. Cleanly break out Convergence Layer Protocol (TCPCL) into its own (new-style) pure dissector.
2. Make Bundle dissection into a new style dissector and clean so that it can be called using call_disssector.
3. Use tcp_dissect_pdus for TCPCL protocol instead of "manual" while loop.  This allows contact header to benefit from TCP fragmentation.
4. Make time fields use time field types so they can be filterable.
5. A few functions were move to remove need for static declaration at top of file.
6. Remove pri_hdr_procflags global variable.

Next up - making more fields filterable.

svn path=/trunk/; revision=51337
2013-08-13 11:37:27 +00:00
Martin Mathieson ab8f63d76c Add missing return (reported as missing break by coverity)
svn path=/trunk/; revision=51336
2013-08-13 10:40:06 +00:00
Stig Bjørlykke a31a88b142 Show the Lua plugin being loaded in the splash screen.
svn path=/trunk/; revision=51335
2013-08-13 10:38:30 +00:00
Jörg Mayer bae2eee028 Implement in cmake:
http://anonsvn.wireshark.org/viewvc/viewvc.cgi?view=rev&revision=51322

> User: guy
> Date: 2013/08/12 01:01 PM
>
> Log:
>  Just check whether dladdr() is available; we check in the code whether
>  it succeeds, so there's no point in checking whether it succeeds in a
>  sample program.

svn path=/trunk/; revision=51334
2013-08-13 09:58:09 +00:00
Pascal Quantin 9ef54f5ea2 Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9035 :
Indicate the right direction in info column

svn path=/trunk/; revision=51333
2013-08-13 08:19:41 +00:00
Guy Harris 890093e0e4 Wrap in "extern "C"" for the benefit of C++ code including it.
svn path=/trunk/; revision=51332
2013-08-13 07:58:06 +00:00
Anders Broman 1e9644c204 From Javier Godoy:
Dissect additional OSD-2 service actions (CREATE/REMOVE PARTITION, GET/SET ATTRIBUTES, QUERY).

This patch adds support for some OSD-2 service actions, following the approach described in bug 8832.

The implemented service actions are:   
 - CREATE PARTITION
 - REMOVE PARTITION
 - REMOVE COLLECTION
 - GET ATTRIBUTES
 - SET ATTRIBUTES
 - QUERY
  
The following service action codes was #defined
 - OSD_2_REMOVE_PARTITION	0x888c
	
The following trees were added 
 - ett_osd2_query_criteria_entry

The following fields were added:	
 - hf_scsi_osd2_remove_scope (REMOVE PARTITION)
 - hf_scsi_osd2_immed_tr (QUERY)
 - hf_scsi_osd2_matches_collection_object_id (QUERY)
 - hf_scsi_osd2_query_type (query list CDB continuation descriptor)
 - hf_scsi_osd2_query_entry_length (query list CDB continuation descriptor)
 - hf_scsi_osd2_query_attributes_page (query list CDB continuation descriptor)
 - hf_scsi_osd2_query_attribute_number (query list CDB continuation descriptor)
 - hf_scsi_osd2_query_minimum_attribute_value_length (query list CDB continuation descriptor)*
 - hf_scsi_osd2_query_maximum_attribute_value_length (query list CDB continuation descriptor)*
 * (dissection of the attribute value in query descriptors is not implemented yet)
 
The following value_string arrays were added:
 - scsi_osd2_remove_scope_val (OSD2r4 Table 143)
 - scsi_osd2_query_type_vals (OSD2r4 Table 75)
 
The following value_string arrays were updated:		
 - scsi_osd_svcaction_vals
 - scsi_osd2_object_descriptor_format_val
 
The following functions were added:	 
 - dissect_osd2_query
 - dissect_osd2_query_list_descriptor (dissect CDB continuation descriptor type 0x0002)
 
The following expert_info fields were added:
 - ei_osd2_query_values_equal (PI_PROTOCOL,PI_NOTE) - the minimum and maximum attribute values are equal in a query descriptor entry
  
Changes in dissect_osd2_cdb_continuation:
 - Dissect case 0x0002 
 
Changes in dissect_osd_*
 - Initialize extra_data->osd2
 - Dissect OSD-2 specific fields
 - Call dissect_osd_cdb_continuation_length / dissect_osd_cdb_continuation  (if osd2)
 - Version-specific increment of offset after dissecting capability/security_parameters

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9029

svn path=/trunk/; revision=51331
2013-08-13 05:29:04 +00:00
Anders Broman 4daf984804 From Yaniv Kaul:
small addition to SCSI dissection (media rotation speed analysis)

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9030

svn path=/trunk/; revision=51330
2013-08-13 05:19:48 +00:00
Evan Huus a2b2885daf Create the dissector hash table in only one place, and specify that its values
should be freed when it is destroyed. This requires splitting packet_init in
two: the hash table which must be created before protocol registration, and the
caching of common protocol handles, which must happen after registration.

svn path=/trunk/; revision=51329
2013-08-13 03:11:28 +00:00
Evan Huus 14b098baf7 When freeing the preferences of a module, also free the preferences of its
submodule.

svn path=/trunk/; revision=51328
2013-08-13 02:56:55 +00:00
Evan Huus f528d4ecbc Only rescan packets if we have packets to rescan. Fixes at least the surface
problem in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9033

The underlying scoping issues may not be fully resolved yet.

svn path=/trunk/; revision=51327
2013-08-13 02:18:04 +00:00
Evan Huus 7292140b9c Fix name resolution tests:
- 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-13 01:41:51 +00:00
Evan Huus 616324c21e Be sure to initialize the jumbo flag when creating a new chunk header by
splitting an existing chunk. Thanks to Jeff for catching this one.

svn path=/trunk/; revision=51325
2013-08-12 23:35:35 +00:00
Jörg Mayer 3b5aaefce3 - Extract variables from Makefile.common.
- Apply this to asn1/c1222/

svn path=/trunk/; revision=51324
2013-08-12 22:17:06 +00:00
Guy Harris 50eb826406 If we're looking for some version of GTK+, and don't find it, fail.
That way, if somebody specifies --with-gtk[23] and that version of GTK+
isn't found, we fail with an indication that the version of GTK+ they
asked for isn't there, and if no GUI toolkit was specified, and they
didn't explicitly say "don't build Wireshark", we look for GTK+ 3 and,
if it's not found, let the user know explicitly.

svn path=/trunk/; revision=51323
2013-08-12 20:24:59 +00:00
Guy Harris bebe1200de Just check whether dladdr() is available; we check in the code whether
it succeeds, so there's no point in checking whether it succeeds in a
sample program.

svn path=/trunk/; revision=51322
2013-08-12 20:01:30 +00:00
Pascal Quantin 4b641014a2 Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9031 :
SIP contact-param parsing should be stopped when finding a comma separator

svn path=/trunk/; revision=51321
2013-08-12 19:23:08 +00:00
Guy Harris 57b8c51a2e Tell a bit more of the story of dladdr()'s ability, or lack of same, to
return a path for the executable image not based on argv[0].

svn path=/trunk/; revision=51320
2013-08-12 18:51:06 +00:00
Anders Broman 1ef4ba5e32 Move initalisation of IPv4 hastable to the host_name_lookup_init() rotine.
svn path=/trunk/; revision=51319
2013-08-12 18:33:08 +00:00
Anders Broman af49292ae2 From Tommy Wu:
-         AppId is unsigned.
-         Add Relay application.

svn path=/trunk/; revision=51318
2013-08-12 18:29:42 +00:00
Alexis La Goutte 25a8c57356 Fix error when enable "debug" in wiretap/pcapng.c file
With gcc :
pcapng.c: In function 'pcapng_read_packet_block':
pcapng.c:1147:9: error: request for member 'pseudo_header' in something not a structure or union

With clang :
pcapng.c:1150:86: error: member reference type 'struct wtap_pkthdr *' is a pointer; maybe you meant to use '->'?
                       pcap_get_phdr_size(int_data.wtap_encap, &wblock->packet_header.pseudo_header));
                                                                ~~~~~~~~~~~~~~~~~~~~~^
                                                                                     ->
(Error message from clang is better...)

svn path=/trunk/; revision=51317
2013-08-12 17:46:04 +00:00
Alexis La Goutte f9da854013 Fix shorten-64-to-32 error when build with clang 3.4
mcast_stream.c:393:29: error: implicit conversion loses integer precision: 'long' to 'gint32' (aka 'int')
      [-Werror,-Wshorten-64-to-32]
        usec = buffer[cur].tv_usec - buffer[prev].tv_usec;
             ~ ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~

svn path=/trunk/; revision=51316
2013-08-12 17:45:54 +00:00
Guy Harris 95785b9100 Use "command -v", required by recent POSIX, rather than "which"; I seem
to remember this being suggested relatively recently on some mailing list
(either one of the Wireshark lists or tcpdump-workers, I think).

Handle systems where /usr/X11R6/bin is a symlink to /usr/bin and where
the user running autogen.sh has /usr/X11R6/bin before /usr/bin in their
$PATH.

svn path=/trunk/; revision=51315
2013-08-12 17:16:08 +00:00
Stig Bjørlykke 1cf28c375f Double click Lua scripts in About Plugins list to open in an editor.
svn path=/trunk/; revision=51314
2013-08-12 12:59:21 +00:00
Martin Kaiser f76303cd6c coverity 280403 (logically dead code)
set first to FALSE after the first block was dissected

svn path=/trunk/; revision=51313
2013-08-12 10:15:01 +00:00
Pascal Quantin 40607cbd27 Check presence of PagingRecordList before trying to fetch the number of Paging Ids
svn path=/trunk/; revision=51312
2013-08-12 09:56:30 +00:00
Pascal Quantin 24e7b8aefd Fix copy paste error and reinitialize actx->private_data to NULL once used
svn path=/trunk/; revision=51311
2013-08-12 09:26:24 +00:00
Guy Harris 9ff00164a8 Fix a comment.
Fix calls checking the Linux version number.

svn path=/trunk/; revision=51310
2013-08-12 09:18:54 +00:00
Guy Harris 70523b5014 On some platforms, to get dladdr() you need to link with -ldl. First
try it without -ldl (in case the OS doesn't have it - not a good idea,
as it complicates the build process for cross-platform tools that might
require it on other platforms, but "not a good idea" never stopped UN*X
vendors in the past) and, if that fails, try it with -ldl.

svn path=/trunk/; revision=51309
2013-08-12 09:09:32 +00:00
Guy Harris f568d56df2 Add in a bunch of UNIX-platform-specific ways of getting executable path
information supplied by the kernel; sadly, we can't trust dladdr() to
use those mechanisms, so we try this first.

Expand the comment about finding the application bundle path given the
executable image path.

svn path=/trunk/; revision=51308
2013-08-12 08:28:34 +00:00
Guy Harris 829a4f213a Add a comment discussing the layout of application bundles and the
directories we should - and perhaps should *not* - set up.

svn path=/trunk/; revision=51307
2013-08-12 01:20:20 +00:00
Guy Harris 237c5a7b60 If we weren't started with special privileges, try to figure out if
we're running from inside an OS X app bundle and, if we are, save the
pathname of the top-level bundle directory and use it to get the
pathnames of global data files, plugins, and Python modules.

This obviates the need to set special environment variables for them in
the launcher scripts, so get rid of the commands to do that.

The @rpathification of binaries also obviates the need for the
commented-out setting of DYLD_LIBRARY_PATH, so get rid of that as well.

svn path=/trunk/; revision=51306
2013-08-12 00:59:34 +00:00
Evan Huus bf0f0ec4d9 Reorder and group chunk header flags. Reduces the bit-twiddling needed by the
compiler and provides a surprising (if fairly small) performance win.

svn path=/trunk/; revision=51305
2013-08-11 23:49:56 +00:00
Evan Huus dc46cb0f29 Split jumbo_free and jumbo_realloc into their own functions for readability and
consistency (they are called just once and will be inlined by any reasonable
compiler).

Also add some comments, fix some spacing etc. No functional changes.

svn path=/trunk/; revision=51304
2013-08-11 22:32:46 +00:00
Evan Huus 6eef00ac05 Move the null check outside the function call. Simpler, and more efficient for
compilers that decide not to inline.

svn path=/trunk/; revision=51303
2013-08-11 22:20:35 +00:00
Evan Huus 497e53ee06 Little optimization: move two statements inside an if block.
svn path=/trunk/; revision=51302
2013-08-11 19:33:30 +00:00
Anders Broman 93c9c4b0ff Use g_hashtable for IPv4 name resolution.
svn path=/trunk/; revision=51301
2013-08-11 19:02:26 +00:00
Evan Huus f9834195ed Don't let a valgrind-output-parsing error hide the fact that it was an error of
some sort: if we don't recognize valgrind's output then something somewhere went
wrong and we should be informed.

svn path=/trunk/; revision=51300
2013-08-11 17:48:49 +00:00