aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-gsm_sms.c
AgeCommit message (Collapse)AuthorFilesLines
2017-10-15Remove superfluous null-checks before strdup/freeAhmad Fatoum1-3/+1
NULL checks were removed for following free functions: - g_free "If mem is NULL it simply returns" https://developer.gnome.org/glib/stable/glib-Memory-Allocation.html#g-free - g_slist_free(_full)? "NULL is considered to be the empty list" https://developer.gnome.org/glib/stable/glib-Singly-Linked-Lists.html - g_strfreev "If str_array is NULL, this function simply returns." https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html#g-strfreev - g_slice_free "If mem is NULL, this macro does nothing." https://developer.gnome.org/glib/stable/glib-Memory-Slices.html#g-slice-free - g_match_info_free "not NULL... otherwise does nothing" https://developer.gnome.org/glib/stable/glib-Perl-compatible-regular-expressions.html#g-match-info-free - dfilter_free defined in Wireshark code. Returns early when passed NULL epan/dfilter/dfilter.c They were also removed around calls to g_strdup where applicable: - g_strdup "If str is NULL it returns NULL." https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html#g-strdup Change-Id: Ie80c2db89bef531edc3aed7b7c9f654e1d654d04 Reviewed-on: https://code.wireshark.org/review/23406 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2017-10-10[GSM SMS] If the digits are E164 International number add an E.164AndersBroman1-1/+11
filter. Change-Id: Idcfa53d1db9e9f7b5501ca92592fb0fa0790ffe9 Reviewed-on: https://code.wireshark.org/review/23873 Reviewed-by: Anders Broman <a.broman58@gmail.com> Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-09-15epan: Fix misuse of comma operatorStig Bjørlykke1-9/+9
Change-Id: I349dc9896db0bd306bc92f92eb9d4a65d98d309c Reviewed-on: https://code.wireshark.org/review/23558 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-06-17gsm_sms: decode UCS2 as UTF-16Vasil Velichckov1-4/+12
Some phones (Android and iOS smartphones) encode emoji characters as UTF-16 big endian and although the UTF-16 is not specified in the 3GPP 23.038 (GSM 03.38) it seems to be widely supported Bug: 13808 Change-Id: Ic4a600e42fb4b471223aaef1a661bd002835b519 Reviewed-on: https://code.wireshark.org/review/22181 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-05gsm_sms: fix no previous prototype for ‘proto_reg_handoff_gsm_sms’ ↵Alexis La Goutte1-0/+1
[-Wmissing-prototypes] Change-Id: If580b059d6aae1d69ac32578674491205a7ae21d Reviewed-on: https://code.wireshark.org/review/21517 Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-04-30GSM SMS: use TCAP OTID as last resort for reassembly when GSM MAP does not ↵Pascal Quantin1-0/+2
give info Bug: 13592 Change-Id: Ie13e7466da906e72418c6f9d5ea6f816ff14e129 Reviewed-on: https://code.wireshark.org/review/21425 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2017-04-29GSM MAP: use TCAP OTID to retrieve SM-RP-OA and SM-RP-DA fields when requiredPascal Quantin1-9/+11
Bug: 13592 Change-Id: Ib8a0ff6d897699c44e5c4b8834123169066cf904 Reviewed-on: https://code.wireshark.org/review/21397 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-04-28GSM SMS: Use SIP To / From tapped addresses for reassemblyPascal Quantin1-10/+36
Ping-Bug: 13592 Change-Id: Ie07033972943ef38ca88bc0e82463ebccd281ce2 Reviewed-on: https://code.wireshark.org/review/21354 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>
2017-04-25GSM SMS: add more lower layer info for reassembly and switch preference to ↵Pascal Quantin1-9/+18
on by default Change-Id: I3faf15c326d14e246975094ad31431eba2404d8c Ping-Bug: 13592 Reviewed-on: https://code.wireshark.org/review/21320 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2017-04-25GSM SMS: fix display of reassembled 8 bits SMSPascal Quantin1-1/+1
Change-Id: I0052fb1f311f18180fbc7c6b8bd2fbf23215ad67 Reviewed-on: https://code.wireshark.org/review/21319 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2017-04-24GSM SMS: optionally use GSM-MAP info to perform reassembly (off by default)Pascal Quantin1-18/+43
Change-Id: I62c7a04e62167bd2d68d861f1d8d854f3159b159 Ping-Bug: 13592 Reviewed-on: https://code.wireshark.org/review/21306 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2017-04-12GSM SMS: also consider source and destination address for reassemblyPascal Quantin1-13/+35
Change-Id: I68ca00c970828311392565882bd7e4803df9818a Reviewed-on: https://code.wireshark.org/review/21032 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2017-04-11GSM SMS: take into consideration TP-OA/TP-DA fields and direction for reassemblyPascal Quantin1-16/+154
Bug: 13572 Change-Id: Ieb1b972f95bc5c445597dd9aa2a0d8e7e9985238 Reviewed-on: https://code.wireshark.org/review/21013 Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-02GHashtable -> wmem_map conversionsMichael Mann1-20/+6
Many of the register_init_routine/register_cleanup_routine functions are for initializing and cleaning up a GHashtable. wmem_map_new_autoreset can do that automatically, so convert many of the simple cases. Change-Id: I93e1f435845fd5a5e5286487e9f0092fae052f3e Reviewed-on: https://code.wireshark.org/review/19912 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com> Tested-by: Dario Lombardo <lomato@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-29Register reassembly tablesMichael Mann1-3/+4
Register all reassembly tables with a central unit, allowing the central unit to have the callback that initializes and destroys the reassembly tables, rather than have dissectors do it individually. Change-Id: Ic92619c06fb5ba6f1c3012f613cae14982e101d4 Reviewed-on: https://code.wireshark.org/review/19834 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-08-31Don't do any Decode As stuff for dissector tables not used with Decode As.Guy Harris1-1/+1
Have all dissector tables have a "supports Decode As" flag, which defaults to FALSE, and which is set to TRUE if a register_decode_as() refers to it. When adding a dissector to a dissector table with a given key, only add it for Decode As if the dissector table supports it. For non-FT_STRING dissector tables, always check for multiple entries for the same protocol with different dissectors, and report an error if we found them. This means there's no need for the creator of a dissector table to specify whether duplicates of that sort should be allowed - we always do the check when registering something for "Decode As" (in a non-FT_STRING dissector table), and just don't bother registering anything for "Decode As" if the dissector table doesn't support "Decode As", so there's no check done for those dissector tables. Change-Id: I4a1fdea3bddc2af27a65cfbca23edc99b26c0eed Reviewed-on: https://code.wireshark.org/review/17402 Petri-Dish: Guy Harris <guy@alum.mit.edu> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-04-23ETSI CAT: add dissection of Information Elements coded as EFadnPascal Quantin1-1/+18
While we are at it, fix decoding of STK packed SMS Change-Id: I2de757f1720381c75f23f3ee6043ac56813db658 Reviewed-on: https://code.wireshark.org/review/15054 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-17Associate dissector tables and heuristic subdissector lists with a protocol.Michael Mann1-1/+1
This will make it easier to determine protocol dependencies. Some LLC OUI dissector tables didn't have an associated protocol, so they were left without one (-1 used) Change-Id: I6339f16476510ef3f393d6fb5d8946419bfb4b7d Reviewed-on: https://code.wireshark.org/review/14446 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-02-08GSM SMS: fix dissection of alphanumeric addressPascal Quantin1-4/+4
Change-Id: I5d6f3c78b99979376243f722161b3ae25adad230 Reviewed-on: https://code.wireshark.org/review/13830 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-01-24Add the packet number to the packet_info structure, and use it.Guy Harris1-5/+5
That removes most of the uses of the frame number field in the frame_data structure. Change-Id: Ie22e4533e87f8360d7c0a61ca6ffb796cc233f22 Reviewed-on: https://code.wireshark.org/review/13509 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-21GSM SMS: add dissection of Special SMS Message Indication IEPascal Quantin1-1/+75
Change-Id: I154c3b4c4ef7dd3a243c9df003df01807b45c095 Reviewed-on: https://code.wireshark.org/review/13475 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-12-09new_register_dissector -> register_dissector for dissector directory.Michael Mann1-1/+1
Change-Id: Ie39ef054a4a942687bd079f3a4d8c2cc55d5f22c Reviewed-on: https://code.wireshark.org/review/12485 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-29GSM SMS: fix reassembly of UCS2 encoded SMSPascal Quantin1-35/+14
Bug: 11809 Change-Id: I5cbf43cbc9d0f33fa527aef1be4d5105f1d795a7 Reviewed-on: https://code.wireshark.org/review/12288 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-11-04Don't allow multiple registrations of a protocol in dissector tables.Michael Mann1-1/+1
The target here is the Decode As dialog where protocols have multiple registrations into a dissector table and that shows up as multiple entries in the Decode As dialog list with the same name so users are unsure which "dissector" they are choosing. The "default" behavior (done in this commit) is to not allow duplicates for a dissector table, whether its part of Decode As or not. It's just ENFORCED for Decode As. Bug: 3949 Change-Id: Ibe14fa61aaeca0881f9cc39b78799e314b5e8127 Reviewed-on: https://code.wireshark.org/review/11405 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-21GSM SMS: do not call GSM SMS port IE subdissectors until message is reassembledPascal Quantin1-5/+8
Change-Id: Ibf384c01a1d3283e36b87a3d84e6c256341b8664 Reviewed-on: https://code.wireshark.org/review/11190 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-07-03Call reassembly_table_destroy and move g_hash_table_destroyPeter Wu1-3/+8
This patch moves g_hash_table_destroy calls from the init routine to the cleanup routine. Besides that, the conditional check for the hash table has been removed, assuming that init is always paired with a cleanup call. If reassembly_table_init is found, a reassembly_table_destroy call is prepended to the cleanup function as well. Comments have been removed from the init function as well as these did not seem to have additional value ("destroy hash table" is clear from the context). The changes were automatically generated using https://git.lekensteyn.nl/peter/wireshark-notes/diff/one-off/cleanup-rewrite.py?id=4d11f07180d9c115eb14bd860e9a47d82d3d1dcd Manually edited files (for assignment auditing): dvbci, ositp, sccp, tcp. Other files that needed special attention due to the use of register_postseq_cleanup_routine: - ipx: keep call, do not add another cleanup routine. - ncp: remove empty mncp_postseq_cleanup. mncp_hash_lookup is used even if a frame is visited before (see dissect_ncp_common), hence the hash table cannot be destroyed here. Do it in cleanup instead. - ndps: add cleanup routine to kill reassembly table, but do not destroy the hash table as it is already done in ndps_postseq_cleanup. Change-Id: I95a72b3df2978b2c13fefff6bd6821442193d0ed Reviewed-on: https://code.wireshark.org/review/9223 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-05-20GSM SMS: update some (value|range)_string tables for MTC Device Trigger featurePascal Quantin1-4/+6
Change-Id: Iffc62744310688d2f5f4d6689ff2f9d96fd4f6f1 Reviewed-on: https://code.wireshark.org/review/8552 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-03-07GSM SMS: minor fixes to DELIVER, DELIVER REPORT and STATUS_REPORT dissectionPascal Quantin1-1/+13
Change-Id: I9bf3b0529e353ff9c2e936e75e86fffae17506fd Reviewed-on: https://code.wireshark.org/review/7579 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-01-02Replace proto_tree_add_text in dissector header files where it was used in a ↵Michael Mann1-10/+0
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>
2014-12-23Deleting unneccessary #includes from dissectors.Martin Mathieson1-2/+0
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-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-4/+0
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-14GSM SMS: fix dissection of Character Set IEPascal Quantin1-29/+14
Also do not display a 8bits data SMS as an expert error Those 2 points led me to a wrong analysis yesterday Change-Id: Ib319e2ef8f0e7297cd2e119b6d0d98638e6a3d61 Reviewed-on: https://code.wireshark.org/review/5763 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-12-13gsm_sms: Use ENC_BIG_ENDIAN when fetching FT_U?INT8 fieldsBill Meier1-47/+47
Change-Id: If41cf6c10e4af8554cd8f6a69bd8654ad7262c85 Reviewed-on: https://code.wireshark.org/review/5749 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-13GSM SMS: fix 'msg_class' may be used uninitialized in this function warningPascal Quantin1-3/+2
Change-Id: Ie1c53929df2dfec1b4935ca1088f375c666d3b36 Reviewed-on: https://code.wireshark.org/review/5746 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-12-13fix compile errorMartin Kaiser1-1/+1
packet-gsm_sms.c: In function 'dis_field_dcs': packet-gsm_sms.c:694:12: error: 'msg_class' may be used uninitialized in this function [-Werror=maybe-uninitialized] cc1: all warnings being treated as errors make[5]: *** [libdissectors_la-packet-gsm_sms.lo] Error 1 I suppose that 0xff is an invalid message class and therefore a reasonable default value. Change-Id: Iab3d3f50144b24bee4972063c2170d7a9f9b7c25 Reviewed-on: https://code.wireshark.org/review/5745 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-12-13GSM SMS: fix (U)SIM Data Download Class 2 dissectionPascal Quantin1-7/+27
Change-Id: Id4ea574e34c0bd35bc757fdc68d0e6b72129ef04 Reviewed-on: https://code.wireshark.org/review/5744 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-10-04GSM-SMS: Fix Dead Store (Dead assignement/Dead increment) warning found by ClangAlexis La Goutte1-3/+0
Change-Id: If0700726bf9a7359313d0cb69d959471c0ea9580 Reviewed-on: https://code.wireshark.org/review/4463 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-10-01GSM SMS: follow-up of gd65b7d5Pascal Quantin1-55/+54
Change-Id: I221e1411501e7c15eafe43e109f478684fa5ef10 Reviewed-on: https://code.wireshark.org/review/4408 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-10-01Eliminate proto_tree_add_text from GSM_SMS dissector.Michael Mann1-1492/+1172
Change-Id: Ibe189239735da2ebb1b0ce61a5af249975b38be3 Reviewed-on: https://code.wireshark.org/review/4402 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-06-29convert to proto_tree_add_subtree[_format]Michael Mann1-42/+18
Change-Id: If110de1e0555637264f86f1508858d569871a9c7 Reviewed-on: https://code.wireshark.org/review/2675 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19Revert "Fixup: tvb_* -> tvb_captured"Michael Mann1-12/+12
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html This reverts commit 246fe2ca4c67d8c98caa84e2f57694f6322e2f96. Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f Reviewed-on: https://code.wireshark.org/review/2430 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-18Fixup: tvb_* -> tvb_capturedDario Lombardo1-12/+12
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f Reviewed-on: https://code.wireshark.org/review/2377 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-19Add new proto_tree_add_format_text() functionJakub Zawadzki1-2/+1
There are lot of text dissectors which want just to add escaped (not filtrable) text, add new function proto_tree_add_format_text() which just do this in optimized way. Change-Id: Ia0e189b620cc0a5b74cfdaef1ad4571d766bb2ab Reviewed-on: https://code.wireshark.org/review/1678 Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Evan Huus <eapache@gmail.com>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(Using sed : sed -i '/^ \* \$Id\$/,+1 d') Fix manually some typo (in export_object_dicom.c and crc16-plain.c) Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8 Reviewed-on: https://code.wireshark.org/review/497 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-01-14UCS2 encoded SMS is directly read from data -> remove PROTO_ITEM_SET_GENERATED()Pascal Quantin1-8/+5
svn path=/trunk/; revision=54783
2014-01-01Add proto_tree_add_ts_23_038_7bits_item() / tvb_get_ts_23_038_7bits_string() ↵Pascal Quantin1-185/+8
functions and update dissectors to use it. Remove gsm_sms_char_7bit_unpack() / gsm_sms_chars_to_utf8() functions. Update documentation a bit. svn path=/trunk/; revision=54534
2013-12-21Add missing includesJakub Zawadzki1-0/+1
svn path=/trunk/; revision=54332
2013-12-19Use tvb_get_string_enc(), or proto_tree_add_item(), rather thanGuy Harris1-52/+33
tvb_get_unicode_string() or g_iconv stuff. svn path=/trunk/; revision=54244
2013-12-17Comment a useless incrementPascal Quantin1-1/+1
svn path=/trunk/; revision=54173
2013-12-15Fix [-Wmissing-prototypes]Jakub Zawadzki1-6/+2
svn path=/trunk/; revision=54135