aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors
diff options
context:
space:
mode:
authorDavid Perry <boolean263@protonmail.com>2023-03-07 13:34:34 +0000
committerGilbert Ramirez <gilbertr@gmail.com>2023-03-07 13:34:34 +0000
commit808fcd3c2b9a2df9afcdd3e3b11a7014d03c4561 (patch)
tree378c86bf77f9c36f0bafb9675cccf21434f6b019 /epan/dissectors
parent248ee51e362f757a2b79b6495e44bbbb335ea4b0 (diff)
SMPP: Add command/response field
Diffstat (limited to 'epan/dissectors')
-rw-r--r--epan/dissectors/packet-smpp.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/epan/dissectors/packet-smpp.c b/epan/dissectors/packet-smpp.c
index 52e03c7846..2835573b83 100644
--- a/epan/dissectors/packet-smpp.c
+++ b/epan/dissectors/packet-smpp.c
@@ -74,6 +74,8 @@ static int st_smpp_res = -1;
static int st_smpp_res_status = -1;
static int hf_smpp_command_id = -1;
+static int hf_smpp_command_request = -1;
+static int hf_smpp_command_response = -1;
static int hf_smpp_command_length = -1;
static int hf_smpp_command_status = -1;
static int hf_smpp_sequence_number = -1;
@@ -2497,18 +2499,25 @@ dissect_smpp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
* Create display subtree for the PDU
*/
proto_tree_add_uint(smpp_tree, hf_smpp_command_length, tvb, 0, 4, command_length);
+ if (command_id & SMPP_COMMAND_ID_RESPONSE_MASK) {
+ ti = proto_tree_add_boolean(smpp_tree, hf_smpp_command_response, tvb, 4, 4, TRUE);
+ }
+ else {
+ ti = proto_tree_add_boolean(smpp_tree, hf_smpp_command_request, tvb, 4, 4, TRUE);
+ }
+ proto_item_set_generated(ti);
proto_tree_add_uint(smpp_tree, hf_smpp_command_id, tvb, 4, 4, command_id);
- proto_item_append_text(ti, ", Command: %s", command_str);
+ proto_item_append_text(smpp_tree, ", Command: %s", command_str);
/*
* Status is only meaningful with responses
*/
if (command_id & SMPP_COMMAND_ID_RESPONSE_MASK) {
proto_tree_add_uint(smpp_tree, hf_smpp_command_status, tvb, 8, 4, command_status);
- proto_item_append_text (ti, ", Status: \"%s\"", command_status_str);
+ proto_item_append_text (smpp_tree, ", Status: \"%s\"", command_status_str);
}
proto_tree_add_uint(smpp_tree, hf_smpp_sequence_number, tvb, 12, 4, sequence_number);
- proto_item_append_text(ti, ", Seq: %u, Len: %u", sequence_number, command_length);
+ proto_item_append_text(smpp_tree, ", Seq: %u, Len: %u", sequence_number, command_length);
if (command_length <= tvb_reported_length(tvb))
{
@@ -2766,6 +2775,20 @@ proto_register_smpp(void)
HFILL
}
},
+ { &hf_smpp_command_request,
+ { "Request", "smpp.request",
+ FT_BOOLEAN, BASE_NONE, NULL, 0x00,
+ "TRUE if this is a SMPP request.",
+ HFILL
+ }
+ },
+ { &hf_smpp_command_response,
+ { "Response", "smpp.response",
+ FT_BOOLEAN, BASE_NONE, NULL, 0x00,
+ "TRUE if this is a SMPP response.",
+ HFILL
+ }
+ },
{ &hf_smpp_command_status,
{ "Result", "smpp.command_status",
FT_UINT32, BASE_HEX | BASE_RANGE_STRING, RVALS(rvals_command_status), 0x00,