summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-simulcrypt.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-simulcrypt.c')
-rw-r--r--epan/dissectors/packet-simulcrypt.c68
1 files changed, 26 insertions, 42 deletions
diff --git a/epan/dissectors/packet-simulcrypt.c b/epan/dissectors/packet-simulcrypt.c
index 65218c621b..77bdce7de7 100644
--- a/epan/dissectors/packet-simulcrypt.c
+++ b/epan/dissectors/packet-simulcrypt.c
@@ -804,32 +804,25 @@ dissect_ecmg_parameter_value (proto_tree *tree, tvbuff_t *tvb, packet_info *pinf
proto_tree_add_item(tree, hf_simulcrypt_ecm_channel_id, tvb, offset, plen, ENC_BIG_ENDIAN);
break;
case SIMULCRYPT_ECMG_DELAY_START:
- simulcrypt_item = proto_tree_add_item(tree, hf_simulcrypt_delay_start, tvb, offset, plen, ENC_BIG_ENDIAN);
- proto_item_append_text(simulcrypt_item, " ms");
+ proto_tree_add_item(tree, hf_simulcrypt_delay_start, tvb, offset, plen, ENC_BIG_ENDIAN);
break;
case SIMULCRYPT_ECMG_DELAY_STOP:
- simulcrypt_item = proto_tree_add_item(tree, hf_simulcrypt_delay_stop, tvb, offset, plen, ENC_BIG_ENDIAN);
- proto_item_append_text(simulcrypt_item, " ms");
+ proto_tree_add_item(tree, hf_simulcrypt_delay_stop, tvb, offset, plen, ENC_BIG_ENDIAN);
break;
case SIMULCRYPT_ECMG_TRANSITION_DELAY_START:
- simulcrypt_item = proto_tree_add_item(tree, hf_simulcrypt_transition_delay_start, tvb, offset, plen, ENC_BIG_ENDIAN);
- proto_item_append_text(simulcrypt_item, " ms");
+ proto_tree_add_item(tree, hf_simulcrypt_transition_delay_start, tvb, offset, plen, ENC_BIG_ENDIAN);
break;
case SIMULCRYPT_ECMG_TRANSITION_DELAY_STOP:
- simulcrypt_item = proto_tree_add_item(tree, hf_simulcrypt_transition_delay_stop, tvb, offset, plen, ENC_BIG_ENDIAN);
- proto_item_append_text(simulcrypt_item, " ms");
+ proto_tree_add_item(tree, hf_simulcrypt_transition_delay_stop, tvb, offset, plen, ENC_BIG_ENDIAN);
break;
case SIMULCRYPT_ECMG_AC_DELAY_START:
- simulcrypt_item = proto_tree_add_item(tree, hf_simulcrypt_ac_delay_start, tvb, offset, plen, ENC_BIG_ENDIAN);
- proto_item_append_text(simulcrypt_item, " ms");
+ proto_tree_add_item(tree, hf_simulcrypt_ac_delay_start, tvb, offset, plen, ENC_BIG_ENDIAN);
break;
case SIMULCRYPT_ECMG_AC_DELAY_STOP:
- simulcrypt_item = proto_tree_add_item(tree, hf_simulcrypt_ac_delay_stop, tvb, offset, plen, ENC_BIG_ENDIAN);
- proto_item_append_text(simulcrypt_item, " ms");
+ proto_tree_add_item(tree, hf_simulcrypt_ac_delay_stop, tvb, offset, plen, ENC_BIG_ENDIAN);
break;
case SIMULCRYPT_ECMG_ECM_REP_PERIOD:
- simulcrypt_item = proto_tree_add_item(tree, hf_simulcrypt_ecm_rep_period, tvb, offset, plen, ENC_BIG_ENDIAN);
- proto_item_append_text(simulcrypt_item, " ms");
+ proto_tree_add_item(tree, hf_simulcrypt_ecm_rep_period, tvb, offset, plen, ENC_BIG_ENDIAN);
break;
case SIMULCRYPT_ECMG_MAX_STREAMS:
proto_tree_add_item(tree, hf_simulcrypt_max_streams, tvb, offset, plen, ENC_BIG_ENDIAN);
@@ -848,8 +841,7 @@ dissect_ecmg_parameter_value (proto_tree *tree, tvbuff_t *tvb, packet_info *pinf
proto_tree_add_item(tree, hf_simulcrypt_cw_per_msg, tvb, offset, plen, ENC_BIG_ENDIAN);
break;
case SIMULCRYPT_ECMG_MAX_COMP_TIME:
- simulcrypt_item = proto_tree_add_item(tree, hf_simulcrypt_max_comp_time, tvb, offset, plen, ENC_BIG_ENDIAN);
- proto_item_append_text(simulcrypt_item, " ms");
+ proto_tree_add_item(tree, hf_simulcrypt_max_comp_time, tvb, offset, plen, ENC_BIG_ENDIAN);
break;
case SIMULCRYPT_ECMG_ACCESS_CRITERIA:
proto_tree_add_item(tree, hf_simulcrypt_access_criteria, tvb, offset, plen, ENC_NA);
@@ -919,8 +911,6 @@ static void
dissect_emmg_parameter_value (proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, guint32 offset,
guint16 plen, guint16 ptype, gchar *pvalue_char)
{
- proto_item *simulcrypt_item;
-
switch (ptype) {
case SIMULCRYPT_EMMG_CLIENT_ID:
proto_tree_add_item(tree, hf_simulcrypt_client_id, tvb, offset, plen, ENC_BIG_ENDIAN);
@@ -938,8 +928,7 @@ dissect_emmg_parameter_value (proto_tree *tree, tvbuff_t *tvb, packet_info *pinf
proto_tree_add_item(tree, hf_simulcrypt_datagram, tvb, offset, plen, ENC_NA);
break;
case SIMULCRYPT_EMMG_BANDWIDTH:
- simulcrypt_item = proto_tree_add_item(tree, hf_simulcrypt_bandwidth, tvb, offset, plen, ENC_BIG_ENDIAN);
- proto_item_append_text(simulcrypt_item, " kbit/s");
+ proto_tree_add_item(tree, hf_simulcrypt_bandwidth, tvb, offset, plen, ENC_BIG_ENDIAN);
break;
case SIMULCRYPT_EMMG_DATA_TYPE:
proto_tree_add_item(tree, hf_simulcrypt_data_type, tvb, offset, plen, ENC_BIG_ENDIAN);
@@ -1183,16 +1172,13 @@ dissect_psig_parameter_value (proto_tree *tree, tvbuff_t *tvb, packet_info *pinf
proto_tree_add_item(tree, hf_simulcrypt_datagram, tvb, offset, plen, ENC_NA);
break;
case SIMULCRYPT_PSIG_BANDWIDTH:
- simulcrypt_item = proto_tree_add_item(tree, hf_simulcrypt_bandwidth, tvb, offset, plen, ENC_BIG_ENDIAN);
- proto_item_append_text(simulcrypt_item, " kbit/s");
+ proto_tree_add_item(tree, hf_simulcrypt_bandwidth, tvb, offset, plen, ENC_BIG_ENDIAN);
break;
case SIMULCRYPT_PSIG_INITIAL_BANDWIDTH:
- simulcrypt_item = proto_tree_add_item(tree, hf_simulcrypt_initial_bandwidth, tvb, offset, plen, ENC_BIG_ENDIAN);
- proto_item_append_text(simulcrypt_item, " kbit/s");
+ proto_tree_add_item(tree, hf_simulcrypt_initial_bandwidth, tvb, offset, plen, ENC_BIG_ENDIAN);
break;
case SIMULCRYPT_PSIG_MAX_COMP_TIME:
- simulcrypt_item = proto_tree_add_item(tree, hf_simulcrypt_max_comp_time, tvb, offset, plen, ENC_BIG_ENDIAN);
- proto_item_append_text(simulcrypt_item, " ms");
+ proto_tree_add_item(tree, hf_simulcrypt_max_comp_time, tvb, offset, plen, ENC_BIG_ENDIAN);
break;
case SIMULCRYPT_PSIG_ASI_INPUT_PACKET_ID:
proto_tree_add_item(tree, hf_simulcrypt_asi_input_packet_id, tvb, offset, plen, ENC_BIG_ENDIAN);
@@ -1261,8 +1247,7 @@ dissect_simulcrypt_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset+=2;
/* Message Length 2 Bytes */
- simulcrypt_item = proto_tree_add_item(simulcrypt_header_tree, hf_simulcrypt_message_length, tvb, offset, 2, ENC_BIG_ENDIAN);
- proto_item_append_text(simulcrypt_item, " (bytes)");
+ proto_tree_add_item(simulcrypt_header_tree, hf_simulcrypt_message_length, tvb, offset, 2, ENC_BIG_ENDIAN);
msg_length = tvb_get_ntohs(tvb, offset); /* read 2 byte message length value */
offset+=2;
@@ -1363,8 +1348,7 @@ dissect_simulcrypt_data(proto_tree *simulcrypt_tree, proto_item *simulcrypt_item
proto_tree_add_item(simulcrypt_parameter_tree, hf_simulcrypt_parameter_type, tvb, offset, 2, ENC_BIG_ENDIAN);
break;
}
- simulcrypt_item = proto_tree_add_item(simulcrypt_parameter_tree, hf_simulcrypt_parameter_length, tvb, offset+2, 2, ENC_BIG_ENDIAN); /* length item */
- proto_item_append_text(simulcrypt_item, " (bytes)");
+ proto_tree_add_item(simulcrypt_parameter_tree, hf_simulcrypt_parameter_length, tvb, offset+2, 2, ENC_BIG_ENDIAN); /* length item */
offset += 2+2; /* offset --> parameter value */
switch (iftype) {
@@ -1460,7 +1444,7 @@ proto_register_simulcrypt (void)
NULL, HFILL }},
{ &hf_simulcrypt_message_length,
- { "Message Length", "simulcrypt.message.len", FT_UINT16, BASE_DEC, NULL, 0x0, /* length 2 bytes, print as decimal value */
+ { "Message Length", "simulcrypt.message.len", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_byte_bytes, 0x0, /* length 2 bytes, print as decimal value */
NULL, HFILL }},
{ &hf_simulcrypt_message,
@@ -1484,7 +1468,7 @@ proto_register_simulcrypt (void)
NULL, HFILL }},
{ &hf_simulcrypt_parameter_length,
- { "Parameter Length", "simulcrypt.parameter.len", FT_UINT16, BASE_DEC, NULL, 0x0, /* length 2 bytes, print as decimal value */
+ { "Parameter Length", "simulcrypt.parameter.len", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_byte_bytes, 0x0, /* length 2 bytes, print as decimal value */
NULL, HFILL }},
{ &hf_simulcrypt_ca_system_id,
@@ -1508,31 +1492,31 @@ proto_register_simulcrypt (void)
NULL, HFILL }},
{ &hf_simulcrypt_delay_start,
- { "Delay start", "simulcrypt.delay_start", FT_INT16, BASE_DEC, NULL, 0x0,
+ { "Delay start", "simulcrypt.delay_start", FT_INT16, BASE_DEC|BASE_UNIT_STRING, &units_milliseconds, 0x0,
NULL, HFILL }},
{ &hf_simulcrypt_delay_stop,
- { "Delay stop", "simulcrypt.delay_stop", FT_INT16, BASE_DEC, NULL, 0x0,
+ { "Delay stop", "simulcrypt.delay_stop", FT_INT16, BASE_DEC|BASE_UNIT_STRING, &units_milliseconds, 0x0,
NULL, HFILL }},
{ &hf_simulcrypt_ac_delay_start,
- { "AC delay start", "simulcrypt.ac_delay_start", FT_INT16, BASE_DEC, NULL, 0x0,
+ { "AC delay start", "simulcrypt.ac_delay_start", FT_INT16, BASE_DEC|BASE_UNIT_STRING, &units_milliseconds, 0x0,
NULL, HFILL }},
{ &hf_simulcrypt_ac_delay_stop,
- { "AC delay stop", "simulcrypt.ac_delay_stop", FT_INT16, BASE_DEC, NULL, 0x0,
+ { "AC delay stop", "simulcrypt.ac_delay_stop", FT_INT16, BASE_DEC|BASE_UNIT_STRING, &units_milliseconds, 0x0,
NULL, HFILL }},
{ &hf_simulcrypt_transition_delay_start,
- { "Transition delay start", "simulcrypt.transition_delay_start", FT_INT16, BASE_DEC, NULL, 0x0,
+ { "Transition delay start", "simulcrypt.transition_delay_start", FT_INT16, BASE_DEC|BASE_UNIT_STRING, &units_milliseconds, 0x0,
NULL, HFILL }},
{ &hf_simulcrypt_transition_delay_stop,
- { "Transition delay stop", "simulcrypt.transition_delay_stop", FT_INT16, BASE_DEC, NULL, 0x0,
+ { "Transition delay stop", "simulcrypt.transition_delay_stop", FT_INT16, BASE_DEC|BASE_UNIT_STRING, &units_milliseconds, 0x0,
NULL, HFILL }},
{ &hf_simulcrypt_ecm_rep_period,
- { "ECM repetition period", "simulcrypt.ecm_rep_period", FT_UINT16, BASE_DEC, NULL, 0x0,
+ { "ECM repetition period", "simulcrypt.ecm_rep_period", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_milliseconds, 0x0,
NULL, HFILL }},
{ &hf_simulcrypt_max_streams,
@@ -1552,7 +1536,7 @@ proto_register_simulcrypt (void)
NULL, HFILL }},
{ &hf_simulcrypt_max_comp_time,
- { "Max comp time", "simulcrypt.max_comp_time", FT_UINT16, BASE_DEC, NULL, 0x0,
+ { "Max comp time", "simulcrypt.max_comp_time", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_milliseconds, 0x0,
NULL, HFILL }},
{ &hf_simulcrypt_access_criteria,
@@ -1612,7 +1596,7 @@ proto_register_simulcrypt (void)
NULL, HFILL }},
{ &hf_simulcrypt_bandwidth,
- { "Bandwidth", "simulcrypt.bandwidth", FT_UINT16, BASE_DEC, NULL, 0x0,
+ { "Bandwidth", "simulcrypt.bandwidth", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_kbps, 0x0,
NULL, HFILL }},
{ &hf_simulcrypt_data_type,
@@ -1792,7 +1776,7 @@ proto_register_simulcrypt (void)
NULL, HFILL }},
{ &hf_simulcrypt_initial_bandwidth,
- { "Initial bandwidth", "simulcrypt.parameter.initial_bandwidth", FT_UINT16, BASE_DEC, NULL, 0x0,
+ { "Initial bandwidth", "simulcrypt.parameter.initial_bandwidth", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_kbps, 0x0,
NULL, HFILL }},
{ &hf_simulcrypt_asi_input_packet_id,