Guy Harris [Wed, 27 Apr 2011 02:54:44 +0000 (02:54 -0000)]
Create a new frame_data_sequence data type; it represents a dense
sequence of frame_data structures, indexed by the frame number. Extract
the relevant bits of the capture_file data structure and move them to
the frame_data_sequence, and move the relevant code from cfile.c and
tweak it to handle frame_data_sequence structures.
Have a possibly-null pointer to a frame_data_sequence structure in the
capture_file structure; if it's null, we aren't keeping a sequence of
frame_data structures (we don't keep that sequence when we're doing
one-pass processing in TShark).
Nothing in libwireshark should care about a capture_file structure; get
rid of some unnecessary includes of cfile.h.
svn path=/trunk/; revision=36881
Guy Harris [Wed, 27 Apr 2011 00:43:31 +0000 (00:43 -0000)]
Another hack to handle the one-pass case.
svn path=/trunk/; revision=36880
Guy Harris [Tue, 26 Apr 2011 23:17:47 +0000 (23:17 -0000)]
Short-term hack to fix bug 5855 - don't try to process all the
frame_data structures for all the packets if we don't actually *have*
any frame_data structures for any packets, e.g. in TShark in one-pass
mode.
Also:
Use #if 0/#endif instead of commenting out.
Consistently use 4-space indentation.
svn path=/trunk/; revision=36879
Guy Harris [Tue, 26 Apr 2011 23:07:40 +0000 (23:07 -0000)]
If HAVE_LIBGNUTLS isn't defined, don't build functions that are used
only if HAVE_LIBGNUTLS is defined.
svn path=/trunk/; revision=36878
Guy Harris [Tue, 26 Apr 2011 22:56:22 +0000 (22:56 -0000)]
If HAVE_LIBGNUTLS isn't defined, don't build functions that are used
only if HAVE_LIBGNUTLS is defined.
svn path=/trunk/; revision=36877
Gerald Combs [Tue, 26 Apr 2011 22:51:35 +0000 (22:51 -0000)]
From Adam Langley via bug 4349:
This patch adds support for getting the pre-master secret of a TLS
connection from a log file. Currently Wireshark can decrypt and TLS
connection only if it has the server's private key.
I commonly have a use case where I control the TLS client, but not the
server. In order to decrypt in this case, I've added support to NSS
(used by Chrome and Firefox) to log the keys to a file on disk:
https://bugzilla.mozilla.org/show_bug.cgi?id=536474
Given this file, Wireshark can then decrypt the resulting TLS connections.
The format is such that Wireshark opens and linearly scans the file each
time it sees a ClientKeyExchange. If the key log grows too large, this
is pretty inefficient. However, it's simple and the number of
interesting TLS connections when debugging is usually very small.
svn path=/trunk/; revision=36876
Gerald Combs [Tue, 26 Apr 2011 21:59:11 +0000 (21:59 -0000)]
From Ivan Sy via bug 3343:
- Support for DTLS and SSL RSA keys list using User Accessible Table
- Support for IPv6 SSL as posted by bug#3343 comment#1
- 'any' and 'anyipv4' for IPv4 wildcard
- 'anyipv6' for IPv6 wildcard
- UAT fields validation.
From me:
- Update paramaters to match UAT API changes.
- Change the UAT filename.
- Fix buffer overflow for IPv6 addresses.
- Allow the use of hostnames along with numeric addresses.
- Don't convert strings to addresses twice.
- Don't use the same variable name for different data types.
- Make "any" mean "any IPv4 or any IPv6".
- Bend the concept of obsolete preferences slightly so that we can convert
and old-style key list to a UAT.
- Clean up whitespace.
- Don't point to a User's Guide section for now; it may make more sense to
keep using the wiki page.
SSL dissector changes have been tested. DTLS dissector changes have not.
svn path=/trunk/; revision=36875
Anders Broman [Tue, 26 Apr 2011 20:24:53 +0000 (20:24 -0000)]
From Yaniv Kaul:
Fix 'set but not used' errors that GCC 4.6 emits.
svn path=/trunk/; revision=36874
Gerald Combs [Tue, 26 Apr 2011 17:13:37 +0000 (17:13 -0000)]
get_host_ipaddr() was returning numeric addresses in host byte order
and hostnames in network byte order. Have it return everything in
network byte order.
svn path=/trunk/; revision=36873
Alexis La Goutte [Tue, 26 Apr 2011 14:43:00 +0000 (14:43 -0000)]
Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=36872
Alexis La Goutte [Tue, 26 Apr 2011 14:42:41 +0000 (14:42 -0000)]
Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=36871
Alexis La Goutte [Tue, 26 Apr 2011 14:41:49 +0000 (14:41 -0000)]
Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=36870
Alexis La Goutte [Tue, 26 Apr 2011 14:41:33 +0000 (14:41 -0000)]
Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=36869
Alexis La Goutte [Tue, 26 Apr 2011 14:40:19 +0000 (14:40 -0000)]
Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=36868
Jakub Zawadzki [Tue, 26 Apr 2011 10:10:22 +0000 (10:10 -0000)]
- Synchronize gtk/Makefile.am checkapi with gtk/Makefile.nmake
- fix: Found deprecated-gtk APIs in packet_win.c: gtk_entry_new_with_max_length
svn path=/trunk/; revision=36867
Jakub Zawadzki [Tue, 26 Apr 2011 08:51:25 +0000 (08:51 -0000)]
Add new function packet_hex_editor_print.
svn path=/trunk/; revision=36866
Jakub Zawadzki [Tue, 26 Apr 2011 07:12:42 +0000 (07:12 -0000)]
Packet editing for single field_info:
- Support FT_STRING and FT_STRINGZ types.
- hex editor (mainly for unsupported types)
svn path=/trunk/; revision=36865
Guy Harris [Tue, 26 Apr 2011 02:55:59 +0000 (02:55 -0000)]
Cast away warnings about "struct sockaddr" -> "struct sockaddr_XXX"
casts that are actually safe.
svn path=/trunk/; revision=36864
Guy Harris [Tue, 26 Apr 2011 02:53:58 +0000 (02:53 -0000)]
Get rid of a cast that was causing alignment warnings and that was bogus
anyway (the second argument to g_slist_find_custom is a gconstpointer,
not a gpointer * or a gconstpointer *).
svn path=/trunk/; revision=36863
Guy Harris [Tue, 26 Apr 2011 02:51:10 +0000 (02:51 -0000)]
Get rid of some code that's no longer relevant with the new tree
structure for frame_data items.
svn path=/trunk/; revision=36862
Guy Harris [Tue, 26 Apr 2011 02:47:52 +0000 (02:47 -0000)]
Cast away warnings about "struct sockaddr" -> "struct sockaddr_XXX"
casts that are actually safe.
svn path=/trunk/; revision=36861
Chris Maynard [Tue, 26 Apr 2011 01:06:25 +0000 (01:06 -0000)]
Remove const qualifier to name, abbrev and blurb to pacify the buildbots.
svn path=/trunk/; revision=36860
Chris Maynard [Tue, 26 Apr 2011 00:41:08 +0000 (00:41 -0000)]
Plug a memory leak.
svn path=/trunk/; revision=36859
Stephen Fisher [Mon, 25 Apr 2011 22:55:31 +0000 (22:55 -0000)]
Take out extra pair of parenthesis
svn path=/trunk/; revision=36858
Jakub Zawadzki [Mon, 25 Apr 2011 21:26:52 +0000 (21:26 -0000)]
Make checkapi happy
svn path=/trunk/; revision=36857
Guy Harris [Mon, 25 Apr 2011 21:20:47 +0000 (21:20 -0000)]
Get rid of some unnecessary casts that just provoke uninteresting
warnings.
More fun with GArrays: cast away some warnings that don't report real
alignment problems and that wouldn't even happen if the "data" member of
a GArray were a "void *".
svn path=/trunk/; revision=36856
Guy Harris [Mon, 25 Apr 2011 21:19:54 +0000 (21:19 -0000)]
More fun with GArrays: cast away some warnings that don't report real
alignment problems and that wouldn't even happen if the "data" member of
a GArray were a "void *".
svn path=/trunk/; revision=36855
Guy Harris [Mon, 25 Apr 2011 21:19:22 +0000 (21:19 -0000)]
More fun with GArrays: cast away some warnings that don't report real
alignment problems and that wouldn't even happen if the "data" member of
a GArray were a "void *".
Clean up indentation.
svn path=/trunk/; revision=36854
Guy Harris [Mon, 25 Apr 2011 21:07:01 +0000 (21:07 -0000)]
Get rid of some extra parentheses that cause clang to warn that you
might have meant to do an assignment rather than a comparison.
svn path=/trunk/; revision=36853
Jakub Zawadzki [Mon, 25 Apr 2011 19:57:45 +0000 (19:57 -0000)]
Fix compilation warning:
packet_win.c:230: warning: 'u_val' may be used uninitialized in this function
svn path=/trunk/; revision=36852
Anders Broman [Mon, 25 Apr 2011 19:36:13 +0000 (19:36 -0000)]
from Jakub Zawadzki:
Don't thaw the packet list during file loading to speed up file loading.
svn path=/trunk/; revision=36851
Jakub Zawadzki [Mon, 25 Apr 2011 19:28:00 +0000 (19:28 -0000)]
- Experimental support to edit single field_info.
Note: For now only integers (without bitmask), I'm afraid other fields require more work.
svn path=/trunk/; revision=36850
Guy Harris [Mon, 25 Apr 2011 19:01:05 +0000 (19:01 -0000)]
Store the frame_data structures in a tree, rather than a linked list.
This lets us get rid of the per-frame_data-structure prev and next
pointers, saving memory (at least according to Activity Monitor's report
of the virtual address space size on my Snow Leopard machine, it's a
noticeable saving), and lets us look up frame_data structures by frame
number in O(log2(number of frames)) time rather than O(number of frames)
time. It seems to take more CPU time when reading in the file, but
seems to go from "finished reading in all the packets" to "displaying
the packets" faster and seems to free up the frame_data structures
faster when closing the file.
It *is* doing more copying, currently, as we now don't allocate the
frame_data structure until after the packet has passed the read filter,
so that might account for the additional CPU time.
(Oh, and, for what it's worth, on an LP64 platform, a frame_data
structure is exactly 128 bytes long. However, there's more stuff to
remove, so the power-of-2 size is not guaranteed to remain, and it's not
a power-of-2 size on an ILP32 platform.)
It also means we don't need GLib 2.10 or later for the two-pass mode in
TShark.
It also means some code in the TCP dissector that was checking
pinfo->fd->next to see if it's NULL, in order to see if this is the last
packet in the file, no longer works, but that wasn't guaranteed to work
anyway:
we might be doing a one-pass read through the capture in TShark;
we might be dissecting the frame while we're reading in the
packets for the first time in Wireshark;
we might be doing a live capture in Wireshark;
in which case packets might be prematurely considered "the last packet".
#if 0 the no-longer-working tests, pending figuring out a better way of
doing it.
svn path=/trunk/; revision=36849
Stephen Fisher [Mon, 25 Apr 2011 16:29:16 +0000 (16:29 -0000)]
Cast away some clang errors about cast alignments that appear safe.
svn path=/trunk/; revision=36848
Stephen Fisher [Mon, 25 Apr 2011 16:19:07 +0000 (16:19 -0000)]
Fix clang error ("increases requird alignment from 1 to 8") by removing
unnecessary VALS() cast
svn path=/trunk/; revision=36847
Guy Harris [Mon, 25 Apr 2011 05:33:07 +0000 (05:33 -0000)]
Make the packet count an unsigned value, as frame numbers are unsigned.
Make the loops that scan through all the packets do so by frame number,
to abstract away the "next" and "previous" pointers in the frame_data
structure. Add a routine to cfile.c to map frame numbers to frame_data
structures, and put in some special case handling so scanning forward or
backward through the packets is O(N) rather than O(N^2).
svn path=/trunk/; revision=36846
Jeff Morriss [Mon, 25 Apr 2011 02:06:17 +0000 (02:06 -0000)]
From Loránd Jakab via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5854 :
The Locator/ID Separation Protocol [1] is being standardized within the IETF,
and it is nearing RFC status (pending security review). I have been maintaining
a dissector patch for about a year, see [2]. Feedback received indicates that,
among others, it is widely used by the developers of a large router vendor,
without issues.
In January I submitted the dissector for data plane packets as bug #5602, which
was committed as r35615. The patch attached to this bug adds support for
dissection of control plane packets.
[1] http://tools.ietf.org/html/draft-ietf-lisp
[2] http://lisp.ccaba.upc.edu/wireshark/
svn path=/trunk/; revision=36845
Jeff Morriss [Mon, 25 Apr 2011 01:37:19 +0000 (01:37 -0000)]
From Joakim Wiberg via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5801 :
The attached patch replaces most of the proto_tree_add_text() with
proto_tree_add_item(). That resulted in several new display filters.
It also uses the correct defines (ENC_NA, ENC_BIG_ENDIAN and ENC_LITTLE_ENDIAN)
instead of TRUE/FALSE in all proto_tree_add_item() calls.
Also it prints all out all connected transport data, since this is used by
"IENetP Test Tool" as a part of the XML export.
svn path=/trunk/; revision=36844
Jakub Zawadzki [Sun, 24 Apr 2011 22:52:49 +0000 (22:52 -0000)]
Packet editing:
- Show next editing bit (for hex it'd require patching packet_hex_apply_reverse_tag)
- Remove memset()s
- Try to fix compilation for win64.
svn path=/trunk/; revision=36843
Jakub Zawadzki [Sun, 24 Apr 2011 21:57:12 +0000 (21:57 -0000)]
Allocate space for epan_dissect_t inside struct.
svn path=/trunk/; revision=36842
Jakub Zawadzki [Sun, 24 Apr 2011 21:19:41 +0000 (21:19 -0000)]
Initial support for editing packets inside wireshark.
svn path=/trunk/; revision=36841
Jörg Mayer [Sun, 24 Apr 2011 21:10:45 +0000 (21:10 -0000)]
Fix CID 813: Code after ERROR is dead code (never reached)
svn path=/trunk/; revision=36840
Guy Harris [Sun, 24 Apr 2011 21:02:55 +0000 (21:02 -0000)]
new_packet_list_find_row_from_data() is always used to select a packet,
so get rid of the select_flag argument, and rename it
new_packet_list_select_row_from_data().
It's also always passed a frame_data *, so make its argument a
frame_data *.
Its return value is used only to detect whether the packet was found in
the display or not, so make it a gboolean. Check it in *all* cases
where it's called, and change the dialog message a bit (the most likely
cause is that the user cancelled a redissection of the packets, so not
all packets in the capture file are in the display.
Also, in the find case, pass it the new packet we found.
svn path=/trunk/; revision=36839
Guy Harris [Sun, 24 Apr 2011 19:41:28 +0000 (19:41 -0000)]
Make the interface combo box an entry, so you can type in it again.
svn path=/trunk/; revision=36838
Guy Harris [Sun, 24 Apr 2011 19:38:12 +0000 (19:38 -0000)]
gtk_combo_box_new_text() returns a GtkComboBox, and you connect a
function directly to its "changed" signal; GtkComboBox is a subclass of
GtkBin, but you don't connect to its child.
svn path=/trunk/; revision=36837
Gerald Combs [Sun, 24 Apr 2011 15:03:44 +0000 (15:03 -0000)]
[Automatic manuf, services and enterprise-numbers update for 2011-04-24]
svn path=/trunk/; revision=36834
Guy Harris [Sat, 23 Apr 2011 19:03:05 +0000 (19:03 -0000)]
Back out previous change - I guess the Solaris buildbot has a pre-2.5.30
flex.
svn path=/trunk/; revision=36833
Guy Harris [Sat, 23 Apr 2011 17:56:43 +0000 (17:56 -0000)]
Try putting the include of config.h at the top of the generated scanner,
so that the config.h definitions are available before we include
anything else; that way, for example, anything defined to enable
large-file support will be defined before we include any system header
files that might depend on it.
svn path=/trunk/; revision=36832
Jeff Morriss [Sat, 23 Apr 2011 11:10:47 +0000 (11:10 -0000)]
Rename g_gnuc_malloc.h to g_gnuc.h
svn path=/trunk/; revision=36831
Stig Bjørlykke [Sat, 23 Apr 2011 09:47:28 +0000 (09:47 -0000)]
Check if changing to another profile in change_configuration_profile()
svn path=/trunk/; revision=36830
Jakub Zawadzki [Sat, 23 Apr 2011 09:13:16 +0000 (09:13 -0000)]
Use orginal nsstime_t structures (without copying).
svn path=/trunk/; revision=36829
Stephen Fisher [Fri, 22 Apr 2011 19:31:09 +0000 (19:31 -0000)]
Don't pass -fexcess-precision=fast to clang like we do for gcc.
svn path=/trunk/; revision=36828
Jeff Morriss [Fri, 22 Apr 2011 18:32:56 +0000 (18:32 -0000)]
Avoid passing a NULL string pointer to format routines: some libc's (e.g.,
Solaris') will seg-fault on that.
svn path=/trunk/; revision=36827
Stephen Fisher [Fri, 22 Apr 2011 18:04:26 +0000 (18:04 -0000)]
Fix various warnings found by clang 3.0 (trunk 129935) complier:
- Extraneous parentheses
- Use _U_ for unused function parameters instead of assigning the variable
to itself
svn path=/trunk/; revision=36826
Jeff Morriss [Fri, 22 Apr 2011 17:57:10 +0000 (17:57 -0000)]
As suggested by Jakub Zawadzki:
Rename g_gnuc_malloc.h to g_gnuc.h (since it contains non-malloc related
GNUC stuff).
Use G_GNUC_WARN_UNUSED_RESULT from glib instead of using warn_unused_result
directly.
svn path=/trunk/; revision=36825
Stephen Fisher [Fri, 22 Apr 2011 17:51:48 +0000 (17:51 -0000)]
Fix warning about using wrong enum that is probably causing an actual
bug: whenever call_state is assigned to VOIP_CALL_SETUP in other parts
of Wireshark code (such as gtk/voip_calls.c), then call_active_state
is set to VOIP_ACTIVE. Do that here too. It was set to VOIP_NO_STATE
(from the wrong enum), which would have likely resulted in the wrong
value being assigned.
svn path=/trunk/; revision=36824
Stephen Fisher [Fri, 22 Apr 2011 17:42:40 +0000 (17:42 -0000)]
Fix a "equality comparison with extraneous parentheses" warning found
by clang 3.0 (trunk 129935) compiler.
svn path=/trunk/; revision=36823
Stephen Fisher [Fri, 22 Apr 2011 17:36:16 +0000 (17:36 -0000)]
Fix a "equality comparison with extraneous parentheses" warning found
by clang 3.0 (trunk 129935) compiler.
svn path=/trunk/; revision=36822
Stephen Fisher [Fri, 22 Apr 2011 17:33:53 +0000 (17:33 -0000)]
Use _U_ for unused function parameters instead of assigning the variable
to itself. Found by clang 3.0 (trunk 129935) compiler.
svn path=/trunk/; revision=36821
Stephen Fisher [Fri, 22 Apr 2011 17:31:57 +0000 (17:31 -0000)]
Fix a few "equality comparison with extraneous parentheses" warnings
found by clang 3.0 (trunk 129935) compiler.
svn path=/trunk/; revision=36820
Stephen Fisher [Fri, 22 Apr 2011 17:30:06 +0000 (17:30 -0000)]
Use _U_ for unused function parameters instead of assigning the
variable to itself. Found by clang 3.0 (trunk) compiler.
svn path=/trunk/; revision=36819
Stephen Fisher [Fri, 22 Apr 2011 17:25:25 +0000 (17:25 -0000)]
Change enum type in struct to an int to allow different enum types to
be used for the field display type in the struct.
svn path=/trunk/; revision=36818
Stephen Fisher [Fri, 22 Apr 2011 17:08:59 +0000 (17:08 -0000)]
Fix whitespace a bit and add field names from doc/README.developer to
comments such as FIELDNAME, FIELDABBREV, etc.
svn path=/trunk/; revision=36817
Guy Harris [Fri, 22 Apr 2011 17:05:28 +0000 (17:05 -0000)]
Assume the tags are mallocated, so they're properly aligned. Cast away
the warnings.
svn path=/trunk/; revision=36816
Stephen Fisher [Fri, 22 Apr 2011 16:31:32 +0000 (16:31 -0000)]
Remove enum cast that doesn't do anything and causes a warning about
converting between enum types in clang 3.0 (trunk).
svn path=/trunk/; revision=36815
Stephen Fisher [Fri, 22 Apr 2011 16:27:01 +0000 (16:27 -0000)]
Found by clang 3.0 (built from trunk): various implicit conversion from
enumeration type 'xxx' to different enumeration type 'xxx'
Fix: Create different structs based on the enum type contained within.
svn path=/trunk/; revision=36814
Stephen Fisher [Fri, 22 Apr 2011 15:53:34 +0000 (15:53 -0000)]
Use _U_ for unused function parameters instead of assigning a variable
to itself. Found by clang compiler.
svn path=/trunk/; revision=36813
Jeff Morriss [Fri, 22 Apr 2011 15:15:10 +0000 (15:15 -0000)]
If we're using GNUC, use attribute warn_unused_result to verify that the
return value of proto_item_add_subtree() is used.
(The WARN_IF_UNUSED macro doesn't belong here... But where should it go?)
svn path=/trunk/; revision=36812
Jeff Morriss [Fri, 22 Apr 2011 14:48:10 +0000 (14:48 -0000)]
Use the return value of proto_item_add_subtree(): put the filter masks in their own subtree (as it appears was intended).
svn path=/trunk/; revision=36811
Jeff Morriss [Fri, 22 Apr 2011 14:41:26 +0000 (14:41 -0000)]
Don't create subtrees that are not used (and don't create subtrees which might
have--if the original code was different--contained only one sub-item).
Remove some no-longer-used ett variables.
svn path=/trunk/; revision=36810
Jeff Morriss [Fri, 22 Apr 2011 14:33:58 +0000 (14:33 -0000)]
Don't assume that a proto_item is equivalent to a proto_tree.
Use the return value from proto_item_add_subtree().
svn path=/trunk/; revision=36809
Jeff Morriss [Fri, 22 Apr 2011 14:32:35 +0000 (14:32 -0000)]
Don't create a subtree that is not used.
svn path=/trunk/; revision=36808
Jeff Morriss [Fri, 22 Apr 2011 14:30:19 +0000 (14:30 -0000)]
Use the return value of proto_item_add_subtree()
svn path=/trunk/; revision=36807
Jeff Morriss [Fri, 22 Apr 2011 14:29:00 +0000 (14:29 -0000)]
Don't assume that a proto_item is equivalent to a proto_tree.
Use the return value from proto_item_add_subtree().
svn path=/trunk/; revision=36806
Jeff Morriss [Fri, 22 Apr 2011 14:17:34 +0000 (14:17 -0000)]
Don't create a subtree that is not used.
svn path=/trunk/; revision=36805
Jeff Morriss [Fri, 22 Apr 2011 14:13:20 +0000 (14:13 -0000)]
Use the return value of proto_item_add_subtree()
svn path=/trunk/; revision=36804
Alexis La Goutte [Fri, 22 Apr 2011 13:16:45 +0000 (13:16 -0000)]
Enhance BT-UTP dissector:
* Add type (syn, data, reset...) in column info
* Split dissect_utp_header(...) function to
* dissect_utp_header_v0(...)
* dissect_utp_header_v1(...)
* dissect_utp_extensions(...)
svn path=/trunk/; revision=36803
Alexis La Goutte [Fri, 22 Apr 2011 13:11:52 +0000 (13:11 -0000)]
Fix (latest) Dead Store (Dead nested assignment) Warning found by Clang
svn path=/trunk/; revision=36802
Alexis La Goutte [Fri, 22 Apr 2011 13:07:11 +0000 (13:07 -0000)]
From wireshark.org/lists/wireshark-dev/201104/msg00231.html
Always use the returned tree value of proto_tree_add_subtree (and not the item!)
svn path=/trunk/; revision=36801
Jakub Zawadzki [Fri, 22 Apr 2011 12:25:01 +0000 (12:25 -0000)]
Cleanup emem_verify_pointer()
svn path=/trunk/; revision=36800
Guy Harris [Fri, 22 Apr 2011 07:58:19 +0000 (07:58 -0000)]
Add some casts to squelch complaints about alignment; our little slab
allocator should return properly-aligned items.
svn path=/trunk/; revision=36799
Jakub Zawadzki [Fri, 22 Apr 2011 07:36:37 +0000 (07:36 -0000)]
Remove invalid svn:executable property
svn path=/trunk/; revision=36798
Jakub Zawadzki [Fri, 22 Apr 2011 07:15:45 +0000 (07:15 -0000)]
Add return instructions for system without support for G_GNUC_NORETURN (e.g. some older gcc compilers).
Reported by Anders Broman on -dev list.
svn path=/trunk/; revision=36797
Guy Harris [Fri, 22 Apr 2011 04:04:20 +0000 (04:04 -0000)]
We deal with pointer alignment ourselves, so we ensure the casts are
safe. Tell the compiler so.
svn path=/trunk/; revision=36796
Guy Harris [Fri, 22 Apr 2011 04:01:30 +0000 (04:01 -0000)]
Either the buf argument to emem_scrub_memory() is properly aligned or it
isn't. If it is, we don't need to worry about alignment, so the XXX
comment doesn't belong there; if it isn't, then we should do what the
comment says. For now, assume the comment before the XXX comment is
correct, and just cast away the alignment warning.
svn path=/trunk/; revision=36795
Guy Harris [Fri, 22 Apr 2011 03:53:01 +0000 (03:53 -0000)]
ep_alloc() returns a properly-aligned value for all uses; that's why it
returns void * rather than guint8 *. Don't pointer-convert that
information away; otherwise, compilers might whine about safe pointer
casts.
svn path=/trunk/; revision=36794
Guy Harris [Fri, 22 Apr 2011 03:34:39 +0000 (03:34 -0000)]
Stuff that comes back from ep_alloc() is properly aligned for all uses;
that's why it returns "void *", not "guint8 *". Don't pointer-convert
that information away; otherwise, compilers might whine at you about
unsafe casts.
svn path=/trunk/; revision=36793
Guy Harris [Fri, 22 Apr 2011 03:31:06 +0000 (03:31 -0000)]
Cast away bogus warnings. (I begin to see why C++ has templates here,
complicated though they might be for both users and implementors....)
svn path=/trunk/; revision=36792
Guy Harris [Fri, 22 Apr 2011 03:27:40 +0000 (03:27 -0000)]
*Properly* get rid of bogus cast.
svn path=/trunk/; revision=36791
Guy Harris [Fri, 22 Apr 2011 03:25:48 +0000 (03:25 -0000)]
"guint8 *" means "pointer to array of bytes that may or may not be
properly aligned"; "void *", at least when it's the return value of
ep_malloc(), means "pointer to properly-aligned chunk of memory". Use
"void *" in get_sdp_data_element() and its callers in that case, to
squelch compiler warnings.
svn path=/trunk/; revision=36790
Guy Harris [Fri, 22 Apr 2011 03:12:18 +0000 (03:12 -0000)]
Cast away alignment warnings about pointers where we never actually
directly dereference pointers to the field members.
Get rid of an unnecessary cast that provokes warnings.
svn path=/trunk/; revision=36789
Guy Harris [Fri, 22 Apr 2011 03:11:14 +0000 (03:11 -0000)]
Cast away warnings about "struct sockaddr" -> "struct sockaddr_XXX"
casts that are actually safe.
svn path=/trunk/; revision=36788
Guy Harris [Fri, 22 Apr 2011 03:10:22 +0000 (03:10 -0000)]
Make all the fields in the various structures just arrays of bytes, so
we can cast not-necessarily-aligned pointers to pointers to those
structures without risk of compiler warnings *or* the underlying problem
the compiler's trying to warn us about (no, you can't always dereference
an unaligned pointer - SPARC traps, and at least some ARM processors may
do something other than what you want, for example).
This also caught some cases where we were not even properly
byte-swapping on big-endian platforms.
This also lets us not muck around with splitting 64-bit times into two
32-bit fields - we have pletohll(), after all.
svn path=/trunk/; revision=36787
Bill Meier [Thu, 21 Apr 2011 22:49:36 +0000 (22:49 -0000)]
Remove unneeded #include <errno>,<math>,<ctype> & "isprint";
Do minoir whitespace & indentation cleanup.
svn path=/trunk/; revision=36786
Bill Meier [Thu, 21 Apr 2011 22:42:32 +0000 (22:42 -0000)]
Add #include <ctype.h> before #include "isprint.h";
Remove an unneeded line of code;
Do some indentation & whitespace cleanup.
svn path=/trunk/; revision=36785
Jeff Morriss [Thu, 21 Apr 2011 22:38:41 +0000 (22:38 -0000)]
Avoid passing a NULL string pointer to format routines: some libc's (e.g.,
Solaris') will seg-fault on that.
svn path=/trunk/; revision=36784
Bill Meier [Thu, 21 Apr 2011 22:31:45 +0000 (22:31 -0000)]
#include <errno.h> & #include <math.h> not req'd;
svn path=/trunk/; revision=36783
Bill Meier [Thu, 21 Apr 2011 22:26:27 +0000 (22:26 -0000)]
Remove unneeded #include <ctype.h> and "isprint.h";
Do minor whitespace cleanup.
svn path=/trunk/; revision=36782
Bill Meier [Thu, 21 Apr 2011 22:13:56 +0000 (22:13 -0000)]
Remove some unneeded #includes;
Correct some typos;
Use consistent indentation & do some whitespace cleanup.
svn path=/trunk/; revision=36781
Bill Meier [Thu, 21 Apr 2011 21:50:35 +0000 (21:50 -0000)]
Remove some uneeded #includes;
Minor indentation & whitespace cleanup.
svn path=/trunk/; revision=36780