Commit Graph

74 Commits

Author SHA1 Message Date
Guy Harris 8195bdd340 Rename a bunch of things with "conversation".
A conversation in Wireshark might have two endpoints or might have no
endpoints; few if any have one endpoint.  Distinguish between
conversations and endpoints.
2022-08-25 20:02:20 -07:00
DarienSpencer65 f593c4165e AT: Implement CMGR command (binary mode) 2022-08-25 16:47:28 +00:00
DarienSpencer65 58ee7bf6ee AT: Implement CMGL command (binary mode) 2022-06-12 09:29:33 +00:00
Darien Spencer 8fd9d1d274 AT: Implementing a session context
Some AT commands and responses need context to be parsed correctly.
For example AT+CGMI's and AT+CGSN's responses are arbitrary strings
without "AT+" or "+" prefix (So saving the command is needed).
Another use case is when a command/response is followed by its data in
the following line, like AT+CGML (SMS content's listed in the line after
the "+CGML" line).

The implementation utilizes the USB conversation of the session to
pass information between packets.
Every new packets takes a 'snapshot' of the data stored in the conversation
before starting to parse and re-uses it when parsing & re-parsing of
that packet occurs.
2022-06-03 21:49:48 +00:00
Jaap Keuter adbaced04c Dissectors should not include stdio.h, unless needed 2021-12-05 12:45:46 +00:00
Stig Bjørlykke 11c6ed177f at: Fix typo in cme_error_vals
Also remove a leading space in at_type_vals.
2021-11-26 13:22:04 +00:00
David Perry 6e8c7283d6 Change some `wmem_packet_scope()` to `pinfo->pool` 2021-07-27 21:36:43 +00:00
Guy Harris 57a1514ac7 Cast away the return value of g_strlcpy() and g_strlcat().
Most of the time, the return value tells us nothing useful, as we've
already decided that we're perfectly willing to live with string
truncation.  Hopefully this keeps Coverity from whining that those
routines could return an error code (NARRATOR: They don't) and thus that
we're ignoring the possibility of failure (as indicated, we've already
decided that we can live with string truncation, so truncation is *NOT*
a failure).
2021-04-30 03:19:19 -07:00
Stig Bjørlykke 5413331ed3 AT: Handle response without leading \r\n
The AT response may not contain a leading \r\n, so avoid checking
for this to determine if it's a response. This characters will be
removed as a part of white space removal anyway.
2020-10-27 07:22:09 +00:00
Martin Mathieson b8a773dddc Fix some spelling errors in dissector strings.
A first batch of spelling errors, detected using a script that uses
pyspellcheck and a Wireshark-specific dictionary file.
2020-08-29 19:31:11 +00:00
Martin Kaiser 1fab12081d at: remove _U_ for a parameter which is used
This fixes a -Wused-but-marked-unused compiler warning.

Change-Id: I85d92954821feda80f1189a0e1b2c2071a25610a
Reviewed-on: https://code.wireshark.org/review/36702
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-05 08:29:50 +00:00
Darien Spencer 179901c269 AT: Add ZUSIM command
Change-Id: I691e8aa2277866f49bf93b33668b69b4662f6d75
Reviewed-on: https://code.wireshark.org/review/34774
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2019-10-14 13:21:17 +00:00
Guy Harris 20800366dd HTTPS (almost) everywhere.
Change all wireshark.org URLs to use https.

Fix some broken links while we're at it.

Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c
Reviewed-on: https://code.wireshark.org/review/34089
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-26 18:44:40 +00:00
Darien Spencer 1436ec11bb AT: Remove copy-pasted comment
Comment is about CME error, should be in ZPAS dissection func.

Change-Id: Iad2bc3de564374b23ca60053d227e02219c2a8c4
Reviewed-on: https://code.wireshark.org/review/33926
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2019-07-13 16:01:55 +00:00
Guy Harris 2c9db3edd3 Get rid of unused variable.
It's filled in, and modified, but never used after that.

Change-Id: Id5e1e9e5bc3223b04bd77f94117388ec8aa274d6
Reviewed-on: https://code.wireshark.org/review/33922
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-13 00:56:18 +00:00
Anders Broman 3a9c42ba8e Fix Wpointer-sign warnings.
Change-Id: I1ac6cfecf2ff4b12f75ed0214dc40983d3db3bc8
Reviewed-on: https://code.wireshark.org/review/33906
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-07-12 08:16:34 +00:00
Darien Spencer 09f0d853e3 AT: Add ZPAS Command
Change-Id: I557830fc960095359bebd05574890c5b5d51d3c7
Reviewed-on: https://code.wireshark.org/review/32997
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-05-17 07:54:16 +00:00
Gerald Combs 8d3ac3af86 epan: Convert our PROTO_ITEM_ macros to inline functions.
Convert our various PROTO_ITEM_ macros to inline functions and document
them.

Change-Id: I070b15d4f70d2189217a177ee8ba2740be36327c
Reviewed-on: https://code.wireshark.org/review/32706
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-04 04:03:38 +00:00
Gerald Combs 8c22c5bade Fix some spelling errors found by Lintian.
Change-Id: If6fc3aab7ad4fc634567121f7b9541bc6f6c5766
Reviewed-on: https://code.wireshark.org/review/30926
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-05 18:58:19 +00:00
Darien Spencer 9a40000182 AT: Add CSUPI command
Change-Id: I501bd0e00a20b39e4c53bdd7e5e2b9b3c5234469
Reviewed-on: https://code.wireshark.org/review/29635
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-09-12 21:57:45 +00:00
Darien Spencer 5c7dae1337 AT: Fix rejection values
Dissect functions for CNUM/VTS were returning TRUE for all wrong role/type combinations instead of FALSE ( = Rejecting the parameter )

Change-Id: I1aae5b76db83cef6b59f5244c05a67b2110f8969
Reviewed-on: https://code.wireshark.org/review/29634
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-09-12 19:38:57 +00:00
Darien Spencer 97c9dca72e AT: Add CMUX command
Change-Id: I35f53f15a35d6e13cac57ebb42c35c62b43cc32f
Reviewed-on: https://code.wireshark.org/review/29490
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2018-09-08 18:32:32 +00:00
Darien Spencer ac28cefcc5 AT: Fix CSQ checking for wrong action
Should allow ACTION_SIMPLY instead of ACTION

Change-Id: Ia56ee3e17fcc8a36bb41ca38200d19fca689f94b
Reviewed-on: https://code.wireshark.org/review/29489
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2018-09-08 18:31:22 +00:00
Darien Spencer 5f9a85c62f AT: Add GMI, GMM, GMR commands
Counterparts of CGMI, CGMM, CGMR

Change-Id: Icc99f48816fa421c3fbb681ab443b2b56457dd00
Reviewed-on: https://code.wireshark.org/review/29463
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-09-08 07:10:37 +00:00
Stig Bjørlykke b42348e251 AT: Fix dissector function return types
Change to return gboolean for dissector functions returning
TRUE or FALSE.

Change-Id: I418f765253326cd1153b82bd6af042c36cbfc2d4
Reviewed-on: https://code.wireshark.org/review/29446
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2018-09-06 10:57:17 +00:00
Stig Bjørlykke 555d911bb0 AT: Add CGMI and CGMR command
Change-Id: Ifc4f02fcd0def6280a62c0485389a5ca5a2c98d4
Reviewed-on: https://code.wireshark.org/review/29443
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-09-06 08:31:57 +00:00
Darien Spencer b62822055f AT: Add CSCS command
Change-Id: Idb4373d4a3bcdbcac99f1688d8a517bb1fbd0ffd
Reviewed-on: https://code.wireshark.org/review/29402
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-09-03 05:18:31 +00:00
Darien Spencer 3906a788cc AT: Add CPIN command
Change-Id: Ib92ceabf9699da0ee202a086d1a24464e552ebbd
Reviewed-on: https://code.wireshark.org/review/29279
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-26 19:14:04 +00:00
Darien Spencer 6f0e29054c AT: Correct dissection func for +CLAC
Change-Id: I2efc1151ce27138a4360c7dba75d916ecb8dc270
Reviewed-on: https://code.wireshark.org/review/29284
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-26 19:11:31 +00:00
Darien Spencer 3ba67f735d AT: Add CSQ command
Change-Id: I8e795710b04f9421e9b847f800f35552af46fa67
Reviewed-on: https://code.wireshark.org/review/29258
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-24 07:13:57 +00:00
Darien Spencer 78d7a1d3f7 AT: Clarify that a DCE is a Modem
Change-Id: I0216a67bc5a99877efc972d21e777c97c46546f5
Reviewed-on: https://code.wireshark.org/review/29267
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-24 03:53:28 +00:00
Darien Spencer 5673a58bfa AT: Fix suffix length checks, add no suffix case
Change-Id: I20a7e52635cf95ea1b5d1c85cd0ae6e8619ebff8
Reviewed-on: https://code.wireshark.org/review/29189
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-21 07:26:37 +00:00
Darien Spencer 4b4f644afc AT: Add CLAC command
Change-Id: I84dbc146fe4300e22dfed21572b97e57b449af54
Reviewed-on: https://code.wireshark.org/review/29186
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-19 06:45:34 +00:00
Darien Spencer 1b97441da0 AT: Add CGSN/GSN Commands
Change-Id: Ie383c0de07e4114f00e6c8833b6c18fcbaa4a07f
Reviewed-on: https://code.wireshark.org/review/29185
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-18 21:42:03 +00:00
Darien Spencer 46ea37d592 AT: Reorder commands dissection functions
Now in alphabetical order

Change-Id: I9c572e04e422cc595c66681ff77cd37a944383b9
Reviewed-on: https://code.wireshark.org/review/29171
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-17 13:00:51 +00:00
Darien Spencer a322cf7842 AT: Reorder commands dictionary
Now in alphabetical order

Change-Id: I28d863fc176518a2c26c417257f657f9d888ceb7
Reviewed-on: https://code.wireshark.org/review/29156
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-16 19:30:17 +00:00
Darien Spencer f3f4655655 AT: Add CFUN command
Change-Id: Ia2b69fa6c72a12ace5b27dc868c7853c2f8d7c52
Reviewed-on: https://code.wireshark.org/review/29151
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-16 09:51:38 +00:00
Darien Spencer 47860f05b4 AT: Add CPMS command
Change-Id: Idb4dd32849d1d1c64eab1c5f58e5b268aff43b04
Reviewed-on: https://code.wireshark.org/review/29006
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-11 15:30:19 +00:00
Darien Spencer ab47e8a52f AT: Add ^CIMI command
AT^CIMI is an alternative form for AT+CIMI for some modems

Change-Id: Id64fb4e0d76396400aa69fceeadba3a87ddf68e1
Reviewed-on: https://code.wireshark.org/review/29072
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-11 15:26:48 +00:00
Darien Spencer 93d50f542f AT: Allow more CMEE command types
Code was only allowing actions, while 'test', 'read' ,'action simply' and 'response'
are also possible

Change-Id: Iee84dd77912debe96a06f0b7d6b3e1f15527ce3b
Reviewed-on: https://code.wireshark.org/review/28997
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-08-07 20:13:22 +00:00
Darien Spencer 169962be43 AT: Fix check for numeric CME errors
Allow whitespaces in numeric error codes.

Change-Id: Id9baa2b8d90519f83ecba10f9cc479e15a932e3d
Reviewed-on: https://code.wireshark.org/review/28976
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-05 18:41:39 +00:00
Darien Spencer 93eaa1d648 AT: Add CIMI command
Change-Id: I7a03add8b48d0f360fbe5434fef866461804c2f3
Reviewed-on: https://code.wireshark.org/review/28940
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-08-05 09:43:46 +00:00
Peter Wu 114012dc4b AT: fix check for non-numeric CME errors
Fix the digit check, testing a pointer as character is an error.

Change-Id: I1ce2898dd1cca0b61bb2da342c81bc648fdb1cf2
Fixes: v2.9.0rc0-1356-g51c6fde9c7 ("AT: Distinguish between numeric and textual CME errors")
Reviewed-on: https://code.wireshark.org/review/28962
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-05 04:47:32 +00:00
Darien Spencer 4d650e7249 AT: Add CSIM command
Parse both commands and responses, including a call to GSM SIM dissector

Change-Id: I39624a1a088066aae6eb1e6fd61d4f73821b2345
Reviewed-on: https://code.wireshark.org/review/28959
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-05 04:46:41 +00:00
Darien Spencer 5c474bdef1 AT: Fix CME Error description
Leftover description form the BT-HFP dissector was classifying the DTE as an
Audio Gateway, which isn't always the case.

Change-Id: If6f916026bce00dc8783d95f48e449ffa9951d37
Reviewed-on: https://code.wireshark.org/review/28960
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-04 18:57:04 +00:00
Darien Spencer 98484f6428 AT: Allow test command for AT+CGMM
Change-Id: Ifbd6cb4dcfc4dee9b174eca60aaaac9de8968303
Reviewed-on: https://code.wireshark.org/review/28950
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-04 13:52:29 +00:00
Darien Spencer 51c6fde9c7 AT: Distinguish between numeric and textual CME errors
Change-Id: Ibf57da87f0ecd3a25461b333883ae8f84b3b4e31
Reviewed-on: https://code.wireshark.org/review/28951
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-04 13:49:04 +00:00
Alexis La Goutte 49aef5b061 at: Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
Change-Id: Ibe42807cfbf3ed57791d4f4beb8e95cc71ba39f4
Reviewed-on: https://code.wireshark.org/review/28942
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Darien Spencer <cusneud@mail.com>
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2018-08-04 07:51:56 +00:00
Darien Spencer d985188aa5 AT: Dissect commands
This commit introduces dissection of the different parts of the command,
showing of the command direction and origin entity, generic dissection of
'unsupported' commands, detailed dissection of several 'supported'
commands and aggregated commands dissection.

Most of the code has been taken from BT-HFP (A protocol of AT commands
over bluetooth).
Change-Id: I3516ec9c28581df8ef9c0c37f9b6ee9ec0c55938
Reviewed-on: https://code.wireshark.org/review/28699
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-01 05:48:06 +00:00
Darien Spencer 79a3829f4b AT: Allow padding in heuristic check
Bug: 14882
Change-Id: I0aa26d2ae898d47e0e33794f95e9c464cf5ec6f1
Reviewed-on: https://code.wireshark.org/review/28296
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-06-28 23:55:10 +00:00