Commit Graph

55261 Commits

Author SHA1 Message Date
Guy Harris e3477bd136 Get rid of some no-longer-necessary casts.
g_ascii_isXXX() can be handed a char value safely; they won't try to use
it as an index into a table before checking it.

Change-Id: Icf80163fb5f9dccd0b97917e318b1db0bf3e0cf8
Reviewed-on: https://code.wireshark.org/review/4801
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-17 23:58:23 +00:00
Guy Harris a91799ebfa Don't use ctype.h routines.
That avoids locale dependency and handles possibly-signed chars(which
we weren't always doing before).

Change-Id: I89e50678abb8c3e535081c92ca25bc1bab672c68
Reviewed-on: https://code.wireshark.org/review/4798
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-17 23:43:09 +00:00
Guy Harris 19b7819694 Get rid of unnecessary includes of ctype.h.
Change-Id: Ibb194cd839d174af9c96f7bb1e2941b3dd6c1ce1
Reviewed-on: https://code.wireshark.org/review/4797
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-17 23:31:20 +00:00
Guy Harris 033f096ee9 Don't use ctype.h routines.
That avoids locale dependency and handles possibly-signed chars (which
we weren't always doing before).

Change-Id: Ieceb93029252f646397b6488f2df8a57c6d2a23d
Reviewed-on: https://code.wireshark.org/review/4794
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-17 23:11:18 +00:00
Guy Harris 344c2bbb5e strptime.c needs ctype.h.
Change-Id: Icf4020426d3a5e0a6bd2012a266cf07be9928abf
Reviewed-on: https://code.wireshark.org/review/4793
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-17 21:59:45 +00:00
Guy Harris 214a78c8e1 Get rid of unnecessary include of ctype.h.
Change-Id: Ib83e707ebbbb420ce269a652ede6b7366d24240e
Reviewed-on: https://code.wireshark.org/review/4792
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-17 21:28:21 +00:00
Guy Harris e304f6d9f8 Get rid of unnecessary includes of ctype.h.
Change-Id: Ic23203f13fd6627b664e8ed1438d328c46328b9f
Reviewed-on: https://code.wireshark.org/review/4790
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-17 21:22:58 +00:00
Guy Harris 5fc398c328 Don't use ctype.h routines.
That avoids locale dependency and handles possibly-signed chars (which
we weren't doing before).

Change-Id: I189222eff624ad2d2e960bc0b69f3f22d35f351f
Reviewed-on: https://code.wireshark.org/review/4787
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-17 21:11:44 +00:00
Guy Harris 36e4e6fa0a Get rid of unused includes of <ctype.h>.
Change-Id: Iab9eaeb0f5765748b2582177396264e4e69bc6d1
Reviewed-on: https://code.wireshark.org/review/4786
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-17 21:04:59 +00:00
Guy Harris 5bfde7c638 Don't use ctype.h routines.
That avoids locale dependency and handles possibly-signed chars (which
we weren't doing before).

Change-Id: I70f3d993c9a8fbf870901f12b430d733968c3fa8
Reviewed-on: https://code.wireshark.org/review/4781
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-17 20:37:42 +00:00
Hannes Mezger 35a9b98138 Use proto_tree_add_bitmask for ExpandedNodeId EncodingMask
Instead of adding the items using proto_tree_add_item, use proto_tree_add_bitmask in parseExpandedNodeId(). Also, the redundant 'NodeId ' text is removed from hf_opcua_nodeid_... items for better readability.

Change-Id: Ie68f1d280dd733fd2eede0b2b73ad8d7f28396b3
Reviewed-on: https://code.wireshark.org/review/4730
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-17 16:04:09 +00:00
AndersBroman 17a1a0d5e7 SGsAP Update to V12.6.0 except for IE TMSI based NRI container.
Change-Id: Iafb62a27589de1810d4d3bd1e32f1c89898e9171
Reviewed-on: https://code.wireshark.org/review/4777
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-10-17 14:52:12 +00:00
Hannes Mezger e5bbfa0f15 Add argument 'packet_info *pinfo' to all dissecting functions
Change-Id: Ie02326e365ee3f620fcbe3f2e8e45dc5300d3418
Reviewed-on: https://code.wireshark.org/review/4728
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-17 14:51:40 +00:00
AndersBroman 0ceeddee17 Dissect CDMA2000 PDU if GCSNA dissector exists.
Change-Id: I866fb9bbc3e94df63231959d6745f3d45ca84020
Reviewed-on: https://code.wireshark.org/review/4772
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-10-17 12:01:27 +00:00
AndersBroman 9d1afef1df isdigit -> g_ascii_isdigit to make the build work.
Change-Id: I670b7b83976a9db9491e017015d570a4dc8f433d
Reviewed-on: https://code.wireshark.org/review/4771
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-10-17 08:52:10 +00:00
Guy Harris 441698863d Eliminate include of <ctype.h>.
This is not built if we have glibc (as we already have getopt() from
it), and it's not part of glibc, so....

Change-Id: Iae4ff944c78fc55a8cd2eaf523a3696c47b741d7
Reviewed-on: https://code.wireshark.org/review/4769
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-17 07:02:37 +00:00
Guy Harris 87545f39da Remove unnecessary includes of <ctype.h>.
Change-Id: I8eacec5fa8d57b10d40a3627197461dae89c6cb2
Reviewed-on: https://code.wireshark.org/review/4768
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-17 06:57:41 +00:00
Guy Harris f90d8dcbbb Use g_ascii_isspace() instead of isascii() && isspace().
This eliminates one more use of <ctype.h> macros; we're using
g_ascii_isXXX() instead of isXXX() elsewhere.

Change-Id: I184caeefab95dda2cf207acf9539eabbd7c32a51
Reviewed-on: https://code.wireshark.org/review/4767
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-17 06:54:54 +00:00
Guy Harris 63ab36be92 Don't use <ctype.h> macros, and eliminate an include of <ctype.h>.
This avoids locale-dependent tests, and fixes cases where we passed
signed char values to those macros (which is not safe with char being
signed, as it is on most, but not all, platforms).

Change-Id: Iea962cd7e4dfaf33c3c873ba43814cc6ed298d94
Reviewed-on: https://code.wireshark.org/review/4764
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-17 06:41:58 +00:00
Guy Harris 23b233d741 Remove unnecessary include of <ctype.h>.
Change-Id: I596b252d5fb41e654961483cb530754442f25bc7
Reviewed-on: https://code.wireshark.org/review/4763
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-17 06:29:36 +00:00
Guy Harris 44d4339eb3 Don't use <ctype.h> macros, and eliminate an include of <ctype.h>.
This avoids locale-dependent tests, and fixes cases where we passed
signed char values to those macros (which is not safe with char being
signed, as it is on most, but not all, platforms).

Change-Id: I51d9716fe3eb02a6e98208334285c07597a6be79
Reviewed-on: https://code.wireshark.org/review/4761
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-17 06:22:20 +00:00
Guy Harris 25d9a7b5f1 Don't use <ctype.h> macros, and eliminate an include of <ctype.h>.
This avoids locale-dependent tests.

Change-Id: I709ff6b1a837fb0390b29f911d3b9ef1015a2d1e
Reviewed-on: https://code.wireshark.org/review/4758
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-17 06:09:11 +00:00
Guy Harris 762b8d78ec Don't use ctype.h routines.
That avoids locale dependency and handles possibly-signed chars (which
we weren't doing before).

Change-Id: I2afab254044e0d39dfa67acd840b9fe4ff1e6d08
Reviewed-on: https://code.wireshark.org/review/4756
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-17 06:01:58 +00:00
Guy Harris 0d9b449ae9 Don't use <ctype.h> macros.
They're locale-dependent (although those *particular* ones might not
be).

Remove no-longer necessary (or not-even-necessary-before-this-change)
includes of <ctype.h>

Change-Id: I1384e3ae4ccba6af9220a08773abcde7ea320573
Reviewed-on: https://code.wireshark.org/review/4755
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-17 01:26:27 +00:00
Guy Harris 359a32f735 No need for our own wrappers around tolower() and toupper().
We can just use g_ascii_tolower() and g_ascii_toupper();

Change-Id: I8a88a096d16ce8c60dd9151e5bdddf6747702145
Reviewed-on: https://code.wireshark.org/review/4754
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-17 01:21:48 +00:00
Guy Harris e6fcff1eb6 Use g_ascii_isalnum() rather than isalnum().
That way, we don't have to worry about casting the argument (which, in
one place, was done wrong - casting to int preserves the sign-extension
done with signed chars), and don't have to worry about a locale in which
particular 8-bit byte values are considered alphanumeric characters.

Change-Id: I129b4bfdad70ade4ab6e0a1d2c13d59ae9e6f524
Reviewed-on: https://code.wireshark.org/review/4751
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-16 23:46:58 +00:00
Guy Harris f249589938 Just have get_mac_lte_rapid_description() return the description string.
If get_mac_lte_rapid_description() returned FALSE, we always used "" as
the description string; just have it return the string, or return "" if
rapid ranges haven't been configured, and just use the string.

(If the code ever needs to determine in other places whether rapid ranges
have been configured, it can check s_rapid_ranges_configured, or
get_mac_lte_rapid_description() could return NULL in that case and the
code using the string can check for a null value.)

This should squelch some incorrect used-but-not-set warnings from at
least one compiler.

Change-Id: I3ed495a4beb4a553e453e7bca764d1d8a07c5e53
Reviewed-on: https://code.wireshark.org/review/4750
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-16 23:04:26 +00:00
Guy Harris a517d500b4 Make sort_alphabet() not fail too badly with characters in [128,255].
Treat all values in the alphabet as unsigned.

Change-Id: I4476c75352f32673a9cd131ea233465f3376fa25
Reviewed-on: https://code.wireshark.org/review/4747
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-16 21:56:03 +00:00
Martin Kaiser aa1f2c5e4c use supported/unsupported for the bitfield elements
order them from MSB to LSB

Change-Id: Ie758285c2cf5d19e00d6d256c49acca15ce81168
Reviewed-on: https://code.wireshark.org/review/4746
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-10-16 21:25:36 +00:00
Martin Kaiser ee56b721bb smartcard descriptor: start a bitfield for the features
Change-Id: I636cfdfcd61d6d5dc041f9dbc657244d94e88b7f
Reviewed-on: https://code.wireshark.org/review/4745
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-10-16 21:24:58 +00:00
AndersBroman b64183285b GTPv2 in Complete Request Message call the NAS dissector with a tvb only
containing the IE not the rest of the tvb.

Change-Id: I3eead5047b4f8de47e280ac447c66b110592bccd
Reviewed-on: https://code.wireshark.org/review/4744
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-10-16 20:32:49 +00:00
Guy Harris 71a42e0fbc Oops, I missed one "cast a char to int and use it as a subscript" case.
Casting a signed char with a negative value to int will preserve the
value, so it'll still be a negative subscript.  Cast to guchar instead,
to make sure 0x80 through 0xFF are treated as 128 to 255, not -128 to
-1.

Change-Id: I1f0b33ba3686e963d45317b45465ff335431d17f
Reviewed-on: https://code.wireshark.org/review/4742
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-16 20:04:28 +00:00
Guy Harris f6bc6f957a Better fix - just check that the upper and lower nibbles are >= 0xA.
An unsigned 8-bit integer is always <= 0xFF; that was the cause of the
warning.

To see whether a byte, when represented as hex, has letters for its
upper and lower nibbles, just check whether both nibbles are >= 0xA.
Cast the extracted nibbles to make sure there's no sign-extension.

Change-Id: If4c7717a5d2fe341c02e9309ee6b89973a6ac292
Reviewed-on: https://code.wireshark.org/review/4739
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-16 19:08:19 +00:00
Dario Lombardo 7f74471229 Added italian translation to qt.
Change-Id: If58ed29e78a9994fc488a4d01cf665f7e8d82830
Reviewed-on: https://code.wireshark.org/review/4707
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-10-16 18:55:33 +00:00
Guy Harris 0db468e300 gchar is not guaranteed to be signed; use gint8.
C does not guarantee that char is signed (that's why there's a keyword
"signed").  Use gint8, to indicate that it's not a character, it's an
8-bit signed integer.

Change-Id: Id632df23352840cbc86a4d88f4c7dade95ab7837
Reviewed-on: https://code.wireshark.org/review/4736
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-16 18:44:30 +00:00
Guy Harris 50add40a2d Fix some more "char is unsigned" issues, and a possible "char is signed" one.
C neither guarantees that char is signed nor that it's unsigned.  Make
the str_to_nibble tables arrays of gint8, to make sure they can hold
numbers between 0 and 15 as well as -1.  Cast gchar to guchar, not int,
when using it as a subscript into that array, so that the subscripts are
in the range 0 to 255, not -128 to 127.

Change-Id: Ib85de5aa4e83ae9efd808c78ce3f86f45b4a3f2a
Reviewed-on: https://code.wireshark.org/review/4734
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-16 18:16:58 +00:00
Guy Harris 353f6258f9 Fix issues in some ARM compilers, due to char being unsigned?
I'm not 100% certain the comparisons were right even with signed char;
make the comparisons unsigned vs. unsigned, regardless of whether char
is signed or not.  (No, C doesn't require it to be signed; that's why
there's a "signed" keyword.)

Change-Id: Icbbd1019a2f7d4ebb40d821255834f825cd7c5a7
Reviewed-on: https://code.wireshark.org/review/4731
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-16 18:06:38 +00:00
Hannes Mezger 381966b6c4 Replace proto_tree_add_text in non-generated files
As requested by Michael Mann, most of the occurences of proto_tree_add_text/proto_item_add_subtree are replaced with proto_tree_add_subtree(_format) or proto_tree_add_item/proto_item_append_text in the non-generated files.

Change-Id: I27cccde88780adef43c78efd26333f47af098ad6
Reviewed-on: https://code.wireshark.org/review/4726
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-16 16:55:47 +00:00
Pascal Quantin 14b75d838d ETSI CAT: fix a typo and remove deprecated API call
Change-Id: I7df02d6a605ca0912c179caa04a405c5c18eb552
Reviewed-on: https://code.wireshark.org/review/4727
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-10-16 16:01:48 +00:00
Hannes Mezger a34b2526c6 Replace proto_tree_add_text with proto_tree_add_subtree(_format) in generated files
As requested by Michael Mann, all occurences of proto_tree_add_text/proto_item_add_subtree are replaced with proto_tree_add_subtree(_format) in the generated files. Our generator templates have also been updated accordingly.

Change-Id: I49ddd664dffef4b3ceda77edd1b2d7e01da363f3
Reviewed-on: https://code.wireshark.org/review/4725
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-16 14:47:58 +00:00
Guy Harris d347b7284f Don't try to compute time stamps for files from Packet Builder.
I don't trust Packet Builder's ability to convert time stamps between
Capsa format and pcap.

Change-Id: I0ac2e14216e37127d81d5bf1c6d48a2c20841a8e
Reviewed-on: https://code.wireshark.org/review/4721
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-16 10:01:57 +00:00
Guy Harris c74cefbfc9 Fix a debugging printout.
Change-Id: I06bc40bece3ea98578a252217c9de4748276a440
Reviewed-on: https://code.wireshark.org/review/4720
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-16 07:01:15 +00:00
Guy Harris 377a4865e3 Get rid of some set-but-no-longer-used variables.
Change-Id: Iaf7267b6ee3d4ab288c8ffa487f5de736bc4aead
Reviewed-on: https://code.wireshark.org/review/4719
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-16 06:54:23 +00:00
Guy Harris df8389559f Make sure *err and *err_info are set when returning PCAPNG_BLOCK_NOT_SHB.
Clean up a comment and indentation while we're at it.

Change-Id: Ia2b0a3f642849dcd464e04cdca13ff05c2fbe2e6
Reviewed-on: https://code.wireshark.org/review/4717
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-16 01:17:41 +00:00
Guy Harris 9cfab55200 The record offset block begins with a 1-byte(!) header.
Clean up the code to read the block according to that description.

Change-Id: Icb332e293c4b41d91989aa17a7546f298068e908
Reviewed-on: https://code.wireshark.org/review/4716
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-16 00:57:26 +00:00
Guy Harris fa8d236166 Get rid of another unused variable.
Change-Id: Id3e9bdd9308342460f84b5d4aeb13e9d6d52616c
Reviewed-on: https://code.wireshark.org/review/4715
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-16 00:20:03 +00:00
Guy Harris 7bca9126ed Don't allocate the interfaces array until we've read the SHB.
Nothing from the SHB gets stored in the interfaces array - it's filled
in from IDBs - so it doesn't need to exist when we read the first SHB,
and thus doesn't need to be freed if the attempt to read the SHB gets an
error or a "this isn't a pcap-ng file" indication.

Update a comment while we're at it.

Change-Id: Ie67edb52dcf13c974607e95e290661bf48be68ae
Reviewed-on: https://code.wireshark.org/review/4711
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-15 23:56:18 +00:00
Guy Harris f518089709 Clean up the read routines.
The block read routines don't need to return a "bytes read" amount any
more.

Have pcapng_read_block() just return an indication:

	PCAPNG_BLOCK_OK - the read succeeded;

	PCAPNG_BLOCK_NOT_SHB - the read failed in a fashion that
	    indicates that we might just not be reading a pcap-ng file;

	PCAPNG_BLOCK_ERROR - the read failed in some other fashion
	    (i.e., we already have concluded that the file is a pcap-ng
	    file, or we got an I/O error).

In the cases where it needs to know whether it's reading the first block
for an open, have it check the shb_read flag, rather than being passed a
separate Boolean argument.

This means that pcapng_read_section_header_block() should return such an
indication as well.

Make the other block-reading routines return a Boolean success/failure
indication.

Change-Id: Id371457018a008ece9058d6042da44d631e51889
Reviewed-on: https://code.wireshark.org/review/4710
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-15 23:46:41 +00:00
Michael Mann 371e4ae1c7 Eliminate some proto_tree_add_text from GSM dissectors (so now there are no dissectors with 100+ proto_tree_add_text calls).
Add tfs_allocated_by_receiver_sender to tfs.h because it seems "popular" enough.

Change-Id: I478461d9b951a2c3e3aec6aaf996d95ba2c0feee
Reviewed-on: https://code.wireshark.org/review/4708
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-10-15 19:16:37 +00:00
Dario Lombardo 9b7ee18f8b Typos in source code and in README.qt
Change-Id: I5aef31ef7ad604352f6e108835f0e9c2d10cdf8a
Reviewed-on: https://code.wireshark.org/review/4706
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-10-15 16:43:14 +00:00