From c256942255a898ea514a69b8880654b044a154ee Mon Sep 17 00:00:00 2001 From: Bill Meier Date: Mon, 1 Nov 2010 18:26:34 +0000 Subject: Use value_string_ext fcns to access various value_string arrays. Also: use value_string_const() instead of value_string() where apropriate; minor reformatting & whitespace cleanup. svn path=/trunk/; revision=34745 --- epan/dissectors/packet-gsm_a_gm.c | 2 +- epan/dissectors/packet-gtp.c | 211 +++--- epan/dissectors/packet-ndp.c | 77 +-- epan/dissectors/packet-ppp.c | 1304 +++++++++++++++++++------------------ epan/dissectors/packet-ppp.h | 2 +- 5 files changed, 813 insertions(+), 783 deletions(-) (limited to 'epan/dissectors') diff --git a/epan/dissectors/packet-gsm_a_gm.c b/epan/dissectors/packet-gsm_a_gm.c index 276c9c1745..5ab5a9d27c 100644 --- a/epan/dissectors/packet-gsm_a_gm.c +++ b/epan/dissectors/packet-gsm_a_gm.c @@ -3221,7 +3221,7 @@ de_sm_pco(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add if ( handle != NULL ) { proto_tree_add_text(tree,tvb, curr_offset-3, 2, "Protocol: %s (%u)" , - val_to_str(prot, ppp_vals, "Unknown"), prot); + val_to_str_ext_const(prot, &ppp_vals_ext, "Unknown"), prot); proto_tree_add_text(tree,tvb, curr_offset-1, 1, "Length: 0x%02x (%u)", e_len , e_len); /* * dissect the embedded message diff --git a/epan/dissectors/packet-gtp.c b/epan/dissectors/packet-gtp.c index 89af65f99f..5a5e8d18a2 100644 --- a/epan/dissectors/packet-gtp.c +++ b/epan/dissectors/packet-gtp.c @@ -465,6 +465,7 @@ static const value_string message_type[] = { {GTP_MSG_TPDU, "T-PDU"}, {0, NULL} }; +static value_string_ext message_type_ext = VALUE_STRING_EXT_INIT(message_type); /* definitions of fields in extension header */ #define GTP_EXT_CAUSE 0x01 @@ -691,6 +692,7 @@ static const value_string gtp_val[] = { {GTP_EXT_PRIV_EXT, "Private Extension"}, {0, NULL} }; +static value_string_ext gtp_val_ext = VALUE_STRING_EXT_INIT(gtp_val); /* It seems like some IE's are renamed in gtpv1 at least reading * 3GPP TS 29.060 version 6.11.0 Release 6 @@ -790,22 +792,23 @@ static const value_string gtpv1_val[] = { {GTP_EXT_PRIV_EXT, "Private Extension"}, {0, NULL} }; +static value_string_ext gtpv1_val_ext = VALUE_STRING_EXT_INIT(gtpv1_val); /* GPRS: 9.60 v7.6.0, page 37 * UMTS: 29.060 v4.0, page 45 */ static const value_string cause_type[] = { - {0, "Request IMSI"}, - {1, "Request IMEI"}, - {2, "Request IMSI and IMEI"}, - {3, "No identity needed"}, - {4, "MS refuses"}, - {5, "MS is not GPRS responding"}, - {59, "System failure"}, /* charging */ - {60, "The transmit buffers are becoming full"}, /* charging */ - {61, "The receive buffers are becoming full"}, /* charging */ - {62, "Another node is about to go down"}, /* charging */ - {63, "This node is about to go down"}, /* charging */ + { 0, "Request IMSI"}, + { 1, "Request IMEI"}, + { 2, "Request IMSI and IMEI"}, + { 3, "No identity needed"}, + { 4, "MS refuses"}, + { 5, "MS is not GPRS responding"}, + { 59, "System failure"}, /* charging */ + { 60, "The transmit buffers are becoming full"}, /* charging */ + { 61, "The receive buffers are becoming full"}, /* charging */ + { 62, "Another node is about to go down"}, /* charging */ + { 63, "This node is about to go down"}, /* charging */ {128, "Request accepted"}, {192, "Non-existent"}, {193, "Invalid message format"}, @@ -848,6 +851,7 @@ static const value_string cause_type[] = { {255, "Request not fulfilled"}, /* charging */ {0, NULL} }; +static value_string_ext cause_type_ext = VALUE_STRING_EXT_INIT(cause_type); /* GPRS: 9.02 v7.7.0 * UMTS: 29.002 v4.2.1, chapter 17.5, page 268 @@ -962,6 +966,7 @@ static const value_string qos_mean_type[] = { {0x1F, "Best effort"}, /* Class 1 */ {0, NULL} }; +static value_string_ext qos_mean_type_ext = VALUE_STRING_EXT_INIT(qos_mean_type); static const value_string qos_del_err_sdu[] = { {0x00, "Subscribed delivery of erroneous SDUs (in MS to network direction)"}, @@ -1120,6 +1125,7 @@ static const value_string qos_trans_delay[] = { {0x3F, "Reserved"}, {0, NULL} }; +static value_string_ext qos_trans_delay_ext = VALUE_STRING_EXT_INIT(qos_trans_delay); static const value_string qos_guar_ul[] = { {0x00, "Subscribed guaranteed bit rate for uplink (in MS to network direction)"}, @@ -1282,6 +1288,7 @@ static const value_string ranap_cause_type[] = { {0, NULL} }; +static value_string_ext ranap_cause_type_ext = VALUE_STRING_EXT_INIT(ranap_cause_type); static const value_string mm_sec_modep[] = { {0, "Used cipher value, UMTS keys and Quintuplets"}, @@ -2850,7 +2857,7 @@ static int decode_gtp_rai(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, p guint8 byte[3]; guint16 mnc, mcc; - te = proto_tree_add_text(tree, tvb, offset, 1, "%s", val_to_str(GTP_EXT_RAI, gtp_val, "Unknown message")); + te = proto_tree_add_text(tree, tvb, offset, 1, "%s", val_to_str_ext_const(GTP_EXT_RAI, >p_val_ext, "Unknown message")); ext_tree_rai = proto_item_add_subtree(te, ett_gtp_rai); byte[0] = tvb_get_guint8(tvb, offset + 1); @@ -2972,7 +2979,7 @@ static int decode_gtp_auth_tri(tvbuff_t * tvb, int offset, packet_info * pinfo _ proto_tree *ext_tree_auth_tri; proto_item *te; - te = proto_tree_add_text(tree, tvb, offset, 29, "%s", val_to_str(GTP_EXT_AUTH_TRI, gtp_val, "Unknown message")); + te = proto_tree_add_text(tree, tvb, offset, 29, "%s", val_to_str_ext_const(GTP_EXT_AUTH_TRI, >p_val_ext, "Unknown message")); ext_tree_auth_tri = proto_item_add_subtree(tree, ett_gtp_auth_tri); proto_tree_add_text(ext_tree_auth_tri, tvb, offset + 1, 16, "RAND: %s", tvb_bytes_to_str(tvb, offset + 1, 16)); @@ -3053,7 +3060,7 @@ static const gchar *dissect_radius_selection_mode(proto_tree * tree, tvbuff_t * sel_mode = tvb_get_guint8(tvb, 0) - 0x30; proto_tree_add_uint(tree, hf_gtp_sel_mode, tvb, 0, 1, sel_mode); - return val_to_str(sel_mode, sel_mode_type, "Unknown"); + return val_to_str_const(sel_mode, sel_mode_type, "Unknown"); } static int decode_gtp_sel_mode(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree) @@ -3127,7 +3134,7 @@ static int decode_gtp_18(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, pr switch (gtp_version) { case 0: - te = proto_tree_add_text(tree, tvb, offset, 4, "%s", val_to_str(GTP_EXT_FLOW_II, gtp_val, "Unknown message")); + te = proto_tree_add_text(tree, tvb, offset, 4, "%s", val_to_str_ext_const(GTP_EXT_FLOW_II, >p_val_ext, "Unknown message")); ext_tree_flow_ii = proto_item_add_subtree(te, ett_gtp_flow_ii); proto_tree_add_uint(ext_tree_flow_ii, hf_gtp_nsapi, tvb, offset + 1, 1, tvb_get_guint8(tvb, offset + 1) & 0x0F); @@ -3137,7 +3144,7 @@ static int decode_gtp_18(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, pr return 4; case 1: - te = proto_tree_add_text(tree, tvb, offset, 6, "%s", val_to_str(GTP_EXT_TEID_II, gtpv1_val, "Unknown message")); + te = proto_tree_add_text(tree, tvb, offset, 6, "%s", val_to_str_ext_const(GTP_EXT_TEID_II, >pv1_val_ext, "Unknown message")); ext_tree_flow_ii = proto_item_add_subtree(te, ett_gtp_flow_ii); proto_tree_add_uint(ext_tree_flow_ii, hf_gtp_nsapi, tvb, offset + 1, 1, tvb_get_guint8(tvb, offset + 1) & 0x0F); @@ -3207,38 +3214,38 @@ static int decode_gtp_ranap_cause(tvbuff_t * tvb, int offset, packet_info * pinf if (ranap > 0 && ranap <= 64) proto_tree_add_uint_format(tree, hf_gtp_ranap_cause, tvb, offset, 2, ranap, "%s (Radio Network Layer Cause) : %s (%u)", - val_to_str(GTP_EXT_RANAP_CAUSE, gtp_val, "Unknown"), - val_to_str(ranap, ranap_cause_type, "Unknown RANAP Cause"), ranap); + val_to_str_ext_const(GTP_EXT_RANAP_CAUSE, >p_val_ext, "Unknown"), + val_to_str_ext_const(ranap, &ranap_cause_type_ext, "Unknown RANAP Cause"), ranap); if (ranap > 64 && ranap <= 80) proto_tree_add_uint_format(tree, hf_gtp_ranap_cause, tvb, offset, 2, ranap, "%s (Transport Layer Cause) : %s (%u)", - val_to_str(GTP_EXT_RANAP_CAUSE, gtp_val, "Unknown"), - val_to_str(ranap, ranap_cause_type, "Unknown RANAP Cause"), ranap); + val_to_str_ext_const(GTP_EXT_RANAP_CAUSE, >p_val_ext, "Unknown"), + val_to_str_ext_const(ranap, &ranap_cause_type_ext, "Unknown RANAP Cause"), ranap); if (ranap > 80 && ranap <= 96) proto_tree_add_uint_format(tree, hf_gtp_ranap_cause, tvb, offset, 2, ranap, "%s (NAS Cause) : %s (%u)", - val_to_str(GTP_EXT_RANAP_CAUSE, gtp_val, "Unknown"), - val_to_str(ranap, ranap_cause_type, "Unknown RANAP Cause"), ranap); + val_to_str_ext_const(GTP_EXT_RANAP_CAUSE, >p_val_ext, "Unknown"), + val_to_str_ext_const(ranap, &ranap_cause_type_ext, "Unknown RANAP Cause"), ranap); if (ranap > 96 && ranap <= 112) proto_tree_add_uint_format(tree, hf_gtp_ranap_cause, tvb, offset, 2, ranap, "%s (Protocol Cause) : %s (%u)", - val_to_str(GTP_EXT_RANAP_CAUSE, gtp_val, "Unknown"), - val_to_str(ranap, ranap_cause_type, "Unknown RANAP Cause"), ranap); + val_to_str_ext_const(GTP_EXT_RANAP_CAUSE, >p_val_ext, "Unknown"), + val_to_str_ext_const(ranap, &ranap_cause_type_ext, "Unknown RANAP Cause"), ranap); if (ranap > 112 && ranap <= 128) proto_tree_add_uint_format(tree, hf_gtp_ranap_cause, tvb, offset, 2, ranap, "%s (Miscellaneous Cause) : %s (%u)", - val_to_str(GTP_EXT_RANAP_CAUSE, gtp_val, "Unknown"), - val_to_str(ranap, ranap_cause_type, "Unknown RANAP Cause"), ranap); + val_to_str_ext_const(GTP_EXT_RANAP_CAUSE, >p_val_ext, "Unknown"), + val_to_str_ext_const(ranap, &ranap_cause_type_ext, "Unknown RANAP Cause"), ranap); if (ranap > 128 /* && ranap <=255 */ ) proto_tree_add_uint_format(tree, hf_gtp_ranap_cause, tvb, offset, 2, ranap, "%s (Non-standard Cause) : %s (%u)", - val_to_str(GTP_EXT_RANAP_CAUSE, gtp_val, "Unknown"), - val_to_str(ranap, ranap_cause_type, "Unknown RANAP Cause"), ranap); + val_to_str_ext_const(GTP_EXT_RANAP_CAUSE, >p_val_ext, "Unknown"), + val_to_str_ext_const(ranap, &ranap_cause_type_ext, "Unknown RANAP Cause"), ranap); return 2; } @@ -3253,7 +3260,7 @@ static int decode_gtp_rab_cntxt(tvbuff_t * tvb, int offset, packet_info * pinfo proto_tree *ext_tree_rab_cntxt; proto_item *te; - te = proto_tree_add_text(tree, tvb, offset, 10, "%s", val_to_str(GTP_EXT_RAB_CNTXT, gtp_val, "Unknown message")); + te = proto_tree_add_text(tree, tvb, offset, 10, "%s", val_to_str_ext_const(GTP_EXT_RAB_CNTXT, >p_val_ext, "Unknown message")); ext_tree_rab_cntxt = proto_item_add_subtree(te, ett_gtp_rab_cntxt); nsapi = tvb_get_guint8(tvb, offset + 1) & 0x0F; @@ -3324,7 +3331,7 @@ static int decode_gtp_pkt_flow_id(tvbuff_t * tvb, int offset, packet_info * pinf proto_tree_add_uint(ext_tree_pkt_flow_id, hf_gtp_nsapi, tvb, offset + 1, 1, nsapi); proto_tree_add_uint_format(ext_tree_pkt_flow_id, hf_gtp_pkt_flow_id, tvb, - offset + 2, 1, pkt_flow_id, "%s : %u", val_to_str(GTP_EXT_PKT_FLOW_ID, gtp_val, "Unknown message"), pkt_flow_id); + offset + 2, 1, pkt_flow_id, "%s : %u", val_to_str_ext_const(GTP_EXT_PKT_FLOW_ID, >p_val_ext, "Unknown message"), pkt_flow_id); return 3; } @@ -3343,7 +3350,7 @@ static int decode_gtp_chrg_char(tvbuff_t * tvb, int offset, packet_info * pinfo chrg_char = tvb_get_ntohs(tvb, offset + 1); te = proto_tree_add_uint(tree, hf_gtp_chrg_char, tvb, offset, 3, chrg_char); - /*"%s: %x", val_to_str (GTP_EXT_CHRG_CHAR, gtp_val, "Unknown message"), chrg_char); */ + /*"%s: %x", val_to_str_ext_const (GTP_EXT_CHRG_CHAR, >p_val_ext, "Unknown message"), chrg_char); */ ext_tree_chrg_char = proto_item_add_subtree(te, ett_gtp_chrg_char); proto_tree_add_uint(ext_tree_chrg_char, hf_gtp_chrg_char_s, tvb, offset + 1, 2, chrg_char); @@ -3413,7 +3420,7 @@ static int decode_gtp_ra_prio_lcs(tvbuff_t * tvb, int offset, packet_info * pinf proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s : ", val_to_str(GTP_EXT_RA_PRIO_LCS, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s : ", val_to_str_ext_const(GTP_EXT_RA_PRIO_LCS, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_ra_prio_lcs); offset++; @@ -3474,8 +3481,9 @@ static int decode_gtp_user_addr(tvbuff_t * tvb, int offset, packet_info * pinfo pdp_typ = tvb_get_guint8(tvb, offset + 4); te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s (%s/%s)", - val_to_str(GTP_EXT_USER_ADDR, gtp_val, "Unknown message"), - val_to_str(pdp_org, pdp_org_type, "Unknown PDP Organization"), val_to_str(pdp_typ, pdp_type, "Unknown PDP Type")); + val_to_str_ext_const(GTP_EXT_USER_ADDR, >p_val_ext, "Unknown message"), + val_to_str_const(pdp_org, pdp_org_type, "Unknown PDP Organization"), + val_to_str_const(pdp_typ, pdp_type, "Unknown PDP Type")); ext_tree_user = proto_item_add_subtree(te, ett_gtp_user); proto_tree_add_text(ext_tree_user, tvb, offset + 1, 2, "Length : %u", length); @@ -3584,7 +3592,7 @@ static int decode_gtp_mm_cntxt(tvbuff_t * tvb, int offset, packet_info * pinfo _ tvbuff_t *l3_tvb; - te = proto_tree_add_text(tree, tvb, offset, 1, "%s", val_to_str(GTP_EXT_MM_CNTXT, gtp_val, "Unknown message")); + te = proto_tree_add_text(tree, tvb, offset, 1, "%s", val_to_str_ext_const(GTP_EXT_MM_CNTXT, >p_val_ext, "Unknown message")); ext_tree_mm = proto_item_add_subtree(te, ett_gtp_mm); /* Octet 2 - 3 */ @@ -4135,7 +4143,7 @@ static int decode_gtp_pdp_cntxt(tvbuff_t * tvb, int offset, packet_info * pinfo length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, length + 3, "%s", val_to_str(GTP_EXT_PDP_CNTXT, gtp_val, "Unknown message")); + te = proto_tree_add_text(tree, tvb, offset, length + 3, "%s", val_to_str_ext_const(GTP_EXT_PDP_CNTXT, >p_val_ext, "Unknown message")); ext_tree_pdp = proto_item_add_subtree(te, ett_gtp_pdp); vaa = (tvb_get_guint8(tvb, offset + 3) >> 6) & 0x01; @@ -4196,8 +4204,8 @@ static int decode_gtp_pdp_cntxt(tvbuff_t * tvb, int offset, packet_info * pinfo pdp_type_num = tvb_get_guint8(tvb, offset + 1); pdp_addr_len = tvb_get_guint8(tvb, offset + 2); - proto_tree_add_text(ext_tree_pdp, tvb, offset, 1, "PDP organization: %s", val_to_str(pdp_type_org, pdp_type, "Unknown PDP org")); - proto_tree_add_text(ext_tree_pdp, tvb, offset + 1, 1, "PDP type: %s", val_to_str(pdp_type_num, pdp_type, "Unknown PDP type")); + proto_tree_add_text(ext_tree_pdp, tvb, offset, 1, "PDP organization: %s", val_to_str_const(pdp_type_org, pdp_type, "Unknown PDP org")); + proto_tree_add_text(ext_tree_pdp, tvb, offset + 1, 1, "PDP type: %s", val_to_str_const(pdp_type_num, pdp_type, "Unknown PDP type")); proto_tree_add_text(ext_tree_pdp, tvb, offset + 2, 1, "PDP address length: %u", pdp_addr_len); if (pdp_addr_len > 0) { @@ -4287,7 +4295,7 @@ static int decode_gtp_apn(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, p length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, length + 3, "%s", val_to_str(GTP_EXT_APN, gtp_val, "Unknown field")); + te = proto_tree_add_text(tree, tvb, offset, length + 3, "%s", val_to_str_ext_const(GTP_EXT_APN, >p_val_ext, "Unknown field")); ext_tree_apn = proto_item_add_subtree(te, ett_gtp_apn); proto_tree_add_text(ext_tree_apn, tvb, offset + 1, 2, "APN length : %u", length); @@ -4314,7 +4322,7 @@ int decode_gtp_proto_conf(tvbuff_t * tvb, int offset, packet_info * pinfo, proto length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, length + 3, "%s", val_to_str(GTP_EXT_PROTO_CONF, gtp_val, "Unknown message")); + te = proto_tree_add_text(tree, tvb, offset, length + 3, "%s", val_to_str_ext_const(GTP_EXT_PROTO_CONF, >p_val_ext, "Unknown message")); ext_tree_proto = proto_item_add_subtree(te, ett_gtp_proto); proto_tree_add_text(ext_tree_proto, tvb, offset + 1, 2, "Length: %u", length); @@ -4338,7 +4346,7 @@ int decode_gtp_proto_conf(tvbuff_t * tvb, int offset, packet_info * pinfo, proto if (proto_len > 0) { proto_tree_add_text(ext_tree_proto, tvb, offset, 2, "Protocol %u ID: %s (0x%04x)", - cnt, val_to_str(proto_id, ppp_vals, "Unknown"), proto_id); + cnt, val_to_str_ext_const(proto_id, &ppp_vals_ext, "Unknown"), proto_id); proto_tree_add_text(ext_tree_proto, tvb, offset + 2, 1, "Protocol %u length: %u", cnt, proto_len); /* @@ -4761,7 +4769,7 @@ static int decode_gtp_hdr_list(tvbuff_t * tvb, int offset, packet_info * pinfo _ length = tvb_get_guint8(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 2 + length, "%s", val_to_str(GTP_EXT_HDR_LIST, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 2 + length, "%s", val_to_str_ext_const(GTP_EXT_HDR_LIST, >p_val_ext, "Unknown")); ext_tree_hdr_list = proto_item_add_subtree(te, ett_gtp_hdr_list); proto_tree_add_text(ext_tree_hdr_list, tvb, offset + 1, 1, "Number of Extension Header Types in list (i.e., length) : %u", length); @@ -4770,7 +4778,7 @@ static int decode_gtp_hdr_list(tvbuff_t * tvb, int offset, packet_info * pinfo _ hdr = tvb_get_guint8(tvb, offset + 2 + i); proto_tree_add_text(ext_tree_hdr_list, tvb, offset + 2 + i, 1, "No. %u --> Extension Header Type value : %s (%u)", i + 1, - val_to_str(hdr, gtp_val, "Unknown Extension Header Type"), hdr); + val_to_str_ext_const(hdr, >p_val_ext, "Unknown Extension Header Type"), hdr); } return 2 + length; @@ -4787,7 +4795,7 @@ static int decode_gtp_trigger_id(tvbuff_t * tvb, int offset, packet_info * pinfo length = tvb_get_ntohs(tvb, offset + 1); - proto_tree_add_text(tree, tvb, offset, 3 + length, "%s length : %u", val_to_str(GTP_EXT_TRIGGER_ID, gtp_val, "Unknown"), length); + proto_tree_add_text(tree, tvb, offset, 3 + length, "%s length : %u", val_to_str_ext_const(GTP_EXT_TRIGGER_ID, >p_val_ext, "Unknown"), length); return 3 + length; @@ -4804,7 +4812,7 @@ static int decode_gtp_omc_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_ length = tvb_get_ntohs(tvb, offset + 1); - proto_tree_add_text(tree, tvb, offset, 3 + length, "%s length : %u", val_to_str(GTP_EXT_OMC_ID, gtp_val, "Unknown"), length); + proto_tree_add_text(tree, tvb, offset, 3 + length, "%s length : %u", val_to_str_ext_const(GTP_EXT_OMC_ID, >p_val_ext, "Unknown"), length); return 3 + length; @@ -4824,10 +4832,10 @@ static int decode_gtp_chrg_addr(tvbuff_t * tvb, int offset, packet_info * pinfo length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s : ", val_to_str(GTP_EXT_CHRG_ADDR, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s : ", val_to_str_ext_const(GTP_EXT_CHRG_ADDR, >p_val_ext, "Unknown")); ext_tree_chrg_addr = proto_item_add_subtree(te, ett_gtp_chrg_addr); - proto_tree_add_text(ext_tree_chrg_addr, tvb, offset + 1, 2, "%s length : %u", val_to_str(GTP_EXT_CHRG_ADDR, gtp_val, "Unknown"), length); + proto_tree_add_text(ext_tree_chrg_addr, tvb, offset + 1, 2, "%s length : %u", val_to_str_ext_const(GTP_EXT_CHRG_ADDR, >p_val_ext, "Unknown"), length); switch (length) { case 4: @@ -4859,7 +4867,7 @@ static int decode_gtp_ran_tr_cont(tvbuff_t * tvb, int offset, packet_info * pinf proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s : ", val_to_str(GTP_EXT_RAN_TR_CONT, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s : ", val_to_str_ext_const(GTP_EXT_RAN_TR_CONT, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_ran_tr_cont); offset++; @@ -4883,7 +4891,7 @@ static int decode_gtp_pdp_cont_prio(tvbuff_t * tvb, int offset, packet_info * pi proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s : ", val_to_str(GTP_EXT_PDP_CONT_PRIO, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s : ", val_to_str_ext_const(GTP_EXT_PDP_CONT_PRIO, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_pdp_cont_prio); offset++; @@ -4907,7 +4915,7 @@ static int decode_gtp_add_rab_setup_inf(tvbuff_t * tvb, int offset, packet_info proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s : ", val_to_str(GTP_EXT_ADD_RAB_SETUP_INF, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s : ", val_to_str_ext_const(GTP_EXT_ADD_RAB_SETUP_INF, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_rab_setup_inf); offset++; @@ -4932,7 +4940,7 @@ static int decode_gtp_ssgn_no(tvbuff_t * tvb, int offset, packet_info * pinfo _U proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s : ", val_to_str(GTP_EXT_SSGN_NO, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s : ", val_to_str_ext_const(GTP_EXT_SSGN_NO, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_ssgn_no); offset++; @@ -4956,7 +4964,7 @@ static int decode_gtp_common_flgs(tvbuff_t * tvb, int offset, packet_info * pinf proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s : ", val_to_str(GTP_EXT_COMMON_FLGS, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s : ", val_to_str_ext_const(GTP_EXT_COMMON_FLGS, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_common_flgs); offset++; @@ -4992,7 +5000,7 @@ static int decode_gtp_apn_res(tvbuff_t * tvb, int offset, packet_info * pinfo _U proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s : ", val_to_str(GTP_EXT_APN_RES, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s : ", val_to_str_ext_const(GTP_EXT_APN_RES, >p_val_ext, "Unknown")); ext_tree_apn_res = proto_item_add_subtree(te, ett_gtp_ext_tree_apn_res); offset++; @@ -5026,7 +5034,7 @@ static int decode_gtp_rat_type(tvbuff_t * tvb, int offset, packet_info * pinfo _ proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_RAT_TYPE, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_RAT_TYPE, >p_val_ext, "Unknown")); ext_tree_rat_type = proto_item_add_subtree(te, ett_gtp_ext_rat_type); offset++; @@ -5088,7 +5096,7 @@ static int decode_gtp_usr_loc_inf(tvbuff_t * tvb, int offset, packet_info * pinf guint8 geo_loc_type; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_USR_LOC_INF, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_USR_LOC_INF, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_usr_loc_inf); offset++; @@ -5141,7 +5149,7 @@ static int decode_gtp_ms_time_zone(tvbuff_t * tvb, int offset, packet_info * pin char sign; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s: ", val_to_str(GTP_EXT_MS_TIME_ZONE, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s: ", val_to_str_ext_const(GTP_EXT_MS_TIME_ZONE, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_ms_time_zone); offset++; @@ -5166,7 +5174,7 @@ static int decode_gtp_ms_time_zone(tvbuff_t * tvb, int offset, packet_info * pin offset++; data = tvb_get_guint8(tvb, offset) & 0x3; - proto_tree_add_text(ext_tree, tvb, offset, 1, "%s", val_to_str(data, daylight_saving_time_vals, "Unknown")); + proto_tree_add_text(ext_tree, tvb, offset, 1, "%s", val_to_str_const(data, daylight_saving_time_vals, "Unknown")); return 3 + length; @@ -5187,7 +5195,7 @@ static int decode_gtp_imeisv(tvbuff_t * tvb, int offset, packet_info * pinfo _U_ const char *digit_str; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_IMEISV, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_IMEISV, >p_val_ext, "Unknown")); ext_imeisv = proto_item_add_subtree(te, ett_gtp_ext_imeisv); offset++; @@ -5221,7 +5229,7 @@ static int decode_gtp_camel_chg_inf_con(tvbuff_t * tvb, int offset, packet_info proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_CAMEL_CHG_INF_CON, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_CAMEL_CHG_INF_CON, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_camel_chg_inf_con); offset++; @@ -5246,7 +5254,7 @@ static int decode_gtp_mbms_ue_ctx(tvbuff_t * tvb, int offset, packet_info * pinf proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_MBMS_UE_CTX, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_MBMS_UE_CTX, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_GTP_EXT_MBMS_UE_CTX); offset++; @@ -5276,7 +5284,7 @@ static int decode_gtp_tmgi(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, tvbuff_t *next_tvb; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_TMGI, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_TMGI, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_tmgi); offset++; @@ -5304,7 +5312,7 @@ static int decode_gtp_rim_ra(tvbuff_t * tvb, int offset, packet_info * pinfo _U_ proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_RIM_RA, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_RIM_RA, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_rim_ra); offset++; @@ -5332,7 +5340,7 @@ static int decode_gtp_mbms_prot_conf_opt(tvbuff_t * tvb, int offset, packet_info proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_MBMS_PROT_CONF_OPT, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_MBMS_PROT_CONF_OPT, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_mbms_prot_conf_opt); offset++; @@ -5370,7 +5378,7 @@ static int decode_gtp_mbms_ses_dur(tvbuff_t * tvb, int offset, packet_info * pin proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_MBMS_SES_DUR, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_MBMS_SES_DUR, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_bms_ses_dur); offset++; @@ -5411,7 +5419,7 @@ static int decode_gtp_mbms_sa(tvbuff_t * tvb, int offset, packet_info * pinfo _U int i; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_MBMS_SA, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_MBMS_SA, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_mbms_sa); offset++; @@ -5461,7 +5469,7 @@ static int decode_gtp_src_rnc_pdp_ctx_inf(tvbuff_t * tvb, int offset, packet_inf proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_SRC_RNC_PDP_CTX_INF, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_SRC_RNC_PDP_CTX_INF, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_src_rnc_pdp_ctx_inf); offset++; @@ -5486,7 +5494,7 @@ static int decode_gtp_add_trs_inf(tvbuff_t * tvb, int offset, packet_info * pinf proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_ADD_TRS_INF, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_ADD_TRS_INF, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_add_trs_inf); offset++; @@ -5511,7 +5519,7 @@ static int decode_gtp_hop_count(tvbuff_t * tvb, int offset, packet_info * pinfo proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_HOP_COUNT, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_HOP_COUNT, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_hop_count); offset++; @@ -5536,7 +5544,7 @@ static int decode_gtp_sel_plmn_id(tvbuff_t * tvb, int offset, packet_info * pinf proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_SEL_PLMN_ID, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_SEL_PLMN_ID, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_sel_plmn_id); offset++; @@ -5561,7 +5569,7 @@ static int decode_gtp_mbms_ses_id(tvbuff_t * tvb, int offset, packet_info * pinf proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_MBMS_SES_ID, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_MBMS_SES_ID, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_mbms_ses_id); offset++; @@ -5593,7 +5601,7 @@ static int decode_gtp_mbms_2g_3g_ind(tvbuff_t * tvb, int offset, packet_info * p proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_MBMS_2G_3G_IND, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_MBMS_2G_3G_IND, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_mbms_2g_3g_ind); offset++; @@ -5618,7 +5626,7 @@ static int decode_gtp_enh_nsapi(tvbuff_t * tvb, int offset, packet_info * pinfo proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_ENH_NSAPI, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_ENH_NSAPI, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_enh_nsapi); offset++; @@ -5643,7 +5651,7 @@ static int decode_gtp_add_mbms_trs_inf(tvbuff_t * tvb, int offset, packet_info * proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_ADD_MBMS_TRS_INF, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_ADD_MBMS_TRS_INF, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_ad_mbms_trs_inf); offset++; @@ -5668,7 +5676,7 @@ static int decode_gtp_mbms_ses_id_rep_no(tvbuff_t * tvb, int offset, packet_info proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_MBMS_SES_ID_REP_NO, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_MBMS_SES_ID_REP_NO, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_mbms_ses_id_rep_no); offset++; @@ -5708,7 +5716,7 @@ static int decode_gtp_mbms_time_to_data_tr(tvbuff_t * tvb, int offset, packet_in guint8 time_2_dta_tr; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_MBMS_TIME_TO_DATA_TR, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_MBMS_TIME_TO_DATA_TR, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_mbms_time_to_data_tr); offset++; @@ -5752,7 +5760,7 @@ decode_gtp_ps_ho_req_ctx(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, pr proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_PS_HO_REQ_CTX, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_PS_HO_REQ_CTX, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_ps_ho_req_ctx); offset++; @@ -5778,7 +5786,7 @@ decode_gtp_bss_cont(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_t proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_BSS_CONT, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_BSS_CONT, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_bss_cont); offset++; @@ -5807,7 +5815,7 @@ decode_gtp_cell_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tr proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_CELL_ID, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_CELL_ID, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_cell_id); offset++; @@ -5840,7 +5848,7 @@ decode_gtp_pdu_no(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tre proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_PDU_NO, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_PDU_NO, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_pdu_no); offset++; @@ -5866,7 +5874,7 @@ decode_gtp_bssgp_cause(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, prot proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_BSSGP_CAUSE, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_BSSGP_CAUSE, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_bssgp_cause); offset++; @@ -5893,7 +5901,7 @@ decode_gtp_mbms_bearer_cap(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_BSSGP_CAUSE, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_BSSGP_CAUSE, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_bssgp_cause); offset++; @@ -5919,7 +5927,7 @@ decode_gtp_rim_ra_disc(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, prot proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_RIM_ROUTING_ADDR_DISC, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_RIM_ROUTING_ADDR_DISC, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_pdu_no); offset++; @@ -5943,7 +5951,7 @@ decode_gtp_lst_set_up_pfc(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, p proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_LIST_OF_SETUP_PFCS, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_LIST_OF_SETUP_PFCS, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_pdu_no); offset++; @@ -5969,7 +5977,7 @@ static int decode_gtp_ps_handover_xid(tvbuff_t * tvb, int offset, packet_info * guint8 xid_par_len; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_PS_HANDOVER_XIP_PAR, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_PS_HANDOVER_XIP_PAR, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_ps_handover_xid); offset++; @@ -6005,7 +6013,7 @@ static int decode_gtp_ms_inf_chg_rep_act(tvbuff_t * tvb, int offset, packet_info proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_MS_INF_CHG_REP_ACT, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_MS_INF_CHG_REP_ACT, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_pdu_no); offset++; @@ -6028,7 +6036,7 @@ static int decode_gtp_direct_tnl_flg(tvbuff_t * tvb, int offset, packet_info * p proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_DIRECT_TUNNEL_FLGS, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_DIRECT_TUNNEL_FLGS, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_pdu_no); offset++; @@ -6055,7 +6063,7 @@ static int decode_gtp_corrl_id(tvbuff_t * tvb, int offset, packet_info * pinfo _ proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_CORRELATION_ID, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_CORRELATION_ID, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_pdu_no); offset++; @@ -6078,7 +6086,7 @@ static int decode_gtp_bearer_cntrl_mod(tvbuff_t * tvb, int offset, packet_info * proto_item *te; length = tvb_get_ntohs(tvb, offset + 1); - te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_BEARER_CONTROL_MODE, gtp_val, "Unknown")); + te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_BEARER_CONTROL_MODE, >p_val_ext, "Unknown")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext_pdu_no); offset++; @@ -6155,7 +6163,7 @@ static int decode_gtp_data_req(tvbuff_t * tvb, int offset, packet_info * pinfo _ proto_item *te; tvbuff_t *next_tvb; - te = proto_tree_add_text(tree, tvb, offset, 1, "%s", val_to_str(GTP_EXT_DATA_REQ, gtp_val, "Unknown message")); + te = proto_tree_add_text(tree, tvb, offset, 1, "%s", val_to_str_ext_const(GTP_EXT_DATA_REQ, >p_val_ext, "Unknown message")); ext_tree = proto_item_add_subtree(te, ett_gtp_ext); length = tvb_get_ntohs(tvb, offset + 1); @@ -6257,7 +6265,7 @@ static int decode_gtp_priv_ext(tvbuff_t * tvb, int offset, packet_info * pinfo _ proto_tree *ext_tree_priv_ext; proto_item *te; - te = proto_tree_add_text(tree, tvb, offset, 1, "%s", val_to_str(GTP_EXT_PRIV_EXT, gtp_val, "Unknown message")); + te = proto_tree_add_text(tree, tvb, offset, 1, "%s", val_to_str_ext_const(GTP_EXT_PRIV_EXT, >p_val_ext, "Unknown message")); ext_tree_priv_ext = proto_item_add_subtree(te, ett_gtp_ext); offset++; @@ -6355,7 +6363,7 @@ static void dissect_gtp_common(tvbuff_t * tvb, packet_info * pinfo, proto_tree * break; } - col_add_str(pinfo->cinfo, COL_INFO, val_to_str(gtp_hdr.message, message_type, "Unknown")); + col_add_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(gtp_hdr.message, &message_type_ext, "Unknown")); if (tree) { ti = proto_tree_add_item(tree, proto_gtp, tvb, 0, -1, FALSE); @@ -6501,7 +6509,7 @@ static void dissect_gtp_common(tvbuff_t * tvb, packet_info * pinfo, proto_tree * break; default: proto_tree_add_text(gtp_tree, tvb, offset, 1, "[WARNING] wrong next field, should be: %s", - val_to_str(checked_field, gtp_val, "Unknown extension field")); + val_to_str_ext_const(checked_field, >p_val_ext, "Unknown extension field")); break; } } @@ -6597,7 +6605,8 @@ static void dissect_gtp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) } } if(version>2){ - proto_tree_add_text(tree, tvb, 0, -1, "No WS dissector for GTP version %u %s", version, val_to_str(version, ver_types, "Unknown")); + proto_tree_add_text(tree, tvb, 0, -1, "No WS dissector for GTP version %u %s", version, + val_to_str_const(version, ver_types, "Unknown")); return; } @@ -6642,7 +6651,7 @@ void proto_register_gtp(void) {"Response To", "gtp.response_to", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "This is a response to the GTP request in this frame", HFILL}}, {&hf_gtp_time, {"Time", "gtp.time", FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0, "The time between the Request and the Response", HFILL}}, {&hf_gtp_apn, {"APN", "gtp.apn", FT_STRING, BASE_NONE, NULL, 0, "Access Point Name", HFILL}}, - {&hf_gtp_cause, {"Cause", "gtp.cause", FT_UINT8, BASE_DEC, VALS(cause_type), 0, "Cause of operation", HFILL}}, + {&hf_gtp_cause, {"Cause", "gtp.cause", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &cause_type_ext, 0, "Cause of operation", HFILL}}, {&hf_gtp_chrg_char, {"Charging characteristics", "gtp.chrg_char", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL}}, {&hf_gtp_chrg_char_s, {"Spare", "gtp.chrg_char_s", FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_S, NULL, HFILL}}, {&hf_gtp_chrg_char_n, {"Normal charging", "gtp.chrg_char_n", FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_N, NULL, HFILL}}, @@ -6705,7 +6714,7 @@ void proto_register_gtp(void) {&hf_gtp_imsi, {"IMSI", "gtp.imsi", FT_STRING, BASE_NONE, NULL, 0, "International Mobile Subscriber Identity number", HFILL}}, {&hf_gtp_length, {"Length", "gtp.length", FT_UINT16, BASE_DEC, NULL, 0, "Length (i.e. number of octets after TID or TEID)", HFILL}}, {&hf_gtp_map_cause, {"MAP cause", "gtp.map_cause", FT_UINT8, BASE_DEC, VALS(gsm_old_GSMMAPLocalErrorcode_vals), 0, NULL, HFILL}}, - {&hf_gtp_message_type, {"Message Type", "gtp.message", FT_UINT8, BASE_HEX, VALS(message_type), 0x0, "GTP Message Type", HFILL}}, + {&hf_gtp_message_type, {"Message Type", "gtp.message", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &message_type_ext, 0x0, "GTP Message Type", HFILL}}, {&hf_gtp_ms_reason, {"MS not reachable reason", "gtp.ms_reason", FT_UINT8, BASE_DEC, VALS(ms_not_reachable_type), 0, NULL, HFILL}}, {&hf_gtp_ms_valid, {"MS validated", "gtp.ms_valid", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}}, @@ -6733,7 +6742,7 @@ void proto_register_gtp(void) {&hf_gtp_qos_spare3, {"Spare", "gtp.qos_spare3", FT_UINT8, BASE_DEC, NULL, GTP_EXT_QOS_SPARE3_MASK, "Spare (shall be sent as '000' )", HFILL}}, {&hf_gtp_qos_mean, - {"QoS mean", "gtp.qos_mean", FT_UINT8, BASE_DEC, VALS(qos_mean_type), GTP_EXT_QOS_MEAN_MASK, "Quality of Service Mean Throughput", HFILL}}, + {"QoS mean", "gtp.qos_mean", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &qos_mean_type_ext, GTP_EXT_QOS_MEAN_MASK, "Quality of Service Mean Throughput", HFILL}}, {&hf_gtp_qos_al_ret_priority, {"Allocation/Retention priority", "gtp.qos_al_ret_priority", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, {&hf_gtp_qos_traf_class, @@ -6755,7 +6764,7 @@ void proto_register_gtp(void) {"SDU Error ratio", "gtp.qos_sdu_err_ratio", FT_UINT8, BASE_DEC, VALS(qos_sdu_err_ratio), GTP_EXT_QOS_SDU_ERR_RATIO_MASK, NULL, HFILL}}, {&hf_gtp_qos_trans_delay, - {"Transfer delay", "gtp.qos_trans_delay", FT_UINT8, BASE_DEC, VALS(qos_trans_delay), GTP_EXT_QOS_TRANS_DELAY_MASK, NULL, HFILL}}, + {"Transfer delay", "gtp.qos_trans_delay", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &qos_trans_delay_ext, GTP_EXT_QOS_TRANS_DELAY_MASK, NULL, HFILL}}, {&hf_gtp_qos_traf_handl_prio, {"Traffic handling priority", "gtp.qos_traf_handl_prio", FT_UINT8, BASE_DEC, VALS(qos_traf_handl_prio), GTP_EXT_QOS_TRAF_HANDL_PRIORITY_MASK, NULL, HFILL}}, @@ -6781,7 +6790,7 @@ void proto_register_gtp(void) {&hf_gtp_rai_mnc, {"MNC", "gtp.mnc", FT_UINT8, BASE_DEC, NULL, 0, "Mobile Network Code", HFILL}}, {&hf_gtp_rai_rac, {"RAC", "gtp.rac", FT_UINT8, BASE_DEC, NULL, 0, "Routing Area Code", HFILL}}, {&hf_gtp_rai_lac, {"LAC", "gtp.lac", FT_UINT16, BASE_DEC, NULL, 0, "Location Area Code", HFILL}}, - {&hf_gtp_ranap_cause, {"RANAP cause", "gtp.ranap_cause", FT_UINT8, BASE_DEC, VALS(ranap_cause_type), 0, NULL, HFILL}}, + {&hf_gtp_ranap_cause, {"RANAP cause", "gtp.ranap_cause", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &ranap_cause_type_ext, 0, NULL, HFILL}}, {&hf_gtp_recovery, {"Recovery", "gtp.recovery", FT_UINT8, BASE_DEC, NULL, 0, "Restart counter", HFILL}}, {&hf_gtp_reorder, {"Reordering required", "gtp.reorder", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}}, {&hf_gtp_rnc_ipv4, {"RNC address IPv4", "gtp.rnc_ipv4", FT_IPv4, BASE_NONE, NULL, 0, "Radio Network Controller address IPv4", HFILL}}, @@ -7143,9 +7152,9 @@ void proto_reg_handoff_gtp(void) } gtp_over_tcp = g_gtp_over_tcp; - gtpv0_port = g_gtpv0_port; - gtpv1c_port = g_gtpv1c_port; - gtpv1u_port = g_gtpv1u_port; + gtpv0_port = g_gtpv0_port; + gtpv1c_port = g_gtpv1c_port; + gtpv1u_port = g_gtpv1u_port; dissector_add("udp.port", g_gtpv0_port, gtp_prim_handle); dissector_add("udp.port", g_gtpv1c_port, gtp_handle); diff --git a/epan/dissectors/packet-ndp.c b/epan/dissectors/packet-ndp.c index 111744dc72..b444ff4bfb 100644 --- a/epan/dissectors/packet-ndp.c +++ b/epan/dissectors/packet-ndp.c @@ -8,17 +8,17 @@ * Wireshark - Network traffic analyzer * By Gerald Combs * Copyright 1998 Gerald Combs -* +* * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. -* +* * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. -* +* * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -29,7 +29,7 @@ * Protocol (BNMP), Nortel Management MIB (NMM), Nortel Topology Discovery * Protocol (NTDP), SynOptics Network Management Protocol (SONMP). * (source: Wikipedia article on "Nortel Discovery Protocol") -* +* */ #include "config.h" @@ -44,7 +44,7 @@ #include #include -/* Although this protocol is propietary it is documented in the SynOptics MIB's +/* Although this protocol is proprietary it is documented in the SynOptics MIB's * So I'm not giving anything away :-) * The only thing I have not done is decode the segment identifier; * This changes so much depending on whether the chassis supports @@ -54,7 +54,7 @@ * http://www.nortelnetworks.com */ - + /* chassis types */ /* Last updated from version 229 ("200609010000Z") of SnpxChassisType in SYNOPTICS-ROOT-MIB.mib */ static const value_string ndp_chassis_val[] = @@ -77,6 +77,7 @@ static const value_string ndp_chassis_val[] = {16, "Ethercell"}, {17, "5005"}, {18, "Alcatel Ethernet workgroup conc."}, + {20, "2715SA"}, {21, "2486"}, {22, "28000 series"}, @@ -163,7 +164,7 @@ static const value_string ndp_chassis_val[] = {103, "Alteon Application Switch 2208"}, {104, "Alteon Application Switch 2216"}, {105, "Alteon Application Switch 3408"}, - {106, "Alteon Application Switch 3416"}, + {106, "Alteon Application Switch 3416"}, {107, "Nortel Networks Wireless LAN SecuritySwitch 2250"}, {108, "Ethernet Switch 425-48T"}, {109, "Ethernet Switch 425-24T"}, @@ -222,6 +223,7 @@ static const value_string ndp_chassis_val[] = {162, "Ethernet Routing Switch 2500-50T-PWR"}, {0, NULL} }; +static value_string_ext ndp_chassis_val_ext = VALUE_STRING_EXT_INIT(ndp_chassis_val); /* from synro179.mib - SnpxBackplaneType */ static const value_string ndp_backplane_val[] = @@ -240,6 +242,7 @@ static const value_string ndp_backplane_val[] = {12, "Ethernet, Fast Ethernet and Gigabit Ethernet"}, {0, NULL} }; +static value_string_ext ndp_backplane_val_ext = VALUE_STRING_EXT_INIT(ndp_backplane_val); static const value_string ndp_state_val[] = { @@ -260,7 +263,7 @@ static const value_string ndp_state_val[] = static int proto_ndp = -1; static int hf_ndp_ip_address = -1; -static int hf_ndp_segment_identifier = -1; +static int hf_ndp_segment_identifier = -1; static int hf_ndp_chassis_type = -1; static int hf_ndp_backplane_type = -1; static int hf_ndp_state = -1; @@ -269,15 +272,15 @@ static int hf_ndp_number_of_links = -1; static gint ett_ndp = -1; -static void +static void dissect_ndp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { const char *hello_type; proto_tree *ndp_tree = NULL; proto_item *ti; - + col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDP"); - + if (check_col(pinfo->cinfo, COL_INFO)) { hello_type = ""; if (pinfo->dl_dst.type == AT_ETHER) { @@ -297,36 +300,36 @@ dissect_ndp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) col_add_fstr(pinfo->cinfo, COL_INFO, "%sHello", hello_type); } - + if (tree) { ti = proto_tree_add_protocol_format(tree, proto_ndp, tvb, 0, 11, "Nortel Discovery Protocol"); ndp_tree = proto_item_add_subtree(ti, ett_ndp); - + proto_tree_add_item(ndp_tree, hf_ndp_ip_address, tvb, NDP_IP_ADDRESS, 4, FALSE); - - - proto_tree_add_item(ndp_tree, hf_ndp_segment_identifier, tvb, + + + proto_tree_add_item(ndp_tree, hf_ndp_segment_identifier, tvb, NDP_SEGMENT_IDENTIFIER, 3, FALSE); - - + + proto_tree_add_item(ndp_tree, hf_ndp_chassis_type, tvb, NDP_CHASSIS_TYPE, 1, FALSE); - + proto_tree_add_item(ndp_tree, hf_ndp_backplane_type, tvb, NDP_BACKPLANE_TYPE, 1, FALSE); - - + + proto_tree_add_item(ndp_tree, hf_ndp_state, tvb, NDP_STATE, 1, FALSE); - + proto_tree_add_item(ndp_tree, hf_ndp_number_of_links, tvb, NDP_NUMBER_OF_LINKS, 1, FALSE); } - - + + } @@ -338,38 +341,38 @@ proto_register_ndp(void) { &hf_ndp_ip_address, { "IP address", "ndp.ipaddress", FT_IPv4, BASE_NONE, NULL, 0x0, "IP address of the Network Management Module (NMM))", HFILL }}, - + { &hf_ndp_segment_identifier, { "Segment Identifier", "ndp.segmentident", FT_UINT24, BASE_HEX, NULL, 0x0, "Segment id of the segment from which the agent is sending the topology message", HFILL }}, - + { &hf_ndp_chassis_type, - { "Chassis type", "ndp.chassis", FT_UINT8, BASE_DEC, - VALS(ndp_chassis_val), 0x0, + { "Chassis type", "ndp.chassis", FT_UINT8, BASE_DEC|BASE_EXT_STRING, + &ndp_chassis_val_ext, 0x0, "Chassis type of the agent sending the topology message", HFILL }}, - + { &hf_ndp_backplane_type, - { "Backplane type", "ndp.backplane", FT_UINT8, BASE_DEC, - VALS(ndp_backplane_val), 0x0, + { "Backplane type", "ndp.backplane", FT_UINT8, BASE_DEC|BASE_EXT_STRING, + &ndp_backplane_val_ext, 0x0, "Backplane type of the agent sending the topology message", HFILL }}, - + { &hf_ndp_state, { "State", "ndp.state", FT_UINT8, BASE_DEC, VALS(ndp_state_val), 0x0, "Current state of this Network Management Module (NMM)", HFILL }}, - + { &hf_ndp_number_of_links, { "Number of links", "ndp.numberoflinks", FT_UINT8, BASE_DEC, NULL, 0x0, "Number of interconnect ports", HFILL }}, }; - + static gint *ett[] = { &ett_ndp, }; proto_ndp = proto_register_protocol("Nortel Discovery Protocol", "NDP", "ndp"); proto_register_field_array(proto_ndp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - + register_dissector("ndp", dissect_ndp, proto_ndp); } @@ -377,9 +380,9 @@ void proto_reg_handoff_ndp(void) { dissector_handle_t ndp_handle; - + ndp_handle = find_dissector("ndp"); - + dissector_add("llc.nortel_pid", 0x01a1, ndp_handle); /* flatnet hello */ dissector_add("llc.nortel_pid", 0x01a2, ndp_handle); /* Segment hello */ /* not got round to adding this but its really old, so I'm not sure people will see it */ diff --git a/epan/dissectors/packet-ppp.c b/epan/dissectors/packet-ppp.c index 87be555754..448727a267 100644 --- a/epan/dissectors/packet-ppp.c +++ b/epan/dissectors/packet-ppp.c @@ -171,41 +171,41 @@ static int ett_mp_flags = -1; static int proto_mplscp = -1; static gint ett_mplscp = -1; -static gint ett_mplscp_options = -1; +static gint ett_mplscp_options = -1; static int proto_cdpcp = -1; static gint ett_cdpcp = -1; -static gint ett_cdpcp_options = -1; +static gint ett_cdpcp_options = -1; -static int proto_pap = -1; /* PAP vars */ -static gint ett_pap = -1; -static gint ett_pap_data = -1; +static int proto_pap = -1; /* PAP vars */ +static gint ett_pap = -1; +static gint ett_pap_data = -1; -static gint hf_pap_code = -1; -static gint hf_pap_identifier = -1; -static gint hf_pap_length = -1; -static gint hf_pap_data = -1; -static gint hf_pap_peer_id = -1; +static gint hf_pap_code = -1; +static gint hf_pap_identifier = -1; +static gint hf_pap_length = -1; +static gint hf_pap_data = -1; +static gint hf_pap_peer_id = -1; static gint hf_pap_peer_id_length = -1; -static gint hf_pap_password = -1; +static gint hf_pap_password = -1; static gint hf_pap_password_length = -1; -static gint hf_pap_message = -1; +static gint hf_pap_message = -1; static gint hf_pap_message_length = -1; -static gint hf_pap_stuff = -1; +static gint hf_pap_stuff = -1; -static int proto_chap = -1; /* CHAP vars */ -static gint ett_chap = -1; -static gint ett_chap_data = -1; +static int proto_chap = -1; /* CHAP vars */ +static gint ett_chap = -1; +static gint ett_chap_data = -1; -static gint hf_chap_code = -1; -static gint hf_chap_identifier = -1; -static gint hf_chap_length = -1; -static gint hf_chap_data = -1; -static gint hf_chap_value_size = -1; -static gint hf_chap_value = -1; -static gint hf_chap_name = -1; -static gint hf_chap_message = -1; +static gint hf_chap_code = -1; +static gint hf_chap_identifier = -1; +static gint hf_chap_length = -1; +static gint hf_chap_data = -1; +static gint hf_chap_value_size = -1; +static gint hf_chap_value = -1; +static gint hf_chap_name = -1; +static gint hf_chap_message = -1; static int proto_ipv6cp = -1; /* IPv6CP vars */ @@ -215,7 +215,7 @@ static gint ett_ipv6cp_options = -1; static gint ett_ipv6cp_if_id_opt = -1; static gint ett_ipv6cp_compress_opt = -1; -static int proto_iphc_crtp = -1; /* CRTP vars */ +static int proto_iphc_crtp = -1; /* CRTP vars */ static int hf_iphc_crtp_cid8 = -1; static int hf_iphc_crtp_cid16 = -1; static int hf_iphc_crtp_gen = -1; @@ -269,138 +269,139 @@ static guint pppmux_def_prot_id = 0; /* * Used by the GTP dissector as well. */ -const value_string ppp_vals[] = { - {PPP_PADDING, "Padding Protocol" }, - {PPP_ROHC_SCID, "ROHC small-CID" }, - {PPP_ROHC_LCID, "ROHC large-CID" }, - {PPP_IP, "IP" }, - {PPP_OSI, "OSI" }, - {PPP_XNSIDP, "Xerox NS IDP" }, - {PPP_DEC4, "DECnet Phase IV" }, - {PPP_AT, "Appletalk" }, - {PPP_IPX, "Netware IPX/SPX"}, - {PPP_VJC_COMP, "VJ compressed TCP"}, - {PPP_VJC_UNCOMP,"VJ uncompressed TCP"}, - {PPP_BCP, "Bridging Control Protocol"}, - {PPP_ST, "Stream Protocol (ST-II)" }, - {PPP_VINES, "Vines" }, - {PPP_AT_EDDP, "AppleTalk EDDP" }, - {PPP_AT_SB, "AppleTalk SmartBuffered" }, - {PPP_MP, "Multilink"}, - {PPP_NB, "NETBIOS Framing" }, - {PPP_CISCO, "Cisco Systems" }, - {PPP_ASCOM, "Ascom Timeplex" }, - {PPP_LBLB, "Fujitsu Link Backup and Load Balancing" }, - {PPP_RL, "DCA Remote Lan" }, - {PPP_SDTP, "Serial Data Transport Protocol" }, - {PPP_LLC, "SNA over LLC" }, - {PPP_SNA, "SNA" }, - {PPP_IPV6HC, "IPv6 Header Compression " }, - {PPP_KNX, "KNX Bridging Data" }, - {PPP_ENCRYPT, "Encryption" }, - {PPP_ILE, "Individual Link Encryption" }, - {PPP_IPV6, "IPv6" }, - {PPP_MUX, "PPP Multiplexing"}, - {PPP_VSNP, "Vendor-Specific Network Protocol"}, - {PPP_RTP_FH, "RTP IPHC Full Header" }, - {PPP_RTP_CTCP, "RTP IPHC Compressed TCP" }, - {PPP_RTP_CNTCP, "RTP IPHC Compressed Non TCP" }, - {PPP_RTP_CUDP8, "RTP IPHC Compressed UDP 8" }, - {PPP_RTP_CRTP8, "RTP IPHC Compressed RTP 8" }, - {PPP_STAMPEDE, "Stampede Bridging" }, - {PPP_MPPLUS, "MP+ Protocol" }, - {PPP_NTCITS_IPI,"NTCITS IPI" }, - {PPP_ML_SLCOMP, "single link compression in multilink" }, - {PPP_COMP, "compressed packet" }, - {PPP_STP_HELLO, "802.1D Hello Packet" }, - {PPP_IBM_SR, "IBM Source Routing BPDU" }, - {PPP_DEC_LB, "DEC LANBridge100 Spanning Tree"}, - {PPP_CDP, "Cisco Discovery Protocol" }, - {PPP_NETCS, "Netcs Twin Routing" }, - {PPP_STP, "Scheduled Transfer Protocol" }, - {PPP_EDP, "Extreme Discovery Protocol" }, - {PPP_OSCP, "Optical Supervisory Channel Protocol" }, - {PPP_OSCP2, "Optical Supervisory Channel Protocol" }, - {PPP_LUXCOM, "Luxcom" }, - {PPP_SIGMA, "Sigma Network Systems" }, - {PPP_ACSP, "Apple Client Server Protocol" }, - {PPP_MPLS_UNI, "MPLS Unicast"}, - {PPP_MPLS_MULTI, "MPLS Multicast"}, - {PPP_P12844, "IEEE p1284.4 standard - data packets" }, - {PPP_TETRA, "ETSI TETRA Networks Protocol Type 1" }, - {PPP_MFTP, "Multichannel Flow Treatment Protocol" }, - {PPP_RTP_CTCPND,"RTP IPHC Compressed TCP No Delta" }, - {PPP_RTP_CS, "RTP IPHC Context State" }, - {PPP_RTP_CUDP16,"RTP IPHC Compressed UDP 16" }, - {PPP_RTP_CRDP16,"RTP IPHC Compressed RTP 16" }, - {PPP_CCCP, "Cray Communications Control Protocol" }, - {PPP_CDPD_MNRP, "CDPD Mobile Network Registration Protocol" }, - {PPP_EXPANDAP, "Expand accelerator protocol" }, - {PPP_ODSICP, "ODSICP NCP" }, - {PPP_DOCSIS, "DOCSIS DLL" }, - {PPP_CETACEANNDP, "Cetacean Network Detection Protocol" }, - {PPP_LZS, "Stacker LZS" }, - {PPP_REFTEK, "RefTek Protocol" }, - {PPP_FC, "Fibre Channel" }, - {PPP_EMIT, "EMIT Protocols" }, - {PPP_VSP, "Vendor-Specific Protocol" }, - {PPP_IPCP, "IP Control Protocol" }, - {PPP_OSICP, "OSI Control Protocol" }, - {PPP_XNSIDPCP, "Xerox NS IDP Control Protocol" }, - {PPP_DECNETCP, "DECnet Phase IV Control Protocol" }, - {PPP_ATCP, "AppleTalk Control Protocol" }, - {PPP_IPXCP, "IPX Control Protocol" }, - {PPP_BRIDGENCP, "Bridging NCP" }, - {PPP_SPCP, "Stream Protocol Control Protocol" }, - {PPP_BVCP, "Banyan Vines Control Protocol" }, - {PPP_MLCP, "Multi-Link Control Protocol" }, - {PPP_NBCP, "NETBIOS Framing Control Protocol" }, - {PPP_CISCOCP, "Cisco Systems Control Protocol" }, - {PPP_ASCOMCP, "Ascom Timeplex" }, - {PPP_LBLBCP, "Fujitsu LBLB Control Protocol" }, - {PPP_RLNCP, "DCA Remote Lan Network Control Protocol" }, - {PPP_SDCP, "Serial Data Control Protocol" }, - {PPP_LLCCP, "SNA over LLC Control Protocol" }, - {PPP_SNACP, "SNA Control Protocol" }, - {PPP_KNXCP, "KNX Bridging Control Protocol" }, - {PPP_ECP, "Encryption Control Protocol" }, - {PPP_ILECP, "Individual Encryption Control Protocol" }, - {PPP_IPV6CP, "IPv6 Control Protocol" }, - {PPP_MUXCP, "PPPMux Control Protocol"}, - {PPP_VSNCP, "Vendor-Specific Network Control Protocol"}, - {PPP_STAMPEDECP,"Stampede Bridging Control Protocol" }, - {PPP_MPPCP, "MP+ Control Protocol" }, - {PPP_IPICP, "NTCITS IPI Control Protocol" }, - {PPP_SLCC, "single link compression in multilink control" }, - {PPP_CCP, "Compression Control Protocol" }, - {PPP_CDPCP, "CDP Control Protocol" }, - {PPP_NETCSCP, "Netcs Twin Routing" }, - {PPP_STPCP, "STP - Control Protocol" }, - {PPP_EDPCP, "EDP Control Protocol" }, - {PPP_ACSPC, "Apple Client Server Protocol Control" }, - {PPP_MPLSCP, "MPLS Control Protocol" }, - {PPP_P12844CP, "IEEE p1284.4 standard - Protocol Control" }, - {PPP_TETRACP, "ETSI TETRA TNP1 Control Protocol" }, - {PPP_MFTPCP, "Multichannel Flow Treatment Protocol" }, - {PPP_LCP, "Link Control Protocol" }, - {PPP_PAP, "Password Authentication Protocol" }, - {PPP_LQR, "Link Quality Report protocol" }, - {PPP_SPAP, "Shiva Password Authentication Protocol" }, - {PPP_CBCP, "Callback Control Protocol" }, - {PPP_BACP, "Bandwidth Allocation Control Protocol" }, - {PPP_BAP, "Bandwidth Allocation Protocol" }, - {PPP_VSAP, "Vendor-Specific Authentication Protocol" }, - {PPP_CONTCP, "Container Control Protocol" }, - {PPP_CHAP, "Challenge Handshake Authentication Protocol" }, - {PPP_RSAAP, "RSA Authentication Protocol" }, - {PPP_EAP, "Extensible Authentication Protocol" }, - {PPP_SIEP, "Mitsubishi Security Information Exchange Protocol"}, - {PPP_SBAP, "Stampede Bridging Authorization Protocol" }, - {PPP_PRPAP, "Proprietary Authentication Protocol" }, - {PPP_PRPAP2, "Proprietary Authentication Protocol" }, - {PPP_PRPNIAP, "Proprietary Node ID Authentication Protocol" }, +static const value_string ppp_vals[] = { + {PPP_PADDING, "Padding Protocol" }, + {PPP_ROHC_SCID, "ROHC small-CID" }, + {PPP_ROHC_LCID, "ROHC large-CID" }, + {PPP_IP, "IP" }, + {PPP_OSI, "OSI" }, + {PPP_XNSIDP, "Xerox NS IDP" }, + {PPP_DEC4, "DECnet Phase IV" }, + {PPP_AT, "Appletalk" }, + {PPP_IPX, "Netware IPX/SPX"}, + {PPP_VJC_COMP, "VJ compressed TCP"}, + {PPP_VJC_UNCOMP, "VJ uncompressed TCP"}, + {PPP_BCP, "Bridging Control Protocol"}, + {PPP_ST, "Stream Protocol (ST-II)" }, + {PPP_VINES, "Vines" }, + {PPP_AT_EDDP, "AppleTalk EDDP" }, + {PPP_AT_SB, "AppleTalk SmartBuffered" }, + {PPP_MP, "Multilink"}, + {PPP_NB, "NETBIOS Framing" }, + {PPP_CISCO, "Cisco Systems" }, + {PPP_ASCOM, "Ascom Timeplex" }, + {PPP_LBLB, "Fujitsu Link Backup and Load Balancing" }, + {PPP_RL, "DCA Remote Lan" }, + {PPP_SDTP, "Serial Data Transport Protocol" }, + {PPP_LLC, "SNA over LLC" }, + {PPP_SNA, "SNA" }, + {PPP_IPV6HC, "IPv6 Header Compression " }, + {PPP_KNX, "KNX Bridging Data" }, + {PPP_ENCRYPT, "Encryption" }, + {PPP_ILE, "Individual Link Encryption" }, + {PPP_IPV6, "IPv6" }, + {PPP_MUX, "PPP Multiplexing"}, + {PPP_VSNP, "Vendor-Specific Network Protocol"}, + {PPP_RTP_FH, "RTP IPHC Full Header" }, + {PPP_RTP_CTCP, "RTP IPHC Compressed TCP" }, + {PPP_RTP_CNTCP, "RTP IPHC Compressed Non TCP" }, + {PPP_RTP_CUDP8, "RTP IPHC Compressed UDP 8" }, + {PPP_RTP_CRTP8, "RTP IPHC Compressed RTP 8" }, + {PPP_STAMPEDE, "Stampede Bridging" }, + {PPP_MPPLUS, "MP+ Protocol" }, + {PPP_NTCITS_IPI, "NTCITS IPI" }, + {PPP_ML_SLCOMP, "single link compression in multilink" }, + {PPP_COMP, "compressed packet" }, + {PPP_STP_HELLO, "802.1D Hello Packet" }, + {PPP_IBM_SR, "IBM Source Routing BPDU" }, + {PPP_DEC_LB, "DEC LANBridge100 Spanning Tree"}, + {PPP_CDP, "Cisco Discovery Protocol" }, + {PPP_NETCS, "Netcs Twin Routing" }, + {PPP_STP, "Scheduled Transfer Protocol" }, + {PPP_EDP, "Extreme Discovery Protocol" }, + {PPP_OSCP, "Optical Supervisory Channel Protocol" }, + {PPP_OSCP2, "Optical Supervisory Channel Protocol" }, + {PPP_LUXCOM, "Luxcom" }, + {PPP_SIGMA, "Sigma Network Systems" }, + {PPP_ACSP, "Apple Client Server Protocol" }, + {PPP_MPLS_UNI, "MPLS Unicast"}, + {PPP_MPLS_MULTI, "MPLS Multicast"}, + {PPP_P12844, "IEEE p1284.4 standard - data packets" }, + {PPP_TETRA, "ETSI TETRA Networks Protocol Type 1" }, + {PPP_MFTP, "Multichannel Flow Treatment Protocol" }, + {PPP_RTP_CTCPND, "RTP IPHC Compressed TCP No Delta" }, + {PPP_RTP_CS, "RTP IPHC Context State" }, + {PPP_RTP_CUDP16, "RTP IPHC Compressed UDP 16" }, + {PPP_RTP_CRDP16, "RTP IPHC Compressed RTP 16" }, + {PPP_CCCP, "Cray Communications Control Protocol" }, + {PPP_CDPD_MNRP, "CDPD Mobile Network Registration Protocol" }, + {PPP_EXPANDAP, "Expand accelerator protocol" }, + {PPP_ODSICP, "ODSICP NCP" }, + {PPP_DOCSIS, "DOCSIS DLL" }, + {PPP_CETACEANNDP, "Cetacean Network Detection Protocol" }, + {PPP_LZS, "Stacker LZS" }, + {PPP_REFTEK, "RefTek Protocol" }, + {PPP_FC, "Fibre Channel" }, + {PPP_EMIT, "EMIT Protocols" }, + {PPP_VSP, "Vendor-Specific Protocol" }, + {PPP_IPCP, "IP Control Protocol" }, + {PPP_OSICP, "OSI Control Protocol" }, + {PPP_XNSIDPCP, "Xerox NS IDP Control Protocol" }, + {PPP_DECNETCP, "DECnet Phase IV Control Protocol" }, + {PPP_ATCP, "AppleTalk Control Protocol" }, + {PPP_IPXCP, "IPX Control Protocol" }, + {PPP_BRIDGENCP, "Bridging NCP" }, + {PPP_SPCP, "Stream Protocol Control Protocol" }, + {PPP_BVCP, "Banyan Vines Control Protocol" }, + {PPP_MLCP, "Multi-Link Control Protocol" }, + {PPP_NBCP, "NETBIOS Framing Control Protocol" }, + {PPP_CISCOCP, "Cisco Systems Control Protocol" }, + {PPP_ASCOMCP, "Ascom Timeplex" }, + {PPP_LBLBCP, "Fujitsu LBLB Control Protocol" }, + {PPP_RLNCP, "DCA Remote Lan Network Control Protocol" }, + {PPP_SDCP, "Serial Data Control Protocol" }, + {PPP_LLCCP, "SNA over LLC Control Protocol" }, + {PPP_SNACP, "SNA Control Protocol" }, + {PPP_KNXCP, "KNX Bridging Control Protocol" }, + {PPP_ECP, "Encryption Control Protocol" }, + {PPP_ILECP, "Individual Encryption Control Protocol" }, + {PPP_IPV6CP, "IPv6 Control Protocol" }, + {PPP_MUXCP, "PPPMux Control Protocol"}, + {PPP_VSNCP, "Vendor-Specific Network Control Protocol"}, + {PPP_STAMPEDECP, "Stampede Bridging Control Protocol" }, + {PPP_MPPCP, "MP+ Control Protocol" }, + {PPP_IPICP, "NTCITS IPI Control Protocol" }, + {PPP_SLCC, "single link compression in multilink control" }, + {PPP_CCP, "Compression Control Protocol" }, + {PPP_CDPCP, "CDP Control Protocol" }, + {PPP_NETCSCP, "Netcs Twin Routing" }, + {PPP_STPCP, "STP - Control Protocol" }, + {PPP_EDPCP, "EDP Control Protocol" }, + {PPP_ACSPC, "Apple Client Server Protocol Control" }, + {PPP_MPLSCP, "MPLS Control Protocol" }, + {PPP_P12844CP, "IEEE p1284.4 standard - Protocol Control" }, + {PPP_TETRACP, "ETSI TETRA TNP1 Control Protocol" }, + {PPP_MFTPCP, "Multichannel Flow Treatment Protocol" }, + {PPP_LCP, "Link Control Protocol" }, + {PPP_PAP, "Password Authentication Protocol" }, + {PPP_LQR, "Link Quality Report protocol" }, + {PPP_SPAP, "Shiva Password Authentication Protocol" }, + {PPP_CBCP, "Callback Control Protocol" }, + {PPP_BACP, "Bandwidth Allocation Control Protocol" }, + {PPP_BAP, "Bandwidth Allocation Protocol" }, + {PPP_VSAP, "Vendor-Specific Authentication Protocol" }, + {PPP_CONTCP, "Container Control Protocol" }, + {PPP_CHAP, "Challenge Handshake Authentication Protocol" }, + {PPP_RSAAP, "RSA Authentication Protocol" }, + {PPP_EAP, "Extensible Authentication Protocol" }, + {PPP_SIEP, "Mitsubishi Security Information Exchange Protocol"}, + {PPP_SBAP, "Stampede Bridging Authorization Protocol" }, + {PPP_PRPAP, "Proprietary Authentication Protocol" }, + {PPP_PRPAP2, "Proprietary Authentication Protocol" }, + {PPP_PRPNIAP, "Proprietary Node ID Authentication Protocol" }, {0, NULL } }; +value_string_ext ppp_vals_ext = VALUE_STRING_EXT_INIT(ppp_vals); /* CP (LCP, IPCP, etc.) codes. * from pppd fsm.h @@ -498,57 +499,57 @@ static const value_string cbcp_vals[] = { }; static const value_string bap_vals[] = { - {BAP_CREQ, "Call Request" }, - {BAP_CRES, "Call Response" }, - {BAP_CBREQ, "Callback Request" }, - {BAP_CBRES, "Callback Response" }, - {BAP_LDQREQ, "Link Drop Query Request" }, - {BAP_LDQRES, "Link Drop Query Response" }, - {BAP_CSI, "Call Status Indication" }, - {BAP_CSRES, "Call Status Response" }, - {0, NULL } + {BAP_CREQ, "Call Request" }, + {BAP_CRES, "Call Response" }, + {BAP_CBREQ, "Callback Request" }, + {BAP_CBRES, "Callback Response" }, + {BAP_LDQREQ, "Link Drop Query Request" }, + {BAP_LDQRES, "Link Drop Query Response" }, + {BAP_CSI, "Call Status Indication" }, + {BAP_CSRES, "Call Status Response" }, + {0, NULL } }; -#define BAP_RESP_CODE_REQACK 0x00 -#define BAP_RESP_CODE_REQNAK 0x01 -#define BAP_RESP_CODE_REQREJ 0x02 -#define BAP_RESP_CODE_REQFULLNAK 0x03 +#define BAP_RESP_CODE_REQACK 0x00 +#define BAP_RESP_CODE_REQNAK 0x01 +#define BAP_RESP_CODE_REQREJ 0x02 +#define BAP_RESP_CODE_REQFULLNAK 0x03 static const value_string bap_resp_code_vals[] = { - {BAP_RESP_CODE_REQACK, "Request Ack" }, - {BAP_RESP_CODE_REQNAK, "Request Nak" }, - {BAP_RESP_CODE_REQREJ, "Request Rej" }, - {BAP_RESP_CODE_REQFULLNAK, "Request Full Nak" }, - {0, NULL } + {BAP_RESP_CODE_REQACK, "Request Ack" }, + {BAP_RESP_CODE_REQNAK, "Request Nak" }, + {BAP_RESP_CODE_REQREJ, "Request Rej" }, + {BAP_RESP_CODE_REQFULLNAK, "Request Full Nak" }, + {0, NULL } }; -#define BAP_LINK_TYPE_ISDN 0 /* ISDN */ -#define BAP_LINK_TYPE_X25 1 /* X.25 */ -#define BAP_LINK_TYPE_ANALOG 2 /* Analog */ -#define BAP_LINK_TYPE_SD 3 /* Switched Digital (non-ISDN) */ -#define BAP_LINK_TYPE_ISDNOV 4 /* ISDN data over voice */ -#define BAP_LINK_TYPE_RESV5 5 /* Reserved */ -#define BAP_LINK_TYPE_RESV6 6 /* Reserved */ -#define BAP_LINK_TYPE_RESV7 7 /* Reserved */ +#define BAP_LINK_TYPE_ISDN 0 /* ISDN */ +#define BAP_LINK_TYPE_X25 1 /* X.25 */ +#define BAP_LINK_TYPE_ANALOG 2 /* Analog */ +#define BAP_LINK_TYPE_SD 3 /* Switched Digital (non-ISDN) */ +#define BAP_LINK_TYPE_ISDNOV 4 /* ISDN data over voice */ +#define BAP_LINK_TYPE_RESV5 5 /* Reserved */ +#define BAP_LINK_TYPE_RESV6 6 /* Reserved */ +#define BAP_LINK_TYPE_RESV7 7 /* Reserved */ static const value_string bap_link_type_vals[] = { - {BAP_LINK_TYPE_ISDN, "ISDN" }, - {BAP_LINK_TYPE_X25, "X.25" }, - {BAP_LINK_TYPE_ANALOG, "Analog" }, - {BAP_LINK_TYPE_SD, "Switched Digital (non-ISDN)" }, - {BAP_LINK_TYPE_ISDNOV, "ISDN data over voice" }, - {BAP_LINK_TYPE_RESV5, "Reserved" }, - {BAP_LINK_TYPE_RESV6, "Reserved" }, - {BAP_LINK_TYPE_RESV7, "Reserved" }, - {0, NULL } + {BAP_LINK_TYPE_ISDN, "ISDN" }, + {BAP_LINK_TYPE_X25, "X.25" }, + {BAP_LINK_TYPE_ANALOG, "Analog" }, + {BAP_LINK_TYPE_SD, "Switched Digital (non-ISDN)" }, + {BAP_LINK_TYPE_ISDNOV, "ISDN data over voice" }, + {BAP_LINK_TYPE_RESV5, "Reserved" }, + {BAP_LINK_TYPE_RESV6, "Reserved" }, + {BAP_LINK_TYPE_RESV7, "Reserved" }, + {0, NULL } }; -#define BAP_PHONE_DELTA_SUBOPT_UNIQ_DIGIT 1 /* Unique Digit */ -#define BAP_PHONE_DELTA_SUBOPT_SUBSC_NUM 2 /* Subscriber Number */ -#define BAP_PHONE_DELTA_SUBOPT_PHONENUM_SUBADDR 3 /* Phone Number Sub Address */ +#define BAP_PHONE_DELTA_SUBOPT_UNIQ_DIGIT 1 /* Unique Digit */ +#define BAP_PHONE_DELTA_SUBOPT_SUBSC_NUM 2 /* Subscriber Number */ +#define BAP_PHONE_DELTA_SUBOPT_PHONENUM_SUBADDR 3 /* Phone Number Sub Address */ static const value_string bap_phone_delta_subopt_vals[] = { - {BAP_PHONE_DELTA_SUBOPT_UNIQ_DIGIT, "Unique Digit" }, - {BAP_PHONE_DELTA_SUBOPT_SUBSC_NUM, "Subscriber Number" }, + {BAP_PHONE_DELTA_SUBOPT_UNIQ_DIGIT, "Unique Digit" }, + {BAP_PHONE_DELTA_SUBOPT_SUBSC_NUM, "Subscriber Number" }, {BAP_PHONE_DELTA_SUBOPT_PHONENUM_SUBADDR, "Phone Number Sub Address" }, - {0, NULL } + {0, NULL } }; /* @@ -558,167 +559,168 @@ static const value_string bap_phone_delta_subopt_vals[] = { * adapted to BAP protocol. */ static const value_string q931_cause_code_vals[] = { - { 0x00, "Call successful" }, - { 0x01, "Unallocated (unassigned) number" }, - { 0x02, "No route to specified transit network" }, - { 0x03, "No route to destination" }, - { 0x04, "Send special information tone" }, - { 0x05, "Misdialled trunk prefix" }, - { 0x06, "Channel unacceptable" }, - { 0x07, "Call awarded and being delivered in an established channel" }, - { 0x08, "Prefix 0 dialed but not allowed" }, - { 0x09, "Prefix 1 dialed but not allowed" }, - { 0x0A, "Prefix 1 dialed but not required" }, - { 0x0B, "More digits received than allowed, call is proceeding" }, - { 0x10, "Normal call clearing" }, - { 0x11, "User busy" }, - { 0x12, "No user responding" }, - { 0x13, "No answer from user (user alerted)" }, - { 0x14, "Subscriber absent" }, - { 0x15, "Call rejected" }, - { 0x16, "Number changed" }, - { 0x17, "Reverse charging rejected" }, - { 0x18, "Call suspended" }, - { 0x19, "Call resumed" }, - { 0x1A, "Non-selected user clearing" }, - { 0x1B, "Destination out of order" }, - { 0x1C, "Invalid number format (incomplete number)" }, - { 0x1D, "Facility rejected" }, - { 0x1E, "Response to STATUS ENQUIRY" }, - { 0x1F, "Normal unspecified" }, - { 0x21, "Circuit out of order" }, - { 0x22, "No circuit/channel available" }, - { 0x23, "Destination unattainable" }, - { 0x25, "Degraded service" }, - { 0x26, "Network out of order" }, - { 0x27, "Transit delay range cannot be achieved" }, - { 0x28, "Throughput range cannot be achieved" }, - { 0x29, "Temporary failure" }, - { 0x2A, "Switching equipment congestion" }, - { 0x2B, "Access information discarded" }, - { 0x2C, "Requested circuit/channel not available" }, - { 0x2D, "Pre-empted" }, - { 0x2E, "Precedence call blocked" }, - { 0x2F, "Resources unavailable, unspecified" }, - { 0x31, "Quality of service unavailable" }, - { 0x32, "Requested facility not subscribed" }, - { 0x33, "Reverse charging not allowed" }, - { 0x34, "Outgoing calls barred" }, - { 0x35, "Outgoing calls barred within CUG" }, - { 0x36, "Incoming calls barred" }, - { 0x37, "Incoming calls barred within CUG" }, - { 0x38, "Call waiting not subscribed" }, - { 0x39, "Bearer capability not authorized" }, - { 0x3A, "Bearer capability not presently available" }, - { 0x3E, "Inconsistency in designated outgoing access information and subscriber class" }, - { 0x3F, "Service or option not available, unspecified" }, - { 0x41, "Bearer capability not implemented" }, - { 0x42, "Channel type not implemented" }, - { 0x43, "Transit network selection not implemented" }, - { 0x44, "Message not implemented" }, - { 0x45, "Requested facility not implemented" }, - { 0x46, "Only restricted digital information bearer capability is available" }, - { 0x4F, "Service or option not implemented, unspecified" }, - { 0x51, "Invalid call reference value" }, - { 0x52, "Identified channel does not exist" }, - { 0x53, "Call identity does not exist for suspended call" }, - { 0x54, "Call identity in use" }, - { 0x55, "No call suspended" }, - { 0x56, "Call having the requested call identity has been cleared" }, - { 0x57, "Called user not member of CUG" }, - { 0x58, "Incompatible destination" }, - { 0x59, "Non-existent abbreviated address entry" }, - { 0x5A, "Destination address missing, and direct call not subscribed" }, - { 0x5B, "Invalid transit network selection (national use)" }, - { 0x5C, "Invalid facility parameter" }, - { 0x5D, "Mandatory information element is missing" }, - { 0x5F, "Invalid message, unspecified" }, - { 0x60, "Mandatory information element is missing" }, - { 0x61, "Message type non-existent or not implemented" }, - { 0x62, "Message not compatible with call state or message type non-existent or not implemented" }, - { 0x63, "Information element non-existent or not implemented" }, - { 0x64, "Invalid information element contents" }, - { 0x65, "Message not compatible with call state" }, - { 0x66, "Recovery on timer expiry" }, - { 0x67, "Parameter non-existent or not implemented - passed on" }, - { 0x6E, "Message with unrecognized parameter discarded" }, - { 0x6F, "Protocol error, unspecified" }, - { 0x7F, "Internetworking, unspecified" }, + { 0x00, "Call successful" }, + { 0x01, "Unallocated (unassigned) number" }, + { 0x02, "No route to specified transit network" }, + { 0x03, "No route to destination" }, + { 0x04, "Send special information tone" }, + { 0x05, "Misdialled trunk prefix" }, + { 0x06, "Channel unacceptable" }, + { 0x07, "Call awarded and being delivered in an established channel" }, + { 0x08, "Prefix 0 dialed but not allowed" }, + { 0x09, "Prefix 1 dialed but not allowed" }, + { 0x0A, "Prefix 1 dialed but not required" }, + { 0x0B, "More digits received than allowed, call is proceeding" }, + { 0x10, "Normal call clearing" }, + { 0x11, "User busy" }, + { 0x12, "No user responding" }, + { 0x13, "No answer from user (user alerted)" }, + { 0x14, "Subscriber absent" }, + { 0x15, "Call rejected" }, + { 0x16, "Number changed" }, + { 0x17, "Reverse charging rejected" }, + { 0x18, "Call suspended" }, + { 0x19, "Call resumed" }, + { 0x1A, "Non-selected user clearing" }, + { 0x1B, "Destination out of order" }, + { 0x1C, "Invalid number format (incomplete number)" }, + { 0x1D, "Facility rejected" }, + { 0x1E, "Response to STATUS ENQUIRY" }, + { 0x1F, "Normal unspecified" }, + { 0x21, "Circuit out of order" }, + { 0x22, "No circuit/channel available" }, + { 0x23, "Destination unattainable" }, + { 0x25, "Degraded service" }, + { 0x26, "Network out of order" }, + { 0x27, "Transit delay range cannot be achieved" }, + { 0x28, "Throughput range cannot be achieved" }, + { 0x29, "Temporary failure" }, + { 0x2A, "Switching equipment congestion" }, + { 0x2B, "Access information discarded" }, + { 0x2C, "Requested circuit/channel not available" }, + { 0x2D, "Pre-empted" }, + { 0x2E, "Precedence call blocked" }, + { 0x2F, "Resources unavailable, unspecified" }, + { 0x31, "Quality of service unavailable" }, + { 0x32, "Requested facility not subscribed" }, + { 0x33, "Reverse charging not allowed" }, + { 0x34, "Outgoing calls barred" }, + { 0x35, "Outgoing calls barred within CUG" }, + { 0x36, "Incoming calls barred" }, + { 0x37, "Incoming calls barred within CUG" }, + { 0x38, "Call waiting not subscribed" }, + { 0x39, "Bearer capability not authorized" }, + { 0x3A, "Bearer capability not presently available" }, + { 0x3E, "Inconsistency in designated outgoing access information and subscriber class" }, + { 0x3F, "Service or option not available, unspecified" }, + { 0x41, "Bearer capability not implemented" }, + { 0x42, "Channel type not implemented" }, + { 0x43, "Transit network selection not implemented" }, + { 0x44, "Message not implemented" }, + { 0x45, "Requested facility not implemented" }, + { 0x46, "Only restricted digital information bearer capability is available" }, + { 0x4F, "Service or option not implemented, unspecified" }, + { 0x51, "Invalid call reference value" }, + { 0x52, "Identified channel does not exist" }, + { 0x53, "Call identity does not exist for suspended call" }, + { 0x54, "Call identity in use" }, + { 0x55, "No call suspended" }, + { 0x56, "Call having the requested call identity has been cleared" }, + { 0x57, "Called user not member of CUG" }, + { 0x58, "Incompatible destination" }, + { 0x59, "Non-existent abbreviated address entry" }, + { 0x5A, "Destination address missing, and direct call not subscribed" }, + { 0x5B, "Invalid transit network selection (national use)" }, + { 0x5C, "Invalid facility parameter" }, + { 0x5D, "Mandatory information element is missing" }, + { 0x5F, "Invalid message, unspecified" }, + { 0x60, "Mandatory information element is missing" }, + { 0x61, "Message type non-existent or not implemented" }, + { 0x62, "Message not compatible with call state or message type non-existent or not implemented" }, + { 0x63, "Information element non-existent or not implemented" }, + { 0x64, "Invalid information element contents" }, + { 0x65, "Message not compatible with call state" }, + { 0x66, "Recovery on timer expiry" }, + { 0x67, "Parameter non-existent or not implemented - passed on" }, + { 0x6E, "Message with unrecognized parameter discarded" }, + { 0x6F, "Protocol error, unspecified" }, + { 0x7F, "Internetworking, unspecified" }, { 0xFF, "Non-specific failure" }, - { 0, NULL } + { 0, NULL } }; +static value_string_ext q931_cause_code_vals_ext = VALUE_STRING_EXT_INIT(q931_cause_code_vals); static const value_string bap_call_status_opt_action_vals[] = { - {0, "No retry" }, - {1, "Retry" }, - {0, NULL } + {0, "No retry" }, + {1, "Retry" }, + {0, NULL } }; -#define STAC_CM_NONE 0 -#define STAC_CM_LCB 1 -#define STAC_CM_CRC 2 -#define STAC_CM_SN 3 -#define STAC_CM_EXTMODE 4 +#define STAC_CM_NONE 0 +#define STAC_CM_LCB 1 +#define STAC_CM_CRC 2 +#define STAC_CM_SN 3 +#define STAC_CM_EXTMODE 4 static const value_string stac_checkmode_vals[] = { - {STAC_CM_NONE, "None" }, - {STAC_CM_LCB, "LCB" }, - {STAC_CM_CRC, "CRC" }, - {STAC_CM_SN, "Sequence Number" }, - {STAC_CM_EXTMODE, "Extended Mode" }, - {0, NULL } + {STAC_CM_NONE, "None" }, + {STAC_CM_LCB, "LCB" }, + {STAC_CM_CRC, "CRC" }, + {STAC_CM_SN, "Sequence Number" }, + {STAC_CM_EXTMODE, "Extended Mode" }, + {0, NULL } }; -#define LZSDCP_CM_NONE 0 -#define LZSDCP_CM_LCB 1 -#define LZSDCP_CM_SN 2 -#define LZSDCP_CM_SN_LCB 3 +#define LZSDCP_CM_NONE 0 +#define LZSDCP_CM_LCB 1 +#define LZSDCP_CM_SN 2 +#define LZSDCP_CM_SN_LCB 3 static const value_string lzsdcp_checkmode_vals[] = { - {LZSDCP_CM_NONE, "None" }, - {LZSDCP_CM_LCB, "LCB" }, - {LZSDCP_CM_SN, "Sequence Number" }, - {LZSDCP_CM_SN_LCB, "Sequence Number + LCB" }, - {0, NULL } + {LZSDCP_CM_NONE, "None" }, + {LZSDCP_CM_LCB, "LCB" }, + {LZSDCP_CM_SN, "Sequence Number" }, + {LZSDCP_CM_SN_LCB, "Sequence Number + LCB" }, + {0, NULL } }; -#define LZSDCP_PM_NONE 0 -#define LZSDCP_PM_PROC_UNCOMP 1 +#define LZSDCP_PM_NONE 0 +#define LZSDCP_PM_PROC_UNCOMP 1 static const value_string lzsdcp_processmode_vals[] = { - {LZSDCP_PM_NONE, "None" }, - {LZSDCP_PM_PROC_UNCOMP, "Process-Uncompressed" }, - {0, NULL } + {LZSDCP_PM_NONE, "None" }, + {LZSDCP_PM_PROC_UNCOMP, "Process-Uncompressed" }, + {0, NULL } }; /* * Options. (LCP) */ -#define CI_MRU 1 /* Maximum Receive Unit */ -#define CI_ASYNCMAP 2 /* Async Control Character Map */ -#define CI_AUTHTYPE 3 /* Authentication Type */ -#define CI_QUALITY 4 /* Quality Protocol */ -#define CI_MAGICNUMBER 5 /* Magic Number */ -#define CI_PCOMPRESSION 7 /* Protocol Field Compression */ -#define CI_ACCOMPRESSION 8 /* Address/Control Field Compression */ -#define CI_FCS_ALTERNATIVES 9 /* FCS Alternatives (RFC 1570) */ -#define CI_SELF_DESCRIBING_PAD 10 /* Self-Describing Pad (RFC 1570) */ -#define CI_NUMBERED_MODE 11 /* Numbered Mode (RFC 1663) */ -#define CI_CALLBACK 13 /* Callback (RFC 1570) */ -#define CI_COMPOUND_FRAMES 15 /* Compound frames (RFC 1570) */ -#define CI_MULTILINK_MRRU 17 /* Multilink MRRU (RFC 1990) */ -#define CI_MULTILINK_SSNH 18 /* Multilink Short Sequence Number - Header (RFC 1990) */ -#define CI_MULTILINK_EP_DISC 19 /* Multilink Endpoint Discriminator - (RFC 1990) */ -#define CI_DCE_IDENTIFIER 21 /* DCE Identifier */ -#define CI_MULTILINK_PLUS_PROC 22 /* Multilink Plus Procedure */ -#define CI_LINK_DISC_FOR_BACP 23 /* Link Discriminator for BACP - (RFC 2125) */ -#define CI_LCP_AUTHENTICATION 24 /* LCP Authentication Option */ -#define CI_COBS 25 /* Consistent Overhead Byte - Stuffing */ -#define CI_PREFIX_ELISION 26 /* Prefix elision */ -#define CI_MULTILINK_HDR_FMT 27 /* Multilink header format */ -#define CI_INTERNATIONALIZATION 28 /* Internationalization (RFC 2484) */ -#define CI_SDL_ON_SONET_SDH 29 /* Simple Data Link on SONET/SDH */ +#define CI_MRU 1 /* Maximum Receive Unit */ +#define CI_ASYNCMAP 2 /* Async Control Character Map */ +#define CI_AUTHTYPE 3 /* Authentication Type */ +#define CI_QUALITY 4 /* Quality Protocol */ +#define CI_MAGICNUMBER 5 /* Magic Number */ +#define CI_PCOMPRESSION 7 /* Protocol Field Compression */ +#define CI_ACCOMPRESSION 8 /* Address/Control Field Compression */ +#define CI_FCS_ALTERNATIVES 9 /* FCS Alternatives (RFC 1570) */ +#define CI_SELF_DESCRIBING_PAD 10 /* Self-Describing Pad (RFC 1570) */ +#define CI_NUMBERED_MODE 11 /* Numbered Mode (RFC 1663) */ +#define CI_CALLBACK 13 /* Callback (RFC 1570) */ +#define CI_COMPOUND_FRAMES 15 /* Compound frames (RFC 1570) */ +#define CI_MULTILINK_MRRU 17 /* Multilink MRRU (RFC 1990) */ +#define CI_MULTILINK_SSNH 18 /* Multilink Short Sequence Number + Header (RFC 1990) */ +#define CI_MULTILINK_EP_DISC 19 /* Multilink Endpoint Discriminator + (RFC 1990) */ +#define CI_DCE_IDENTIFIER 21 /* DCE Identifier */ +#define CI_MULTILINK_PLUS_PROC 22 /* Multilink Plus Procedure */ +#define CI_LINK_DISC_FOR_BACP 23 /* Link Discriminator for BACP + (RFC 2125) */ +#define CI_LCP_AUTHENTICATION 24 /* LCP Authentication Option */ +#define CI_COBS 25 /* Consistent Overhead Byte + Stuffing */ +#define CI_PREFIX_ELISION 26 /* Prefix elision */ +#define CI_MULTILINK_HDR_FMT 27 /* Multilink header format */ +#define CI_INTERNATIONALIZATION 28 /* Internationalization (RFC 2484) */ +#define CI_SDL_ON_SONET_SDH 29 /* Simple Data Link on SONET/SDH */ static void dissect_lcp_mru_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, int offset, guint length, packet_info *pinfo, @@ -956,22 +958,22 @@ static const ip_tcp_opt lcp_opts[] = { } }; -#define N_LCP_OPTS (sizeof lcp_opts / sizeof lcp_opts[0]) +#define N_LCP_OPTS (sizeof lcp_opts / sizeof lcp_opts[0]) /* * Options. (VSNCP) */ -#define CI_PDN_IDENTIFIER 1 -#define CI_ACCESS_POINT_NM 2 -#define CI_PDN_TYPE 3 -#define CI_PDN_ADDRESS 4 -#define CI_PROTOCOL_CONFIG 5 -#define CI_ERROR_CODE 6 -#define CI_ATTACH_TYPE 7 -#define CI_IPv4DEFAULT_ROUTER 8 -#define CI_ADDRESS_ALLOC 9 -#define CI_APN_AMBR 10 +#define CI_PDN_IDENTIFIER 1 +#define CI_ACCESS_POINT_NM 2 +#define CI_PDN_TYPE 3 +#define CI_PDN_ADDRESS 4 +#define CI_PROTOCOL_CONFIG 5 +#define CI_ERROR_CODE 6 +#define CI_ATTACH_TYPE 7 +#define CI_IPv4DEFAULT_ROUTER 8 +#define CI_ADDRESS_ALLOC 9 +#define CI_APN_AMBR 10 static void dissect_vsncp_pdnid_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, int offset, guint length, packet_info *pinfo, @@ -1084,34 +1086,34 @@ static const ip_tcp_opt vsncp_opts[] = { } }; -#define N_VSNCP_OPTS (sizeof vsncp_opts / sizeof vsncp_opts[0]) +#define N_VSNCP_OPTS (sizeof vsncp_opts / sizeof vsncp_opts[0]) /* * CHAP Algorithms */ -#define CHAP_ALG_MD5 0x05 /* CHAP with MD5 */ -#define CHAP_ALG_MSV1 0x80 /* MS-CHAPv1 */ -#define CHAP_ALG_MSV2 0x81 /* MS-CHAPv2 */ +#define CHAP_ALG_MD5 0x05 /* CHAP with MD5 */ +#define CHAP_ALG_MSV1 0x80 /* MS-CHAPv1 */ +#define CHAP_ALG_MSV2 0x81 /* MS-CHAPv2 */ static const value_string chap_alg_vals[] = { - {CHAP_ALG_MD5, "CHAP with MD5" }, - {CHAP_ALG_MSV1, "MS-CHAP" }, - {CHAP_ALG_MSV2, "MS-CHAP-2" }, - {0, NULL } + {CHAP_ALG_MD5, "CHAP with MD5" }, + {CHAP_ALG_MSV1, "MS-CHAP" }, + {CHAP_ALG_MSV2, "MS-CHAP-2" }, + {0, NULL } }; /* * Options. (IPCP) */ -#define CI_ADDRS 1 /* IP Addresses (deprecated) (RFC 1172) */ -#define CI_COMPRESSTYPE 2 /* Compression Type (RFC 1332) */ -#define CI_ADDR 3 /* IP Address (RFC 1332) */ -#define CI_MOBILE_IPv4 4 /* Mobile IPv4 (RFC 2290) */ -#define CI_MS_DNS1 129 /* Primary DNS value (RFC 1877) */ -#define CI_MS_WINS1 130 /* Primary WINS value (RFC 1877) */ -#define CI_MS_DNS2 131 /* Secondary DNS value (RFC 1877) */ -#define CI_MS_WINS2 132 /* Secondary WINS value (RFC 1877) */ +#define CI_ADDRS 1 /* IP Addresses (deprecated) (RFC 1172) */ +#define CI_COMPRESSTYPE 2 /* Compression Type (RFC 1332) */ +#define CI_ADDR 3 /* IP Address (RFC 1332) */ +#define CI_MOBILE_IPv4 4 /* Mobile IPv4 (RFC 2290) */ +#define CI_MS_DNS1 129 /* Primary DNS value (RFC 1877) */ +#define CI_MS_WINS1 130 /* Primary WINS value (RFC 1877) */ +#define CI_MS_DNS2 131 /* Secondary DNS value (RFC 1877) */ +#define CI_MS_WINS2 132 /* Secondary WINS value (RFC 1877) */ static void dissect_ipcp_addrs_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, int offset, guint length, packet_info *pinfo, @@ -1193,32 +1195,32 @@ static const ip_tcp_opt ipcp_opts[] = { } }; -#define N_IPCP_OPTS (sizeof ipcp_opts / sizeof ipcp_opts[0]) +#define N_IPCP_OPTS (sizeof ipcp_opts / sizeof ipcp_opts[0]) /* * IP Compression options */ -#define IPCP_COMPRESS_VJ_1172 0x37 /* value defined in RFC1172 (typo) */ -#define IPCP_COMPRESS_VJ 0x2d /* value defined in RFC1332 (correct) */ -#define IPCP_COMPRESS_IPHC 0x61 +#define IPCP_COMPRESS_VJ_1172 0x37 /* value defined in RFC1172 (typo) */ +#define IPCP_COMPRESS_VJ 0x2d /* value defined in RFC1332 (correct) */ +#define IPCP_COMPRESS_IPHC 0x61 const value_string ipcp_compress_proto_vals[] = { - { IPCP_COMPRESS_VJ_1172, "VJ compression (RFC1172-typo)" }, - { IPCP_COMPRESS_VJ, "VJ compression" }, - { IPCP_COMPRESS_IPHC, "IPHC compression" }, - { 0, NULL } + { IPCP_COMPRESS_VJ_1172, "VJ compression (RFC1172-typo)" }, + { IPCP_COMPRESS_VJ, "VJ compression" }, + { IPCP_COMPRESS_IPHC, "IPHC compression" }, + { 0, NULL } }; /* IPHC suboptions (RFC2508, 3544) */ -#define IPCP_IPHC_CRTP 1 -#define IPCP_IPHC_ECRTP 2 -#define IPCP_IPHC_DISABLE_PROTO 3 /* Disable compression for protocol */ +#define IPCP_IPHC_CRTP 1 +#define IPCP_IPHC_ECRTP 2 +#define IPCP_IPHC_DISABLE_PROTO 3 /* Disable compression for protocol */ const value_string ipcp_iphc_disable_proto_vals[] = { - { 1, "TCP" }, - { 2, "Non-TCP" }, - { 0, NULL } + { 1, "TCP" }, + { 2, "Non-TCP" }, + { 0, NULL } }; static const ip_tcp_opt ipcp_iphc_subopts[] = { @@ -1276,31 +1278,31 @@ static const ip_tcp_opt osicp_opts[] = { /* * Options. (CCP) */ -#define CI_CCP_OUI 0 /* OUI (RFC1962) */ -#define CI_CCP_PREDICT1 1 /* Predictor type 1 (RFC1962) */ -#define CI_CCP_PREDICT2 2 /* Predictor type 2 (RFC1962) */ -#define CI_CCP_PUDDLE 3 /* Puddle Jumper (RFC1962) */ -#define CI_CCP_HPPPC 16 /* Hewlett-Packard PPC (RFC1962) */ -#define CI_CCP_STAC 17 /* stac Electronics LZS (RFC1974) */ -#define CI_CCP_MPPC 18 /* Microsoft PPC (RFC2218/3078) */ -#define CI_CCP_GFZA 19 /* Gandalf FZA (RFC1962) */ -#define CI_CCP_V42BIS 20 /* V.42bis compression */ -#define CI_CCP_BSDLZW 21 /* BSD LZW Compress (RFC1977) */ -#define CI_CCP_LZSDCP 23 /* LZS-DCP (RFC1967) */ -#define CI_CCP_MVRCA 24 /* MVRCA (Magnalink) (RFC1975) */ -#define CI_CCP_DEFLATE 26 /* Deflate (RFC1979) */ -#define CI_CCP_RESERVED 255 /* Reserved (RFC1962) */ +#define CI_CCP_OUI 0 /* OUI (RFC1962) */ +#define CI_CCP_PREDICT1 1 /* Predictor type 1 (RFC1962) */ +#define CI_CCP_PREDICT2 2 /* Predictor type 2 (RFC1962) */ +#define CI_CCP_PUDDLE 3 /* Puddle Jumper (RFC1962) */ +#define CI_CCP_HPPPC 16 /* Hewlett-Packard PPC (RFC1962) */ +#define CI_CCP_STAC 17 /* stac Electronics LZS (RFC1974) */ +#define CI_CCP_MPPC 18 /* Microsoft PPC (RFC2218/3078) */ +#define CI_CCP_GFZA 19 /* Gandalf FZA (RFC1962) */ +#define CI_CCP_V42BIS 20 /* V.42bis compression */ +#define CI_CCP_BSDLZW 21 /* BSD LZW Compress (RFC1977) */ +#define CI_CCP_LZSDCP 23 /* LZS-DCP (RFC1967) */ +#define CI_CCP_MVRCA 24 /* MVRCA (Magnalink) (RFC1975) */ +#define CI_CCP_DEFLATE 26 /* Deflate (RFC1979) */ +#define CI_CCP_RESERVED 255 /* Reserved (RFC1962) */ /* * Microsoft Point-To-Point Compression (MPPC) and Encryption (MPPE) * supported bits. */ -#define MPPC_SUPPORTED_BITS_C 0x00000001 /* MPPC negotiation */ -#define MPPE_SUPPORTED_BITS_D 0x00000010 /* Obsolete */ -#define MPPE_SUPPORTED_BITS_L 0x00000020 /* 40-bit encryption */ -#define MPPE_SUPPORTED_BITS_S 0x00000040 /* 128-bit encryption */ -#define MPPE_SUPPORTED_BITS_M 0x00000080 /* 56-bit encryption */ -#define MPPE_SUPPORTED_BITS_H 0x01000000 /* stateless mode */ +#define MPPC_SUPPORTED_BITS_C 0x00000001 /* MPPC negotiation */ +#define MPPE_SUPPORTED_BITS_D 0x00000010 /* Obsolete */ +#define MPPE_SUPPORTED_BITS_L 0x00000020 /* 40-bit encryption */ +#define MPPE_SUPPORTED_BITS_S 0x00000040 /* 128-bit encryption */ +#define MPPE_SUPPORTED_BITS_M 0x00000080 /* 56-bit encryption */ +#define MPPE_SUPPORTED_BITS_H 0x01000000 /* stateless mode */ static void dissect_ccp_stac_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, int offset, guint length, packet_info *pinfo, @@ -1380,16 +1382,16 @@ static const ip_tcp_opt ccp_opts[] = { }, }; -#define N_CCP_OPTS (sizeof ccp_opts / sizeof ccp_opts[0]) +#define N_CCP_OPTS (sizeof ccp_opts / sizeof ccp_opts[0]) /* * Options. (CBCP) */ -#define CI_CBCP_NO_CALLBACK 1 /* No callback */ -#define CI_CBCP_CB_USER 2 /* Callback to a user-specified number */ -#define CI_CBCP_CB_PRE 3 /* Callback to a pre-specified or +#define CI_CBCP_NO_CALLBACK 1 /* No callback */ +#define CI_CBCP_CB_USER 2 /* Callback to a user-specified number */ +#define CI_CBCP_CB_PRE 3 /* Callback to a pre-specified or administrator specified number */ -#define CI_CBCP_CB_ANY 4 /* Callback to any of a list of numbers */ +#define CI_CBCP_CB_ANY 4 /* Callback to any of a list of numbers */ static void dissect_cbcp_no_callback_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, int offset, guint length, packet_info *pinfo, @@ -1435,12 +1437,12 @@ static const ip_tcp_opt cbcp_opts[] = { }; -#define N_CBCP_OPTS (sizeof cbcp_opts / sizeof cbcp_opts[0]) +#define N_CBCP_OPTS (sizeof cbcp_opts / sizeof cbcp_opts[0]) /* * Options. (BACP) */ -#define CI_BACP_FAVORED_PEER 1 /* Favored-Peer */ +#define CI_BACP_FAVORED_PEER 1 /* Favored-Peer */ static void dissect_bacp_favored_peer_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, int offset, guint length, packet_info *pinfo, @@ -1457,17 +1459,17 @@ static const ip_tcp_opt bacp_opts[] = { } }; -#define N_BACP_OPTS (sizeof bacp_opts / sizeof bacp_opts[0]) +#define N_BACP_OPTS (sizeof bacp_opts / sizeof bacp_opts[0]) /* * Options. (BAP) */ -#define CI_BAP_LINK_TYPE 1 /* Link Type */ -#define CI_BAP_PHONE_DELTA 2 /* Phone-Delta */ -#define CI_BAP_NO_PHONE_NUM_NEEDED 3 /* No Phone Number Needed */ -#define CI_BAP_REASON 4 /* Reason */ -#define CI_BAP_LINK_DISC 5 /* Link Discriminator */ -#define CI_BAP_CALL_STATUS 6 /* Call Status */ +#define CI_BAP_LINK_TYPE 1 /* Link Type */ +#define CI_BAP_PHONE_DELTA 2 /* Phone-Delta */ +#define CI_BAP_NO_PHONE_NUM_NEEDED 3 /* No Phone Number Needed */ +#define CI_BAP_REASON 4 /* Reason */ +#define CI_BAP_LINK_DISC 5 /* Link Discriminator */ +#define CI_BAP_CALL_STATUS 6 /* Call Status */ static void dissect_bap_link_type_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, int offset, guint length, packet_info *pinfo, @@ -1540,7 +1542,7 @@ static const ip_tcp_opt bap_opts[] = { } }; -#define N_BAP_OPTS (sizeof bap_opts / sizeof bap_opts[0]) +#define N_BAP_OPTS (sizeof bap_opts / sizeof bap_opts[0]) static void dissect_ppp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); @@ -1599,8 +1601,8 @@ static const ip_tcp_opt pppmuxcp_opts[] = { /* * Options. (IPv6CP) */ -#define CI_IPV6CP_IF_ID 1 /* Interface Identifier (RFC 2472) */ -#define CI_IPV6CP_COMPRESSTYPE 2 /* Compression Type (RFC 2472) */ +#define CI_IPV6CP_IF_ID 1 /* Interface Identifier (RFC 2472) */ +#define CI_IPV6CP_COMPRESSTYPE 2 /* Compression Type (RFC 2472) */ static void dissect_ipv6cp_if_id_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, int offset, guint length, packet_info *pinfo, @@ -1625,7 +1627,7 @@ static const ip_tcp_opt ipv6cp_opts[] = { }, }; -#define N_IPV6CP_OPTS (sizeof ipv6cp_opts / sizeof ipv6cp_opts[0]) +#define N_IPV6CP_OPTS (sizeof ipv6cp_opts / sizeof ipv6cp_opts[0]) /* ******************************************************************************* @@ -1852,9 +1854,9 @@ dissect_lcp_async_map_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, int offset, */ map = tvb_get_ntohl(tvb, offset + 2); if (map == 0x00000000) - mapstr = "None"; /* don't map any control characters */ + mapstr = "None"; /* don't map any control characters */ else if (map == 0xffffffff) - mapstr = "All"; /* map all control characters */ + mapstr = "All"; /* map all control characters */ else { #define MAX_MAPSTR_LEN (32*(10+2)+1) mapstr=ep_alloc(MAX_MAPSTR_LEN); @@ -1890,7 +1892,7 @@ dissect_lcp_protocol_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, int offset, length -= 2; protocol = tvb_get_ntohs(tvb, offset); proto_tree_add_text(field_tree, tvb, offset, 2, "%s: %s (0x%02x)", optp->name, - val_to_str(protocol, ppp_vals, "Unknown"), protocol); + val_to_str_ext_const(protocol, &ppp_vals_ext, "Unknown"), protocol); offset += 2; length -= 2; if (length > 0) @@ -1915,7 +1917,7 @@ dissect_lcp_authprot_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, int offset, length -= 2; protocol = tvb_get_ntohs(tvb, offset); proto_tree_add_text(field_tree, tvb, offset, 2, "%s: %s (0x%02x)", optp->name, - val_to_str(protocol, ppp_vals, "Unknown"), protocol); + val_to_str_ext_const(protocol, &ppp_vals_ext, "Unknown"), protocol); offset += 2; length -= 2; if (length > 0) { @@ -1923,7 +1925,7 @@ dissect_lcp_authprot_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, int offset, algorithm = tvb_get_guint8(tvb, offset); proto_tree_add_text(field_tree, tvb, offset, length, "Algorithm: %s (0x%02x)", - val_to_str(algorithm, chap_alg_vals, "Unknown"), + val_to_str_const(algorithm, chap_alg_vals, "Unknown"), algorithm); offset++; } else { @@ -2025,7 +2027,7 @@ dissect_lcp_callback_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, int offset, length -= 2; operation = tvb_get_guint8(tvb, offset); proto_tree_add_text(field_tree, tvb, offset, 1, "Operation: %s (0x%02x)", - val_to_str(operation, callback_op_vals, "Unknown"), + val_to_str_const(operation, callback_op_vals, "Unknown"), operation); offset += 1; length -= 1; @@ -2043,12 +2045,12 @@ dissect_lcp_multilink_mrru_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, tvb_get_ntohs(tvb, offset + 2)); } -#define CLASS_NULL 0 -#define CLASS_LOCAL 1 -#define CLASS_IP 2 -#define CLASS_IEEE_802_1 3 -#define CLASS_PPP_MAGIC_NUMBER 4 -#define CLASS_PSDN_DIRECTORY_NUMBER 5 +#define CLASS_NULL 0 +#define CLASS_LOCAL 1 +#define CLASS_IP 2 +#define CLASS_IEEE_802_1 3 +#define CLASS_PPP_MAGIC_NUMBER 4 +#define CLASS_PSDN_DIRECTORY_NUMBER 5 static const value_string multilink_ep_disc_class_vals[] = { {CLASS_NULL, "Null" }, @@ -2076,7 +2078,7 @@ dissect_lcp_multilink_ep_disc_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, length -= 2; ep_disc_class = tvb_get_guint8(tvb, offset); proto_tree_add_text(field_tree, tvb, offset, 1, "Class: %s (%u)", - val_to_str(ep_disc_class, multilink_ep_disc_class_vals, "Unknown"), + val_to_str_const(ep_disc_class, multilink_ep_disc_class_vals, "Unknown"), ep_disc_class); offset += 1; length -= 1; @@ -2189,7 +2191,7 @@ dissect_lcp_internationalization_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, length -= 2; charset = tvb_get_ntohl(tvb, offset); proto_tree_add_text(field_tree, tvb, offset, 4, "Character set: %s (0x%04x)", - val_to_str(charset, charset_num_vals, "Unknown"), + val_to_str_const(charset, charset_num_vals, "Unknown"), charset); offset += 4; length -= 4; @@ -2223,17 +2225,19 @@ dissect_ipcp_addrs_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, ip_to_str(tvb_get_ptr(tvb, offset, 4))); } -static void dissect_ipcp_addr_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, - int offset, guint length, packet_info *pinfo _U_, - proto_tree *tree) +static void +dissect_ipcp_addr_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, + int offset, guint length, packet_info *pinfo _U_, + proto_tree *tree) { proto_tree_add_text(tree, tvb, offset, length, "%s: %s", optp->name, ip_to_str(tvb_get_ptr(tvb, offset + 2, 4))); } -static void dissect_ipcp_compress_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, - int offset, guint length, packet_info *pinfo _U_, - proto_tree *tree) +static void +dissect_ipcp_compress_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, + int offset, guint length, packet_info *pinfo _U_, + proto_tree *tree) { guint8 ub; guint16 us; @@ -2244,14 +2248,14 @@ static void dissect_ipcp_compress_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, optp->name, length, plurality(length, "", "s")); field_tree = proto_item_add_subtree(tf, *optp->subtree_index); - offset += 2; /* Skip option type + length */ + offset += 2; /* Skip option type + length */ length -= 2; us = tvb_get_ntohs(tvb, offset); proto_tree_add_text( field_tree, tvb, offset, 2, "IP compression protocol: %s (0x%04x)", - val_to_str( us, ipcp_compress_proto_vals, "Unknown protocol" ), + val_to_str_const( us, ipcp_compress_proto_vals, "Unknown protocol" ), us ); - offset += 2; /* skip protocol */ + offset += 2; /* skip protocol */ length -= 2; if (length > 0) { @@ -2354,9 +2358,10 @@ static void dissect_ipcp_compress_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, } } -static void dissect_ipcp_iphc_disableprot_opt(const ip_tcp_opt *optp, - tvbuff_t *tvb, - int offset, guint length, +static void +dissect_ipcp_iphc_disableprot_opt(const ip_tcp_opt *optp, + tvbuff_t *tvb, + int offset, guint length, packet_info *pinfo _U_, proto_tree *tree) { @@ -2370,14 +2375,15 @@ static void dissect_ipcp_iphc_disableprot_opt(const ip_tcp_opt *optp, param = tvb_get_guint8(tvb, offset + 2); proto_tree_add_text(field_tree, tvb, offset + 2, 1, "Protocol: %s (0x%02x)", - val_to_str( param, ipcp_iphc_disable_proto_vals, "Unknown" ), + val_to_str_const( param, ipcp_iphc_disable_proto_vals, "Unknown" ), param ); } -static void dissect_osicp_align_npdu_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, - int offset, guint length, packet_info *pinfo _U_, - proto_tree *tree) +static void +dissect_osicp_align_npdu_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, + int offset, guint length, packet_info *pinfo _U_, + proto_tree *tree) { proto_item *tf; proto_tree *field_tree; @@ -2391,13 +2397,14 @@ static void dissect_osicp_align_npdu_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, "Alignment: %u", alignment); } -static void dissect_pppmuxcp_def_pid_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, - int offset, guint length, packet_info *pinfo _U_, - proto_tree *tree) +static void +dissect_pppmuxcp_def_pid_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, + int offset, guint length, packet_info *pinfo _U_, + proto_tree *tree) { pppmux_def_prot_id = tvb_get_ntohs(tvb, offset + 2); proto_tree_add_text(tree, tvb, offset + 2, length - 2, "%s: %s (0x%02x)",optp->name, - val_to_str(pppmux_def_prot_id, ppp_vals, "Unknown"), pppmux_def_prot_id); + val_to_str_ext_const(pppmux_def_prot_id, &ppp_vals_ext, "Unknown"), pppmux_def_prot_id); } @@ -2424,7 +2431,7 @@ dissect_ccp_stac_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, check_mode = tvb_get_guint8(tvb, offset + 4); proto_tree_add_text(field_tree, tvb, offset + 4, 1, "Check Mode: %s (0x%02X)", - val_to_str(check_mode, stac_checkmode_vals, "Unknown"), + val_to_str_const(check_mode, stac_checkmode_vals, "Unknown"), check_mode); } } @@ -2498,12 +2505,12 @@ dissect_ccp_lzsdcp_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, check_mode = tvb_get_guint8(tvb, offset + 4); proto_tree_add_text(field_tree, tvb, offset + 4, 1, "Check Mode: %s (0x%02X)", - val_to_str(check_mode, lzsdcp_checkmode_vals, "Unknown"), + val_to_str_const(check_mode, lzsdcp_checkmode_vals, "Unknown"), check_mode); process_mode = tvb_get_guint8(tvb, offset + 5); proto_tree_add_text(field_tree, tvb, offset + 5, 1, "Process Mode: %s (0x%02X)", - val_to_str(process_mode, lzsdcp_processmode_vals, "Unkown"), + val_to_str_const(process_mode, lzsdcp_processmode_vals, "Unkown"), process_mode); } @@ -2635,8 +2642,9 @@ dissect_bap_link_type_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, "Link Speed: %u kbps", tvb_get_ntohs(tvb, offset + 2)); link_type = tvb_get_guint8(tvb, offset + 4); proto_tree_add_text(field_tree, tvb, offset + 4, 1, - "Link Type: %s (%u)", val_to_str(link_type, bap_link_type_vals, - "Unknown"), link_type); + "Link Type: %s (%u)", + val_to_str_const(link_type, bap_link_type_vals, "Unknown"), + link_type); } static void @@ -2667,7 +2675,7 @@ dissect_bap_phone_delta_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, proto_tree_add_text(suboption_tree, tvb, offset, 1, "Sub-Option Type: %s (%u)", - val_to_str(subopt_type, bap_phone_delta_subopt_vals, "Unknown"), + val_to_str_const(subopt_type, bap_phone_delta_subopt_vals, "Unknown"), subopt_type); if (subopt_len < 2) { @@ -2769,17 +2777,18 @@ dissect_bap_call_status_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, status = tvb_get_guint8(tvb, offset + 2); proto_tree_add_text(field_tree, tvb, offset + 2, 1, "Status: %s (0x%02x)", - val_to_str(status, q931_cause_code_vals, "Unknown"), status); + val_to_str_ext_const(status, &q931_cause_code_vals_ext, "Unknown"), status); action = tvb_get_guint8(tvb, offset + 3); proto_tree_add_text(field_tree, tvb, offset + 3, 1, "Action: %s (0x%02x)", - val_to_str(action, bap_call_status_opt_action_vals, "Unknown"), action); + val_to_str_const(action, bap_call_status_opt_action_vals, "Unknown"), action); } -static void dissect_vsncp_pdnid_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, - int offset, guint length, packet_info *pinfo _U_, - proto_tree *tree) +static void +dissect_vsncp_pdnid_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, + int offset, guint length, packet_info *pinfo _U_, + proto_tree *tree) { proto_item *tf; guint8 PDNID; @@ -2790,9 +2799,10 @@ static void dissect_vsncp_pdnid_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, offset += 2; } -static void dissect_vsncp_attachtype_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, - int offset, guint length, packet_info *pinfo _U_, - proto_tree *tree) +static void +dissect_vsncp_attachtype_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, + int offset, guint length, packet_info *pinfo _U_, + proto_tree *tree) { static const value_string attach_vals[] = { @@ -2807,22 +2817,23 @@ static void dissect_vsncp_attachtype_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, if(tree) { proto_tree_add_text(tree, tvb, offset, length, "%s: %s (0x%02x)", - optp->name, val_to_str(attach , attach_vals, "Unknown"), attach); + optp->name, val_to_str_const(attach , attach_vals, "Unknown"), attach); } offset += 2; } -static void dissect_vsncp_pdntype_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, - int offset, guint length, packet_info *pinfo _U_, - proto_tree *tree) +static void +dissect_vsncp_pdntype_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, + int offset, guint length, packet_info *pinfo _U_, + proto_tree *tree) { static const value_string pdntype_vals[] = { - {1, "IPv4" }, - {2, "IPv6" }, - {3, "IPv6/IPv4" }, - {0, NULL } + {1, "IPv4" }, + {2, "IPv6" }, + {3, "IPv6/IPv4" }, + {0, NULL } }; guint8 pdntype; @@ -2831,30 +2842,31 @@ static void dissect_vsncp_pdntype_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, if(tree) { proto_tree_add_text(tree, tvb, offset, length, "%s: %s (0x%02x)", - optp->name, val_to_str(pdntype, pdntype_vals, "Unknown"), pdntype); + optp->name, val_to_str_const(pdntype, pdntype_vals, "Unknown"), pdntype); } offset += 2; } -static void dissect_vsncp_errorcode_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, - int offset, guint length, packet_info *pinfo _U_, - proto_tree *tree) +static void +dissect_vsncp_errorcode_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, + int offset, guint length, packet_info *pinfo _U_, + proto_tree *tree) { static const value_string errorcode_vals[] = { - {0, "General Eror" }, - {1, "Unauthorized APN" }, - {2, "PDN Limit Exceeded" }, - {3, "NO PG-W Available" }, - {4, "P-GW Unreachable" }, - {5, "P-GW Reject" }, - {6, "Insufficient Parameters" }, - {7, "Resource Unavailable" }, - {8, "Admin Prohibited" }, - {9, "PDN-ID Already in Use" }, - {10, "Subscription Limitation" }, - {11, "PDN connection already exists for APN"}, - {0, NULL } + {0, "General Eror" }, + {1, "Unauthorized APN" }, + {2, "PDN Limit Exceeded" }, + {3, "NO PG-W Available" }, + {4, "P-GW Unreachable" }, + {5, "P-GW Reject" }, + {6, "Insufficient Parameters" }, + {7, "Resource Unavailable" }, + {8, "Admin Prohibited" }, + {9, "PDN-ID Already in Use" }, + {10, "Subscription Limitation" }, + {11, "PDN connection already exists for APN" }, + {0, NULL } }; guint8 pdntype; @@ -2863,24 +2875,25 @@ static void dissect_vsncp_errorcode_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, if(tree) { proto_tree_add_text(tree, tvb, offset, length, "%s: %s (0x%02x)", - optp->name, val_to_str(pdntype, errorcode_vals, "Unknown"), pdntype); + optp->name, val_to_str_const(pdntype, errorcode_vals, "Unknown"), pdntype); } offset += 2; } -static void dissect_vsncp_pdnaddress_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, - int offset, guint length, packet_info *pinfo _U_, - proto_tree *tree) +static void +dissect_vsncp_pdnaddress_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, + int offset, guint length, packet_info *pinfo _U_, + proto_tree *tree) { guint8 pdnaddtype; static const value_string pdntype_vals[] = { - {0, "Initial Request by UE" }, - {1, "IPv4 Address" }, - {2, "IPv6 Address" }, - {3, "IPv6/IPv4 Address" }, - {0, NULL } + {0, "Initial Request by UE" }, + {1, "IPv4 Address" }, + {2, "IPv6 Address" }, + {3, "IPv6/IPv4 Address" }, + {0, NULL } }; proto_item *tf; proto_tree *field_tree; @@ -2894,14 +2907,14 @@ static void dissect_vsncp_pdnaddress_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, pdnaddtype = tvb_get_guint8(tvb, offset + 2); proto_tree_add_text(field_tree, tvb, offset+2, 1, "PDN Type (%s): 0x%02x", - val_to_str(pdnaddtype, pdntype_vals, "Unknown"), pdnaddtype); + val_to_str_const(pdnaddtype, pdntype_vals, "Unknown"), pdnaddtype); switch (pdnaddtype) { case 1: proto_tree_add_text(field_tree, tvb, offset+3, length-3, "%s: %s", - val_to_str(pdnaddtype, pdntype_vals, "Unknown"), + val_to_str_const(pdnaddtype, pdntype_vals, "Unknown"), ip_to_str(tvb_get_ptr(tvb, offset + 3, 4))); break; @@ -2911,7 +2924,7 @@ static void dissect_vsncp_pdnaddress_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, tvb_memcpy(tvb, &ad->bytes[8], offset+3, 8); proto_tree_add_text(field_tree, tvb, offset+3, length-3, "%s: %s", - val_to_str(pdnaddtype, pdntype_vals, "Unknown"), ip6_to_str(ad)); + val_to_str_const(pdnaddtype, pdntype_vals, "Unknown"), ip6_to_str(ad)); break; } case 3: @@ -2920,10 +2933,10 @@ static void dissect_vsncp_pdnaddress_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, tvb_memcpy(tvb, &ad->bytes[8], offset+3, 8); proto_tree_add_text(field_tree, tvb, offset+3, length-3, "%s: %s", - val_to_str(pdnaddtype, pdntype_vals, "Unknown"), ip6_to_str(ad)); + val_to_str_const(pdnaddtype, pdntype_vals, "Unknown"), ip6_to_str(ad)); proto_tree_add_text(field_tree, tvb, offset+11, length-11, "%s: %s", - val_to_str(pdnaddtype, pdntype_vals, "Unknown"), + val_to_str_const(pdnaddtype, pdntype_vals, "Unknown"), ip_to_str(tvb_get_ptr(tvb, offset + 11, 4))); break; } @@ -2934,18 +2947,20 @@ static void dissect_vsncp_pdnaddress_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, } -static void dissect_vsncp_ipv4adress_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, - int offset, guint length, packet_info *pinfo _U_, - proto_tree *tree) +static void +dissect_vsncp_ipv4adress_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, + int offset, guint length, packet_info *pinfo _U_, + proto_tree *tree) { proto_tree_add_text(tree, tvb, offset, length, "%s: %s", optp->name, ip_to_str(tvb_get_ptr(tvb, offset + 2, 4))); offset += 2; } -static void dissect_vsncp_apname_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, - int offset, guint length, packet_info *pinfo _U_, - proto_tree *tree) +static void +dissect_vsncp_apname_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, + int offset, guint length, packet_info *pinfo _U_, + proto_tree *tree) { proto_item *tf; proto_tree *field_tree; @@ -2976,16 +2991,17 @@ static void dissect_vsncp_apname_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, } } -static void dissect_vsncp_addressalloc_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, - int offset, guint length, packet_info *pinfo _U_, - proto_tree *tree) +static void +dissect_vsncp_addressalloc_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, + int offset, guint length, packet_info *pinfo _U_, + proto_tree *tree) { static const value_string alloc_vals[] = { - {0, "Null Value (Attach or Handover)" }, - {18, "New PDN type due to network preference" }, - {255, "Success" }, - {0, NULL } + {0, "Null Value (Attach or Handover)" }, + {18, "New PDN type due to network preference" }, + {255, "Success" }, + {0, NULL } }; guint8 alloc; @@ -2994,22 +3010,23 @@ static void dissect_vsncp_addressalloc_opt(const ip_tcp_opt *optp, tvbuff_t *tvb if(tree) { proto_tree_add_text(tree, tvb, offset, length, "%s: %s (0x%02x)", - optp->name, val_to_str(alloc, alloc_vals, "Unknown"), alloc); + optp->name, val_to_str_const(alloc, alloc_vals, "Unknown"), alloc); } offset += 2; } -static void dissect_vsncp_pco_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, - int offset, guint length, packet_info *pinfo _U_, - proto_tree *tree) +static void +dissect_vsncp_pco_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, + int offset, guint length, packet_info *pinfo _U_, + proto_tree *tree) { static const value_string pco_vals[] = { - {0x8021, "IPCP (DNS Address Request)" }, - {0x0001, "P-CSCF Address Request (IPv6)" }, - {0x0003, "DNS Server Address (IPv6)" }, - {0x000A, "IP address allocation via NAS signalling" }, - {0, NULL } + {0x8021, "IPCP (DNS Address Request)" }, + {0x0001, "P-CSCF Address Request (IPv6)" }, + {0x0003, "DNS Server Address (IPv6)" }, + {0x000A, "IP address allocation via NAS signalling" }, + {0, NULL } }; int off = offset+3; guint8 i = 0; @@ -3029,7 +3046,7 @@ static void dissect_vsncp_pco_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, pcotype = tvb_get_ntohs(tvb, off); len = tvb_get_guint8(tvb, (off+2)); proto_tree_add_text(field_tree, tvb, off,2, "Protocol: %s (0x%02x)", - val_to_str(pcotype, pco_vals, "Unknown"), pcotype); + val_to_str_const(pcotype, pco_vals, "Unknown"), pcotype); proto_tree_add_text(field_tree, tvb, off+2,1, "Length:(0x%02x)", len); if(len >0) proto_tree_add_text(field_tree, tvb, off+3,len, "Data (%d byte%s)", len, plurality(len, "", "s")); @@ -3065,13 +3082,13 @@ dissect_cp( tvbuff_t *tvb, int proto_id, int proto_subtree_index, if(check_col(pinfo->cinfo, COL_INFO)) col_add_str(pinfo->cinfo, COL_INFO, - val_to_str(code, proto_vals, "Unknown")); + val_to_str_const(code, proto_vals, "Unknown")); if(tree) { ti = proto_tree_add_item(tree, proto_id, tvb, 0, length, FALSE); fh_tree = proto_item_add_subtree(ti, proto_subtree_index); proto_tree_add_text(fh_tree, tvb, 0, 1, "Code: %s (0x%02x)", - val_to_str(code, proto_vals, "Unknown"), code); + val_to_str_const(code, proto_vals, "Unknown"), code); proto_tree_add_text(fh_tree, tvb, 1, 1, "Identifier: 0x%02x", id); proto_tree_add_text(fh_tree, tvb, 2, 2, "Length: %u", @@ -3146,7 +3163,7 @@ dissect_cp( tvbuff_t *tvb, int proto_id, int proto_subtree_index, protocol = tvb_get_ntohs(tvb, offset); proto_tree_add_text(fh_tree, tvb, offset, 2, "Rejected protocol: %s (0x%04x)", - val_to_str(protocol, ppp_vals, "Unknown"), + val_to_str_ext_const(protocol, &ppp_vals_ext, "Unknown"), protocol); offset += 2; length -= 2; @@ -3204,9 +3221,9 @@ static void dissect_ppp_common( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *fh_tree, proto_item *ti, int proto_offset ) { - guint16 ppp_prot; - int proto_len; - tvbuff_t *next_tvb; + guint16 ppp_prot; + int proto_len; + tvbuff_t *next_tvb; /* Make direction information filterable */ if (tree && @@ -3246,7 +3263,7 @@ dissect_ppp_common( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, col_add_fstr(pinfo->cinfo, COL_PROTOCOL, "0x%04x", ppp_prot); if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "PPP %s (0x%04x)", - val_to_str(ppp_prot, ppp_vals, "Unknown"), ppp_prot); + val_to_str_ext_const(ppp_prot, &ppp_vals_ext, "Unknown"), ppp_prot); call_dissector(data_handle,next_tvb, pinfo, tree); } } @@ -3283,8 +3300,8 @@ dissect_vsncp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) static const value_string OUI_vals[] = { - {0xcf0002, "3GPP2 Unique Organization Number" }, - {0, NULL } + {0xcf0002, "3GPP2 Unique Organization Number" }, + {0, NULL } }; code = tvb_get_guint8(tvb, 0); @@ -3293,16 +3310,16 @@ dissect_vsncp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) OUI = tvb_get_ntoh24(tvb, 4); col_set_str(pinfo->cinfo, COL_PROTOCOL, "VSNCP"); - col_add_str(pinfo->cinfo, COL_INFO, val_to_str(code, cp_vals, "Unknown")); + col_add_str(pinfo->cinfo, COL_INFO, val_to_str_const(code, cp_vals, "Unknown")); if(tree) { ti = proto_tree_add_item(tree, proto_vsncp, tvb, 0, length, FALSE); fh_tree = proto_item_add_subtree(ti, ett_vsncp); - proto_tree_add_text(fh_tree, tvb, 0, 1, "Code: %s (0x%02x)", val_to_str(code, cp_vals, "Unknown"), code); + proto_tree_add_text(fh_tree, tvb, 0, 1, "Code: %s (0x%02x)", val_to_str_const(code, cp_vals, "Unknown"), code); proto_tree_add_text(fh_tree, tvb, 1, 1, "Identifier: 0x%02x", id); proto_tree_add_text(fh_tree, tvb, 2, 2, "Length: %u", length); - proto_tree_add_text(fh_tree, tvb, 4, 3, "OUI: %s (0x%02x)", val_to_str(OUI, OUI_vals, "Unknown"), OUI); + proto_tree_add_text(fh_tree, tvb, 4, 3, "OUI: %s (0x%02x)", val_to_str_const(OUI, OUI_vals, "Unknown"), OUI); } offset = 7; length -= 7; @@ -3360,7 +3377,7 @@ dissect_vsnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) col_add_fstr(pinfo->cinfo, COL_PROTOCOL, "0x%04x", PPP_IP); col_add_fstr(pinfo->cinfo, COL_INFO, "PPP %s (0x%04x)", - val_to_str(PPP_IP, ppp_vals, "Unknown"), PPP_IP); + val_to_str_ext_const(PPP_IP, &ppp_vals_ext, "Unknown"), PPP_IP); call_dissector(data_handle, next_tvb, pinfo, tree); } } @@ -3378,17 +3395,17 @@ dissect_ipcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* * RFC 3518 */ -#define BCP_FCS_PRESENT 0x80 -#define BCP_ZEROPAD 0x20 -#define BCP_IS_BCONTROL 0x10 -#define BCP_PADS_MASK 0x0f - -#define BCP_MACT_ETHERNET 1 -#define BCP_MACT_802_4 2 -#define BCP_MACT_802_5_NONCANON 3 -#define BCP_MACT_FDDI_NONCANON 4 -#define BCP_MACT_802_5_CANON 11 -#define BCP_MACT_FDDI_CANON 12 +#define BCP_FCS_PRESENT 0x80 +#define BCP_ZEROPAD 0x20 +#define BCP_IS_BCONTROL 0x10 +#define BCP_PADS_MASK 0x0f + +#define BCP_MACT_ETHERNET 1 +#define BCP_MACT_802_4 2 +#define BCP_MACT_802_5_NONCANON 3 +#define BCP_MACT_FDDI_NONCANON 4 +#define BCP_MACT_802_5_CANON 11 +#define BCP_MACT_FDDI_CANON 12 static const value_string bcp_mac_type_vals[] = { { BCP_MACT_ETHERNET, "IEEE 802.3/Ethernet" }, @@ -3514,7 +3531,7 @@ dissect_ccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* * Callback Control Protocol - see * - * http://www.linet.gr.jp/~manabe/PPxP/doc/Standards/draft-gidwani-ppp-callback-cp-00.txt + * http://www.linet.gr.jp/~manabe/PPxP/doc/Standards/draft-gidwani-ppp-callback-cp-00.txt */ static void dissect_cbcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) @@ -3554,13 +3571,13 @@ dissect_bap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if(check_col(pinfo->cinfo, COL_INFO)) col_add_str(pinfo->cinfo, COL_INFO, - val_to_str(type, bap_vals, "Unknown")); + val_to_str_const(type, bap_vals, "Unknown")); if(tree) { ti = proto_tree_add_item(tree, proto_bap, tvb, 0, length, FALSE); fh_tree = proto_item_add_subtree(ti, ett_bap_options); proto_tree_add_text(fh_tree, tvb, 0, 1, "Type: %s (0x%02x)", - val_to_str(type, bap_vals, "Unknown"), type); + val_to_str_const(type, bap_vals, "Unknown"), type); proto_tree_add_text(fh_tree, tvb, 1, 1, "Identifier: 0x%02x", id); proto_tree_add_text(fh_tree, tvb, 2, 2, "Length: %u", @@ -3573,7 +3590,7 @@ dissect_bap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) type == BAP_LDQRES || type == BAP_CSRES) { resp_code = tvb_get_guint8(tvb, offset); proto_tree_add_text(fh_tree, tvb, offset, 1, "Response Code: %s (0x%02x)", - val_to_str(resp_code, bap_resp_code_vals, "Unknown"), resp_code); + val_to_str_const(resp_code, bap_resp_code_vals, "Unknown"), resp_code); offset++; length--; } @@ -3722,24 +3739,24 @@ dissect_pppmux(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) * RFC 2508 Internet Protocol Header Compression */ -#define IPHC_CRTP_FH_FLAG_MASK 0xc0 -#define IPHC_CRTP_FH_FLAG_POS 6 -#define IPHC_CRTP_FH_CID8 1 -#define IPHC_CRTP_FH_CID16 3 +#define IPHC_CRTP_FH_FLAG_MASK 0xc0 +#define IPHC_CRTP_FH_FLAG_POS 6 +#define IPHC_CRTP_FH_CID8 1 +#define IPHC_CRTP_FH_CID16 3 -#define IPHC_CRTP_CS_CID8 1 -#define IPHC_CRTP_CS_CID16 2 +#define IPHC_CRTP_CS_CID8 1 +#define IPHC_CRTP_CS_CID16 2 static const value_string iphc_crtp_fh_flags[] = { - {IPHC_CRTP_FH_CID8, "8-bit Context Id" }, - {IPHC_CRTP_FH_CID16, "16-bit Context Id" }, - {0, NULL } + {IPHC_CRTP_FH_CID8, "8-bit Context Id" }, + {IPHC_CRTP_FH_CID16, "16-bit Context Id" }, + {0, NULL } }; static const value_string iphc_crtp_cs_flags[] = { - {IPHC_CRTP_CS_CID8, "8-bit Context Id" }, - {IPHC_CRTP_CS_CID16, "16-bit Context Id" }, - {0, NULL } + {IPHC_CRTP_CS_CID8, "8-bit Context Id" }, + {IPHC_CRTP_CS_CID16, "16-bit Context Id" }, + {0, NULL } }; /* @@ -3778,7 +3795,7 @@ dissect_iphc_crtp_fh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (tree) { ti = proto_tree_add_protocol_format(tree, proto_iphc_crtp, tvb, 0, -1, - "%s", val_to_str(PPP_RTP_FH, ppp_vals, "Unknown")); + "%s", val_to_str_ext_const(PPP_RTP_FH, &ppp_vals_ext, "Unknown")); fh_tree = proto_item_add_subtree(ti, ett_iphc_crtp); flags = (tvb_get_guint8(tvb, 2) & IPHC_CRTP_FH_FLAG_MASK) >> IPHC_CRTP_FH_FLAG_POS; @@ -3872,7 +3889,7 @@ dissect_iphc_crtp_cudp16(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (tree) { ti = proto_tree_add_protocol_format(tree, proto_iphc_crtp, tvb, 0, -1, - "%s", val_to_str(PPP_RTP_CUDP16, ppp_vals, "Unknown")); + "%s", val_to_str_ext_const(PPP_RTP_CUDP16, &ppp_vals_ext, "Unknown")); cudp_tree = proto_item_add_subtree(ti, ett_iphc_crtp); hdr_length = 3; @@ -3907,7 +3924,7 @@ dissect_iphc_crtp_cudp8(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (tree) { ti = proto_tree_add_protocol_format(tree, proto_iphc_crtp, tvb, 0, -1, - "%s", val_to_str(PPP_RTP_CUDP8, ppp_vals, "Unknown")); + "%s", val_to_str_ext_const(PPP_RTP_CUDP8, &ppp_vals_ext, "Unknown")); cudp_tree = proto_item_add_subtree(ti, ett_iphc_crtp); hdr_length = 2; @@ -3942,7 +3959,7 @@ dissect_iphc_crtp_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (tree) { ti = proto_tree_add_protocol_format(tree, proto_iphc_crtp, tvb, 0, -1, - "%s", val_to_str(PPP_RTP_CS, ppp_vals, "Unknown")); + "%s", val_to_str_ext_const(PPP_RTP_CS, &ppp_vals_ext, "Unknown")); cs_tree = proto_item_add_subtree(ti, ett_iphc_crtp); @@ -4170,10 +4187,10 @@ dissect_ppp_hdlc( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) static tvbuff_t* remove_escape_chars(tvbuff_t *tvb, int offset, int length) { - guint8 *buff; - int i; - int scanned_len = 0; - guint8 octet; + guint8 *buff; + int i; + int scanned_len = 0; + guint8 octet; tvbuff_t *next_tvb; buff = g_malloc(length); @@ -4219,8 +4236,8 @@ dissect_ppp_raw_hdlc( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) { proto_item *ti; proto_tree *bs_tree = NULL; - gint offset, end_offset, data_offset; - int length, data_length; + gint offset, end_offset, data_offset; + int length, data_length; tvbuff_t *ppp_tvb; gboolean first = TRUE; @@ -4299,7 +4316,7 @@ dissect_ppp_raw_hdlc( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) return; } - data_offset = offset+1; /* skip starting frame delimiter */ + data_offset = offset+1; /* skip starting frame delimiter */ data_length = end_offset - data_offset; /* @@ -4438,7 +4455,7 @@ dissect_pap( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) { col_set_str(pinfo->cinfo, COL_PROTOCOL, "PPP PAP"); if(check_col(pinfo->cinfo, COL_INFO)) - col_add_str(pinfo->cinfo, COL_INFO, val_to_str(code, pap_vals, "Unknown")); + col_add_str(pinfo->cinfo, COL_INFO, val_to_str_const(code, pap_vals, "Unknown")); if(tree) { ti = proto_tree_add_item(tree, proto_pap, tvb, 0, -1, FALSE); @@ -4460,41 +4477,41 @@ dissect_pap( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) { data_tree = proto_item_add_subtree(data_ti, ett_pap_data); switch(code){ - case CONFREQ: - proto_tree_add_item(data_tree, hf_pap_peer_id_length, tvb, offset, 1, FALSE); - peer_id_length = tvb_get_guint8(tvb, offset); - offset +=1; - - proto_tree_add_item(data_tree, hf_pap_peer_id, tvb, offset, peer_id_length, FALSE); - peer_id = tvb_format_text(tvb, offset, peer_id_length); - offset += peer_id_length; - - proto_tree_add_item(data_tree, hf_pap_password_length, tvb, offset, 1, FALSE); - password_length = tvb_get_guint8(tvb, offset); - offset +=1; - - proto_tree_add_item(data_tree, hf_pap_password, tvb, offset, password_length, FALSE); - password = tvb_format_text(tvb, offset, password_length); - offset += password_length; - - col_append_fstr(pinfo->cinfo, COL_INFO, " (Peer-ID='%s', Password='%s')", peer_id, password); - break; - case CONFACK: - case CONFNAK: - proto_tree_add_item(data_tree, hf_pap_message_length, tvb, offset, 1, FALSE); - message_length = tvb_get_guint8(tvb, offset); - offset +=1; - - proto_tree_add_item(data_tree, hf_pap_message, tvb, offset, message_length, FALSE); - message = tvb_format_text(tvb, offset, message_length); - offset += message_length; - - col_append_fstr(pinfo->cinfo, COL_INFO, " (Message='%s')", message); - break; - default: - proto_tree_add_item(data_tree, hf_pap_stuff, tvb, offset, -1, FALSE); + case CONFREQ: + proto_tree_add_item(data_tree, hf_pap_peer_id_length, tvb, offset, 1, FALSE); + peer_id_length = tvb_get_guint8(tvb, offset); + offset +=1; + + proto_tree_add_item(data_tree, hf_pap_peer_id, tvb, offset, peer_id_length, FALSE); + peer_id = tvb_format_text(tvb, offset, peer_id_length); + offset += peer_id_length; + + proto_tree_add_item(data_tree, hf_pap_password_length, tvb, offset, 1, FALSE); + password_length = tvb_get_guint8(tvb, offset); + offset +=1; + + proto_tree_add_item(data_tree, hf_pap_password, tvb, offset, password_length, FALSE); + password = tvb_format_text(tvb, offset, password_length); + offset += password_length; + + col_append_fstr(pinfo->cinfo, COL_INFO, " (Peer-ID='%s', Password='%s')", peer_id, password); + break; + case CONFACK: + case CONFNAK: + proto_tree_add_item(data_tree, hf_pap_message_length, tvb, offset, 1, FALSE); + message_length = tvb_get_guint8(tvb, offset); + offset +=1; + + proto_tree_add_item(data_tree, hf_pap_message, tvb, offset, message_length, FALSE); + message = tvb_format_text(tvb, offset, message_length); + offset += message_length; + + col_append_fstr(pinfo->cinfo, COL_INFO, " (Message='%s')", message); break; - } + default: + proto_tree_add_item(data_tree, hf_pap_stuff, tvb, offset, -1, FALSE); + break; + } } } @@ -4519,7 +4536,7 @@ dissect_chap( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) { if(check_col(pinfo->cinfo, COL_INFO)) col_add_str(pinfo->cinfo, COL_INFO, - val_to_str(code, chap_vals, "Unknown")); + val_to_str_const(code, chap_vals, "Unknown")); if(tree) { /* Create CHAP protocol tree */ @@ -4645,9 +4662,10 @@ dissect_ipv6cp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) ipv6cp_opts, N_IPV6CP_OPTS, pinfo, tree); } -static void dissect_ipv6cp_if_id_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, - int offset, guint length, packet_info *pinfo _U_, - proto_tree *tree) +static void +dissect_ipv6cp_if_id_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, + int offset, guint length, packet_info *pinfo _U_, + proto_tree *tree) { proto_tree_add_text(tree, tvb, offset, length, "%s: %02x%02x:%02x%02x:%02x%x:%02x%02x", optp->name, @@ -4679,8 +4697,8 @@ proto_register_ppp(void) NULL, 0x0, NULL, HFILL }}, { &hf_ppp_protocol, - { "Protocol", "ppp.protocol", FT_UINT16, BASE_HEX, - VALS(ppp_vals), 0x0, NULL, HFILL }}, + { "Protocol", "ppp.protocol", FT_UINT16, BASE_HEX|BASE_EXT_STRING, + &ppp_vals_ext, 0x0, NULL, HFILL }}, }; static gint *ett[] = { &ett_ppp @@ -4748,19 +4766,19 @@ proto_register_mp(void) { static hf_register_info hf[] = { { &hf_mp_frag_first, - { "First fragment", "mp.first", FT_BOOLEAN, 8, + { "First fragment", "mp.first", FT_BOOLEAN, 8, TFS(&tfs_yes_no), MP_FRAG_FIRST, NULL, HFILL }}, { &hf_mp_frag_last, - { "Last fragment", "mp.last", FT_BOOLEAN, 8, + { "Last fragment", "mp.last", FT_BOOLEAN, 8, TFS(&tfs_yes_no), MP_FRAG_LAST, NULL, HFILL }}, { &hf_mp_sequence_num, - { "Sequence number", "mp.seq", FT_UINT24, BASE_DEC, NULL, 0x0, + { "Sequence number", "mp.seq", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_mp_short_sequence_num, - { "Sequence number", "mp.seq", FT_UINT16, BASE_DEC, NULL, 0x0FFF, + { "Sequence number", "mp.seq", FT_UINT16, BASE_DEC, NULL, 0x0FFF, NULL, HFILL }} }; static gint *ett[] = { @@ -4877,7 +4895,7 @@ proto_register_vsnp(void) static hf_register_info hf[] = { { &hf_vsnp_pdnid, - { "PDN ID", "vsnp.pdnid", + { "PDN ID", "vsnp.pdnid", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } } @@ -4943,19 +4961,19 @@ proto_register_bcp(void) NULL, 0x0, NULL, HFILL }}, { &hf_bcp_fcs_present, - { "LAN FCS present", "bcp.flags.fcs_present", FT_BOOLEAN, 8, + { "LAN FCS present", "bcp.flags.fcs_present", FT_BOOLEAN, 8, TFS(&tfs_yes_no), BCP_FCS_PRESENT, NULL, HFILL }}, { &hf_bcp_zeropad, - { "802.3 pad zero-filled", "bcp.flags.zeropad", FT_BOOLEAN, 8, + { "802.3 pad zero-filled", "bcp.flags.zeropad", FT_BOOLEAN, 8, TFS(&tfs_yes_no), BCP_ZEROPAD, NULL, HFILL }}, { &hf_bcp_bcontrol, - { "Bridge control", "bcp.flags.bcontrol", FT_BOOLEAN, 8, + { "Bridge control", "bcp.flags.bcontrol", FT_BOOLEAN, 8, TFS(&tfs_yes_no), BCP_IS_BCONTROL, NULL, HFILL }}, { &hf_bcp_pads, - { "Pads", "bcp.pads", FT_UINT8, BASE_DEC, + { "Pads", "bcp.pads", FT_UINT8, BASE_DEC, NULL, BCP_PADS_MASK, NULL, HFILL }}, { &hf_bcp_mac_type, @@ -5177,49 +5195,49 @@ proto_register_pap(void) static hf_register_info hf[] = { { &hf_pap_code, { "Code", "pap.code", - FT_UINT8, BASE_DEC, VALS(pap_vals), 0x0, + FT_UINT8, BASE_DEC, VALS(pap_vals), 0x0, "The Code field is one octet and identifies the type of PAP packet", HFILL }}, { &hf_pap_identifier, { "Identifier", "pap.identifier", - FT_UINT8, BASE_DEC, NULL, 0x0, + FT_UINT8, BASE_DEC, NULL, 0x0, "The Identifier field is one octet and aids in matching requests and replies.", HFILL }}, { &hf_pap_length, { "Length", "pap.length", - FT_UINT16, BASE_DEC, NULL, 0x0, + FT_UINT16, BASE_DEC, NULL, 0x0, "The Length field is two octets and indicates the length of the PAP packet", HFILL }}, { &hf_pap_data, { "Data", "pap.data", - FT_NONE, BASE_NONE, NULL, 0x0, + FT_NONE, BASE_NONE, NULL, 0x0, "The format of the Data field is determined by the Code field", HFILL }}, { &hf_pap_peer_id_length, { "Peer-ID-Length", "pap.peer_id.length", - FT_UINT8, BASE_DEC, NULL, 0x0, + FT_UINT8, BASE_DEC, NULL, 0x0, "The Peer-ID-Length field is one octet and indicates the length of the Peer-ID field", HFILL }}, { &hf_pap_peer_id, { "Peer-ID", "pap.peer_id", - FT_STRING, BASE_NONE, NULL, 0x0, + FT_STRING, BASE_NONE, NULL, 0x0, "The Peer-ID field is zero or more octets and indicates the name of the peer to be authenticated", HFILL }}, { &hf_pap_password_length, { "Password-Length", "pap.password.length", - FT_UINT8, BASE_DEC, NULL, 0x0, + FT_UINT8, BASE_DEC, NULL, 0x0, "The Password-Length field is one octet and indicates the length of the Password field", HFILL }}, { &hf_pap_password, { "Password", "pap.password", - FT_STRING, BASE_NONE, NULL, 0x0, + FT_STRING, BASE_NONE, NULL, 0x0, "The Password field is zero or more octets and indicates the password to be used for authentication", HFILL }}, { &hf_pap_message_length, { "Message-Length", "pap.message.length", - FT_UINT8, BASE_DEC, NULL, 0x0, + FT_UINT8, BASE_DEC, NULL, 0x0, "The Message-Length field is one octet and indicates the length of the Message field", HFILL }}, { &hf_pap_message, { "Message", "pap.message", - FT_STRING, BASE_NONE, NULL, 0x0, + FT_STRING, BASE_NONE, NULL, 0x0, "The Message field is zero or more octets, and its contents are implementation dependent.", HFILL }}, { &hf_pap_stuff, { "stuff", "pap.stuff", - FT_BYTES, BASE_NONE, NULL, 0x0, + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }} - }; + }; proto_pap = proto_register_protocol("PPP Password Authentication Protocol", "PPP PAP", @@ -5362,8 +5380,8 @@ proto_register_pppmux(void) static hf_register_info hf[] = { { &hf_pppmux_protocol, - { "Protocol", "ppp.protocol", FT_UINT16, BASE_HEX, - VALS(ppp_vals), 0x0, + { "Protocol", "ppp.protocol", FT_UINT16, BASE_HEX|BASE_EXT_STRING, + &ppp_vals_ext, 0x0, "The protocol of the sub-frame.", HFILL }}, }; diff --git a/epan/dissectors/packet-ppp.h b/epan/dissectors/packet-ppp.h index b4a3c83d8d..6cc7763d35 100644 --- a/epan/dissectors/packet-ppp.h +++ b/epan/dissectors/packet-ppp.h @@ -34,7 +34,7 @@ tvbuff_t *decode_fcs(tvbuff_t *tvb, proto_tree *fh_tree, int fcs_decode, int pro /* * Used by the GTP dissector as well. */ -extern const value_string ppp_vals[]; +extern value_string_ext ppp_vals_ext; /* * Used by CHDLC dissector as well. -- cgit v1.2.3