aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorDarien Spencer <cusneud@mail.com>2018-09-02 22:33:26 +0300
committerAnders Broman <a.broman58@gmail.com>2018-09-03 05:18:31 +0000
commitb62822055f2b71d9b8e2f9d46c629ccbd744e8ee (patch)
tree8fb2a1abdca6388cc436b5717cf9439cc81f778d /epan
parent094297ec77a28a38310d9449cd4f700163434022 (diff)
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>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-at.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/epan/dissectors/packet-at.c b/epan/dissectors/packet-at.c
index 41233821c5..e31f933f34 100644
--- a/epan/dissectors/packet-at.c
+++ b/epan/dissectors/packet-at.c
@@ -72,6 +72,7 @@ static int hf_cpms_used3 = -1;
static int hf_cpms_total1 = -1;
static int hf_cpms_total2 = -1;
static int hf_cpms_total3 = -1;
+static int hf_cscs_chset = -1;
static int hf_csim_command = -1;
static int hf_csim_length = -1;
static int hf_csim_response = -1;
@@ -603,6 +604,13 @@ static gboolean check_cpms(gint role, guint16 type) {
return FALSE;
}
+static gboolean check_cscs(gint role, guint16 type) {
+ if (role == ROLE_DTE && (type == TYPE_ACTION || type == TYPE_READ || type == TYPE_TEST)) return TRUE;
+ if (role == ROLE_DCE && type == TYPE_RESPONSE) return TRUE;
+
+ return FALSE;
+}
+
static gboolean check_csim(gint role, guint16 type) {
if (role == ROLE_DTE && (type == TYPE_ACTION || type == TYPE_TEST)) return TRUE;
if (role == ROLE_DCE && type == TYPE_RESPONSE) return TRUE;
@@ -1257,6 +1265,26 @@ dissect_cpms_parameter(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
}
static gint
+dissect_cscs_parameter(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
+ gint offset, gint role, guint16 type, guint8 *parameter_stream _U_,
+ guint parameter_number, gint parameter_length, void **data _U_)
+{
+ if (!((role == ROLE_DTE && type == TYPE_ACTION) ||
+ (role == ROLE_DCE && type == TYPE_RESPONSE))) {
+ return FALSE;
+ }
+
+ if (parameter_number > 0) {
+ return FALSE;
+ }
+
+ /* For both ACTION and RESPONSE the first
+ * and only parameter is the character set */
+ proto_tree_add_item(tree, hf_cscs_chset, tvb, offset, parameter_length, ENC_NA | ENC_ASCII);
+ return TRUE;
+}
+
+static gint
dissect_csim_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
gint offset, gint role, guint16 type, guint8 *parameter_stream,
guint parameter_number, gint parameter_length, void **data)
@@ -1412,6 +1440,7 @@ static const at_cmd_t at_cmds[] = {
{ "+COPS", "Reading Network Operator", check_cops, dissect_cops_parameter },
{ "+CPIN", "Enter SIM PIN", check_cpin, dissect_cpin_parameter },
{ "+CPMS", "Preferred Message Storage", check_cpms, dissect_cpms_parameter },
+ { "+CSCS", "Select TE Character Set", check_cscs, dissect_cscs_parameter },
{ "+CSIM", "Generic SIM access", check_csim, dissect_csim_parameter },
{ "+CSQ", "Signal Quality", check_csq, dissect_csq_parameter },
{ "+GSN", "Request Product Serial Number Identification (ESN/IMEI)", check_gsn, dissect_no_parameter },
@@ -2071,6 +2100,11 @@ proto_register_at_command(void)
"Amount of messages in the receive memory storage",
HFILL}
},
+ { &hf_cscs_chset,
+ { "Character Set", "at.cscs.chset",
+ FT_STRING, BASE_NONE, NULL, 0,
+ NULL, HFILL}
+ },
{ &hf_csim_command,
{ "Command", "at.csim.command",
FT_STRING, BASE_NONE, NULL, 0,