diff options
author | Bill Meier <wmeier@newsguy.com> | 2015-01-24 17:09:36 -0500 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2015-01-25 16:02:00 +0000 |
commit | b91df340e899637bf81182a9aa0451d54239191a (patch) | |
tree | 37afa3bd31653b10421a6e2f45d3aad9ffd87223 | |
parent | 52801889fce2a664ddfdeec0ff30f85e38087a74 (diff) |
v52: Fix a minor bug introduced in gc71e88e; plus ...
Create/use extended value strings
tvb_length...() --> tvb_reported_length...()
Cleanup:
Remove some dead initializers;
Declare some vars as 'const' (initialized value is never changed);
localize some vars;
whitespace;
Change-Id: Iee21bb67fb42b1160b8ba2b7c2b89b410cc22225
Reviewed-on: https://code.wireshark.org/review/6770
Reviewed-by: Bill Meier <wmeier@newsguy.com>
-rw-r--r-- | epan/dissectors/packet-v52.c | 973 |
1 files changed, 490 insertions, 483 deletions
diff --git a/epan/dissectors/packet-v52.c b/epan/dissectors/packet-v52.c index c5ad1a7bcd..908c94af1a 100644 --- a/epan/dissectors/packet-v52.c +++ b/epan/dissectors/packet-v52.c @@ -222,6 +222,7 @@ static const value_string msg_type_values [] = { { LINK_CONTROL, "Link Control" }, { LINK_CONTROL_ACK, "Link Control Ack" }, { 0, NULL } }; +static value_string_ext msg_type_values_ext = VALUE_STRING_EXT_INIT(msg_type_values); /* SHORT */ static const value_string msg_type_values_short [] = { @@ -260,30 +261,32 @@ static const value_string msg_type_values_short [] = { { LINK_CONTROL, "LinkCtrl" }, { LINK_CONTROL_ACK, "LinkCtrl Ack" }, { 0, NULL } }; +static value_string_ext msg_type_values_short_ext = VALUE_STRING_EXT_INIT(msg_type_values_short); static const value_string pulse_type_values [] = { - { 0xff, "Pulsed normal polarity" }, - { 0xfe, "Pulsed reversed polarity" }, - { 0xfd, "Pulsed battery on c-wire" }, - { 0xfc, "Pulsed on hook" }, - { 0xfb, "Pulsed reduced battery" }, - { 0xfa, "Pulsed no battery" }, - { 0xf9, "Initial ring" }, - { 0xf8, "Meter pulse" }, - { 0xf7, "50 Hz pulse" }, - { 0xf6, "Register recall (timed loop open)" }, - { 0xf5, "Pulsed off hook (pulsed loop closed)" }, - { 0xf4, "Pulsed b-wire connected to earth" }, - { 0xf3, "Earth loop pulse" }, - { 0xf2, "Pulsed b-wire connected to battery" }, - { 0xf1, "Pulsed a-wire connected to earth" }, - { 0xf0, "Pulsed a-wire connected to battery" }, - { 0xef, "Pulsed c-wire connected to earth" }, - { 0xee, "Pulsed c-wire disconnected" }, - { 0xed, "Pulsed normal battery" }, - { 0xec, "Pulsed a-wire disconnected" }, { 0xeb, "Pulsed b-wire disconnected" }, + { 0xec, "Pulsed a-wire disconnected" }, + { 0xed, "Pulsed normal battery" }, + { 0xee, "Pulsed c-wire disconnected" }, + { 0xef, "Pulsed c-wire connected to earth" }, + { 0xf0, "Pulsed a-wire connected to battery" }, + { 0xf1, "Pulsed a-wire connected to earth" }, + { 0xf2, "Pulsed b-wire connected to battery" }, + { 0xf3, "Earth loop pulse" }, + { 0xf4, "Pulsed b-wire connected to earth" }, + { 0xf5, "Pulsed off hook (pulsed loop closed)" }, + { 0xf6, "Register recall (timed loop open)" }, + { 0xf7, "50 Hz pulse" }, + { 0xf8, "Meter pulse" }, + { 0xf9, "Initial ring" }, + { 0xfa, "Pulsed no battery" }, + { 0xfb, "Pulsed reduced battery" }, + { 0xfc, "Pulsed on hook" }, + { 0xfd, "Pulsed battery on c-wire" }, + { 0xfe, "Pulsed reversed polarity" }, + { 0xff, "Pulsed normal polarity" }, { 0, NULL } }; +static value_string_ext pulse_type_values_ext = VALUE_STRING_EXT_INIT(pulse_type_values); static const value_string suppression_indication_values [] = { { 0x0, "No suppression" }, @@ -330,8 +333,9 @@ static const value_string steady_signal_values [] = { { 0x1d, "Ramp to reverse polarity" }, { 0x1e, "Ramp to normal polarity" }, { 0, NULL } }; +static value_string_ext steady_signal_values_ext = VALUE_STRING_EXT_INIT(steady_signal_values); -const true_false_string tfs_digit_ack_values = { +static const true_false_string tfs_digit_ack_values = { "Ending acknowledgement requested when digit transmission is finished", "No ending acknowledgement requested" }; @@ -405,6 +409,7 @@ static const value_string control_function_id_values [] = { { 0x24, "BLOCK ALL ISDN PORTS REJECTED" }, { 0x25, "BLOCK ALL ISDN PORTS COMPLETED" }, { 0, NULL } }; +static value_string_ext control_function_id_values_ext = VALUE_STRING_EXT_INIT(control_function_id_values); static const value_string control_function_id_values_short [] = { { 0x00, "VerifyRe-pro" }, @@ -439,6 +444,7 @@ static const value_string control_function_id_values_short [] = { { 0x24, "BLOCK ALL ISDN PORTS REJECTED" }, { 0x25, "BLOCK ALL ISDN PORTS COMPLETED" }, { 0, NULL } }; +static value_string_ext control_function_id_values_short_ext = VALUE_STRING_EXT_INIT(control_function_id_values_short); static const value_string rejection_cause_values [] = { { 0x00, "No standby C-channel available" }, @@ -544,54 +550,45 @@ static const value_string cause_type_values [] = { { 0x0d, "Too many information elements" }, { 0, NULL } }; -/* PSTN protocol message info elements */ -#define PULSE_NOTIFICATION 0xc0 -#define LINE_INFORMATION 0x80 -#define STATE 0x90 -#define AUTO_SIG_SEQUENCE 0xa0 -#define SEQUENCE_RESPONSE 0xb0 -#define PSTN_SEQUENCE_NUMBER 0x00 -#define CADENCED_RINGING 0x01 -#define PULSED_SIGNAL 0x02 -#define STEADY_SIGNAL 0x03 -#define DIGIT_SIGNAL 0x04 -#define RECOGNITION_TIME 0x10 -#define ENABLE_AUTO_ACK 0x11 -#define DISABLE_AUTO_ACK 0x12 -#define CAUSE 0x13 -#define RESOURCE_UNAVAILABLE 0x14 -#define ENABLE_METERING 0x22 -#define METERING_REPORT 0x23 -#define ATTENUATION 0x24 -/* Control protocol message info elements */ -#define PERFORMANCE_GRADING 0xe0 -#define CP_REJECTION_CAUSE 0xf0 -#define CONTROL_FUNCTION_ELEMENT 0x20 -#define CONTROL_FUNCTION_ID 0x21 -#define VARIANT 0x22 -#define INTERFACE_ID 0x23 -/* Link control protocol message info elements */ -#define LINK_CONTROL_FUNCTION 0x30 -/* BCC protocol message info elements */ -#define USER_PORT_ID 0x40 -#define ISDN_PORT_TS_ID 0x41 -#define V5_TIME_SLOT_ID 0x42 -#define MULTI_SLOT_MAP 0x43 -#define BCC_REJECT_CAUSE 0x44 -#define BCC_PROTOCOL_ERROR_CAUSE 0x45 -#define CONNECTION_INCOMPLETE 0x46 -/* Protection protocol message info elements */ -#define SEQUENCE_NUMBER 0x50 -#define C_CHANNEL_ID 0x51 -#define PP_REJECTION_CAUSE 0x52 -#define PROTOCOL_ERROR 0x53 +/* protocol message info elements */ +#define PSTN_SEQUENCE_NUMBER 0x00 /* PSTN */ +#define CADENCED_RINGING 0x01 /* PSTN */ +#define PULSED_SIGNAL 0x02 /* PSTN */ +#define STEADY_SIGNAL 0x03 /* PSTN */ +#define DIGIT_SIGNAL 0x04 /* PSTN */ +#define RECOGNITION_TIME 0x10 /* PSTN */ +#define ENABLE_AUTO_ACK 0x11 /* PSTN */ +#define DISABLE_AUTO_ACK 0x12 /* PSTN */ +#define CAUSE 0x13 /* PSTN */ +#define RESOURCE_UNAVAILABLE 0x14 /* PSTN */ +#define CONTROL_FUNCTION_ELEMENT 0x20 /* Control */ +#define CONTROL_FUNCTION_ID 0x21 /* Control */ +#define ENABLE_METERING 0x22 /* PSTN */ +#define VARIANT 0x22 /* Control */ +#define METERING_REPORT 0x23 /* PSTN */ +#define INTERFACE_ID 0x23 /* Control */ +#define ATTENUATION 0x24 /* PSTN */ +#define LINK_CONTROL_FUNCTION 0x30 /* Link Control */ +#define USER_PORT_ID 0x40 /* BCC */ +#define ISDN_PORT_TS_ID 0x41 /* BCC */ +#define V5_TIME_SLOT_ID 0x42 /* BCC */ +#define MULTI_SLOT_MAP 0x43 /* BCC */ +#define BCC_REJECT_CAUSE 0x44 /* BCC */ +#define BCC_PROTOCOL_ERROR_CAUSE 0x45 /* BCC */ +#define CONNECTION_INCOMPLETE 0x46 /* BCC */ +#define SEQUENCE_NUMBER 0x50 /* Protection */ +#define C_CHANNEL_ID 0x51 /* Protection */ +#define PP_REJECTION_CAUSE 0x52 /* Protection */ +#define PROTOCOL_ERROR 0x53 /* Protection */ +#define LINE_INFORMATION 0x80 /* PSTN */ +#define STATE 0x90 /* PSTN */ +#define AUTO_SIG_SEQUENCE 0xa0 /* PSTN */ +#define SEQUENCE_RESPONSE 0xb0 /* PSTN */ +#define PULSE_NOTIFICATION 0xc0 /* PSTN */ +#define PERFORMANCE_GRADING 0xe0 /* Control */ +#define CP_REJECTION_CAUSE 0xf0 /* Control */ static const value_string info_element_values [] = { - { PULSE_NOTIFICATION, "Pulse notification" }, - { LINE_INFORMATION, "Line information" }, - { STATE, "State" }, - { AUTO_SIG_SEQUENCE, "Autonomous signal sequence" }, - { SEQUENCE_RESPONSE, "Sequence response" }, { PSTN_SEQUENCE_NUMBER, "Sequence number" }, { CADENCED_RINGING, "Cadenced ringing" }, { PULSED_SIGNAL, "Pulsed signal" }, @@ -602,15 +599,13 @@ static const value_string info_element_values [] = { { DISABLE_AUTO_ACK, "Disable autonomous acknowledge" }, { CAUSE, "Cause" }, { RESOURCE_UNAVAILABLE, "Resource unavailable" }, - { ENABLE_METERING, "Enable metering" }, - { METERING_REPORT, "Metering report" }, - { ATTENUATION, "Attenuation" }, - { PERFORMANCE_GRADING, "Performance grading" }, - { CP_REJECTION_CAUSE, "Rejection cause" }, { CONTROL_FUNCTION_ELEMENT, "Control function element" }, { CONTROL_FUNCTION_ID, "Control function ID" }, + { ENABLE_METERING, "Enable metering" }, { VARIANT, "Variant" }, + { METERING_REPORT, "Metering report" }, { INTERFACE_ID, "Interface ID" }, + { ATTENUATION, "Attenuation" }, { LINK_CONTROL_FUNCTION, "Link control function" }, { USER_PORT_ID, "User port ID" }, { ISDN_PORT_TS_ID, "ISDN port TS ID" }, @@ -623,14 +618,18 @@ static const value_string info_element_values [] = { { C_CHANNEL_ID, "Physical C-Channel ID" }, { PP_REJECTION_CAUSE, "Rejection cause" }, { PROTOCOL_ERROR, "Protocol error cause" }, + { LINE_INFORMATION, "Line information" }, + { STATE, "State" }, + { AUTO_SIG_SEQUENCE, "Autonomous signal sequence" }, + { SEQUENCE_RESPONSE, "Sequence response" }, + { PULSE_NOTIFICATION, "Pulse notification" }, + { PERFORMANCE_GRADING, "Performance grading" }, + { CP_REJECTION_CAUSE, "Rejection cause" }, { 0, NULL } }; +static value_string_ext info_element_values_ext = VALUE_STRING_EXT_INIT(info_element_values); + static const value_string info_element_values_short [] = { - { PULSE_NOTIFICATION, "PN" }, - { LINE_INFORMATION, "LI" }, - { STATE, "ST" }, - { AUTO_SIG_SEQUENCE, "ASS" }, - { SEQUENCE_RESPONSE, "SR" }, { PSTN_SEQUENCE_NUMBER, "SN" }, { CADENCED_RINGING, "CR" }, { PULSED_SIGNAL, "PS" }, @@ -641,15 +640,13 @@ static const value_string info_element_values_short [] = { { DISABLE_AUTO_ACK, "DAA" }, { CAUSE, "CA" }, { RESOURCE_UNAVAILABLE, "RU" }, - { ENABLE_METERING, "EM" }, - { METERING_REPORT, "MR" }, - { ATTENUATION, "ATT" }, - { PERFORMANCE_GRADING, "PG" }, - { CP_REJECTION_CAUSE, "RC" }, { CONTROL_FUNCTION_ELEMENT, "CF element" }, { CONTROL_FUNCTION_ID, "CF ID" }, + { ENABLE_METERING, "EM" }, { VARIANT, "Var" }, + { METERING_REPORT, "MR" }, { INTERFACE_ID, "Interface ID" }, + { ATTENUATION, "ATT" }, { LINK_CONTROL_FUNCTION, "LC F" }, { USER_PORT_ID, "UP ID" }, { ISDN_PORT_TS_ID, "ISDNP TS ID" }, @@ -662,7 +659,15 @@ static const value_string info_element_values_short [] = { { C_CHANNEL_ID, "Phy CChannel ID" }, { PP_REJECTION_CAUSE, "RC" }, { PROTOCOL_ERROR, "PEC" }, + { LINE_INFORMATION, "LI" }, + { STATE, "ST" }, + { AUTO_SIG_SEQUENCE, "ASS" }, + { SEQUENCE_RESPONSE, "SR" }, + { PULSE_NOTIFICATION, "PN" }, + { PERFORMANCE_GRADING, "PG" }, + { CP_REJECTION_CAUSE, "RC" }, { 0, NULL } }; +static value_string_ext info_element_values_short_ext = VALUE_STRING_EXT_INIT(info_element_values_short); #define ADDRESS_OFFSET 1 @@ -678,15 +683,15 @@ static const value_string info_element_values_short [] = { static void dissect_pstn_sequence_number(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 info_element = 0; - guint8 pstn_sequence_number_tmp = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 info_element; + guint8 pstn_sequence_number_tmp; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -701,7 +706,7 @@ dissect_pstn_sequence_number(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_pstn_sequence_number, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); } } @@ -709,14 +714,14 @@ dissect_pstn_sequence_number(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree static void dissect_cadenced_ring(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 info_element = 0; - guint8 cadenced_ring_tmp = 0; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 info_element; + guint8 cadenced_ring_tmp; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -727,14 +732,14 @@ dissect_cadenced_ring(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o cadenced_ring_tmp = tvb_get_guint8(info_tvb, info_offset+2)-0x80; col_append_str(pinfo->cinfo, COL_INFO, " | "); - col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element")); + col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element")); col_append_fstr(pinfo->cinfo, COL_INFO, ": %u", cadenced_ring_tmp); if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_cadenced_ring, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); @@ -744,14 +749,14 @@ dissect_cadenced_ring(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o static void dissect_pulsed_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 info_element = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 info_element; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -761,15 +766,15 @@ dissect_pulsed_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); - col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element")); + col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element")); col_append_str(pinfo->cinfo, COL_INFO, ": "); - col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2), pulse_type_values, "Unknown element")); + col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset+2), &pulse_type_values_ext, "Unknown element")); if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_pulse_type, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN); if (data_length > 3) { @@ -787,14 +792,14 @@ dissect_pulsed_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o static void dissect_steady_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 info_element = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 info_element; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -804,15 +809,15 @@ dissect_steady_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); - col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element")); + col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element")); col_append_str(pinfo->cinfo, COL_INFO, ": "); - col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, steady_signal_values, "Unknown element")); + col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, &steady_signal_values_ext, "Unknown element")); if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_steady_signal, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN); } } @@ -820,15 +825,15 @@ dissect_steady_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o static void dissect_digit_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 buffer = 0; - guint8 info_element = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 buffer; + guint8 info_element; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -839,7 +844,7 @@ dissect_digit_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_digit_ack, info_tvb, info_offset+2, 1, ENC_NA); @@ -850,7 +855,7 @@ dissect_digit_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of proto_tree_add_item(info_tree, hf_v52_digit_info, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); col_append_str(pinfo->cinfo, COL_INFO, " | "); - col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element")); + col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element")); col_append_fstr(pinfo->cinfo, COL_INFO, ": %u", buffer); } @@ -858,15 +863,14 @@ dissect_digit_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of static void dissect_recognition_time(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 buffer = 0; - guint8 info_element = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 info_element; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -876,19 +880,20 @@ dissect_recognition_time(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); - col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element")); + col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element")); if (info_tree != NULL) { + guint8 buffer; proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); buffer = tvb_get_guint8(info_tvb, info_offset+2)&0x7f; /*Signal = Coding of pulse type*/ - if(buffer>=0x6b) + if (buffer >= 0x6b) proto_tree_add_item(info_tree, hf_v52_pulse_type, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN); /*Signal = Coding of steady signal type*/ - else if(buffer<=0x1a) + else if (buffer <= 0x1a) proto_tree_add_item(info_tree, hf_v52_steady_signal, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_duration_type, info_tvb, info_offset+3, 1, ENC_BIG_ENDIAN); @@ -898,15 +903,14 @@ dissect_recognition_time(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in static void dissect_enable_auto_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 buffer = 0; - guint8 info_element = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 info_element; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -916,34 +920,35 @@ dissect_enable_auto_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); - col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element")); + col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element")); if (info_tree != NULL) { + guint8 buffer; proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); buffer = tvb_get_guint8(info_tvb, info_offset+2)&0x7f; /*Signal*/ - if(buffer>=0x6b) + if (buffer >= 0x6b) proto_tree_add_item(info_tree, hf_v52_pulse_type, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN); - else if(buffer<=0x1a) + else if (buffer <= 0x1a) proto_tree_add_item(info_tree, hf_v52_steady_signal, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN); buffer = tvb_get_guint8(info_tvb, info_offset+3)&0x7f; /*Response*/ - if(buffer>=0x6b) + if (buffer >= 0x6b) proto_tree_add_item(info_tree, hf_v52_pulse_type, info_tvb, info_offset+3, 1, ENC_BIG_ENDIAN); - else if(buffer<=0x1a) - proto_tree_add_item(info_tree, hf_v52_steady_signal, info_tvb, info_offset+3,1,ENC_BIG_ENDIAN); + else if (buffer <= 0x1a) + proto_tree_add_item(info_tree, hf_v52_steady_signal, info_tvb, info_offset+3, 1, ENC_BIG_ENDIAN); - if(tvb_length_remaining(info_tvb, info_offset+4)){ - proto_tree_add_item(info_tree, hf_v52_suppression_indicator, info_tvb, info_offset+4,1,ENC_BIG_ENDIAN); - proto_tree_add_item(info_tree, hf_v52_pulse_duration, info_tvb, info_offset+4,1,ENC_BIG_ENDIAN); + if (tvb_reported_length_remaining(info_tvb, info_offset+4)) { + proto_tree_add_item(info_tree, hf_v52_suppression_indicator, info_tvb, info_offset+4, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(info_tree, hf_v52_pulse_duration, info_tvb, info_offset+4, 1, ENC_BIG_ENDIAN); } - if(tvb_length_remaining(info_tvb, info_offset+5)){ - proto_tree_add_item(info_tree, hf_v52_ack_request_indicator, info_tvb, info_offset+5,1,ENC_BIG_ENDIAN); - proto_tree_add_item(info_tree, hf_v52_number_of_pulses, info_tvb, info_offset+5,1,ENC_BIG_ENDIAN); + if (tvb_reported_length_remaining(info_tvb, info_offset+5)) { + proto_tree_add_item(info_tree, hf_v52_ack_request_indicator, info_tvb, info_offset+5, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(info_tree, hf_v52_number_of_pulses, info_tvb, info_offset+5, 1, ENC_BIG_ENDIAN); } } } @@ -951,15 +956,14 @@ dissect_enable_auto_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int static void dissect_disable_auto_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 buffer = 0; - guint8 info_element = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 info_element; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -969,18 +973,19 @@ dissect_disable_auto_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); - col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element")); + col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element")); if (info_tree != NULL) { + guint8 buffer; proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); buffer = tvb_get_guint8(info_tvb, info_offset+2)&0x7f; - if(buffer>=0x6b) + if (buffer >= 0x6b) proto_tree_add_item(info_tree, hf_v52_pulse_type, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN); - else if(buffer<=0x1a) + else if (buffer <= 0x1a) proto_tree_add_item(info_tree, hf_v52_steady_signal, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN); } } @@ -988,14 +993,14 @@ dissect_disable_auto_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in static void dissect_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 info_element = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 info_element; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -1005,7 +1010,7 @@ dissect_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); - col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element")); + col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element")); col_append_str(pinfo->cinfo, COL_INFO, ": "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, cause_type_values, "Unknown element")); @@ -1013,26 +1018,26 @@ dissect_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"), info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_cause_type, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN); - if(tvb_length_remaining(info_tvb, info_offset+3)) + if (tvb_reported_length_remaining(info_tvb, info_offset+3)) proto_tree_add_uint_format(info_tree, hf_v52_msg_type, info_tvb, info_offset+3, 1, tvb_get_guint8(info_tvb, info_offset+3), - "Diagnostic: %s",val_to_str_const(tvb_get_guint8(info_tvb, info_offset+3), msg_type_values,"unknown")); + "Diagnostic: %s", val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset+3), &msg_type_values_ext, "unknown")); } } static void dissect_resource_unavailable(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 info_element = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 info_element; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -1042,12 +1047,12 @@ dissect_resource_unavailable(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); - col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element")); + col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element")); if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_res_unavailable, info_tvb, info_offset+2, info_element_length, ENC_ASCII|ENC_NA); } } @@ -1055,14 +1060,14 @@ dissect_resource_unavailable(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree static void dissect_pulse_notification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 info_element = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 info_element; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -1072,10 +1077,10 @@ dissect_pulse_notification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); - col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element")); + col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element")); if (info_tree != NULL) { - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_pulse_notification, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); } } @@ -1083,14 +1088,14 @@ dissect_pulse_notification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, static void dissect_line_information(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 info_element = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 info_element; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -1100,10 +1105,10 @@ dissect_line_information(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); - col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element")); + col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element")); if (info_tree != NULL) { - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_line_info, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); } } @@ -1111,14 +1116,14 @@ dissect_line_information(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in static void dissect_state(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 info_element = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 info_element; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -1128,10 +1133,10 @@ dissect_state(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); - col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element")); + col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element")); if (info_tree != NULL) { - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_state, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); } } @@ -1139,14 +1144,14 @@ dissect_state(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) static void dissect_auto_sig_sequence(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 info_element = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 info_element; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -1156,10 +1161,10 @@ dissect_auto_sig_sequence(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, i info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); - col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element")); + col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element")); if (info_tree != NULL) { - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_auto_signalling_sequence, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); } } @@ -1167,14 +1172,14 @@ dissect_auto_sig_sequence(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, i static void dissect_sequence_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 info_element = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 info_element; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -1184,10 +1189,10 @@ dissect_sequence_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, i info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); - col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element")); + col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element")); if (info_tree != NULL) { - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_sequence_response, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); } } @@ -1195,14 +1200,14 @@ dissect_sequence_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, i static void dissect_control_function_element(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 info_element = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 info_element; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -1219,7 +1224,7 @@ dissect_control_function_element(tvbuff_t *tvb, packet_info *pinfo, proto_tree * if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_control_function_element, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); } } @@ -1227,14 +1232,14 @@ dissect_control_function_element(tvbuff_t *tvb, packet_info *pinfo, proto_tree * static void dissect_control_function_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 info_element = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 info_element; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -1245,13 +1250,13 @@ dissect_control_function_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (message_type_tmp != 0x13) { col_append_str(pinfo->cinfo, COL_INFO, " | "); - col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, control_function_id_values_short, "Unknown layer3 element")); + col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, &control_function_id_values_short_ext, "Unknown layer3 element")); } if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_control_function_id, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); } } @@ -1259,15 +1264,15 @@ dissect_control_function_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, static void dissect_variant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 info_element = 0; - guint8 variantValue = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 info_element; + guint8 variantValue; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -1282,7 +1287,7 @@ dissect_variant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_variant, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); } } @@ -1290,15 +1295,15 @@ dissect_variant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) static void dissect_interface_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 info_element = 0; - guint8 interfaceAllIdValue = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 info_element; + guint8 interfaceAllIdValue; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -1313,7 +1318,7 @@ dissect_interface_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_if_up_id, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_if_id, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_if_low_id, info_tvb, info_offset+4, info_element_length, ENC_BIG_ENDIAN); @@ -1324,14 +1329,14 @@ dissect_interface_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of static void dissect_sequence_number(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 info_element = 0; - guint8 hf_v52_sequence_number_tmp = 0; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 info_element; + guint8 hf_v52_sequence_number_tmp; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -1341,7 +1346,7 @@ dissect_sequence_number(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); - col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element")); + col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element")); hf_v52_sequence_number_tmp = tvb_get_guint8(info_tvb, info_offset+2)-0x80; col_append_fstr(pinfo->cinfo, COL_INFO, ": %u", hf_v52_sequence_number_tmp); @@ -1349,7 +1354,7 @@ dissect_sequence_number(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_sequence_number, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); } } @@ -1357,14 +1362,14 @@ dissect_sequence_number(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int static void dissect_physical_c_channel_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 info_element = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 info_element; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -1378,7 +1383,7 @@ dissect_physical_c_channel_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_v5_link_id, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_v5_time_slot, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN); } @@ -1387,14 +1392,14 @@ dissect_physical_c_channel_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre static void dissect_pp_rejection_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 info_element = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 info_element; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -1409,7 +1414,7 @@ dissect_pp_rejection_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_rejection_cause, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); } } @@ -1417,14 +1422,14 @@ dissect_pp_rejection_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, static void dissect_protocol_error(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 info_element = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 info_element; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -1439,7 +1444,7 @@ dissect_protocol_error(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_error_cause, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_diagnostic_msg, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_diagnostic_element, info_tvb, info_offset+4, info_element_length, ENC_BIG_ENDIAN); @@ -1449,14 +1454,14 @@ dissect_protocol_error(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int static void dissect_performance_grading(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 info_element = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 info_element; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -1469,7 +1474,7 @@ dissect_performance_grading(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset)-0xe0, performance_grading_values, "Unknown element")); if (info_tree != NULL) { - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_performance_grading, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); } } @@ -1477,14 +1482,14 @@ dissect_performance_grading(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, static void dissect_cp_rejection_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 info_element = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 info_element; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -1497,7 +1502,7 @@ dissect_cp_rejection_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset)-0xe0, cp_rejection_cause_values, "Unknown element")); if (info_tree != NULL) { - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_cp_rejection_cause, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); } } @@ -1505,15 +1510,15 @@ dissect_cp_rejection_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, static void dissect_user_port_identification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 buffer = 0; - guint8 info_element = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 buffer; + guint8 info_element; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -1524,15 +1529,17 @@ dissect_user_port_identification(tvbuff_t *tvb, packet_info *pinfo, proto_tree * proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); - if(buffer==0x01){ + buffer = tvb_get_guint8(info_tvb, info_offset+2)&0x01; + + if (buffer == 0x01) { proto_tree_add_item(info_tree, hf_v52_pstn_user_port_id, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_pstn_user_port_id_lower, info_tvb, info_offset+3, 1, ENC_BIG_ENDIAN); col_append_fstr(pinfo->cinfo, COL_INFO, " | PSTN port: %u", (((tvb_get_guint8(info_tvb, info_offset+2)>>1)<<8)+(tvb_get_guint8(info_tvb, info_offset+3)))); } - else if(buffer == 0x00){ + else if (buffer == 0x00) { proto_tree_add_item(info_tree, hf_v52_isdn_user_port_id, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_isdn_user_port_id_lower, info_tvb, info_offset+3, 1, ENC_BIG_ENDIAN); @@ -1543,15 +1550,15 @@ dissect_user_port_identification(tvbuff_t *tvb, packet_info *pinfo, proto_tree * static void dissect_isdn_port_time_slot_identification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 info_element = 0; - guint8 isdn_user_port_ts_num_tmp = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 info_element; + guint8 isdn_user_port_ts_num_tmp; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -1567,7 +1574,7 @@ dissect_isdn_port_time_slot_identification(tvbuff_t *tvb, packet_info *pinfo, pr if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_isdn_user_port_ts_num, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); } } @@ -1575,16 +1582,16 @@ dissect_isdn_port_time_slot_identification(tvbuff_t *tvb, packet_info *pinfo, pr static void dissect_v5_time_slot_identification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 info_element = 0; - guint8 v5_link_id_tmp = 0; - guint8 v5_time_slot_tmp = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 info_element; + guint8 v5_link_id_tmp; + guint8 v5_time_slot_tmp; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -1609,7 +1616,7 @@ dissect_v5_time_slot_identification(tvbuff_t *tvb, packet_info *pinfo, proto_tre if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_v5_link_id, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_override, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_v5_time_slot, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN); @@ -1619,14 +1626,14 @@ dissect_v5_time_slot_identification(tvbuff_t *tvb, packet_info *pinfo, proto_tre static void dissect_multi_slot_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 info_element = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 info_element; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -1635,29 +1642,29 @@ dissect_multi_slot_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); - col_append_fstr(pinfo->cinfo, COL_INFO, " | V5MSlink ID:%u",tvb_get_guint8(info_tvb, info_offset+2)); + col_append_fstr(pinfo->cinfo, COL_INFO, " | V5MSlink ID:%u", tvb_get_guint8(info_tvb, info_offset+2)); if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_v5_link_id, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); - if(tvb_length_remaining(info_tvb, info_offset+3)) + if (tvb_reported_length_remaining(info_tvb, info_offset+3)) proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN); - if(tvb_length_remaining(info_tvb, info_offset+4)) + if (tvb_reported_length_remaining(info_tvb, info_offset+4)) proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+4, info_element_length, ENC_BIG_ENDIAN); - if(tvb_length_remaining(info_tvb, info_offset+5)) + if (tvb_reported_length_remaining(info_tvb, info_offset+5)) proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+5, info_element_length, ENC_BIG_ENDIAN); - if(tvb_length_remaining(info_tvb, info_offset+6)) + if (tvb_reported_length_remaining(info_tvb, info_offset+6)) proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+6, info_element_length, ENC_BIG_ENDIAN); - if(tvb_length_remaining(info_tvb, info_offset+7)) + if (tvb_reported_length_remaining(info_tvb, info_offset+7)) proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+7, info_element_length, ENC_BIG_ENDIAN); - if(tvb_length_remaining(info_tvb, info_offset+8)) + if (tvb_reported_length_remaining(info_tvb, info_offset+8)) proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+8, info_element_length, ENC_BIG_ENDIAN); - if(tvb_length_remaining(info_tvb, info_offset+9)) + if (tvb_reported_length_remaining(info_tvb, info_offset+9)) proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+9, info_element_length, ENC_BIG_ENDIAN); - if(tvb_length_remaining(info_tvb, info_offset+10)) + if (tvb_reported_length_remaining(info_tvb, info_offset+10)) proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+10, info_element_length, ENC_BIG_ENDIAN); } } @@ -1665,14 +1672,14 @@ dissect_multi_slot_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int static void dissect_bcc_rejct_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 info_element = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 info_element; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -1687,7 +1694,7 @@ dissect_bcc_rejct_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_reject_cause_type, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); } } @@ -1695,14 +1702,14 @@ dissect_bcc_rejct_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int static void dissect_bcc_protocol_error_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 info_element = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 info_element; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -1717,12 +1724,12 @@ dissect_bcc_protocol_error_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree * if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_bcc_protocol_error_cause, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); - if(tvb_length_remaining(info_tvb, info_offset+3)) + if (tvb_reported_length_remaining(info_tvb, info_offset+3)) proto_tree_add_item(info_tree, hf_v52_diagnostic_message, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN); - if(tvb_length_remaining(info_tvb, info_offset+4)) + if (tvb_reported_length_remaining(info_tvb, info_offset+4)) proto_tree_add_item(info_tree, hf_v52_diagnostic_information, info_tvb, info_offset+4, info_element_length, ENC_BIG_ENDIAN); } } @@ -1730,14 +1737,14 @@ dissect_bcc_protocol_error_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree * static void dissect_connection_incomplete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 info_element = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 info_element; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); @@ -1752,7 +1759,7 @@ dissect_connection_incomplete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_connection_incomplete_reason, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); } } @@ -1760,18 +1767,18 @@ dissect_connection_incomplete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre static void dissect_link_control_function(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { - proto_tree *info_tree; - proto_item *ti_info; - guint8 info_element_length = 1; - guint8 info_element = 0; + proto_tree *info_tree; + proto_item *ti_info; + const guint8 info_element_length = 1; + guint8 info_element; - guint16 data_length; - tvbuff_t *info_tvb; - int info_offset = 0; + guint16 data_length; + tvbuff_t *info_tvb; + const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); - data_length = tvb_get_guint8(tvb, offset+1)+2; + data_length = tvb_get_guint8(tvb, offset+1) + 2; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); @@ -1784,7 +1791,7 @@ dissect_link_control_function(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); - proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element); + proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_link_control_function, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); } } @@ -1799,60 +1806,60 @@ dissect_v52_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /*int old_offset;*/ int singleoctet; - while(tvb_length_remaining(tvb,offset) > 0){ + while (tvb_reported_length_remaining(tvb, offset) > 0) { singleoctet = 0; /* old_offset = offset; */ info_element = tvb_get_guint8(tvb, offset); - switch(info_element){ + switch (info_element) { case PSTN_SEQUENCE_NUMBER: - info_element_length = tvb_get_guint8(tvb,offset+1); + info_element_length = tvb_get_guint8(tvb, offset+1); dissect_pstn_sequence_number(tvb, pinfo, tree, offset); - offset +=info_element_length+2; + offset += info_element_length+2; break; case CADENCED_RINGING: - info_element_length = tvb_get_guint8(tvb,offset+1); + info_element_length = tvb_get_guint8(tvb, offset+1); dissect_cadenced_ring(tvb, pinfo, tree, offset); - offset +=info_element_length+2; + offset += info_element_length+2; break; case PULSED_SIGNAL: - info_element_length = tvb_get_guint8(tvb,offset+1); + info_element_length = tvb_get_guint8(tvb, offset+1); dissect_pulsed_signal(tvb, pinfo, tree, offset); - offset +=info_element_length+2; + offset += info_element_length+2; break; case STEADY_SIGNAL: - info_element_length = tvb_get_guint8(tvb,offset+1); + info_element_length = tvb_get_guint8(tvb, offset+1); dissect_steady_signal(tvb, pinfo, tree, offset); - offset +=info_element_length+2; + offset += info_element_length+2; break; case DIGIT_SIGNAL: - info_element_length = tvb_get_guint8(tvb,offset+1); + info_element_length = tvb_get_guint8(tvb, offset+1); dissect_digit_signal(tvb, pinfo, tree, offset); - offset +=info_element_length+2; + offset += info_element_length+2; break; case RECOGNITION_TIME: - info_element_length = tvb_get_guint8(tvb,offset+1); + info_element_length = tvb_get_guint8(tvb, offset+1); dissect_recognition_time(tvb, pinfo, tree, offset); - offset +=info_element_length+2; + offset += info_element_length+2; break; case ENABLE_AUTO_ACK: - info_element_length = tvb_get_guint8(tvb,offset+1); + info_element_length = tvb_get_guint8(tvb, offset+1); dissect_enable_auto_ack(tvb, pinfo, tree, offset); - offset +=info_element_length+2; + offset += info_element_length+2; break; case DISABLE_AUTO_ACK: - info_element_length = tvb_get_guint8(tvb,offset+1); + info_element_length = tvb_get_guint8(tvb, offset+1); dissect_disable_auto_ack(tvb, pinfo, tree, offset); - offset +=info_element_length+2; + offset += info_element_length+2; break; case CAUSE: - info_element_length = tvb_get_guint8(tvb,offset+1); + info_element_length = tvb_get_guint8(tvb, offset+1); dissect_cause(tvb, pinfo, tree, offset); - offset +=info_element_length+2; + offset += info_element_length+2; break; case RESOURCE_UNAVAILABLE: - info_element_length = tvb_get_guint8(tvb,offset+1); + info_element_length = tvb_get_guint8(tvb, offset+1); dissect_resource_unavailable(tvb, pinfo, tree, offset); - offset +=info_element_length+2; + offset += info_element_length+2; break; case PULSE_NOTIFICATION: dissect_pulse_notification(tvb, pinfo, tree, offset); @@ -1876,44 +1883,44 @@ dissect_v52_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; case CONTROL_FUNCTION_ELEMENT: - info_element_length = tvb_get_guint8(tvb,offset+1); + info_element_length = tvb_get_guint8(tvb, offset+1); dissect_control_function_element(tvb, pinfo, tree, offset); - offset +=info_element_length+2; + offset += info_element_length+2; break; case CONTROL_FUNCTION_ID: - info_element_length = tvb_get_guint8(tvb,offset+1); + info_element_length = tvb_get_guint8(tvb, offset+1); dissect_control_function_id(tvb, pinfo, tree, offset); - offset +=info_element_length+2; + offset += info_element_length+2; break; case VARIANT: - info_element_length = tvb_get_guint8(tvb,offset+1); + info_element_length = tvb_get_guint8(tvb, offset+1); dissect_variant(tvb, pinfo, tree, offset); - offset +=info_element_length+2; + offset += info_element_length+2; break; case INTERFACE_ID: - info_element_length = tvb_get_guint8(tvb,offset+1); + info_element_length = tvb_get_guint8(tvb, offset+1); dissect_interface_id(tvb, pinfo, tree, offset); - offset +=info_element_length+2; + offset += info_element_length+2; break; case SEQUENCE_NUMBER: - info_element_length = tvb_get_guint8(tvb,offset+1); + info_element_length = tvb_get_guint8(tvb, offset+1); dissect_sequence_number(tvb, pinfo, tree, offset); - offset +=info_element_length+2; + offset += info_element_length+2; break; case C_CHANNEL_ID: - info_element_length = tvb_get_guint8(tvb,offset+1); + info_element_length = tvb_get_guint8(tvb, offset+1); dissect_physical_c_channel_id(tvb, pinfo, tree, offset); - offset +=info_element_length+2; + offset += info_element_length+2; break; case PP_REJECTION_CAUSE: - info_element_length = tvb_get_guint8(tvb,offset+1); + info_element_length = tvb_get_guint8(tvb, offset+1); dissect_pp_rejection_cause(tvb, pinfo, tree, offset); - offset +=info_element_length+2; + offset += info_element_length+2; break; case PROTOCOL_ERROR: - info_element_length = tvb_get_guint8(tvb,offset+1); + info_element_length = tvb_get_guint8(tvb, offset+1); dissect_protocol_error(tvb, pinfo, tree, offset); - offset +=info_element_length+2; + offset += info_element_length+2; break; case PERFORMANCE_GRADING: dissect_performance_grading(tvb, pinfo, tree, offset); @@ -1924,44 +1931,44 @@ dissect_v52_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) singleoctet = 1; break; case USER_PORT_ID: - info_element_length = tvb_get_guint8(tvb,offset+1); + info_element_length = tvb_get_guint8(tvb, offset+1); dissect_user_port_identification(tvb, pinfo, tree, offset); - offset +=info_element_length+2; + offset += info_element_length+2; break; case ISDN_PORT_TS_ID: - info_element_length = tvb_get_guint8(tvb,offset+1); + info_element_length = tvb_get_guint8(tvb, offset+1); dissect_isdn_port_time_slot_identification(tvb, pinfo, tree, offset); - offset +=info_element_length+2; + offset += info_element_length+2; break; case V5_TIME_SLOT_ID: - info_element_length = tvb_get_guint8(tvb,offset+1); + info_element_length = tvb_get_guint8(tvb, offset+1); dissect_v5_time_slot_identification(tvb, pinfo, tree, offset); - offset +=info_element_length+2; + offset += info_element_length+2; break; case MULTI_SLOT_MAP: - info_element_length = tvb_get_guint8(tvb,offset+1); + info_element_length = tvb_get_guint8(tvb, offset+1); dissect_multi_slot_map(tvb, pinfo, tree, offset); - offset +=info_element_length+2; + offset += info_element_length+2; break; case BCC_REJECT_CAUSE: - info_element_length = tvb_get_guint8(tvb,offset+1); + info_element_length = tvb_get_guint8(tvb, offset+1); dissect_bcc_rejct_cause(tvb, pinfo, tree, offset); - offset +=info_element_length+2; + offset += info_element_length+2; break; case BCC_PROTOCOL_ERROR_CAUSE: - info_element_length = tvb_get_guint8(tvb,offset+1); + info_element_length = tvb_get_guint8(tvb, offset+1); dissect_bcc_protocol_error_cause(tvb, pinfo, tree, offset); - offset +=info_element_length+2; + offset += info_element_length+2; break; case CONNECTION_INCOMPLETE: - info_element_length = tvb_get_guint8(tvb,offset+1); + info_element_length = tvb_get_guint8(tvb, offset+1); dissect_connection_incomplete(tvb, pinfo, tree, offset); - offset +=info_element_length+2; + offset += info_element_length+2; break; case LINK_CONTROL_FUNCTION: - info_element_length = tvb_get_guint8(tvb,offset+1); + info_element_length = tvb_get_guint8(tvb, offset+1); dissect_link_control_function(tvb, pinfo, tree, offset); - offset +=info_element_length+2; + offset += info_element_length+2; break; default: offset += 1; @@ -1985,7 +1992,6 @@ dissect_v52_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { int offset = 0; proto_tree *v52_tree = NULL; - proto_item *ti; gboolean addr = FALSE; guint8 bcc_all_address_tmp_up = -1; guint16 pstn_all_address_tmp, isdn_all_address_tmp, bcc_all_address_tmp; @@ -1994,6 +2000,7 @@ dissect_v52_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) col_set_str(pinfo->cinfo, COL_PROTOCOL, "V52"); if (tree) { + proto_item *ti; ti = proto_tree_add_item(tree, proto_v52, tvb, offset, -1, ENC_NA); v52_tree = proto_item_add_subtree(ti, ett_v52); @@ -2010,7 +2017,7 @@ dissect_v52_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_item(v52_tree, hf_v52_pstn_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(v52_tree, hf_v52_pstn_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, ENC_BIG_ENDIAN); - pstn_all_address_tmp = (((tvb_get_guint8(tvb,ADDRESS_OFFSET)>>1)<<8)+(tvb_get_guint8(tvb,LOW_ADDRESS_OFFSET))); + pstn_all_address_tmp = (((tvb_get_guint8(tvb, ADDRESS_OFFSET)>>1)<<8)+(tvb_get_guint8(tvb, LOW_ADDRESS_OFFSET))); col_append_fstr(pinfo->cinfo, COL_INFO, " | PSTN: %u", pstn_all_address_tmp); @@ -2059,7 +2066,7 @@ dissect_v52_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if ((message_type_tmp >= 0x18) && (message_type_tmp <= 0x1f)) { addr = TRUE; - prot_all_address_tmp = (tvb_get_guint8(tvb, ADDRESS_OFFSET)<<8) + (tvb_get_guint8(tvb,LOW_ADDRESS_OFFSET)); + prot_all_address_tmp = (tvb_get_guint8(tvb, ADDRESS_OFFSET)<<8) + (tvb_get_guint8(tvb, LOW_ADDRESS_OFFSET)); proto_tree_add_item(v52_tree, hf_v52_prot_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(v52_tree, hf_v52_prot_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, ENC_BIG_ENDIAN); @@ -2092,7 +2099,7 @@ dissect_v52_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) col_append_str(pinfo->cinfo, COL_INFO, " | "); - col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(tvb, MSG_TYPE_OFFSET), msg_type_values_short, "Unknown msg type")); + col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(tvb, MSG_TYPE_OFFSET), &msg_type_values_short_ext, "Unknown msg type")); dissect_v52_info(tvb, pinfo, v52_tree); } @@ -2184,11 +2191,11 @@ proto_register_v52(void) /* OTHER */ {&hf_v52_msg_type, { "Message type", "v52.msg_type", - FT_UINT8, BASE_HEX, VALS(msg_type_values), 0x0, + FT_UINT8, BASE_HEX|BASE_EXT_STRING, &msg_type_values_ext, 0x0, NULL, HFILL } }, {&hf_v52_info_element, { "Information element", "v52.info_element", - FT_UINT8, BASE_HEX, VALS(info_element_values), 0x0, + FT_UINT8, BASE_HEX|BASE_EXT_STRING, &info_element_values_ext, 0x0, NULL, HFILL } }, {&hf_v52_info_length, { "Information length", "v52.info_length", @@ -2208,7 +2215,7 @@ proto_register_v52(void) NULL, HFILL } }, {&hf_v52_pulse_type, { "Pulse Type", "v52.pulse_type", - FT_UINT8, BASE_HEX, VALS(pulse_type_values), 0x0, + FT_UINT8, BASE_HEX|BASE_EXT_STRING, &pulse_type_values_ext, 0x0, NULL, HFILL } }, {&hf_v52_suppression_indicator, { "Suppression indicator", "v52.suppression_indicator", @@ -2228,14 +2235,14 @@ proto_register_v52(void) NULL, HFILL } }, {&hf_v52_steady_signal, { "Steady Signal", "v52.steady_signal", - FT_UINT8, BASE_HEX, VALS(steady_signal_values), 0x7f, + FT_UINT8, BASE_HEX|BASE_EXT_STRING, &steady_signal_values_ext, 0x7f, NULL, HFILL } }, {&hf_v52_digit_ack, - { "Digit ack request indication","v52.digit_ack", + { "Digit ack request indication", "v52.digit_ack", FT_BOOLEAN, 8, TFS(&tfs_digit_ack_values), 0x40, NULL, HFILL } }, {&hf_v52_digit_spare, - { "Digit spare","v52.digit_spare", + { "Digit spare", "v52.digit_spare", FT_UINT8, BASE_HEX, NULL, 0x30, NULL, HFILL } }, {&hf_v52_digit_info, @@ -2248,7 +2255,7 @@ proto_register_v52(void) NULL, HFILL } }, {&hf_v52_res_unavailable, { "Resource unavailable", "v52.res_unavailable", - FT_STRING, BASE_NONE,NULL, 0x0, + FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_v52_line_info, { "Line_Information", "v52.line_info", @@ -2259,7 +2266,7 @@ proto_register_v52(void) FT_UINT8, BASE_HEX, VALS(state_values), 0x0f, NULL, HFILL } }, {&hf_v52_auto_signalling_sequence, - { "Autonomous signalling sequence","v52.auto_signalling_sequence", + { "Autonomous signalling sequence", "v52.auto_signalling_sequence", FT_UINT8, BASE_HEX, NULL, 0x0f, NULL, HFILL } }, {&hf_v52_sequence_response, @@ -2272,7 +2279,7 @@ proto_register_v52(void) NULL, HFILL } }, {&hf_v52_control_function_id, { "Control function ID", "v52.control_function", - FT_UINT8, BASE_HEX, VALS(control_function_id_values), 0x7f, + FT_UINT8, BASE_HEX|BASE_EXT_STRING, &control_function_id_values_ext, 0x7f, NULL, HFILL } }, {&hf_v52_variant, { "Variant", "v52.variant", @@ -2335,23 +2342,23 @@ proto_register_v52(void) FT_UINT8, BASE_HEX, VALS(cp_rejection_cause_values), 0x0f, NULL, HFILL } }, {&hf_v52_pstn_user_port_id, - { "PSTN User Port identification Value","v52.pstn_user_port_id", + { "PSTN User Port identification Value", "v52.pstn_user_port_id", FT_UINT8, BASE_HEX, NULL, 0xfe, NULL, HFILL } }, {&hf_v52_pstn_user_port_id_lower, - { "PSTN User Port Identification Value (lower)","v52.pstn_user_port_id_lower", + { "PSTN User Port Identification Value (lower)", "v52.pstn_user_port_id_lower", FT_UINT8, BASE_HEX, NULL, 0xff, NULL, HFILL } }, {&hf_v52_isdn_user_port_id, - { "ISDN User Port Identification Value","v52.isdn_user_port_id", + { "ISDN User Port Identification Value", "v52.isdn_user_port_id", FT_UINT8, BASE_HEX, NULL, 0xfc, NULL, HFILL } }, {&hf_v52_isdn_user_port_id_lower, - { "ISDN User Port Identification Value (lower)","v52.user_port_id_lower", + { "ISDN User Port Identification Value (lower)", "v52.user_port_id_lower", FT_UINT8, BASE_HEX, NULL, 0xfe, NULL, HFILL } }, {&hf_v52_isdn_user_port_ts_num, - { "ISDN user port time slot number","v52.isdn_user_port_ts_num", + { "ISDN user port time slot number", "v52.isdn_user_port_ts_num", FT_UINT8, BASE_HEX, NULL, 0x1f, NULL, HFILL } }, {&hf_v52_override, @@ -2364,7 +2371,7 @@ proto_register_v52(void) NULL, HFILL } }, {&hf_v52_bcc_protocol_error_cause, { "Protocol error cause type", "v52.bcc_protocol_cause", - FT_UINT8, BASE_HEX, VALS(bcc_protocol_error_cause_type_values),0x7f, + FT_UINT8, BASE_HEX, VALS(bcc_protocol_error_cause_type_values), 0x7f, NULL, HFILL } }, {&hf_v52_diagnostic_message, { "Diagnostic message", "v52.diagnoatic_message", @@ -2379,8 +2386,8 @@ proto_register_v52(void) FT_UINT8, BASE_HEX, VALS(connection_incomplete_reason_values), 0x0, NULL, HFILL } }, {&hf_v52_link_control_function, - { "Link control function","v52.link_control_function", - FT_UINT8, BASE_HEX, VALS(link_control_function_values),0x7f, + { "Link control function", "v52.link_control_function", + FT_UINT8, BASE_HEX, VALS(link_control_function_values), 0x7f, NULL, HFILL } }, {&hf_v52_cause_type, { "Cause type", "v52.cause_type", |