Commit Graph

138 Commits

Author SHA1 Message Date
Guy Harris ff9f9fc431 Don't include "file.h" if you don't need it.
It ends up dragging in libwireshark headers, which programs not linking
with libwireshark shouldn't do.  In particular, including
<epan/address.h> causes some functions that refer to libwireshark
functions to be defined if the compiler doesn't handle "static inline"
the way GCC does, and you end up requiring libwireshark even though you
shouldn't require it.

Move plurality() to wsutil/str_util.h, so that non-libwireshark code can
get it without include epan/packet.h.  Fix includes as necessary.

Change-Id: Ie4819719da4c2b349f61445112aa419e99b977d3
Reviewed-on: https://code.wireshark.org/review/11545
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-04 08:46:30 +00:00
Alexis La Goutte 7fb514fe4d GSM (a_common): fix indent (replace tab by 8 spaces)
Change-Id: Id1d6bfcb04ac75d767fe6f09454dc8235de7bc75
Reviewed-on: https://code.wireshark.org/review/9928
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-08-10 08:31:18 +00:00
Alexis La Goutte 11e5422e71 GSM (a_common): fix no previous prototype for 'gsm_a_*_init' [-Wmissing-prototypes]
Change-Id: I2990cb3432ad377cbed7039ad8fe15019eb7e7f5
Reviewed-on: https://code.wireshark.org/review/9927
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-08-08 19:58:40 +00:00
Alexis La Goutte 524db99e30 GSM (a_common): fix comma at end of enumerator list [-Wpedantic]
Change-Id: I0ea06451861412b642d033a70e0a639aae753beb
Reviewed-on: https://code.wireshark.org/review/9926
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-08-08 19:58:06 +00:00
Gerald Combs ff24ecceb9 Fixup stat_tap table freeing.
As it turns out we *do* need to free table elements. We also need to
free the tables themselves and clear the table array. Do so.

Change-Id: Ic1c81388eac8f47f74caea0169c79685a83aaff9
Reviewed-on: https://code.wireshark.org/review/9901
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-06 21:22:13 +00:00
Gerald Combs ad4ab2a3f1 Convert the GSM A stats to new "generic stat API".
These are largely untested, but the two abis captures on the wiki seem
to work OK. The menu item names could also use some work. Patches
welcome.

Change-Id: I19a5b5fe3476b49d1dd0b684cbb7f367c6ebd4b4
Reviewed-on: https://code.wireshark.org/review/9869
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-04 23:22:29 +00:00
Pascal Quantin 5d8cb033b2 3GPP NAS: upgrade dissector to v12.10.0
Change-Id: Ia89e49d098f86450245c73c4d06a4359a25e3d53
Reviewed-on: https://code.wireshark.org/review/9444
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-07-01 19:20:15 +00:00
Pascal Quantin 89cd92d15f GSM A: force display of the bits sequence corresponding to "Degrees of longitude" field
It makes the display more consistent with other fields of Location Estimate IE

Bug: 11114
Change-Id: Ib31c61a34f419cf97601a660f3b807454b1becd9
Reviewed-on: https://code.wireshark.org/review/8049
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-04-13 13:44:38 +00:00
Alexis La Goutte 38a5fceefc GSM: Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: If10a9902c231b87995562fd0c687a25dcab3e250
Reviewed-on: https://code.wireshark.org/review/7910
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-04-04 15:45:59 +00:00
Pascal Quantin a6459ca125 3GPP NAS: upgrade dissector to v12.9.0
Change-Id: I6bffe7b5b95d72031df5aecac66129d2ceff517e
Reviewed-on: https://code.wireshark.org/review/7889
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-04-03 05:23:32 +00:00
Pascal Quantin e4e59eb065 3GPP NAS: display Short Element Identifier as it was done prior to ge74cb41
Change-Id: Ie001b420eb1fd29c8f5c941e69f4e2929250d887
Reviewed-on: https://code.wireshark.org/review/7885
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-04-03 05:22:04 +00:00
Michael Mann e74cb413b4 Remove proto_tree_add_text from GSM dissectors.
Change-Id: I72a7c1a44bda7755d8b1376dd5e57c46f137ff31
Reviewed-on: https://code.wireshark.org/review/7870
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>
2015-04-01 04:40:38 +00:00
AndersBroman 20e2c05d9b [E212]Modify dissect_e212_mcc_mnc() to take E212 number type as an
argument. While at it remove deprecated APIs

Change-Id: Ib1a7e9d7aeba6379fb4492816a0ac602e67493c6
Reviewed-on: https://code.wireshark.org/review/6534
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-14 13:37:14 +00:00
Michael Mann d1d5bf121e Replace proto_tree_add_text in dissector header files where it was used in a macro that should be expert info.
Change-Id: I045368a0a91586231fc4b1e2700c2275088b76af
Reviewed-on: https://code.wireshark.org/review/6244
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-02 22:11:34 +00:00
Martin Mathieson 48db2548a9 Deleting unneccessary #includes from dissectors.
Second batch (packet-eth.c -> packet-icmpv6.d).

Will look at cleaning up and committing script afterwards.

Change-Id: I14295758b81a59115d8c88899f166cc3d5d17594
Reviewed-on: https://code.wireshark.org/review/6013
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-23 12:22:54 +00:00
Bill Meier b5d7b7ab6e Cleanup use of #includes in non-generated epan/dissector/*.c
Specifically:
- Set packet.h to be the first wireshark #include after
   config.h and "system" #includes.
   packet.h added as an #include in some cases when missing.
- Remove some #includes included (directly/indirectly) in
   packet.h. E.g., glib.h.
   (Done only for those files including packet.h).
- As needed, move "system" #includes to be after config.h and
   before wireshark #includes.
- Rework various #include file specifications for consistency.
- Misc.

Change-Id: Ifaa1a14b50b69fbad38ea4838a49dfe595c54c95
Reviewed-on: https://code.wireshark.org/review/5923
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-21 05:46:22 +00:00
Pascal Quantin 70ca52c023 3GPP: upgrade 2G/3G NAS dissector to v12.7.0 and NAS EPS dissector to v12.6.0
Change-Id: I1e5bc5d28cb956b333c302b1cb18335b59d096a8
Reviewed-on: https://code.wireshark.org/review/5621
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-12-04 15:26:18 +00:00
Michael Mann ab8cad2816 Remove sccp_info member from packet_info structure.
sccp_msg_info_t* is now passed from SCCP dissector to its subdissectors through dissector data parameter.

Change-Id: Iab4aae58f8995e844f72e02e9f2de36e83589fc0
Reviewed-on: https://code.wireshark.org/review/5442
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-11-26 09:20:44 +00:00
Bill Meier 10406870f5 Add editor modelines; fix indentation as needed.
Change-Id: I1ad94654343e5a018a0b3159481d45ffb3a91263
Reviewed-on: https://code.wireshark.org/review/4363
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-29 13:47:02 +00:00
AndersBroman d7e4564321 Use dissect_e212_imsi() to dissect IMSI
fix offset in dissect_e212_mcc_mnc_in_address().

Change-Id: I68006ea3e2c79e2549e6f2d2c8a997e44fc3cdf1
Reviewed-on: https://code.wireshark.org/review/3722
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-08-19 15:47:24 +00:00
Michael Mann fe4b7ee625 convert to proto_tree_add_subtree[_format]
Change-Id: If110de1e0555637264f86f1508858d569871a9c7
Reviewed-on: https://code.wireshark.org/review/2675
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-29 13:10:02 +00:00
Pascal Quantin a8676c2fd7 Fix dissection of BCD numbers
Do not use of tvb_get_string(): what we really want is the byte string, not an ASCII string

Change-Id: I8b9a8b7ccacbdaf6d9525771ff8ed883ba01ad34
Reviewed-on: https://code.wireshark.org/review/329
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-02-23 22:41:45 +00:00
Evan Huus 8f665d9b36 Add a sixteenth element to all BCD digit sets to avoid garbage values when
decoding corrupt bytes. Some of these digit sets could probably be
deduplicated...

svn path=/trunk/; revision=54224
2013-12-18 15:54:32 +00:00
Jakub Zawadzki c45475ab45 Fix [-Wmissing-prototypes]
svn path=/trunk/; revision=54135
2013-12-15 23:44:12 +00:00
Bill Meier fae2172c83 Fix (presumably) a VS Code analysis warning:
C6385: Invalid data: accessing 'dgt->out', the readable size is '15' bytes, but '18' bytes might be read

Also: Do some trivial whitespace and formatting changes.

svn path=/trunk/; revision=54048
2013-12-13 14:56:39 +00:00
Jakub Zawadzki 1899903f69 Include <epan/to_str.h> only when needed.
svn path=/trunk/; revision=53189
2013-11-09 13:41:10 +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 a65045ec3f Code cleanup:
- remove some useless trees
- prettify the dissection of a few IEs
- use ELEM_MAND_VV_SHORT macro where applicable

svn path=/trunk/; revision=51741
2013-09-03 21:10:05 +00:00
Michael Mann a72fc72061 Batch of filterable expert info.
svn path=/trunk/; revision=51689
2013-09-03 02:26:50 +00:00
Pascal Quantin c82839c0a2 Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9085 :
GSM A-I/F DTAP - Detach Request - Detach type is not displayed

svn path=/trunk/; revision=51599
2013-08-30 17:23:36 +00:00
Pascal Quantin 84bf0acc00 Convert a few dissectors from EMEM to WMEM API
svn path=/trunk/; revision=51597
2013-08-30 14:49:55 +00:00
Jeff Morriss af793696a3 Replace some tabs with spaces.
svn path=/trunk/; revision=50674
2013-07-16 18:03:20 +00:00
Jeff Morriss 9bee5819f8 Fix the fuzz failure reported in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8940 :
Test whether idx is in range or not (by seeing if it was found in the
value_string) before using it as an index into any of the elem_var arrays.

This fuzz failure was in elem_telv() but apply the fix to all the elem_*()
functions.

svn path=/trunk/; revision=50672
2013-07-16 17:59:26 +00:00
Pascal Quantin ef942ca080 Upgrade NAS disssectors to v11.7.0
svn path=/trunk/; revision=50494
2013-07-10 21:31:22 +00:00
Chris Maynard 9c6325a069 Properly dissect lat and long according to 3GPP TS 23.032. Fix incorrect display filters for hf_gsm_a_geo_loc_deg_of_lat and hf_gsm_a_geo_loc_deg_of_long.
Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8532
#BACKPORT(1.6,1.8)

svn path=/trunk/; revision=48613
2013-03-28 14:23:07 +00:00
Pascal Quantin 1af56ab0c7 Upgrade NAS disssectors to v11.6.0
svn path=/trunk/; revision=48427
2013-03-19 20:47:48 +00:00
Pascal Quantin f904464fe9 Add a missing static
svn path=/trunk/; revision=48410
2013-03-18 22:58:36 +00:00
Pascal Quantin 86eda54fe6 As suggested by Evan Huus, use extended value_strings
svn path=/trunk/; revision=48407
2013-03-18 22:21:53 +00:00
Pascal Quantin 94f330030d use enum values instead of hardcoded values
(as suggested by Sylvain Munaut in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8487)

svn path=/trunk/; revision=48397
2013-03-18 20:26:47 +00:00
Pascal Quantin ae61fe0158 Try to fix dissection of GSM protocol family broken by r47209.
Using val_to_str seemed to be a good idea, but most value_string arrays were not properly filled or were using hacks.
(I hope I got everything right...)


svn path=/trunk/; revision=47218
2013-01-22 23:25:44 +00:00
Jaap Keuter 6a6aaf7409 Fix for CID 717414-717435.
Never ever access a string in a value string by its array index.
Use the proper access functions (val_to_str[_ext] and friends).

Also: make clean compile, so move out of dirty dissectors.

svn path=/trunk/; revision=47209
2013-01-22 07:18:20 +00:00
Anders Broman 54cb9e70ab Use tvb_bcd_dig_to_ep_str
svn path=/trunk/; revision=46858
2012-12-30 11:10:35 +00:00
Pascal Quantin 0b20f855f0 Upgrade NAS disssectors to v11.5.0
svn path=/trunk/; revision=46842
2012-12-29 17:10:04 +00:00
Guy Harris 8ed7a73e22 Fix a bunch of warnings.
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
sizeof.

Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
strtol() and strtoul().

Change some data types to avoid those implicit conversion warnings.

When assigning a constant to a float, make sure the constant isn't a
double, by appending "f" to the constant.

Constify a bunch of variables, parameters, and return values to
eliminate warnings due to strings being given const qualifiers.  Cast
away those warnings in some cases where an API we don't control forces
us to do so.

Enable a bunch of additional warnings by default.  Note why at least
some of the other warnings aren't enabled.

randpkt.c and text2pcap.c are used to build programs, so they don't need
to be in EXTRA_DIST.

If the user specifies --enable-warnings-as-errors, add -Werror *even if
the user specified --enable-extra-gcc-flags; assume they know what
they're doing and are willing to have the compile fail due to the extra
GCC warnings being treated as errors.

svn path=/trunk/; revision=46748
2012-12-26 05:57:06 +00:00
Bill Meier cd859fd85f Fix several purported [-Wshadow] warnings;
svn path=/trunk/; revision=46189
2012-11-25 22:16:22 +00:00
Anders Broman 7a4b359823 GSM classmark3 8-PSK decode error
proto_tree_add_bits_item() can't be called with a length value of -1.
Calculate the value, fixes BUG:
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7964

#BACKOPRT

svn path=/trunk/; revision=45980
2012-11-09 08:58:42 +00:00
Pascal Quantin 04ba20fa0e Upgrade NAS dissector to v11.4.0 (Release 11)
svn path=/trunk/; revision=45325
2012-10-04 21:23:06 +00:00
Jeff Morriss 2552c750e5 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45017
2012-09-20 02:03:38 +00:00