String passed to val_to_str() must have int format specifier (%u, %d, %x, and so on...).

Fix some cases (easy to grep) by call to val_to_str_const().

svn path=/trunk/; revision=47807
This commit is contained in:
Jakub Zawadzki 2013-02-21 21:04:59 +00:00
parent a3fca22472
commit c5a71b1006
12 changed files with 68 additions and 68 deletions

View File

@ -450,7 +450,7 @@ camelsrt_request_call_matching(tvbuff_t *tvb, packet_info *pinfo,
proto_item *ti, *hidden_item;
#ifdef DEBUG_CAMELSRT
dbg(10,"\n %s #%u\n", val_to_str(srt_type, camelSRTtype_naming, "Unk"),pinfo->fd->num);
dbg(10,"\n %s #%u\n", val_to_str_const(srt_type, camelSRTtype_naming, "Unk"),pinfo->fd->num);
#endif
/* look only for matching request, if matching conversation is available. */
@ -547,7 +547,7 @@ camelsrt_request_call_matching(tvbuff_t *tvb, packet_info *pinfo,
ti = proto_tree_add_uint_format(tree, hf_camelsrt_RequestFrame, tvb, 0, 0,
p_camelsrt_call->category[srt_type].rsp_num,
"Linked response %s in frame %u",
val_to_str(srt_type, camelSRTtype_naming, "Unk"),
val_to_str_const(srt_type, camelSRTtype_naming, "Unk"),
p_camelsrt_call->category[srt_type].rsp_num);
PROTO_ITEM_SET_GENERATED(ti);
} /* frame valid */
@ -571,7 +571,7 @@ camelsrt_report_call_matching(tvbuff_t *tvb, packet_info *pinfo,
proto_item *ti, *hidden_item;
#ifdef DEBUG_CAMELSRT
dbg(10,"\n %s #%u\n", val_to_str(srt_type, camelSRTtype_naming, "Unk"),pinfo->fd->num);
dbg(10,"\n %s #%u\n", val_to_str_const(srt_type, camelSRTtype_naming, "Unk"),pinfo->fd->num);
#endif
camelsrt_call_key.SessionIdKey = p_camelsrt_info->tcap_session_id;
/* look only for matching request, if matching conversation is available. */
@ -648,7 +648,7 @@ camelsrt_report_call_matching(tvbuff_t *tvb, packet_info *pinfo,
ti = proto_tree_add_uint_format(tree, hf_camelsrt_ResponseFrame, tvb, 0, 0,
p_camelsrt_call->category[srt_type].req_num,
"Linked request %s in frame %u",
val_to_str(srt_type, camelSRTtype_naming, "Unk"),
val_to_str_const(srt_type, camelSRTtype_naming, "Unk"),
p_camelsrt_call->category[srt_type].req_num);
PROTO_ITEM_SET_GENERATED(ti);
}

View File

@ -438,7 +438,7 @@ dissect_amr_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint amr
amr_tree = proto_item_add_subtree(ti, ett_amr);
proto_tree_add_text(amr_tree, tvb, offset, -1, "Payload decoded as %s",
val_to_str(amr_encoding_type, amr_encoding_type_value, "Unknown value - Error"));
val_to_str_const(amr_encoding_type, amr_encoding_type_value, "Unknown value - Error"));
switch (amr_encoding_type) {
case 0: /* RFC 3267 Byte aligned */

View File

@ -818,7 +818,7 @@ tele_param_pri_ind(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
oct = tvb_get_guint8(tvb, offset);
str=val_to_str((oct&0xc0)>>6, tele_param_pri_ind_strings, "Unknown");
str=val_to_str_const((oct&0xc0)>>6, tele_param_pri_ind_strings, "Unknown");
other_decode_bitfield_value(ansi_637_bigbuf, oct, 0xc0, 8);
proto_tree_add_text(tree, tvb, offset, 1,

View File

@ -2463,13 +2463,13 @@ dissect_artnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
opcode = tvb_get_letohs(tvb, offset);
col_add_fstr(pinfo->cinfo, COL_INFO, "%s (0x%04x)",
val_to_str(opcode, artnet_opcode_vals, "Unknown"), opcode);
val_to_str_const(opcode, artnet_opcode_vals, "Unknown"), opcode);
if (tree) {
proto_tree_add_uint(artnet_header_tree, hf_artnet_header_opcode, tvb,
offset, 2, opcode);
proto_item_append_text(ti, ", Opcode: %s (0x%04x)", val_to_str(opcode, artnet_opcode_vals, "Unknown"), opcode);
proto_item_append_text(ti, ", Opcode: %s (0x%04x)", val_to_str_const(opcode, artnet_opcode_vals, "Unknown"), opcode);
}
offset += 2;

View File

@ -286,7 +286,7 @@ dissect_btatt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
opcode = tvb_get_guint8(tvb, 0);
offset++;
col_append_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str(opcode, opcode_vals, "<unknown>"));
col_append_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str_const(opcode, opcode_vals, "<unknown>"));
switch (opcode) {
case 0x01: /* Error Response */
@ -294,7 +294,7 @@ dissect_btatt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset++;
proto_tree_add_item(st, hf_btatt_handle_in_error, tvb, offset, 2, ENC_LITTLE_ENDIAN);
col_append_fstr(pinfo->cinfo, COL_INFO, " - %s, Handle: 0x%04x",
val_to_str(tvb_get_guint8(tvb, offset+2), error_vals, "<unknown>"),
val_to_str_const(tvb_get_guint8(tvb, offset+2), error_vals, "<unknown>"),
tvb_get_letohs(tvb, offset));
offset += 2;
proto_tree_add_item(st, hf_btatt_error_code, tvb, offset, 1, ENC_LITTLE_ENDIAN);
@ -518,7 +518,7 @@ dissect_btatt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case 0x18: /* Execute Write Request */
col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
val_to_str(tvb_get_guint8(tvb, offset), flags_vals, "<unknown>"));
val_to_str_const(tvb_get_guint8(tvb, offset), flags_vals, "<unknown>"));
proto_tree_add_item(st, hf_btatt_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;

View File

@ -480,8 +480,8 @@ dissect_sep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
media_type = tvb_get_guint8(tvb, offset + 1) >> 4;
type = (tvb_get_guint8(tvb, offset + 1) & 0x08) >> 3;
sep_item = proto_tree_add_text(tree, tvb, offset, 2, "ACP SEP [%u - %s %s] item %u/%u",
seid, val_to_str(media_type, media_type_vals, "unknown"),
val_to_str(type, sep_type_vals, "unknown"), i_sep, items);
seid, val_to_str_const(media_type, media_type_vals, "unknown"),
val_to_str_const(type, sep_type_vals, "unknown"), i_sep, items);
sep_tree = proto_item_add_subtree(sep_item, ett_btavdtp_sep);
proto_tree_add_item(sep_tree, hf_btavdtp_sep_seid , tvb, offset, 1, ENC_BIG_ENDIAN);
@ -710,7 +710,7 @@ dissect_capabilities(tvbuff_t *tvb, packet_info *pinfo,
while (tvb_length_remaining(tvb, offset)) {
service_category = tvb_get_guint8(tvb, offset);
losc = tvb_get_guint8(tvb, offset + 1);
service_item = proto_tree_add_text(capabilities_tree, tvb, offset, 2 + losc, "Service: %s", val_to_str(service_category, service_category_vals, "RFD"));
service_item = proto_tree_add_text(capabilities_tree, tvb, offset, 2 + losc, "Service: %s", val_to_str_const(service_category, service_category_vals, "RFD"));
service_tree = proto_item_add_subtree(service_item, ett_btavdtp_service);
proto_tree_add_item(service_tree, hf_btavdtp_service_category, tvb, offset, 1, ENC_BIG_ENDIAN);
@ -728,7 +728,7 @@ dissect_capabilities(tvbuff_t *tvb, packet_info *pinfo,
case SERVICE_CATEGORY_RECOVERY:
recovery_type = tvb_get_guint8(tvb, offset);
pitem = proto_tree_add_item(service_tree, hf_btavdtp_recovery_type, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_item_append_text(pitem, " (%s)", val_to_str(recovery_type, recovery_type_vals, "RFD"));
proto_item_append_text(pitem, " (%s)", val_to_str_const(recovery_type, recovery_type_vals, "RFD"));
offset += 1;
losc -= 1;
@ -1092,12 +1092,12 @@ dissect_btavdtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
signal_id = tvb_get_guint8(tvb, offset) & AVDTP_SIGNAL_ID_MASK;
proto_item_append_text(signal_item, "%s (%s)",
val_to_str(signal_id, signal_id_vals, "Unknown signal"),
val_to_str(message_type, message_type_vals, "Unknown message type"));
val_to_str_const(signal_id, signal_id_vals, "Unknown signal"),
val_to_str_const(message_type, message_type_vals, "Unknown message type"));
col_append_fstr(pinfo->cinfo, COL_INFO, "%s - %s",
val_to_str(message_type, message_type_vals, "Unknown message type"),
val_to_str(signal_id, signal_id_vals, "Unknown signal"));
val_to_str_const(message_type, message_type_vals, "Unknown message type"),
val_to_str_const(signal_id, signal_id_vals, "Unknown signal"));
offset += 1;
if (message_type != MESSAGE_TYPE_GENERAL_REJECT) switch (signal_id) {

View File

@ -624,7 +624,7 @@ dissect_attribute_entries(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (attribute_id == 0x01) col_append_fstr(pinfo->cinfo, COL_INFO, " - Title: \"%s\"", value);
entry_item = proto_tree_add_text(ptree, tvb, offset, 4 + 2 + 2 + value_length, "Attribute [%21s]: %s", val_to_str(attribute_id, attribute_id_vals, "Unknown"), value);
entry_item = proto_tree_add_text(ptree, tvb, offset, 4 + 2 + 2 + value_length, "Attribute [%21s]: %s", val_to_str_const(attribute_id, attribute_id_vals, "Unknown"), value);
entry_tree = proto_item_add_subtree(entry_item, ett_btavrcp_attribute_entry);
proto_tree_add_item(entry_tree, hf_btavrcp_attribute, tvb, offset, 4, ENC_BIG_ENDIAN);
@ -931,8 +931,8 @@ dissect_passthrough(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
col_append_fstr(pinfo->cinfo, COL_INFO, " - %s (%s)",
val_to_str(operation, passthrough_operation_vals, "Unknown opcode"),
val_to_str(state, passthrough_state_vals, "unknown"));
val_to_str_const(operation, passthrough_operation_vals, "Unknown opcode"),
val_to_str_const(state, passthrough_state_vals, "unknown"));
return offset;
}
@ -1012,7 +1012,7 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (company_id != COMPANY_BT_SIG) {
col_append_fstr(pinfo->cinfo, COL_INFO, " - %s",
val_to_str(pdu_id, NULL, "Unknown PDU ID"));
val_to_str_const(pdu_id, NULL, "Unknown PDU ID"));
}
proto_tree_add_item(tree, hf_btavrcp_rfa, tvb, offset, 1, ENC_BIG_ENDIAN);
@ -1028,7 +1028,7 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
return offset;
col_append_fstr(pinfo->cinfo, COL_INFO, " - %s",
val_to_str(pdu_id, pdu_id_vals, "Unknown PDU ID"));
val_to_str_const(pdu_id, pdu_id_vals, "Unknown PDU ID"));
if (parameter_length == 0) return offset;
@ -1180,7 +1180,7 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset += 1;
col_append_fstr(pinfo->cinfo, COL_INFO, " - Status: %s",
val_to_str(status, status_vals, "Unknown status"));
val_to_str_const(status, status_vals, "Unknown status"));
} else switch(pdu_id) {
case PDU_GET_CAPABILITIES:
if (is_command) {
@ -1190,7 +1190,7 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
capability = tvb_get_guint8(tvb, offset);
*op |= capability << 8;
col_append_fstr(pinfo->cinfo, COL_INFO, "(%s)",
val_to_str(capability, capability_vals, "unknown"));
val_to_str_const(capability, capability_vals, "unknown"));
offset += 1;
} else {
guint capability;
@ -1216,7 +1216,7 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) - Count: %u",
val_to_str(capability, capability_vals, "unknown"), capability_count);
val_to_str_const(capability, capability_vals, "unknown"), capability_count);
}
break;
case PDU_LIST_PLAYER_APPLICATION_SETTING_ATTRIBUTES:
@ -1404,7 +1404,7 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_item(tree, hf_btavrcp_battery_status, tvb, offset, 1, ENC_BIG_ENDIAN);
battery_status = tvb_get_guint8(tvb, offset);
offset += 1;
col_append_fstr(pinfo->cinfo, COL_INFO, " - Battery: %s", val_to_str(battery_status, battery_status_vals, "unknown"));
col_append_fstr(pinfo->cinfo, COL_INFO, " - Battery: %s", val_to_str_const(battery_status, battery_status_vals, "unknown"));
} else {
/* non */
}
@ -1455,14 +1455,14 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset += 1;
col_append_fstr(pinfo->cinfo, COL_INFO, " PlayStatus: %s, SongPosition: %ums, SongLength: %ums",
val_to_str(play_status, play_status_vals, "unknown"), song_length, song_position);
val_to_str_const(play_status, play_status_vals, "unknown"), song_length, song_position);
}
break;
case PDU_REGISTER_NOTIFICATION:
event_id = tvb_get_guint8(tvb, offset);
*op |= event_id << 8;
col_append_fstr(pinfo->cinfo, COL_INFO, " - %s",
val_to_str(event_id, notification_vals, "Unknown Event ID"));
val_to_str_const(event_id, notification_vals, "Unknown Event ID"));
if (is_command) {
proto_tree_add_item(tree, hf_btavrcp_event_id, tvb, offset, 1, ENC_BIG_ENDIAN);
@ -1491,7 +1491,7 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_item(tree, hf_btavrcp_play_status, tvb, offset, 1, ENC_BIG_ENDIAN);
play_status = tvb_get_guint8(tvb, offset);
offset += 1;
col_append_fstr(pinfo->cinfo, COL_INFO, " - PlayStatus: %s", val_to_str(play_status, play_status_vals, "unknown"));
col_append_fstr(pinfo->cinfo, COL_INFO, " - PlayStatus: %s", val_to_str_const(play_status, play_status_vals, "unknown"));
break;
case EVENT_TRACK_CHANGED:
pitem = proto_tree_add_item(tree, hf_btavrcp_identifier, tvb, offset, 8, ENC_BIG_ENDIAN);
@ -1528,13 +1528,13 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_item(tree, hf_btavrcp_battery_status, tvb, offset, 1, ENC_BIG_ENDIAN);
battery_status = tvb_get_guint8(tvb, offset);
offset += 1;
col_append_fstr(pinfo->cinfo, COL_INFO, " - Battery: %s", val_to_str(battery_status, battery_status_vals, "unknown"));
col_append_fstr(pinfo->cinfo, COL_INFO, " - Battery: %s", val_to_str_const(battery_status, battery_status_vals, "unknown"));
break;
case EVENT_SYSTEM_STATUS_CHANGED:
proto_tree_add_item(tree, hf_btavrcp_system_status, tvb, offset, 1, ENC_BIG_ENDIAN);
system_status = tvb_get_guint8(tvb, offset);
offset += 1;
col_append_fstr(pinfo->cinfo, COL_INFO, " - SystemStatus: %s", val_to_str(system_status, system_status_vals, "unknown"));
col_append_fstr(pinfo->cinfo, COL_INFO, " - SystemStatus: %s", val_to_str_const(system_status, system_status_vals, "unknown"));
break;
case EVENT_PLAYER_APPLICATION_SETTING_CHANGED:
proto_tree_add_item(tree, hf_btavrcp_number_of_settings, tvb, offset, 1, ENC_BIG_ENDIAN);
@ -1595,7 +1595,7 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_item(tree, hf_btavrcp_bt_continuing_pdu_id, tvb, offset, 1, ENC_BIG_ENDIAN);
continuing_op = tvb_get_guint8(tvb, offset) | (company_id << 8);
col_append_fstr(pinfo->cinfo, COL_INFO, " - %s",
val_to_str(tvb_get_guint8(tvb, offset), pdu_id_vals, "Unknown opcode"));
val_to_str_const(tvb_get_guint8(tvb, offset), pdu_id_vals, "Unknown opcode"));
offset += 1;
if (pinfo->fd->flags.visited == 0) {
@ -1632,7 +1632,7 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_item(tree, hf_btavrcp_bt_continuing_pdu_id, tvb, offset, 1, ENC_BIG_ENDIAN);
continuing_op = tvb_get_guint8(tvb, offset) | (company_id << 8);
col_append_fstr(pinfo->cinfo, COL_INFO, " - %s",
val_to_str(tvb_get_guint8(tvb, offset), pdu_id_vals, "Unknown opcode"));
val_to_str_const(tvb_get_guint8(tvb, offset), pdu_id_vals, "Unknown opcode"));
offset += 1;
if (pinfo->fd->flags.visited == 0) {
@ -1706,7 +1706,7 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset += 1;
col_append_fstr(pinfo->cinfo, COL_INFO, " - Status: %s",
val_to_str(status, status_vals, "Unknown status"));
val_to_str_const(status, status_vals, "Unknown status"));
}
break;
case PDU_PLAY_ITEM:
@ -1726,7 +1726,7 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset += 2;
col_append_fstr(pinfo->cinfo, COL_INFO, " - Scope: %s, Uid: 0x%016" G_GINT64_MODIFIER "x, UidCounter: 0x%04x",
val_to_str(scope, scope_vals, "unknown"), uid, uid_counter);
val_to_str_const(scope, scope_vals, "unknown"), uid, uid_counter);
} else {
guint status;
@ -1734,7 +1734,7 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
status = tvb_get_guint8(tvb, offset);
offset += 1;
col_append_fstr(pinfo->cinfo, COL_INFO, " - Status: %s",
val_to_str(status, status_vals, "Unknown status"));
val_to_str_const(status, status_vals, "Unknown status"));
}
break;
case PDU_ADD_TO_NOW_PLAYING:
@ -1754,7 +1754,7 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset += 2;
col_append_fstr(pinfo->cinfo, COL_INFO, " - Scope: %s, Uid: 0x%016" G_GINT64_MODIFIER "x, UidCounter: 0x%04x",
val_to_str(scope, scope_vals, "unknown"), uid, uid_counter);
val_to_str_const(scope, scope_vals, "unknown"), uid, uid_counter);
} else {
guint status;
@ -1762,7 +1762,7 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
status = tvb_get_guint8(tvb, offset);
offset += 1;
col_append_fstr(pinfo->cinfo, COL_INFO, " - Status: %s",
val_to_str(status, status_vals, "Unknown status"));
val_to_str_const(status, status_vals, "Unknown status"));
}
break;
};
@ -1794,11 +1794,11 @@ dissect_browsing(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset += 1;
col_append_fstr(pinfo->cinfo, COL_INFO, ": %s",
val_to_str(status, status_vals, "Unknown status"));
val_to_str_const(status, status_vals, "Unknown status"));
}
col_append_fstr(pinfo->cinfo, COL_INFO, " - %s",
val_to_str(pdu_id, browsing_pdu_id_vals, "Unknown opcode"));
val_to_str_const(pdu_id, browsing_pdu_id_vals, "Unknown opcode"));
if (is_command || status == STATUS_OK) switch(pdu_id) {
case PDU_SET_BROWSED_PLAYER:
@ -1866,7 +1866,7 @@ dissect_browsing(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset = dissect_attribute_id_list(tvb, tree, offset, attribute_count);
col_append_fstr(pinfo->cinfo, COL_INFO, " - Scope: %s, StartItem: 0x%04x, EndItem: 0x%04x",
val_to_str(scope, scope_vals, "unknown"), start_item, end_item);
val_to_str_const(scope, scope_vals, "unknown"), start_item, end_item);
} else {
guint number_of_items;
guint uid_counter;
@ -1921,7 +1921,7 @@ dissect_browsing(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset += 8;
col_append_fstr(pinfo->cinfo, COL_INFO, " - Direction: %s, Uid: 0x%016" G_GINT64_MODIFIER "x, UidCounter: 0x%04x",
val_to_str(direction, direction_vals, "unknown"), uid, uid_counter);
val_to_str_const(direction, direction_vals, "unknown"), uid, uid_counter);
} else {
guint number_of_items;
@ -1952,7 +1952,7 @@ dissect_browsing(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
number_of_attributes = tvb_get_guint8(tvb, offset);
col_append_fstr(pinfo->cinfo, COL_INFO, " - Scope: %s, Uid: 0x%016" G_GINT64_MODIFIER "x, UidCounter: 0x%04x",
val_to_str(scope, scope_vals, "unknown"), uid, uid_counter);
val_to_str_const(scope, scope_vals, "unknown"), uid, uid_counter);
if (number_of_attributes == 0) proto_item_append_text(pitem, " (All Supported Attributes)");
offset += 1;
@ -2056,8 +2056,8 @@ dissect_btavrcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 1;
col_append_fstr(pinfo->cinfo, COL_INFO, "%s: %s",
val_to_str(opcode, opcode_vals, "Unknown opcode"),
val_to_str(ctype, ctype_vals, "Unknown ctype"));
val_to_str_const(opcode, opcode_vals, "Unknown opcode"),
val_to_str_const(ctype, ctype_vals, "Unknown ctype"));
switch(opcode) {
case OPCODE_PASSTHROUGH:

View File

@ -154,7 +154,7 @@ dissect_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
control_type = tvb_get_guint8(tvb, offset);
offset += 1;
col_append_fstr(pinfo->cinfo, COL_INFO, " - %s", val_to_str(control_type, control_type_vals, "Unknown type"));
col_append_fstr(pinfo->cinfo, COL_INFO, " - %s", val_to_str_const(control_type, control_type_vals, "Unknown type"));
switch(control_type) {
case 0x00: /* Command Not Understood */
@ -162,7 +162,7 @@ dissect_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
unknown_control_type = tvb_get_guint8(tvb, offset);
offset += 1;
col_append_fstr(pinfo->cinfo, COL_INFO, " - Unknown(%s)", val_to_str(unknown_control_type, control_type_vals, "Unknown type"));
col_append_fstr(pinfo->cinfo, COL_INFO, " - Unknown(%s)", val_to_str_const(unknown_control_type, control_type_vals, "Unknown type"));
break;
case 0x01: /* Setup Connection Request */
@ -189,7 +189,7 @@ dissect_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
response_message = tvb_get_ntohs(tvb, offset);
offset += 2;
col_append_fstr(pinfo->cinfo, COL_INFO, " - %s",
val_to_str(response_message, setup_connection_response_message_vals, "Unknown response message"));
val_to_str_const(response_message, setup_connection_response_message_vals, "Unknown response message"));
break;
case 0x03: /* Filter Net Type Set */
proto_tree_add_item(tree, hf_btbnep_list_length, tvb, offset, 2, ENC_BIG_ENDIAN);
@ -209,7 +209,7 @@ dissect_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
response_message = tvb_get_ntohs(tvb, offset);
offset += 2;
col_append_fstr(pinfo->cinfo, COL_INFO, " - %s",
val_to_str(response_message, filter_net_type_response_message_vals, "Unknown response message"));
val_to_str_const(response_message, filter_net_type_response_message_vals, "Unknown response message"));
break;
case 0x05: /*Filter Multi Addr Set*/
proto_tree_add_item(tree, hf_btbnep_list_length, tvb, offset, 2, ENC_BIG_ENDIAN);
@ -229,7 +229,7 @@ dissect_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
response_message = tvb_get_ntohs(tvb, offset);
offset += 2;
col_append_fstr(pinfo->cinfo, COL_INFO, " - %s",
val_to_str(response_message, filter_multi_addr_response_message_vals, "Unknown response message"));
val_to_str_const(response_message, filter_multi_addr_response_message_vals, "Unknown response message"));
break;
};
@ -316,7 +316,7 @@ dissect_btbnep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
bnep_type = bnep_type & 0x7F;
offset += 1;
col_append_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str(bnep_type, bnep_type_vals, "Unknown type"));
col_append_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str_const(bnep_type, bnep_type_vals, "Unknown type"));
if (extension_flag) col_append_fstr(pinfo->cinfo, COL_INFO, "+E");
if (bnep_type == BNEP_TYPE_GENERAL_ETHERNET || bnep_type == BNEP_TYPE_COMPRESSED_ETHERNET_DESTINATION_ONLY) {
@ -356,7 +356,7 @@ dissect_btbnep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
type = tvb_get_ntohs(tvb, offset);
if (!top_dissect) {
proto_tree_add_item(btbnep_tree, hf_btbnep_type, tvb, offset, 2, ENC_BIG_ENDIAN);
col_append_fstr(pinfo->cinfo, COL_INFO, " - Type: %s", val_to_str(type, etype_vals, "unknown"));
col_append_fstr(pinfo->cinfo, COL_INFO, " - Type: %s", val_to_str_const(type, etype_vals, "unknown"));
}
offset += 2;
} else {

View File

@ -408,7 +408,7 @@ dissect_hid_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset
proto_tree_add_item(tree, hf_bthid_protocol_code, tvb, offset, 1, ENC_BIG_ENDIAN);
protocol_code = tvb_get_guint8(tvb, offset);
col_append_fstr(pinfo->cinfo, COL_INFO, " - %s", val_to_str(protocol_code, protocol_code_vals, "unknown type"));
col_append_fstr(pinfo->cinfo, COL_INFO, " - %s", val_to_str_const(protocol_code, protocol_code_vals, "unknown type"));
offset += 1;
@ -716,17 +716,17 @@ dissect_bthid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
parameter = transaction_type & 0x0F;
transaction_type = transaction_type >> 4;
col_append_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str(transaction_type, transaction_type_vals, "Unknown TransactionType"));
col_append_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str_const(transaction_type, transaction_type_vals, "Unknown TransactionType"));
switch(transaction_type) {
case 0x00: /* HANDSHAKE */
proto_tree_add_item(bthid_tree, hf_bthid_parameter_result_code, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
col_append_fstr(pinfo->cinfo, COL_INFO, " - Result Code: %s", val_to_str(parameter, result_code_vals, "reserved"));
col_append_fstr(pinfo->cinfo, COL_INFO, " - Result Code: %s", val_to_str_const(parameter, result_code_vals, "reserved"));
break;
case 0x01: /* HID_CONTROL */
proto_tree_add_item(bthid_tree, hf_bthid_parameter_control_operation, tvb, offset, 1, ENC_BIG_ENDIAN);
col_append_fstr(pinfo->cinfo, COL_INFO, " - Control Operation: %s", val_to_str(parameter, control_operation_vals, "reserved"));
col_append_fstr(pinfo->cinfo, COL_INFO, " - Control Operation: %s", val_to_str_const(parameter, control_operation_vals, "reserved"));
offset += 1;
break;
case 0x04: /* GET_REPORT */
@ -735,8 +735,8 @@ dissect_bthid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(bthid_tree, hf_bthid_parameter_report_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
col_append_fstr(pinfo->cinfo, COL_INFO, " - Size: %s, Report Type: %s",
val_to_str(parameter >> 3 , size_vals, "reserved"),
val_to_str(parameter & 0x03, report_type_vals, "reserved"));
val_to_str_const(parameter >> 3 , size_vals, "reserved"),
val_to_str_const(parameter & 0x03, report_type_vals, "reserved"));
if (tvb_length_remaining(tvb, offset) >= 1) {
proto_tree_add_item(bthid_tree, hf_bthid_report_id, tvb, offset, 1, ENC_BIG_ENDIAN);
@ -754,7 +754,7 @@ dissect_bthid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 1;
col_append_fstr(pinfo->cinfo, COL_INFO, " - Report Type: %s",
val_to_str(parameter & 0x03, report_type_vals, "reserved"));
val_to_str_const(parameter & 0x03, report_type_vals, "reserved"));
/* playload */
proto_tree_add_item(bthid_tree, hf_bthid_data, tvb, offset, -1, ENC_BIG_ENDIAN);
@ -769,7 +769,7 @@ dissect_bthid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 1;
col_append_fstr(pinfo->cinfo, COL_INFO, " - Protocol: %s",
val_to_str(protocol, protocol_vals, "reserved"));
val_to_str_const(protocol, protocol_vals, "reserved"));
break;
case 0x07: /* SET_PROTOCOL */
@ -778,7 +778,7 @@ dissect_bthid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 1;
col_append_fstr(pinfo->cinfo, COL_INFO, " - Protocol: %s",
val_to_str(parameter & 0x01, protocol_vals, "reserved"));
val_to_str_const(parameter & 0x01, protocol_vals, "reserved"));
break;
case 0x08: /* GET_IDLE */
case 0x09: /* SET_IDLE */
@ -796,7 +796,7 @@ dissect_bthid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(bthid_tree, hf_bthid_parameter_reserved_32, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(bthid_tree, hf_bthid_parameter_report_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
col_append_fstr(pinfo->cinfo, COL_INFO, " - %s", val_to_str(parameter, report_type_vals, "reserved"));
col_append_fstr(pinfo->cinfo, COL_INFO, " - %s", val_to_str_const(parameter, report_type_vals, "reserved"));
/* playload */
offset = dissect_hid_data(tvb, pinfo, bthid_tree, offset, parameter & 0x03);

View File

@ -224,7 +224,7 @@ dissect_openvpn_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* read opcode and write to info column */
openvpn_opcode = tvb_get_bits8(tvb, offset*8, 5);
col_append_fstr(pinfo->cinfo, COL_INFO, "MessageType: %s",
val_to_str(openvpn_opcode, openvpn_message_types, "Unknown Messagetype"));
val_to_str_const(openvpn_opcode, openvpn_message_types, "Unknown Messagetype"));
openvpn_keyid = tvb_get_bits8(tvb, offset*8 + 5, 3);

View File

@ -264,7 +264,7 @@ geoip_db_name(guint dbnum) {
gi = g_array_index(geoip_dat_arr, GeoIP *, dbnum);
if (gi) {
return (val_to_str(gi->databaseType, geoip_type_name_vals, "Unknown database"));
return (val_to_str_const(gi->databaseType, geoip_type_name_vals, "Unknown database"));
}
return "Invalid database";
}

View File

@ -423,7 +423,7 @@ decode_enumerated_bitfield(const guint32 val, const guint32 mask, const int widt
char *p;
p = decode_bitfield_value(buf, val, mask, width);
g_snprintf(p, (gulong) (1024-(p-buf)), fmt, val_to_str(val & mask, tab, "Unknown"));
g_snprintf(p, (gulong) (1024-(p-buf)), fmt, val_to_str_const(val & mask, tab, "Unknown"));
return buf;
}
@ -444,7 +444,7 @@ decode_enumerated_bitfield_shifted(const guint32 val, const guint32 mask, const
shift++;
p = decode_bitfield_value(buf, val, mask, width);
g_snprintf(p, (gulong) (1024-(p-buf)), fmt, val_to_str((val & mask) >> shift, tab, "Unknown"));
g_snprintf(p, (gulong) (1024-(p-buf)), fmt, val_to_str_const((val & mask) >> shift, tab, "Unknown"));
return buf;
}