Use value_string_ext fcns to access certain value_string arrays;

Some whitespace cleanup.

svn path=/trunk/; revision=34763
This commit is contained in:
Bill Meier 2010-11-03 18:28:35 +00:00
parent dffb55434c
commit 0ca948bacf
10 changed files with 142 additions and 112 deletions

View File

@ -86,7 +86,7 @@ tvb_get_guintvar (tvbuff_t *tvb, guint offset, guint *octetCount)
}
/* See http://www.iana.org/assignments/character-sets for the MIBenum mapping */
const value_string vals_character_sets[] = {
static const value_string vals_character_sets[] = {
{ 0x0000, "*" },
{ 0x0003, "us-ascii" },
{ 0x0004, "iso-8859-1" },
@ -325,3 +325,4 @@ const value_string vals_character_sets[] = {
{ 0x08D3, "tis-620" },
{ 0x0000, NULL }
};
value_string_ext vals_character_sets_ext = VALUE_STRING_EXT_INIT(vals_character_sets);

View File

@ -83,7 +83,7 @@ enum
guint tvb_get_guintvar (tvbuff_t *, guint , guint *);
/* Character set encoding */
extern const value_string vals_character_sets[];
extern value_string_ext vals_character_sets_ext;
/*
* Misc TODO:

View File

@ -1132,6 +1132,7 @@ static const value_string vals_wbxml_public_ids[] = {
{ 0x00, NULL }
};
static value_string_ext vals_wbxml_public_ids_ext = VALUE_STRING_EXT_INIT(vals_wbxml_public_ids);
static const value_string vals_wbxml_versions[] = {
{ 0x00, "1.0" }, /* WAP-104-WBXML */
@ -1141,6 +1142,7 @@ static const value_string vals_wbxml_versions[] = {
{ 0x00, NULL }
};
static value_string_ext vals_wbxml_versions_ext = VALUE_STRING_EXT_INIT(vals_wbxml_versions);
/* WBXML 1.0 global tokens: WAP-104-WBXML
* Same token mapping as in vals_wbxml1x_global_tokens, but:
@ -1176,6 +1178,7 @@ static const value_string vals_wbxml1x_global_tokens[] = {
{ 0x00, NULL }
};
static value_string_ext vals_wbxml1x_global_tokens_ext = VALUE_STRING_EXT_INIT(vals_wbxml1x_global_tokens);
@ -6789,13 +6792,13 @@ dissect_wbxml_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Compose the summary line */
if ( publicid ) {
summary = g_strdup_printf("%s, Public ID: \"%s\"",
val_to_str (version, vals_wbxml_versions, "(unknown 0x%x)"),
val_to_str (publicid, vals_wbxml_public_ids, "(unknown 0x%x)"));
val_to_str_ext (version, &vals_wbxml_versions_ext, "(unknown 0x%x)"),
val_to_str_ext (publicid, &vals_wbxml_public_ids_ext, "(unknown 0x%x)"));
} else {
/* Read length of Public ID from string table */
len = tvb_strsize (tvb, str_tbl + publicid_index);
summary = g_strdup_printf("%s, Public ID: \"%s\"",
val_to_str (version, vals_wbxml_versions, "(unknown 0x%x)"),
val_to_str_ext (version, &vals_wbxml_versions_ext, "(unknown 0x%x)"),
tvb_format_text (tvb, str_tbl + publicid_index, len - 1));
}
@ -8029,7 +8032,7 @@ parse_wbxml_attribute_list_defined (proto_tree *tree, tvbuff_t *tvb,
"| %-10s (Invalid Token!) "
"| WBXML parsing stops here.",
level, *codepage_attr,
val_to_str (peek, vals_wbxml1x_global_tokens, "(unknown 0x%x)"));
val_to_str_ext (peek, &vals_wbxml1x_global_tokens_ext, "(unknown 0x%x)"));
/* Move to end of buffer */
off = tvb_len;
break;
@ -8216,7 +8219,7 @@ parse_wbxml_attribute_list (proto_tree *tree, tvbuff_t *tvb,
"| %-10s (Invalid Token!) "
"| WBXML parsing stops here.",
level, *codepage_attr,
val_to_str (peek, vals_wbxml1x_global_tokens, "(unknown 0x%x)"));
val_to_str_ext (peek, &vals_wbxml1x_global_tokens_ext, "(unknown 0x%x)"));
/* Move to end of buffer */
off = tvb_len;
break;
@ -8262,15 +8265,15 @@ proto_register_wbxml(void)
{ &hf_wbxml_version,
{ "Version",
"wbxml.version",
FT_UINT8, BASE_HEX,
VALS ( vals_wbxml_versions ), 0x00,
FT_UINT8, BASE_HEX|BASE_EXT_STRING,
&vals_wbxml_versions_ext, 0x00,
"WBXML Version", HFILL }
},
{ &hf_wbxml_public_id_known,
{ "Public Identifier (known)",
"wbxml.public_id.known",
FT_UINT32, BASE_HEX,
VALS ( vals_wbxml_public_ids ), 0x00,
FT_UINT32, BASE_HEX|BASE_EXT_STRING,
&vals_wbxml_public_ids_ext, 0x00,
"WBXML Known Public Identifier (integer)", HFILL }
},
{ &hf_wbxml_public_id_literal,
@ -8283,8 +8286,8 @@ proto_register_wbxml(void)
{ &hf_wbxml_charset,
{ "Character Set",
"wbxml.charset",
FT_UINT32, BASE_HEX,
VALS ( vals_character_sets ), 0x00,
FT_UINT32, BASE_HEX|BASE_EXT_STRING,
&vals_character_sets_ext, 0x00,
"WBXML Character Set", HFILL }
},
};

View File

@ -353,7 +353,7 @@ static dissector_handle_t media_handle;
/* Handle for WBXML-encoded UAPROF dissector */
static dissector_handle_t wbxml_uaprof_handle;
const value_string wsp_vals_pdu_type[] = {
static const value_string wsp_vals_pdu_type[] = {
{ 0x00, "Reserved" },
{ 0x01, "Connect" },
{ 0x02, "ConnectReply" },
@ -419,9 +419,10 @@ const value_string wsp_vals_pdu_type[] = {
{ 0x00, NULL }
};
value_string_ext wsp_vals_pdu_type_ext = VALUE_STRING_EXT_INIT(wsp_vals_pdu_type);
/* The WSP status codes are inherited from the HTTP status codes */
const value_string wsp_vals_status[] = {
static const value_string wsp_vals_status[] = {
/* 0x00 - 0x0F Reserved */
{ 0x10, "100 Continue" },
@ -471,8 +472,9 @@ const value_string wsp_vals_status[] = {
{ 0x00, NULL }
};
value_string_ext wsp_vals_status_ext = VALUE_STRING_EXT_INIT(wsp_vals_status);
const value_string vals_wsp_reason_codes[] = {
static const value_string vals_wsp_reason_codes[] = {
{ 0xE0, "Protocol Error (Illegal PDU)" },
{ 0xE1, "Session disconnected" },
{ 0xE2, "Session suspended" },
@ -491,6 +493,7 @@ const value_string vals_wsp_reason_codes[] = {
{ 0x00, NULL }
};
value_string_ext vals_wsp_reason_codes_ext = VALUE_STRING_EXT_INIT(vals_wsp_reason_codes);
/*
* Field names.
@ -639,7 +642,7 @@ static const value_string vals_openwave_field_names[] = {
{ FN_OPENWAVE_DEVCAP_GUI, "x-up-devcap-gui" },
{ 0, NULL }
};
static value_string_ext vals_openwave_field_names_ext = VALUE_STRING_EXT_INIT(vals_openwave_field_names);
static const value_string vals_field_names[] = {
{ FN_ACCEPT, "Accept" },
@ -720,6 +723,7 @@ static const value_string vals_field_names[] = {
{ FN_X_WAP_LOC_DELIVERY, "X-Wap-Loc-Delivery" },
{ 0, NULL }
};
static value_string_ext vals_field_names_ext = VALUE_STRING_EXT_INIT(vals_field_names);
/*
* Bearer types (from the WDP specification).
@ -788,6 +792,7 @@ static const value_string vals_bearer_types[] = {
{ BT_ANSI_136_GHOST, "ANSI-136 GHOST/R-Data" },
{ 0, NULL }
};
static value_string_ext vals_bearer_types_ext = VALUE_STRING_EXT_INIT(vals_bearer_types);
static const value_string vals_content_types[] = {
/* Well-known media types */
@ -886,6 +891,7 @@ static const value_string vals_content_types[] = {
{ 0x0301, "application/iota.mmc-xml"},
{ 0x00, NULL }
};
static value_string_ext vals_content_types_ext = VALUE_STRING_EXT_INIT(vals_content_types);
static const value_string vals_languages[] = {
{ 0x00, "*" },
@ -1030,6 +1036,7 @@ static const value_string vals_languages[] = {
{ 0x8C, "Rhaeto-Romance (rm)" },
{ 0x00, NULL }
};
static value_string_ext vals_languages_ext = VALUE_STRING_EXT_INIT(vals_languages);
#define CACHE_CONTROL_NO_CACHE 0x00
@ -1061,6 +1068,7 @@ static const value_string vals_cache_control[] = {
{ 0x00, NULL }
};
static value_string_ext vals_cache_control_ext = VALUE_STRING_EXT_INIT(vals_cache_control);
static const value_string vals_wap_application_ids[] = {
/* Well-known WAP applications */
@ -1098,6 +1106,7 @@ static const value_string vals_wap_application_ids[] = {
{ 0x00, NULL }
};
static value_string_ext vals_wap_application_ids_ext = VALUE_STRING_EXT_INIT(vals_wap_application_ids);
/* Parameters and well-known encodings */
@ -1109,6 +1118,7 @@ static const value_string vals_wsp_parameter_sec[] = {
{ 0x00, NULL }
};
static value_string_ext vals_wsp_parameter_sec_ext = VALUE_STRING_EXT_INIT(vals_wsp_parameter_sec);
/* Warning codes and mappings */
static const value_string vals_wsp_warning_code[] = {
@ -1121,6 +1131,7 @@ static const value_string vals_wsp_warning_code[] = {
{ 0, NULL }
};
static value_string_ext vals_wsp_warning_code_ext = VALUE_STRING_EXT_INIT(vals_wsp_warning_code);
static const value_string vals_wsp_warning_code_short[] = {
{ 10, "110" },
@ -1132,6 +1143,7 @@ static const value_string vals_wsp_warning_code_short[] = {
{ 0, NULL }
};
static value_string_ext vals_wsp_warning_code_short_ext = VALUE_STRING_EXT_INIT(vals_wsp_warning_code_short);
/* Profile-Warning codes - see http://www.w3.org/TR/NOTE-CCPPexchange */
static const value_string vals_wsp_profile_warning_code[] = {
@ -1145,6 +1157,7 @@ static const value_string vals_wsp_profile_warning_code[] = {
{ 0x00, NULL }
};
static value_string_ext vals_wsp_profile_warning_code_ext = VALUE_STRING_EXT_INIT(vals_wsp_profile_warning_code);
/* Well-known TE values */
static const value_string vals_well_known_te[] = {
@ -1156,6 +1169,7 @@ static const value_string vals_well_known_te[] = {
{ 0x00, NULL }
};
static value_string_ext vals_well_known_te_ext = VALUE_STRING_EXT_INIT(vals_well_known_te);
/*
@ -1757,14 +1771,14 @@ add_headers (proto_tree *tree, tvbuff_t *tvb, int hf, packet_info *pinfo)
/* Call header value dissector for given header */
if (codepage == 1) { /* Default header code page */
DebugLog(("add_headers(code page 0): %s\n",
val_to_str (hdr_id & 0x7f, vals_field_names, "Undefined")));
val_to_str_ext_const (hdr_id & 0x7f, &vals_field_names_ext, "Undefined")));
offset = WellKnownHeader[hdr_id & 0x7F](wsp_headers, tvb,
hdr_start, pinfo);
} else { /* Openwave header code page */
/* Here I'm delibarately assuming that Openwave is the only
* company that defines a WSP header code page. */
DebugLog(("add_headers(code page 0x%02x - assumed to be x-up-1): %s\n",
codepage, val_to_str (hdr_id & 0x7f, vals_openwave_field_names, "Undefined")));
codepage, val_to_str_ext_const (hdr_id & 0x7f, &vals_openwave_field_names_ext, "Undefined")));
offset = WellKnownOpenwaveHeader[hdr_id & 0x7F](wsp_headers,
tvb, hdr_start, pinfo);
}
@ -1889,7 +1903,7 @@ add_headers (proto_tree *tree, tvbuff_t *tvb, int hf, packet_info *pinfo)
#define wkh_1_WellKnownValue /* Parse Well Known Value */ \
hidden_item = proto_tree_add_string(tree, hf_hdr_name, \
tvb, hdr_start, offset - hdr_start, \
val_to_str (hdr_id, vals_field_names, \
val_to_str_ext (hdr_id, &vals_field_names_ext, \
"<Unknown WSP header field 0x%02X>")); \
PROTO_ITEM_SET_HIDDEN(hidden_item); \
if (val_id & 0x80) { /* Well-known value */ \
@ -1944,7 +1958,7 @@ add_headers (proto_tree *tree, tvbuff_t *tvb, int hf, packet_info *pinfo)
tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
proto_tree_add_text(tree, tvb, hdr_start, offset - hdr_start, \
"%s: <Error: Invalid header value>", \
val_to_str (hdr_id, vals_field_names, \
val_to_str_ext (hdr_id, &vals_field_names_ext, \
"<Unknown WSP header field 0x%02X>")); \
} \
} \
@ -1966,19 +1980,19 @@ wkh_default(proto_tree *tree, tvbuff_t *tvb,
tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
ti = proto_tree_add_text (tree, tvb, hdr_start, offset - hdr_start,
"%s: (Undecoded well-known value 0x%02x)",
val_to_str (hdr_id, vals_field_names,
val_to_str_ext (hdr_id, &vals_field_names_ext,
"<Unknown WSP header field 0x%02X>"), val_id & 0x7F);
wkh_2_TextualValue;
tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
ti = proto_tree_add_text(tree, tvb, hdr_start, offset - hdr_start,
"%s: %s",
val_to_str (hdr_id, vals_field_names,
val_to_str_ext (hdr_id, &vals_field_names_ext,
"<Unknown WSP header field 0x%02X>"), val_str);
wkh_3_ValueWithLength;
tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
ti = proto_tree_add_text (tree, tvb, hdr_start, offset - hdr_start,
"%s: (Undecoded value in general form with length indicator)",
val_to_str (hdr_id, vals_field_names,
val_to_str_ext (hdr_id, &vals_field_names_ext,
"<Unknown WSP header field 0x%02X>"));
wkh_4_End(HF_EMPTY); /* The default parser has no associated hf_index;
@ -2000,7 +2014,7 @@ wkh_ ## underscored(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_i
tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
tvb, hdr_start, offset - hdr_start, \
val_to_str(val_id & 0x7F, vals_content_types, \
val_to_str_ext(val_id & 0x7F, &vals_content_types_ext, \
"(Unknown content type identifier 0x%X)")); \
ok = TRUE; \
wkh_2_TextualValue; \
@ -2034,7 +2048,7 @@ wkh_ ## underscored(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_i
tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
tvb, hdr_start, offset - hdr_start, \
val_to_str(val, vals_content_types, \
val_to_str_ext(val, &vals_content_types_ext, \
"(Unknown content type identifier 0x%X)")); \
} \
off += len; \
@ -2110,7 +2124,7 @@ add_content_type(proto_tree *tree, tvbuff_t *tvb, guint32 val_start,
wkh_1_WellKnownValue;
DebugLog(("add_content_type() - Well-known - Start\n"));
*textual_content = val_to_str(val_id & 0x7F, vals_content_types,
*textual_content = val_to_str_ext(val_id & 0x7F, &vals_content_types_ext,
"<Unknown media type identifier 0x%X>");
tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
ti = proto_tree_add_string(tree, hf_hdr_content_type,
@ -2161,7 +2175,7 @@ add_content_type(proto_tree *tree, tvbuff_t *tvb, guint32 val_start,
DebugLog(("add_content_type() - General form - integer_value\n"));
get_integer_value(val, tvb, off, len, ok);
if (ok) {
*textual_content = val_to_str(val, vals_content_types,
*textual_content = val_to_str_ext(val, &vals_content_types_ext,
"<Unknown media type identifier 0x%X>");
tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
ti = proto_tree_add_string(tree, hf_hdr_content_type,
@ -2192,7 +2206,7 @@ add_content_type(proto_tree *tree, tvbuff_t *tvb, guint32 val_start,
/*
* Template for accept_X headers with optional Q parameter value
*/
#define wkh_accept_x_q_header(underscored,Text,valueString,valueName) \
#define wkh_accept_x_q_header(underscored,Text,valueStringExtAddr,valueName) \
static guint32 \
wkh_ ## underscored (proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo _U_) \
{ \
@ -2205,7 +2219,7 @@ wkh_ ## underscored (proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_
tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
tvb, hdr_start, offset - hdr_start, \
val_to_str(val_id & 0x7F, valueString, \
val_to_str_ext(val_id & 0x7F, valueStringExtAddr, \
"<Unknown " valueName " identifier 0x%X>")); \
ok = TRUE; \
wkh_2_TextualValue; \
@ -2229,7 +2243,7 @@ wkh_ ## underscored (proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_
tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
tvb, hdr_start, offset - hdr_start, \
val_to_str(val, valueString, \
val_to_str_ext(val, valueStringExtAddr, \
"<Unknown " valueName " identifier 0x%X>")); \
} \
off += len; \
@ -2250,7 +2264,7 @@ wkh_ ## underscored (proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_
* | ( Value-length ( Token-text | Integer-value ) [ Q-value ] )
*/
wkh_accept_x_q_header(accept_charset, "Accept-Charset",
vals_character_sets, "character set")
&vals_character_sets_ext, "character set")
/*
* Accept-language-value =
* Short-integer
@ -2258,7 +2272,7 @@ wkh_accept_x_q_header(accept_charset, "Accept-Charset",
* | ( Value-length ( Text-string | Integer-value ) [ Q-value ] )
*/
wkh_accept_x_q_header(accept_language, "Accept-Language",
vals_languages, "language")
&vals_languages_ext, "language")
/*
@ -2343,7 +2357,7 @@ wkh_allow(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo
tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
ti = proto_tree_add_string(tree, hf_hdr_allow,
tvb, hdr_start, offset - hdr_start,
val_to_str(val_id & 0x7F, wsp_vals_pdu_type,
val_to_str_ext(val_id & 0x7F, &wsp_vals_pdu_type_ext,
"<Unknown WSP method 0x%02X>"));
ok = TRUE;
}
@ -2370,7 +2384,7 @@ wkh_public(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinf
tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
ti = proto_tree_add_string(tree, hf_hdr_public,
tvb, hdr_start, offset - hdr_start,
val_to_str(val_id & 0x7F, wsp_vals_pdu_type,
val_to_str_ext(val_id & 0x7F, &wsp_vals_pdu_type_ext,
"<Unknown WSP method 0x%02X>"));
ok = TRUE;
}
@ -2398,7 +2412,7 @@ wkh_vary(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo
tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
ti = proto_tree_add_string(tree, hf_hdr_vary,
tvb, hdr_start, offset - hdr_start,
val_to_str(val_id & 0x7F, vals_field_names,
val_to_str_ext(val_id & 0x7F, &vals_field_names_ext,
"<Unknown WSP header field 0x%02X>"));
ok = TRUE;
wkh_2_TextualValue;
@ -2970,7 +2984,7 @@ wkh_age(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo _
/*
* Template for Integer lookup or text value headers:
*/
#define wkh_integer_lookup_or_text_value(underscored,Text,valueString,valueName) \
#define wkh_integer_lookup_or_text_value(underscored,Text,valueStringExtAddr,valueName) \
static guint32 \
wkh_ ## underscored(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo _U_) \
{ \
@ -2981,7 +2995,7 @@ wkh_ ## underscored(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_i
tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
tvb, hdr_start, offset - hdr_start, \
val_to_str(val_id & 0x7F, valueString, \
val_to_str_ext(val_id & 0x7F, valueStringExtAddr, \
"(Unknown " valueName " identifier 0x%X)")); \
ok = TRUE; \
wkh_2_TextualValue; \
@ -2996,7 +3010,7 @@ wkh_ ## underscored(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_i
tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
tvb, hdr_start, offset - hdr_start, \
val_to_str(val_id & 0x7F, valueString, \
val_to_str_ext(val_id & 0x7F, valueStringExtAddr, \
"(Unknown " valueName " identifier 0x%X)")); \
} \
} \
@ -3007,15 +3021,15 @@ wkh_ ## underscored(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_i
* Wap-application-value: Uri-value | Integer-value
*/
wkh_integer_lookup_or_text_value(x_wap_application_id, "X-Wap-Application-Id",
vals_wap_application_ids, "WAP application")
&vals_wap_application_ids_ext, "WAP application")
wkh_integer_lookup_or_text_value(accept_application, "Accept-Application",
vals_wap_application_ids, "WAP application")
&vals_wap_application_ids_ext, "WAP application")
wkh_integer_lookup_or_text_value(content_language, "Content-Language",
vals_languages, "language")
&vals_languages_ext, "language")
/* NOTE - Although the WSP spec says this is an integer-value, the WSP headers
* are encoded as a 7-bit entity! */
wkh_integer_lookup_or_text_value(trailer, "Trailer",
vals_field_names, "well-known-header")
&vals_field_names_ext, "well-known-header")
/*
@ -3301,7 +3315,7 @@ wkh_integer_value_header(content_length, "Content-Length")
wkh_integer_value_header(max_forwards, "Max-Forwards")
#define wkh_integer_lookup_value_header(underscored,Text,valueString,valueName) \
#define wkh_integer_lookup_value_header(underscored,Text,valueStringExtAddr,valueName) \
static guint32 \
wkh_ ## underscored(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo _U_) \
{ \
@ -3309,7 +3323,7 @@ wkh_ ## underscored(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_i
guint32 val = 0, off = val_start, len; \
\
wkh_1_WellKnownValue; \
val_str = match_strval(val_id & 0x7F, valueString); \
val_str = match_strval_ext(val_id & 0x7F, valueStringExtAddr); \
if (val_str) { \
tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
@ -3327,7 +3341,7 @@ wkh_ ## underscored(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_i
if (val_id <= 4) { /* Length field already parsed by macro! */ \
get_long_integer(val, tvb, off, len, ok); \
if (ok) { \
val_str = match_strval(val_id & 0x7F, valueString); \
val_str = match_strval_ext(val_id & 0x7F, valueStringExtAddr); \
if (val_str) { \
tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
@ -3345,7 +3359,7 @@ wkh_ ## underscored(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_i
}
wkh_integer_lookup_value_header(bearer_indication, "Bearer-Indication",
vals_bearer_types, "bearer type")
&vals_bearer_types_ext, "bearer type")
/*
@ -3361,7 +3375,7 @@ wkh_cache_control(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_inf
wkh_1_WellKnownValue;
val = val_id & 0x7F;
val_str = match_strval(val, vals_cache_control);
val_str = match_strval_ext(val, &vals_cache_control_ext);
if (val_str) {
tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
ti = proto_tree_add_string(tree, hf_hdr_cache_control,
@ -3390,7 +3404,7 @@ wkh_cache_control(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_inf
tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
ti = proto_tree_add_string(tree, hf_hdr_cache_control,
tvb, hdr_start, offset - hdr_start,
val_to_str (cache_control_directive & 0x7F, vals_cache_control,
val_to_str_ext (cache_control_directive & 0x7F, &vals_cache_control_ext,
"<Unknown cache control directive 0x%02X>"));
/* TODO: split multiple entries */
ok = TRUE;
@ -3419,7 +3433,7 @@ wkh_cache_control(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_inf
tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
ti = proto_tree_add_string(tree, hf_hdr_cache_control,
tvb, hdr_start, offset - hdr_start,
val_to_str (cache_control_directive & 0x7F, vals_cache_control,
val_to_str_ext (cache_control_directive & 0x7F, &vals_cache_control_ext,
"<Unknown cache control directive 0x%02X>"));
get_delta_seconds_value(val, tvb, off, len, ok);
if (ok) {
@ -3490,7 +3504,7 @@ wkh_warning(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pin
wkh_1_WellKnownValue;
val = val_id & 0x7F;
val_str = match_strval(val, vals_wsp_warning_code);
val_str = match_strval_ext(val, &vals_wsp_warning_code_ext);
if (val_str) {
tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
ti = proto_tree_add_string(tree, hf_hdr_warning,
@ -3508,7 +3522,7 @@ wkh_warning(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pin
warn_code = tvb_get_guint8(tvb, off);
if (warn_code & 0x80) { /* Well known warn code */
val = warn_code & 0x7f;
val_str = match_strval(val, vals_wsp_warning_code_short);
val_str = match_strval_ext(val, &vals_wsp_warning_code_short_ext);
if (val_str) { /* OK */
str = g_strdup_printf("code=%s", val_str);
tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
@ -3561,7 +3575,7 @@ wkh_profile_warning(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_i
wkh_1_WellKnownValue;
val = val_id & 0x7F;
val_str = match_strval(val, vals_wsp_profile_warning_code);
val_str = match_strval_ext(val, &vals_wsp_profile_warning_code_ext);
if (val_str) {
tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
ti = proto_tree_add_string(tree, hf_hdr_profile_warning,
@ -3574,7 +3588,7 @@ wkh_profile_warning(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_i
off = val_start + val_len_len;
warn_code = tvb_get_guint8(tvb, off++);
if (warn_code & 0x80) { /* Well known warn code */
val_str = match_strval(val, vals_wsp_profile_warning_code);
val_str = match_strval_ext(val, &vals_wsp_profile_warning_code_ext);
if (val_str) { /* OK */
tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
ti = proto_tree_add_string(tree, hf_hdr_profile_warning,
@ -3792,7 +3806,7 @@ static guint32 wkh_te (proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packe
off = val_start + val_len_len;
val = tvb_get_guint8(tvb, off);
if (val & 0x80) { /* Well-known-TE */
val_str = match_strval((val & 0x7F), vals_well_known_te);
val_str = match_strval_ext((val & 0x7F), &vals_well_known_te_ext);
if (val_str) {
tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
ti = proto_tree_add_string(tree, hf_hdr_te,
@ -3834,7 +3848,7 @@ static guint32 wkh_te (proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packe
tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
hidden_item = proto_tree_add_string(tree, hf_hdr_name, \
tvb, hdr_start, offset - hdr_start, \
val_to_str (hdr_id, vals_openwave_field_names, \
val_to_str_ext (hdr_id, &vals_openwave_field_names_ext, \
"<Unknown WSP header field 0x%02X>")); \
PROTO_ITEM_SET_HIDDEN(hidden_item); \
if (val_id & 0x80) { /* Well-known value */ \
@ -3865,7 +3879,7 @@ static guint32 wkh_te (proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packe
tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
proto_tree_add_text(tree, tvb, hdr_start, offset - hdr_start, \
"%s: <Error: Invalid header value>", \
val_to_str (hdr_id, vals_openwave_field_names, \
val_to_str_ext (hdr_id, &vals_openwave_field_names_ext, \
"<Unknown WSP header field 0x%02X>")); \
} \
} \
@ -3884,19 +3898,19 @@ wkh_openwave_default(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_
tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
ti = proto_tree_add_text(tree, tvb, hdr_start, offset - hdr_start,
"%s: (Undecoded well-known value 0x%02x)",
val_to_str (hdr_id, vals_openwave_field_names,
val_to_str_ext (hdr_id, &vals_openwave_field_names_ext,
"<Unknown WSP header field 0x%02X>"), val_id & 0x7F);
wkh_2_TextualValue;
tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
ti = proto_tree_add_text(tree,tvb,hdr_start, offset - hdr_start,
"%s: %s",
val_to_str (hdr_id, vals_openwave_field_names,
val_to_str_ext (hdr_id, &vals_openwave_field_names_ext,
"<Unknown WSP header field 0x%02X>"), val_str);
wkh_3_ValueWithLength;
tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start);
ti = proto_tree_add_text(tree, tvb, hdr_start, offset - hdr_start,
"%s: (Undecoded value in general form with length indicator)",
val_to_str (hdr_id, vals_openwave_field_names,
val_to_str_ext (hdr_id, &vals_openwave_field_names_ext,
"<Unknown WSP header field 0x%02X>"));
wkh_4_End(HF_EMPTY); /* See wkh_default for explanation */
@ -3963,7 +3977,7 @@ wkh_tod_value_header(openwave_x_up_proxy_tod,
/* Openwave accept_x_q header */
wkh_accept_x_q_header(openwave_x_up_proxy_trans_charset,
"x-up-proxy-trans-charset",
vals_character_sets, "character set")
&vals_character_sets_ext, "character set")
/* Openwave content type header */
wkh_content_type_header(openwave_x_up_proxy_push_accept,
@ -4152,7 +4166,7 @@ parameter (proto_tree *tree, proto_item *ti, tvbuff_t *tvb, int start, int len)
case 0x01: /* WSP 1.1 encoding - Charset: Well-known-charset */
get_integer_value(val, tvb, offset, val_len, ok);
if (ok) {
val_str = val_to_str(val, vals_character_sets,
val_str = val_to_str_ext(val, &vals_character_sets_ext,
"<Unknown character set Identifier 0x%X>");
proto_tree_add_string(tree, hf_parameter_charset,
tvb, start, type_len + val_len, val_str);
@ -4214,7 +4228,7 @@ parameter (proto_tree *tree, proto_item *ti, tvbuff_t *tvb, int start, int len)
get_short_integer(val,tvb,offset,val_len,ok);
if (ok) {
offset += val_len;
val_str = val_to_str(val, vals_content_types,
val_str = val_to_str_ext(val, &vals_content_types_ext,
"(Unknown content type identifier 0x%X)");
} /* Else: invalid parameter value */
}
@ -4284,7 +4298,7 @@ parameter (proto_tree *tree, proto_item *ti, tvbuff_t *tvb, int start, int len)
peek &= 0x7F;
proto_tree_add_uint (tree, hf_wsp_parameter_sec,
tvb, start, 2, peek);
str = (gchar *) val_to_str(peek, vals_wsp_parameter_sec, "Undefined");
str = (gchar *) val_to_str_ext_const(peek, &vals_wsp_parameter_sec_ext, "Undefined");
s = g_strdup_printf("; SEC=%s", str);
proto_item_append_string (ti, s);
g_free(s);
@ -4986,7 +5000,7 @@ dissect_wsp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (check_col(pinfo->cinfo, COL_INFO))
{
col_append_fstr(pinfo->cinfo, COL_INFO, "WSP %s (0x%02x)",
val_to_str (pdut, wsp_vals_pdu_type, "Unknown PDU type (0x%02x)"),
val_to_str_ext (pdut, &wsp_vals_pdu_type_ext, "Unknown PDU type (0x%02x)"),
pdut);
};
@ -5010,7 +5024,7 @@ dissect_wsp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
tvb, 0, -1, bo_little_endian);
wsp_tree = proto_item_add_subtree(proto_ti, ett_wsp);
proto_item_append_text(proto_ti, ", Method: %s (0x%02x)",
val_to_str (pdut, wsp_vals_pdu_type, "Unknown (0x%02x)"),
val_to_str_ext (pdut, &wsp_vals_pdu_type_ext, "Unknown (0x%02x)"),
pdut);
/* Add common items: only TID and PDU Type */
@ -5230,7 +5244,7 @@ dissect_wsp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint8 reply_status = tvb_get_guint8(tvb, offset);
const char *reply_status_str;
reply_status_str = val_to_str (reply_status, wsp_vals_status, "(Unknown response status)");
reply_status_str = val_to_str_ext_const (reply_status, &wsp_vals_status_ext, "(Unknown response status)");
if (tree) {
ti = proto_tree_add_item (wsp_tree, hf_wsp_header_status,
tvb, offset, 1, bo_little_endian);
@ -6035,7 +6049,7 @@ proto_register_wsp(void)
{ &hf_wsp_header_pdu_type,
{ "PDU Type",
"wsp.pdu_type",
FT_UINT8, BASE_HEX, VALS( wsp_vals_pdu_type ), 0x00,
FT_UINT8, BASE_HEX|BASE_EXT_STRING, &wsp_vals_pdu_type_ext, 0x00,
NULL, HFILL
}
},
@ -6105,7 +6119,7 @@ proto_register_wsp(void)
{ &hf_wsp_header_status,
{ "Status",
"wsp.reply.status",
FT_UINT8, BASE_HEX, VALS( wsp_vals_status ), 0x00,
FT_UINT8, BASE_HEX|BASE_EXT_STRING, &wsp_vals_status_ext, 0x00,
"Reply Status", HFILL
}
},
@ -6168,7 +6182,7 @@ proto_register_wsp(void)
{ &hf_wsp_parameter_sec,
{ "SEC",
"wsp.parameter.sec",
FT_UINT8, BASE_HEX, VALS (vals_wsp_parameter_sec), 0x00,
FT_UINT8, BASE_HEX|BASE_EXT_STRING, &vals_wsp_parameter_sec_ext, 0x00,
"SEC parameter (Content-Type: application/vnd.wap.connectivity-wbxml)", HFILL
}
},
@ -6420,7 +6434,7 @@ proto_register_wsp(void)
{ &hf_address_bearer_type,
{ "Bearer Type",
"wsp.address.bearer_type",
FT_UINT8, BASE_HEX, VALS(vals_bearer_types), 0x0,
FT_UINT8, BASE_HEX|BASE_EXT_STRING, &vals_bearer_types_ext, 0x0,
NULL, HFILL
}
},
@ -6877,7 +6891,7 @@ proto_register_wsp(void)
{ &hf_hdr_warning_code,
{ "Warning code",
"wsp.header.warning.code",
FT_UINT8, BASE_HEX, VALS(vals_wsp_warning_code), 0x00,
FT_UINT8, BASE_HEX|BASE_EXT_STRING, &vals_wsp_warning_code_ext, 0x00,
"WSP header Warning code", HFILL
}
},

View File

@ -33,15 +33,15 @@
/* These reason codes are used in the WTP dissector as the WTP user is
* assumed to be WSP */
extern const value_string vals_wsp_reason_codes[];
extern value_string_ext vals_wsp_reason_codes_ext;
/*
* the following allows TAP code access to the messages
* without having to duplicate it. With MSVC and a
* libwireshark.dll, we need a special declaration.
*/
WS_VAR_IMPORT const value_string wsp_vals_pdu_type[];
WS_VAR_IMPORT const value_string wsp_vals_status[];
WS_VAR_IMPORT value_string_ext wsp_vals_pdu_type_ext;
WS_VAR_IMPORT value_string_ext wsp_vals_status_ext;
/*
* exported functionality
*/

View File

@ -128,6 +128,7 @@ static const value_string wtls_vals_record_type[] = {
{ 4, "application_data" },
{ 0, NULL }
};
static value_string_ext wtls_vals_record_type_ext = VALUE_STRING_EXT_INIT(wtls_vals_record_type);
static const value_string wtls_vals_cipher_bulk[] = {
{ 0, "Null" },
@ -142,6 +143,7 @@ static const value_string wtls_vals_cipher_bulk[] = {
{ 9, "IDEA CBC" },
{ 0, NULL }
};
static value_string_ext wtls_vals_cipher_bulk_ext = VALUE_STRING_EXT_INIT(wtls_vals_cipher_bulk);
static const value_string wtls_vals_cipher_mac[] = {
{ 0, "SHA 0" },
@ -154,6 +156,7 @@ static const value_string wtls_vals_cipher_mac[] = {
{ 7, "MD5" },
{ 0, NULL }
};
static value_string_ext wtls_vals_cipher_mac_ext = VALUE_STRING_EXT_INIT(wtls_vals_cipher_mac);
static const value_string wtls_vals_handshake_type[] = {
{ 0, "Hello Request" },
@ -168,6 +171,7 @@ static const value_string wtls_vals_handshake_type[] = {
{ 20, "Finished" },
{ 0x00, NULL }
};
static value_string_ext wtls_vals_handshake_type_ext = VALUE_STRING_EXT_INIT(wtls_vals_handshake_type);
static const value_string wtls_vals_key_exchange_suite[] = {
{ 0, "NULL" },
@ -191,6 +195,7 @@ static const value_string wtls_vals_key_exchange_suite[] = {
{ 18, "EC Diffie Hellman ECDSA Uncomp" },
{ 0x00, NULL }
};
static value_string_ext wtls_vals_key_exchange_suite_ext = VALUE_STRING_EXT_INIT(wtls_vals_key_exchange_suite);
static const value_string wtls_vals_identifier_type[] = {
{ 0, "No identifier" },
@ -200,6 +205,7 @@ static const value_string wtls_vals_identifier_type[] = {
{ 255, "x509 Distinguished Name" },
{ 0x00, NULL }
};
static value_string_ext wtls_vals_identifier_type_ext = VALUE_STRING_EXT_INIT(wtls_vals_identifier_type);
static const value_string wtls_vals_certificate_type[] = {
{ 1, "WTLS" },
@ -208,6 +214,7 @@ static const value_string wtls_vals_certificate_type[] = {
{ 4, "URL" },
{ 0x00, NULL }
};
static value_string_ext wtls_vals_certificate_type_ext = VALUE_STRING_EXT_INIT(wtls_vals_certificate_type);
static const value_string wtls_vals_compression[] = {
{ 0, "Null" },
@ -277,6 +284,7 @@ static const value_string wtls_vals_alert_description[] = {
{ 100,"no_renegotiation"},
{ 0x00, NULL }
};
static value_string_ext wtls_vals_alert_description_ext = VALUE_STRING_EXT_INIT(wtls_vals_alert_description);
#define WTLS_RECORD_TYPE_LENGTH 0x80
#define WTLS_RECORD_TYPE_SEQUENCE 0x40
@ -789,10 +797,10 @@ dissect_wtls_handshake(proto_tree *tree, tvbuff_t *tvb, guint offset, guint coun
offset+=1;
for (;count > 0;count-=client_size) {
value = tvb_get_guint8 (tvb, offset);
valBulk = match_strval(value, wtls_vals_cipher_bulk);
valBulk = match_strval_ext(value, &wtls_vals_cipher_bulk_ext);
offset++;
client_size=1;
valMac = match_strval(tvb_get_guint8 (tvb, offset), wtls_vals_cipher_mac);
valMac = match_strval_ext(tvb_get_guint8 (tvb, offset), &wtls_vals_cipher_mac_ext);
if (valBulk != NULL)
{
if (valMac != NULL)
@ -1078,14 +1086,14 @@ proto_register_wtls(void)
{ &hf_wtls_record,
{ "Record",
"wtls.record",
FT_UINT8, BASE_DEC, VALS ( wtls_vals_record_type ), 0x0f,
FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wtls_vals_record_type_ext, 0x0f,
NULL, HFILL
}
},
{ &hf_wtls_record_type,
{ "Record Type",
"wtls.rec_type",
FT_UINT8, BASE_DEC, VALS ( wtls_vals_record_type ), 0x0f,
FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wtls_vals_record_type_ext, 0x0f,
NULL, HFILL
}
},
@ -1113,14 +1121,14 @@ proto_register_wtls(void)
{ &hf_wtls_hands,
{ "Handshake",
"wtls.handshake",
FT_UINT8, BASE_DEC, VALS ( wtls_vals_handshake_type ), 0x00,
FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wtls_vals_handshake_type_ext, 0x00,
NULL, HFILL
}
},
{ &hf_wtls_hands_type,
{ "Type",
"wtls.handshake.type",
FT_UINT8, BASE_DEC, VALS ( wtls_vals_handshake_type ), 0x00,
FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wtls_vals_handshake_type_ext, 0x00,
NULL, HFILL
}
},
@ -1197,14 +1205,14 @@ proto_register_wtls(void)
{ &hf_wtls_hands_cli_hello_key_exchange,
{ "Key Exchange",
"wtls.handshake.client_hello.key.key_exchange",
FT_UINT8, BASE_DEC, VALS ( wtls_vals_key_exchange_suite ), 0x00,
FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wtls_vals_key_exchange_suite_ext, 0x00,
NULL, HFILL
}
},
{ &hf_wtls_hands_cli_hello_key_exchange_suite,
{ "Suite",
"wtls.handshake.client_hello.key.key_exchange.suite",
FT_UINT8, BASE_DEC, VALS ( wtls_vals_key_exchange_suite ), 0x00,
FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wtls_vals_key_exchange_suite_ext, 0x00,
NULL, HFILL
}
},
@ -1225,14 +1233,14 @@ proto_register_wtls(void)
{ &hf_wtls_hands_cli_hello_key_identifier_type,
{ "Identifier Type",
"wtls.handshake.client_hello.ident_type",
FT_UINT8, BASE_DEC, VALS ( wtls_vals_identifier_type ), 0x00,
FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wtls_vals_identifier_type_ext, 0x00,
NULL, HFILL
}
},
{ &hf_wtls_hands_cli_hello_key_identifier_charset,
{ "Identifier CharSet",
"wtls.handshake.client_hello.ident_charset",
FT_UINT16, BASE_HEX, VALS ( vals_character_sets ), 0x00,
FT_UINT16, BASE_HEX|BASE_EXT_STRING, &vals_character_sets_ext, 0x00,
NULL, HFILL
}
},
@ -1358,14 +1366,14 @@ proto_register_wtls(void)
{ &hf_wtls_hands_serv_hello_cipher_bulk,
{ "Cipher Bulk",
"wtls.handshake.server_hello.cipher.bulk",
FT_UINT8, BASE_DEC, VALS ( wtls_vals_cipher_bulk ), 0x00,
FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wtls_vals_cipher_bulk_ext, 0x00,
NULL, HFILL
}
},
{ &hf_wtls_hands_serv_hello_cipher_mac,
{ "Cipher MAC",
"wtls.handshake.server_hello.cipher.mac",
FT_UINT8, BASE_DEC, VALS ( wtls_vals_cipher_mac ), 0x00,
FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wtls_vals_cipher_mac_ext, 0x00,
NULL, HFILL
}
},
@ -1407,7 +1415,7 @@ proto_register_wtls(void)
{ &hf_wtls_hands_certificate_type,
{ "Type",
"wtls.handshake.certificate.type",
FT_UINT8, BASE_DEC, VALS ( wtls_vals_certificate_type ), 0x00,
FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wtls_vals_certificate_type_ext, 0x00,
NULL, HFILL
}
},
@ -1435,14 +1443,14 @@ proto_register_wtls(void)
{ &hf_wtls_hands_certificate_wtls_issuer_type,
{ "Issuer",
"wtls.handshake.certificate.issuer.type",
FT_UINT8, BASE_DEC, VALS ( wtls_vals_identifier_type ), 0x00,
FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wtls_vals_identifier_type_ext, 0x00,
NULL, HFILL
}
},
{ &hf_wtls_hands_certificate_wtls_issuer_charset,
{ "Charset",
"wtls.handshake.certificate.issuer.charset",
FT_UINT16, BASE_HEX, VALS ( vals_character_sets ), 0x00,
FT_UINT16, BASE_HEX|BASE_EXT_STRING, &vals_character_sets_ext, 0x00,
NULL, HFILL
}
},
@ -1477,14 +1485,14 @@ proto_register_wtls(void)
{ &hf_wtls_hands_certificate_wtls_subject_type,
{ "Subject",
"wtls.handshake.certificate.subject.type",
FT_UINT8, BASE_DEC, VALS ( wtls_vals_identifier_type ), 0x00,
FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wtls_vals_identifier_type_ext, 0x00,
NULL, HFILL
}
},
{ &hf_wtls_hands_certificate_wtls_subject_charset,
{ "Charset",
"wtls.handshake.certificate.subject.charset",
FT_UINT16, BASE_HEX, VALS ( vals_character_sets ), 0x00,
FT_UINT16, BASE_HEX|BASE_EXT_STRING, &vals_character_sets_ext, 0x00,
NULL, HFILL
}
},
@ -1554,7 +1562,7 @@ proto_register_wtls(void)
{ &hf_wtls_alert_description,
{ "Description",
"wtls.alert.description",
FT_UINT8, BASE_DEC, VALS ( wtls_vals_alert_description ), 0x00,
FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wtls_vals_alert_description_ext, 0x00,
NULL, HFILL
}
},

View File

@ -552,7 +552,7 @@ dissect_wtp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
", Reason: %s (%u)",
ABORT,
PROVIDER,
val_to_str(reason, vals_wsp_reason_codes, "Undefined"),
val_to_str_ext_const(reason, &vals_wsp_reason_codes_ext, "Undefined"),
reason);
}
break;
@ -926,7 +926,7 @@ proto_register_wtp(void)
{ &hf_wtp_header_Abort_reason_user,
{ "Abort Reason",
"wtp.abort.reason.user",
FT_UINT8, BASE_HEX, VALS ( vals_wsp_reason_codes ), 0x00,
FT_UINT8, BASE_HEX|BASE_EXT_STRING, &vals_wsp_reason_codes_ext, 0x00,
NULL, HFILL
}
},

View File

@ -1147,8 +1147,8 @@ write_prefs
ws_strdup_escape_underscore
ws_strdup_unescape_underscore
wslua_plugin_list DATA
wsp_vals_pdu_type DATA
wsp_vals_status DATA
wsp_vals_pdu_type_ext DATA
wsp_vals_status_ext DATA
wtap_nstime_to_sec
xml_escape
xml_get_attrib

View File

@ -282,9 +282,9 @@ wsp_init_table(wspstat_t *sp)
x=2;
}
/* Maybe we should display the hexadecimal value ? */
/* g_snprintf(buffer, sizeof(buffer), "%s (0X%x)", match_strval( index2pdut( i ), wsp_vals_pdu_type), index2pdut(i) );*/
/* g_snprintf(buffer, sizeof(buffer), "%s (0X%x)", match_strval_ext( index2pdut( i ), &wsp_vals_pdu_type_ext), index2pdut(i) );*/
add_table_entry( sp,
match_strval(index2pdut(i), wsp_vals_pdu_type), /* or buffer, */
match_strval_ext(index2pdut(i), &wsp_vals_pdu_type_ext), /* or buffer, */
x,
pos,
0
@ -312,7 +312,8 @@ gtk_wspstat_init(const char *optarg, void *userdata _U_)
GtkWidget *bt_close;
GtkWidget *bbox;
guint32 i;
wsp_status_code_t *sc;
wsp_status_code_t *sc;
const value_string *wsp_vals_status_p;
if (strncmp (optarg, "wsp,stat,", 9) == 0){
@ -326,16 +327,17 @@ gtk_wspstat_init(const char *optarg, void *userdata _U_)
gtk_window_set_destroy_with_parent (GTK_WINDOW(sp->win), TRUE);
sp->hash = g_hash_table_new( g_int_hash, g_int_equal);
for (i=0 ; wsp_vals_status[i].strptr ; i++ )
wsp_vals_status_p = VALUE_STRING_EXT_VS_P(&wsp_vals_status_ext);
for (i=0 ; wsp_vals_status_p[i].strptr ; i++ )
{
gint *key;
sc=g_malloc( sizeof(wsp_status_code_t) );
key=g_malloc( sizeof(gint) );
sc->name=wsp_vals_status[i].strptr;
sc->name=wsp_vals_status_p[i].strptr;
sc->packets=0;
sc->widget=NULL;
sc->sp = sp;
*key=wsp_vals_status[i].value;
*key=wsp_vals_status_p[i].value;
g_hash_table_insert(
sp->hash,
key,

View File

@ -215,11 +215,12 @@ wspstat_draw(void *psp)
static void
wspstat_init(const char *optarg, void* userdata _U_)
{
wspstat_t *sp;
const char *filter=NULL;
guint32 i;
GString *error_string;
wsp_status_code_t *sc;
wspstat_t *sp;
const char *filter=NULL;
guint32 i;
GString *error_string;
wsp_status_code_t *sc;
const value_string *wsp_vals_status_p;
if (!strncmp (optarg, "wsp,stat," , 9)){
filter=optarg+9;
@ -230,14 +231,15 @@ wspstat_init(const char *optarg, void* userdata _U_)
sp = g_malloc( sizeof(wspstat_t) );
sp->hash = g_hash_table_new( g_int_hash, g_int_equal);
for (i=0 ; wsp_vals_status[i].strptr ; i++ )
wsp_vals_status_p = VALUE_STRING_EXT_VS_P(&wsp_vals_status_ext);
for (i=0 ; wsp_vals_status_p[i].strptr ; i++ )
{
gint *key;
sc=g_malloc( sizeof(wsp_status_code_t) );
key=g_malloc( sizeof(gint) );
sc->packets=0;
sc->name=wsp_vals_status[i].strptr;
*key=wsp_vals_status[i].value;
sc->name=wsp_vals_status_p[i].strptr;
*key=wsp_vals_status_p[i].value;
g_hash_table_insert(
sp->hash,
key,
@ -253,7 +255,7 @@ wspstat_init(const char *optarg, void* userdata _U_)
for (i=0;i<sp->num_pdus; i++)
{
sp->pdu_stats[i].packets=0;
sp->pdu_stats[i].type = match_strval( index2pdut( i ), wsp_vals_pdu_type) ;
sp->pdu_stats[i].type = match_strval_ext( index2pdut( i ), &wsp_vals_pdu_type_ext) ;
}
error_string = register_tap_listener(