Commit graph

236 commits

Author SHA1 Message Date
Guy Harris
1b046b76f3 The UMTS GTP QoS Profile is a UTF-8-encoded string.
So use tvb_get_string_enc() with ENC_UTF_8|ENC_NA.

Use tvb_reported_length() while we're at it.

Change-Id: I75bfa9abb23ca411dca5844dd56fe062d16319e0
Reviewed-on: https://code.wireshark.org/review/380
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-02-25 19:00:03 +00:00
Bill Meier
93fe4d53e2 Remove trailing whitespace.
Change-Id: Ia03a1cd4590aceda30ead4aa93ad413d90c6aea6
Reviewed-on: https://code.wireshark.org/review/372
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-02-25 16:36:38 +00:00
Pascal Quantin
92a369eaf4 Remove a few wrong use of tvb_get_string()
Change-Id: I7095e12439fd8c0c5cd3ce14d19662efa3fd841f
Reviewed-on: https://code.wireshark.org/review/339
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-02-25 07:47:57 +00:00
Evan Huus
953c3ef517 Fix dissection of GTP MM Context RAND field.
As suggested by Lükő Bálint to fix bug #9722.

Change-Id: I177f7632a0936f105b1acff5e7c20bcce2328957
Reviewed-on: https://code.wireshark.org/review/109
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-02-04 15:42:01 +00:00
Jakub Zawadzki
d28084d183 Move UAT xton() to wsutil library
Use ws_xton() in few more places.

svn path=/trunk/; revision=54642
2014-01-08 00:28:13 +00:00
Jakub Zawadzki
deb2b236f2 Add missing includes
svn path=/trunk/; revision=54332
2013-12-21 17:23:17 +00:00
Evan Huus
a6415ece0a Rename a couple of to_str functions to have ep_ in the name. This makes it
obvious that the returned string is ephemeral, and opens up the original names
in the API for versions that take a wmem pool (and thus can work in any scope).

svn path=/trunk/; revision=54249
2013-12-19 15:49:09 +00:00
Jakub Zawadzki
c45475ab45 Fix [-Wmissing-prototypes]
svn path=/trunk/; revision=54135
2013-12-15 23:44:12 +00:00
Guy Harris
ce7b83123c No C++/C99 comments, as not all compilers handle them. Use #if 0/#endif
instead.

svn path=/trunk/; revision=53734
2013-12-02 21:18:25 +00:00
Martin Mathieson
a9bd097e71 Start teid_data field from the correct offset
svn path=/trunk/; revision=53688
2013-12-01 08:52:06 +00:00
Martin Mathieson
73f042aa35 Fix number of selected bytes for gtp.teid_data. Also remove some stray tabs and unneeded _U_
svn path=/trunk/; revision=53649
2013-11-29 17:42:08 +00:00
Anders Broman
88d0e909a2 From Katrina Zhang:
Add/fix RFSP dissection.

svn path=/trunk/; revision=53163
2013-11-08 05:58:13 +00:00
Bill Meier
0ad98563a2 From didier gautheron: remove redundant or use faster col_xxx functions
- when the text parameter is constant col_add_str() and col_set_str() are equivalent but col_set_str() is faster.
- same for  replace col_append_fstr and col_append_str
- remove col_clear() when it's redundant:
    + before a col_set/col_add if the dissector can't throw an exception.
- replace col_append() after a col_clear() with faster col_add... or col_set

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


svn path=/trunk/; revision=52948
2013-10-29 14:09:20 +00:00
Bill Meier
fbba4415a6 FIX compiler warning:
packet-gtp.c: In function 'dissect_gtp_common':
  packet-gtp.c:7838: warning: unused variable 'pd_save'

svn path=/trunk/; revision=52932
2013-10-28 20:37:58 +00:00
Michael Mann
e68d15514b Add an extra parameter to gtp_match_response() so pinfo->private_data doesn't need to be used.
svn path=/trunk/; revision=52930
2013-10-28 20:00:04 +00:00
Bill Meier
a3a15ff90b Remove instances of unused 'data_handle' (and of one other handle).
svn path=/trunk/; revision=52767
2013-10-22 16:13:32 +00:00
Bill Meier
2ac134b3c5 whitespace fixes; mostly: remove trailing blanks
svn path=/trunk/; revision=52591
2013-10-13 19:56:52 +00:00
Pascal Quantin
102c452bcb More emem -> wmem conversion:
- tvb_get_g_stringz()/tvb_get_ephemeral_stringz()/tvb_get_seasonal_stringz() -> tvb_get_stringz()
- tvb_get_g_stringz_enc()/tvb_get_ephemeral_stringz_enc() -> tvb_get_stringz_enc()
- tvb_get_ephemeral_unicode_stringz() -> tvb_get_unicode_stringz()
- tvb_bcd_dig_to_ep_str() -> tvb_bcd_dig_to_wmem_packet_str()
- update docs accordingly

svn path=/trunk/; revision=52180
2013-09-22 20:04:35 +00:00
Pascal Quantin
a0c53ffaa1 emem -> wmem conversion:
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits()
- tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup()
- tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode()
- tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string()
- tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string()
- tvb_get_ephemeral_string_enc() -> tvb_get_string_enc()
- update docs accordingly

svn path=/trunk/; revision=52172
2013-09-22 15:50:55 +00:00
Pascal Quantin
868b345eea Convert a few more dissectors to wmem API
svn path=/trunk/; revision=52053
2013-09-15 10:29:49 +00:00
Michael Mann
b38ee917b1 Convert proto_tree_add_uint_format to proto_tree_add_uint_format_value if hf_ field name is the first part of the formatted string. This was done with a perl script on the dissectors directory (packet-*.c), followed by manual inspection of the output. The manual inspection yielded a few cases that really should have been proto_tree_add_uint or proto_tree_add_item, so I updated them accordingly.
The script didn't catch as many as I would have liked, but it's a start.

The most common (ab)use of proto_tree_add_uint_format was for appending strings to CRC/checksum values to note good or bad CRC/checksum.

svn path=/trunk/; revision=52045
2013-09-15 01:48:30 +00:00
Anders Broman
60aaa2d842 Change the default preference on how to dissect dunneled data to GTP_TPDU_AS_TPDU.
svn path=/trunk/; revision=51917
2013-09-10 05:47:28 +00:00
Michael Mann
9e3f9b449f expert_add_info_format_text -> expert_add_info_format
svn path=/trunk/; revision=51852
2013-09-09 00:44:09 +00:00
Anders Broman
f5b85d81d0 From Katrina Zhang:
Fix QoS dissection.

svn path=/trunk/; revision=51752
2013-09-04 18:11:21 +00:00
Michael Mann
5405b34469 Batch of filterable expert info.
svn path=/trunk/; revision=51688
2013-09-02 23:32:31 +00:00
Pascal Quantin
519a7778aa Fix copy/paste error introduced in r51541 and spotted by Joerg
svn path=/trunk/; revision=51564
2013-08-28 17:31:12 +00:00
Jörg Mayer
57b9b11e40 Comment out a line that seems to do nothing.
** CID 1068812: Unused pointer value (UNUSED_VALUE)

svn path=/trunk/; revision=51560
2013-08-28 10:47:23 +00:00
Pascal Quantin
22c5585547 Add a DRX subtree to GTP dissector now that the subtree (useless for NAS and EPS NAS dissectors) was removed from de_gmm_drx_param in r51537
svn path=/trunk/; revision=51541
2013-08-27 19:38:35 +00:00
Anders Broman
266e577aee Update to handle version 9.
svn path=/trunk/; revision=50981
2013-07-28 19:25:14 +00:00
Anders Broman
c6af00a977 From jamie Neufeld:
Add an option to selct if payload is to be dissected as SYNC.

svn path=/trunk/; revision=49595
2013-05-27 16:27:50 +00:00
Anders Broman
b8618947bd Add missing element NSAP to IE Evolved Allocation/Retention Priority II.
svn path=/trunk/; revision=49474
2013-05-21 05:08:50 +00:00
Anders Broman
68f0af8b03 Set pinfo->link_dir per message not in the IE dissection.
svn path=/trunk/; revision=48873
2013-04-16 05:42:17 +00:00
Evan Huus
37600a157b Rename value string (and similar) functions to use a consistent pattern. This
was done using textual search+replace, not anything syntax-aware, so presumably
it got most comments as well (except where there were typos).

Use a consistent coding style, and make proper use of the WS_DLL_* defines.

Group the functions appropriately in the header.

I ended up getting rid of most of the explanatory comments since many of them
duplicated what was in the value_string.c file (and were out of sync with the
recent updates I made to those in r48633). Presumably most of the comments
should be in the .h file not the .c file, but there's enough churn ahead that
it's not worth fixing yet.

Part of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8467

svn path=/trunk/; revision=48634
2013-03-29 00:26:23 +00:00
Anders Broman
6bde918078 From beroset:
remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48426
2013-03-19 20:00:52 +00:00
Guy Harris
9bfeb4963f Make the GTP and GTP' dissectors new-style dissectors, so that they can
reject packets that don't look enough like GTP/GTP' packets.  This fixes
bug 1706, and fixes some other cases where non-GTP/GTP' packets are
being dissected as GTP/GTP'.

svn path=/trunk/; revision=48118
2013-03-06 00:02:18 +00:00
Guy Harris
9b01892eca Use hf_gtp_ext_hdr_next for all "next header" fields, and get rid of
hf_gtp_next.

Don't do "dummy" dissection of extension headers that we don't actually
dissect - we label them by next extension header type, and dissect them
in the default case, which should suffice (until somebody adds
dissection for those types).

svn path=/trunk/; revision=48075
2013-03-05 00:17:56 +00:00
Guy Harris
958574da78 If the length value is bad, an exception will be thrown; we don't need
the item for the length, as we aren't explicitly checking it and
attaching expert info items to it.

svn path=/trunk/; revision=48070
2013-03-04 22:01:29 +00:00
Guy Harris
029c5bdbac Give 3GPP TS numbers for GTP v0, GTP v1, and GTP'.
Give URLs for the 3gpp.org pages for all those specs.

Add #defines for all the GTP v1 extension header types we handle.

"gtp_prime" is a Boolean; make it a gboolean.

Dissect the first 4 octets of the header one field at a time, so that if
the packet is cut short by a snapshot length we at least dissect what's
there.

32.295 isn't entirely clear on what the 20-byte header for GTP' v0 is;
assume it's the same as the header for GTP v0.

Once we've fetched the length field from the fixed-length portion of the
header, set the length of the tvbuff to the sum of the offset past the
fixed-length portion and the length field, to catch running past that
value.

Use GTP_E_MASK|GTP_S_MASK|GTP_PN_MASK as the mask for testing for the
presence of those fields, to make it a bit clearer what's being checked
for.

Don't actually add those fields to the protocol tree unless the flag for
the field is set.

We only need one chunk of code to handle extension headers.

Make that chunk a loop, and put the header in as an FT_NONE item, with
the length, header data, and next header under it.  Put the initial next
header field in as well.  (We treat this like IPv6 extension headers,
with the next header field being part of the previous header, rather
than like a set of TLVs, with the next header field being the type value
of its header.)

Fail if the extension header length is zero.

Use the reported length when processing IEs or T-PDU payload.

svn path=/trunk/; revision=48068
2013-03-04 21:40:36 +00:00
Pascal Quantin
240af26981 Fix a copy/paste error and factorize dissection of extension header length and next extension header
svn path=/trunk/; revision=48007
2013-03-02 13:12:24 +00:00
Anders Broman
599d2e8a9c From Lakshmi Narayana Madala :
GTP dissector enhanced to support UDP Port extension header.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8418

svn path=/trunk/; revision=48004
2013-03-02 11:33:46 +00:00
Anders Broman
e2d3294617 From Katrina Zhang sligtly modified.
- Add dissection of Selected PLMN ID.
- Put enterpice id in the tree
- Filter for UTRAN Transparent Field.

svn path=/trunk/; revision=47252
2013-01-24 09:59:06 +00:00
Pascal Quantin
ccbff26e80 Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8196 :
Add dissection of IPv4v6 type to End User Address IE

svn path=/trunk/; revision=47047
2013-01-13 11:04:46 +00:00
Pascal Quantin
d4cf9ce69a Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8193 :
Add dissection of Dual Address Bearer Flag bit in Common Flags IE

svn path=/trunk/; revision=47036
2013-01-11 20:18:32 +00:00
Anders Broman
433d9c198d Only the private extension IE value part should go in the tvb.
svn path=/trunk/; revision=46996
2013-01-08 09:57:10 +00:00
Anders Broman
be1ff84f48 From Katrina Zhang:Pretify dissection if a dissector exists for the private extension
svn path=/trunk/; revision=46857
2012-12-30 09:35:27 +00:00
Anders Broman
39c816931c Copy-paste error.
svn path=/trunk/; revision=46538
2012-12-14 11:54:35 +00:00
Anders Broman
eba8fb9328 From Martin Isaksson:
- Initiiate GTP header to zero.
- Dont' load TEID unconditionaly, it might not be present.

svn path=/trunk/; revision=46537
2012-12-14 11:27:38 +00:00
Anders Broman
2f827154f8 Bug 3974 - wrong decoding of gtp.target identification.
Use the IE description from 3GPP TS 29.060 version 10.4.0 Release 10.
- Fix bugs with RAI and LAC in other parts of the code.

svn path=/trunk/; revision=46439
2012-12-07 12:06:40 +00:00
Anders Broman
49307fcedc High light bytes including the first lenght byte in the APN name.
svn path=/trunk/; revision=45856
2012-11-01 08:24:08 +00:00
Anders Broman
0c24f376ca The GTP dissector can't handle long APN names, max is 100.
Bug https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7932

svn path=/trunk/; revision=45852
2012-10-31 16:53:39 +00:00