if (tag==T_PROFILE) {
if (len_field % RES_ID_LEN) {
- tag_str = match_strval(tag, dvbci_apdu_tag);
+ tag_str = val_to_str(tag, dvbci_apdu_tag, "Unknown: %d");
pi = proto_tree_add_text(tree, tvb, 0, APDU_TAG_SIZE,
"Invalid APDU length field");
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
if (tag==T_CA_INFO) {
if (len_field % 2) {
- tag_str = match_strval(tag, dvbci_apdu_tag);
+ tag_str = val_to_str(tag, dvbci_apdu_tag, "Unknown: %d");
pi = proto_tree_add_text(tree, tvb, 0, APDU_TAG_SIZE,
"Invalid APDU length field");
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
proto_item_append_text(ti, ": %s %s", msg_class_str, val_to_str(error_code, errorcodes, "Unknown"));
}
else {
- msg_class_str = match_strval(MSGCODE_TO_CLASS(message_code), classes);
- msg_method_str = match_strval(MSGCODE_TO_METHOD(message_code), methods);
-
- if (msg_method_str == NULL)
- msg_method_str = "Unknown";
+ msg_class_str = val_to_str(MSGCODE_TO_CLASS(message_code), classes, "Unknown %d");
+ msg_method_str = val_to_str(MSGCODE_TO_METHOD(message_code), methods, "Unknown %d");
col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s",
msg_method_str, msg_class_str);
}
- msg_class_str = match_strval(msg_type_class, classes);
- msg_method_str = match_strval(msg_type_method, methods);
-
- if (msg_method_str == NULL)
- msg_method_str = "Unknown";
+ msg_class_str = val_to_str_const(msg_type_class, classes, "Unknown");
+ msg_method_str = val_to_str_const(msg_type_method, methods, "Unknown");
if(check_col(pinfo->cinfo,COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s",
proto_tree_add_uint(att_type_tree, stun_att_type_comprehension, tvb, offset, 2, att_type);
ti = proto_tree_add_text(att_type_tree, tvb, offset, 2,
"%s (%d)",
- match_strval((att_type & 0x8000) >> 15, comprehensions),
+ val_to_str((att_type & 0x8000) >> 15, comprehensions, "Unknown: %d"),
(att_type & 0x8000) >> 15);
PROTO_ITEM_SET_GENERATED(ti);
proto_tree_add_uint(att_type_tree, stun_att_type_assignment, tvb, offset, 2, att_type);
ti = proto_tree_add_text(att_type_tree, tvb, offset, 2,
"%s (%d)",
- match_strval((att_type & 0x4000) >> 14, assignments),
+ val_to_str((att_type & 0x4000) >> 14, assignments, "Unknown: %d"),
(att_type & 0x4000) >> 14);
PROTO_ITEM_SET_GENERATED(ti);
#define XCSL_PROTSEQERR 8
#define XCSL_NONE 9
-/* Result code meanings. See function match_strval() for usage */
+/* Result code meanings. */
static const value_string xcsl_action_vals[] = {
{ XCSL_SUCCESS, "Success" },
{ XCSL_UNKNOWN, "Unknown" },
if ( result >= XCSL_NONE ) {
result = XCSL_UNDEFINED;
}
- code = match_strval(result, xcsl_action_vals);
+ code = val_to_str(result, xcsl_action_vals, "Unknown: %d");
/* Print result code and description */
xcsl_item = proto_tree_add_item(tree, hf_xcsl_result, tvb, offset, len, FALSE);