aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-gtpv2.c
diff options
context:
space:
mode:
authorMarius Paliga <marius.paliga@gmail.com>2017-06-08 12:52:42 +0200
committerAnders Broman <a.broman58@gmail.com>2017-06-08 15:55:03 +0000
commit7cd552b5e0031d63ddecb4ef1d85fd369de10e2a (patch)
tree55d2e7f45ac28e14ca695f0845805a9c75593bf7 /epan/dissectors/packet-gtpv2.c
parent1bec19321111809210d50d7dd3a426211fbfd951 (diff)
GTPv2: Added decoding of Serving PLMN Rate Control and Counter IE
As defined in 3GPP TS 29.274 V14.3.0 Change-Id: I79140dfb2f64b7e444f80dcab09e94bc868df097 Reviewed-on: https://code.wireshark.org/review/22036 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-gtpv2.c')
-rw-r--r--epan/dissectors/packet-gtpv2.c63
1 files changed, 60 insertions, 3 deletions
diff --git a/epan/dissectors/packet-gtpv2.c b/epan/dissectors/packet-gtpv2.c
index 342aecb297..d497d2159a 100644
--- a/epan/dissectors/packet-gtpv2.c
+++ b/epan/dissectors/packet-gtpv2.c
@@ -585,6 +585,10 @@ static int hf_gtpv2_node_name = -1;
static int hf_gtpv2_length_of_node_realm = -1;
static int hf_gtpv2_node_realm = -1;
static int hf_gtpv2_ms_ts = -1;
+static int hf_gtpv2_uplink_rate_limit = -1;
+static int hf_gtpv2_downlink_rate_limit = -1;
+static int hf_gtpv2_timestamp_value = -1;
+static int hf_gtpv2_counter_value = -1;
static gint ett_gtpv2 = -1;
static gint ett_gtpv2_flags = -1;
@@ -986,9 +990,9 @@ static value_string_ext gtpv2_message_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv
196 Header Compression Configuration
*/
#define GTPV2_IE_EXTENDED_PCO 197
+#define GTPV2_IE_SERV_PLMN_RATE_CONTROL 198
+#define GTPV2_IE_COUNTER 199
/*
-198 Serving PLMN Rate Control
-199 Counter
200 to 253 Spare. For future use.
254 Special IE type for IE Type Extension
255 Private Extension
@@ -6560,6 +6564,38 @@ dissect_gtpv2_ciot_opt_support_ind(tvbuff_t *tvb, packet_info *pinfo, proto_tree
}
}
+/*
+ * 8.129 Serving PLMN Rate Control
+ */
+static void
+dissect_gtpv2_serv_plmn_rate_control(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_, session_args_t * args _U_)
+{
+ int offset = 0;
+ proto_tree_add_item(tree, hf_gtpv2_uplink_rate_limit, tvb, offset, 2, ENC_BIG_ENDIAN);
+ offset += 2;
+ proto_tree_add_item(tree, hf_gtpv2_downlink_rate_limit, tvb, offset, 2, ENC_BIG_ENDIAN);
+}
+
+/*
+ * 8.130 Counter
+ */
+static void
+dissect_gtpv2_counter(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_, session_args_t * args _U_)
+{
+ const gchar *time_str;
+ int offset = 0;
+
+ /* Timestamp value */
+ /* Octets 5 to 8 shall be encoded in the same format as the first four octets of the 64-bit timestamp
+ *format as defined in section 6 of IETF RFC 5905
+ */
+
+ time_str = tvb_ntp_fmt_ts_sec(tvb, 0);
+ proto_tree_add_string(tree, hf_gtpv2_timestamp_value, tvb, offset, 4, time_str);
+ offset += 4;
+ proto_tree_add_item(tree, hf_gtpv2_counter_value, tvb, offset, 1, ENC_BIG_ENDIAN);
+}
+
typedef struct _gtpv2_ie {
int ie_type;
@@ -6713,7 +6749,8 @@ static const gtpv2_ie_t gtpv2_ies[] = {
/* 195, 8.126 SCEF PDN Connection */
/* 196, 8.127 Header Compression Configuration */
{GTPV2_IE_EXTENDED_PCO, dissect_gtpv2_pco}, /* 197, 8.128 Extended Protocol Configuration Options (ePCO) */
- /* 198, 8.129 Serving PLMN Rate Control */
+ {GTPV2_IE_SERV_PLMN_RATE_CONTROL, dissect_gtpv2_serv_plmn_rate_control}, /* 198, 8.129 Serving PLMN Rate Control */
+ {GTPV2_IE_COUNTER, dissect_gtpv2_counter}, /* 199, 8.130 Counter */
{GTPV2_IE_PRIVATE_EXT, dissect_gtpv2_private_ext},
@@ -9301,6 +9338,26 @@ void proto_register_gtpv2(void)
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0,
NULL, HFILL }
},
+ { &hf_gtpv2_uplink_rate_limit,
+ { "Uplink Rate Limit", "gtpv2.uplink_rate_limit",
+ FT_UINT16, BASE_DEC, NULL, 0x0,
+ NULL, HFILL }
+ },
+ { &hf_gtpv2_downlink_rate_limit,
+ { "Downlink Rate Limit", "gtpv2.downlink_rate_limit",
+ FT_UINT16, BASE_DEC, NULL, 0x0,
+ NULL, HFILL }
+ },
+ { &hf_gtpv2_timestamp_value,
+ { "Timestamp value", "gtpv2.timestamp_value",
+ FT_STRING, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }
+ },
+ { &hf_gtpv2_counter_value,
+ { "Counter value", "gtpv2.counter_value",
+ FT_UINT8, BASE_DEC, NULL, 0x0,
+ NULL, HFILL }
+ },
};
static gint *ett_gtpv2_array[] = {