aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors')
-rw-r--r--epan/dissectors/packet-3g-a11.c2
-rw-r--r--epan/dissectors/packet-6lowpan.c2
-rw-r--r--epan/dissectors/packet-9p.c46
-rw-r--r--epan/dissectors/packet-agentx.c102
-rw-r--r--epan/dissectors/packet-alcap.c1129
-rw-r--r--epan/dissectors/packet-aodv.c130
-rw-r--r--epan/dissectors/packet-asap.c15
-rw-r--r--epan/dissectors/packet-auto_rp.c133
-rw-r--r--epan/dissectors/packet-babel.c84
-rw-r--r--epan/dissectors/packet-bacapp.c98
-rw-r--r--epan/dissectors/packet-ber.c92
-rw-r--r--epan/dissectors/packet-bgp.c75
-rw-r--r--epan/dissectors/packet-bmc.c2
-rw-r--r--epan/dissectors/packet-bootp.c75
-rw-r--r--epan/dissectors/packet-bssap.c7
-rw-r--r--epan/dissectors/packet-bt-dht.c4
-rw-r--r--epan/dissectors/packet-btrfcomm.c2
-rw-r--r--epan/dissectors/packet-bvlc.c6
-rw-r--r--epan/dissectors/packet-calcappprotocol.c2
-rw-r--r--epan/dissectors/packet-cdp.c4
-rw-r--r--epan/dissectors/packet-cip.c30
-rw-r--r--epan/dissectors/packet-cipsafety.c4
-rw-r--r--epan/dissectors/packet-cisco-sm.c8
-rw-r--r--epan/dissectors/packet-coap.c2
-rw-r--r--epan/dissectors/packet-collectd.c40
-rw-r--r--epan/dissectors/packet-componentstatus.c2
-rw-r--r--epan/dissectors/packet-cops.c42
-rw-r--r--epan/dissectors/packet-dccp.c28
-rw-r--r--epan/dissectors/packet-dcom.c2
-rw-r--r--epan/dissectors/packet-dhcp-failover.c10
-rw-r--r--epan/dissectors/packet-dhcpv6.c22
-rw-r--r--epan/dissectors/packet-diameter.c8
-rw-r--r--epan/dissectors/packet-dis.c10
-rw-r--r--epan/dissectors/packet-dlm3.c12
-rw-r--r--epan/dissectors/packet-dmp.c116
-rw-r--r--epan/dissectors/packet-dtls.c8
-rw-r--r--epan/dissectors/packet-dvbci.c24
-rw-r--r--epan/dissectors/packet-ecp-oui.c2
-rw-r--r--epan/dissectors/packet-edonkey.c34
-rw-r--r--epan/dissectors/packet-eigrp.c7
-rw-r--r--epan/dissectors/packet-elcom.c2
-rw-r--r--epan/dissectors/packet-enrp.c6
-rw-r--r--epan/dissectors/packet-epl.c2
-rw-r--r--epan/dissectors/packet-fcswils.c2
-rw-r--r--epan/dissectors/packet-ff.c22
-rw-r--r--epan/dissectors/packet-flip.c18
-rw-r--r--epan/dissectors/packet-fractalgeneratorprotocol.c2
-rw-r--r--epan/dissectors/packet-glusterfs.c2
-rw-r--r--epan/dissectors/packet-gmhdr.c2
-rw-r--r--epan/dissectors/packet-gsm_a_dtap.c10
-rw-r--r--epan/dissectors/packet-gsm_a_rr.c2
-rw-r--r--epan/dissectors/packet-gsm_sms.c4
-rw-r--r--epan/dissectors/packet-h264.c12
-rw-r--r--epan/dissectors/packet-hip.c16
-rw-r--r--epan/dissectors/packet-hsrp.c10
-rw-r--r--epan/dissectors/packet-iapp.c16
-rw-r--r--epan/dissectors/packet-iax2.c4
-rw-r--r--epan/dissectors/packet-icep.c6
-rw-r--r--epan/dissectors/packet-icmpv6.c2
-rw-r--r--epan/dissectors/packet-icp.c2
-rw-r--r--epan/dissectors/packet-icq.c6
-rw-r--r--epan/dissectors/packet-iec104.c6
-rw-r--r--epan/dissectors/packet-ieee80211.c12
-rw-r--r--epan/dissectors/packet-ieee802154.c18
-rw-r--r--epan/dissectors/packet-ieee802a.c2
-rw-r--r--epan/dissectors/packet-igap.c8
-rw-r--r--epan/dissectors/packet-igmp.c6
-rw-r--r--epan/dissectors/packet-image-jfif.c4
-rw-r--r--epan/dissectors/packet-ipmi-app.c2
-rw-r--r--epan/dissectors/packet-ipmi-picmg.c16
-rw-r--r--epan/dissectors/packet-ipmi-se.c52
-rw-r--r--epan/dissectors/packet-ipmi-session.c4
-rw-r--r--epan/dissectors/packet-ipmi-transport.c8
-rw-r--r--epan/dissectors/packet-ipmi.c2
-rw-r--r--epan/dissectors/packet-ipp.c12
-rw-r--r--epan/dissectors/packet-ipv6.c8
-rw-r--r--epan/dissectors/packet-isakmp.c8
-rw-r--r--epan/dissectors/packet-isis-clv.c4
-rw-r--r--epan/dissectors/packet-ismacryp.c2
-rw-r--r--epan/dissectors/packet-ismp.c2
-rw-r--r--epan/dissectors/packet-isup.c18
-rw-r--r--epan/dissectors/packet-itdm.c4
-rw-r--r--epan/dissectors/packet-iua.c22
-rw-r--r--epan/dissectors/packet-juniper.c8
-rw-r--r--epan/dissectors/packet-kingfisher.c4
-rw-r--r--epan/dissectors/packet-kink.c2
-rw-r--r--epan/dissectors/packet-kpasswd.c2
-rw-r--r--epan/dissectors/packet-ldp.c18
-rw-r--r--epan/dissectors/packet-ldss.c4
-rw-r--r--epan/dissectors/packet-linx.c10
-rw-r--r--epan/dissectors/packet-llc.c2
-rw-r--r--epan/dissectors/packet-lldp.c40
-rw-r--r--epan/dissectors/packet-lmp.c2
-rw-r--r--epan/dissectors/packet-ltp.c8
-rw-r--r--epan/dissectors/packet-lwres.c10
-rw-r--r--epan/dissectors/packet-m2pa.c12
-rw-r--r--epan/dissectors/packet-m2tp.c10
-rw-r--r--epan/dissectors/packet-m2ua.c30
-rw-r--r--epan/dissectors/packet-m3ua.c52
-rw-r--r--epan/dissectors/packet-mbtcp.c14
-rw-r--r--epan/dissectors/packet-memcache.c2
-rw-r--r--epan/dissectors/packet-mikey.c20
-rw-r--r--epan/dissectors/packet-mongo.c2
-rw-r--r--epan/dissectors/packet-mpls-echo.c24
-rw-r--r--epan/dissectors/packet-mpls-psc.c2
-rw-r--r--epan/dissectors/packet-mrp-mmrp.c5
-rw-r--r--epan/dissectors/packet-mrp-msrp.c5
-rw-r--r--epan/dissectors/packet-mrp-mvrp.c5
-rw-r--r--epan/dissectors/packet-ms-mms.c38
-rw-r--r--epan/dissectors/packet-mtp3.c4
-rw-r--r--epan/dissectors/packet-mtp3mg.c22
-rw-r--r--epan/dissectors/packet-nbipx.c14
-rw-r--r--epan/dissectors/packet-nbns.c12
-rw-r--r--epan/dissectors/packet-ncp-sss.c2
-rw-r--r--epan/dissectors/packet-ndmp.c2
-rw-r--r--epan/dissectors/packet-netbios.c2
-rw-r--r--epan/dissectors/packet-netperfmeter.c2
-rw-r--r--epan/dissectors/packet-nettl.c6
-rw-r--r--epan/dissectors/packet-nsip.c16
-rw-r--r--epan/dissectors/packet-nt-tpcp.c4
-rw-r--r--epan/dissectors/packet-ntlmssp.c6
-rw-r--r--epan/dissectors/packet-ntp.c12
-rw-r--r--epan/dissectors/packet-olsr.c4
-rw-r--r--epan/dissectors/packet-ositp.c2
-rw-r--r--epan/dissectors/packet-ospf.c26
-rw-r--r--epan/dissectors/packet-p_mul.c2
-rw-r--r--epan/dissectors/packet-pagp.c4
-rw-r--r--epan/dissectors/packet-pcep.c42
-rw-r--r--epan/dissectors/packet-pgsql.c4
-rw-r--r--epan/dissectors/packet-pingpongprotocol.c2
-rw-r--r--epan/dissectors/packet-ppi.c126
-rw-r--r--epan/dissectors/packet-pppoe.c10
-rw-r--r--epan/dissectors/packet-q2931.c2
-rw-r--r--epan/dissectors/packet-q933.c2
-rw-r--r--epan/dissectors/packet-quake3.c4
-rw-r--r--epan/dissectors/packet-radius.c6
-rw-r--r--epan/dissectors/packet-rdp.c12
-rw-r--r--epan/dissectors/packet-rdt.c2
-rw-r--r--epan/dissectors/packet-redbackli.c2
-rw-r--r--epan/dissectors/packet-reload-framing.c4
-rw-r--r--epan/dissectors/packet-reload.c22
-rw-r--r--epan/dissectors/packet-rip.c2
-rw-r--r--epan/dissectors/packet-rlogin.c2
-rw-r--r--epan/dissectors/packet-rmi.c12
-rw-r--r--epan/dissectors/packet-rmp.c2
-rw-r--r--epan/dissectors/packet-rohc.c8
-rw-r--r--epan/dissectors/packet-rpcap.c2
-rw-r--r--epan/dissectors/packet-rpl.c8
-rw-r--r--epan/dissectors/packet-rtnet.c2
-rw-r--r--epan/dissectors/packet-rtp.c4
-rw-r--r--epan/dissectors/packet-sbus.c26
-rw-r--r--epan/dissectors/packet-sccpmg.c2
-rw-r--r--epan/dissectors/packet-scop.c4
-rw-r--r--epan/dissectors/packet-scsi-osd.c4
-rw-r--r--epan/dissectors/packet-sctp.c12
-rw-r--r--epan/dissectors/packet-sflow.c20
-rw-r--r--epan/dissectors/packet-sigcomp.c8
-rw-r--r--epan/dissectors/packet-simulcrypt.c2
-rw-r--r--epan/dissectors/packet-slimp3.c6
-rw-r--r--epan/dissectors/packet-slsk.c28
-rw-r--r--epan/dissectors/packet-smb.c2
-rw-r--r--epan/dissectors/packet-sna.c6
-rw-r--r--epan/dissectors/packet-sprt.c2
-rw-r--r--epan/dissectors/packet-sqloracle.c4
-rw-r--r--epan/dissectors/packet-srvloc.c22
-rw-r--r--epan/dissectors/packet-sscf-nni.c2
-rw-r--r--epan/dissectors/packet-ssl.c10
-rw-r--r--epan/dissectors/packet-stun.c10
-rw-r--r--epan/dissectors/packet-sua.c36
-rw-r--r--epan/dissectors/packet-synphasor.c8
-rw-r--r--epan/dissectors/packet-syslog.c8
-rw-r--r--epan/dissectors/packet-t30.c2
-rw-r--r--epan/dissectors/packet-tacacs.c16
-rw-r--r--epan/dissectors/packet-tcp.c2
-rw-r--r--epan/dissectors/packet-tds.c14
-rw-r--r--epan/dissectors/packet-tipc.c48
-rw-r--r--epan/dissectors/packet-tns.c2
-rw-r--r--epan/dissectors/packet-tpncp.c8
-rw-r--r--epan/dissectors/packet-ua3g.c2
-rw-r--r--epan/dissectors/packet-ucp.c2
-rw-r--r--epan/dissectors/packet-umts_mac.c4
-rw-r--r--epan/dissectors/packet-v52.c130
-rw-r--r--epan/dissectors/packet-v5ua.c42
-rw-r--r--epan/dissectors/packet-vines.c42
-rw-r--r--epan/dissectors/packet-vrrp.c4
-rw-r--r--epan/dissectors/packet-vuze-dht.c8
-rw-r--r--epan/dissectors/packet-wcp.c4
-rw-r--r--epan/dissectors/packet-windows-common.c2
-rw-r--r--epan/dissectors/packet-wlccp.c26
-rw-r--r--epan/dissectors/packet-wtp.c4
-rw-r--r--epan/dissectors/packet-x11.c2
-rw-r--r--epan/dissectors/packet-xmcp.c24
-rw-r--r--epan/dissectors/packet-zbee-aps.c8
-rw-r--r--epan/dissectors/packet-zbee-nwk.c14
-rw-r--r--epan/dissectors/packet-zbee-zdp.c4
195 files changed, 2429 insertions, 1751 deletions
diff --git a/epan/dissectors/packet-3g-a11.c b/epan/dissectors/packet-3g-a11.c
index fe94029b50..491dfdefa1 100644
--- a/epan/dissectors/packet-3g-a11.c
+++ b/epan/dissectors/packet-3g-a11.c
@@ -662,7 +662,7 @@ dissect_3gpp2_radius_aut_flow_profile_ids(proto_tree *tree, tvbuff_t *tvb, pac
/* value is 2 octets */
value = tvb_get_ntohs(tvb,offset+2);
item = proto_tree_add_text(tree, tvb, offset, sub_type_length, "%s = %u",
- val_to_str(sub_type, a11_aut_flow_prof_subtype_vals, "Unknown"), value);
+ val_to_str_const(sub_type, a11_aut_flow_prof_subtype_vals, "Unknown"), value);
sub_tree = proto_item_add_subtree(item, ett_a11_aut_flow_profile_ids);
proto_tree_add_item(sub_tree, hf_a11_aut_flow_prof_sub_type, tvb, offset, 1, ENC_BIG_ENDIAN);
diff --git a/epan/dissectors/packet-6lowpan.c b/epan/dissectors/packet-6lowpan.c
index bf7cbd0de8..63a2fb3e99 100644
--- a/epan/dissectors/packet-6lowpan.c
+++ b/epan/dissectors/packet-6lowpan.c
@@ -1230,7 +1230,7 @@ dissect_6lowpan_iphc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint d
/* Destination address mode changes meanings depending on multicast compression. */
dam_vs = (iphc_flags & LOWPAN_IPHC_FLAG_MCAST_COMP) ? (lowpan_iphc_mcast_modes) : (lowpan_iphc_addr_modes);
ti_dam = proto_tree_add_uint_format_value(iphc_tree, hf_6lowpan_iphc_flag_dam, tvb, offset, sizeof(guint16),
- iphc_flags & LOWPAN_IPHC_FLAG_DST_MODE, "%s (0x%04x)", val_to_str(iphc_dst_mode, dam_vs, "Reserved"), iphc_dst_mode);
+ iphc_flags & LOWPAN_IPHC_FLAG_DST_MODE, "%s (0x%04x)", val_to_str_const(iphc_dst_mode, dam_vs, "Reserved"), iphc_dst_mode);
}
offset += sizeof(guint16);
diff --git a/epan/dissectors/packet-9p.c b/epan/dissectors/packet-9p.c
index 3c1be3e52d..3375cb20e4 100644
--- a/epan/dissectors/packet-9p.c
+++ b/epan/dissectors/packet-9p.c
@@ -43,33 +43,33 @@
http://www.cs.bell-labs.com/sys/man/5/INDEX.html
*/
enum {
- TVERSION = 100,
- RVERSION = 101,
- TAUTH = 102,
- RAUTH = 103,
- TATTACH = 104,
- RATTACH = 105,
- TERROR = 106, /* Not used */
- RERROR = 107,
- TFLUSH = 108,
- RFLUSH = 109,
- TWALK = 110,
- RWALK = 111,
- TOPEN = 112,
+ TVERSION = 100,
+ RVERSION = 101,
+ TAUTH = 102,
+ RAUTH = 103,
+ TATTACH = 104,
+ RATTACH = 105,
+ TERROR = 106, /* Not used */
+ RERROR = 107,
+ TFLUSH = 108,
+ RFLUSH = 109,
+ TWALK = 110,
+ RWALK = 111,
+ TOPEN = 112,
ROPEN,
- TCREATE = 114,
+ TCREATE = 114,
RCREATE,
- TREAD = 116,
+ TREAD = 116,
RREAD,
- TWRITE = 118,
+ TWRITE = 118,
RWRITE,
- TCLUNK = 120,
+ TCLUNK = 120,
RCLUNK,
- TREMOVE = 122,
+ TREMOVE = 122,
RREMOVE,
- TSTAT = 124,
+ TSTAT = 124,
RSTAT,
- TWSTAT = 126,
+ TWSTAT = 126,
RWSTAT
};
/* File open modes */
@@ -189,6 +189,8 @@ static const value_string ninep_msg_type[] =
{RWSTAT, "Rwstat"},
{0, NULL},
};
+static value_string_ext ninep_msg_type_ext = VALUE_STRING_EXT_INIT(ninep_msg_type);
+
/* Open/Create modes */
static const value_string ninep_mode_vals[] =
{
@@ -223,7 +225,7 @@ static int dissect_9P(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
/*ninesz = tvb_get_letohl(tvb, offset);*/
ninemsg = tvb_get_guint8(tvb, offset + 4);
- mname = val_to_str(ninemsg, ninep_msg_type, "Unknown");
+ mname = val_to_str_ext_const(ninemsg, &ninep_msg_type_ext, "Unknown");
if(strcmp(mname,"Unknown") == 0) {
col_add_fstr(pinfo->cinfo, COL_INFO, "9P Data Continuation(?) (Tag %u)",(guint)ninemsg);
@@ -678,7 +680,7 @@ void proto_register_9P(void)
{"Msg length", "9p.msglen", FT_UINT32, BASE_DEC, NULL, 0x0,
"9P Message Length", HFILL}},
{&hf_9P_msgtype,
- {"Msg Type", "9p.msgtype", FT_UINT8, BASE_DEC, VALS(ninep_msg_type), 0x0,
+ {"Msg Type", "9p.msgtype", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &ninep_msg_type_ext, 0x0,
"Message Type", HFILL}},
{&hf_9P_tag,
{"Tag", "9p.tag", FT_UINT16, BASE_DEC, NULL, 0x0,
diff --git a/epan/dissectors/packet-agentx.c b/epan/dissectors/packet-agentx.c
index 62297265f7..ca40d2e76c 100644
--- a/epan/dissectors/packet-agentx.c
+++ b/epan/dissectors/packet-agentx.c
@@ -107,15 +107,15 @@ static gint ett_addcap = -1;
static gint ett_remcap = -1;
-#define AGENTX_OPEN_PDU 1
-#define AGENTX_CLOSE_PDU 2
-#define AGENTX_REGISTER_PDU 3
-#define AGENTX_UNREGISTER_PDU 4
-#define AGENTX_GET_PDU 5
-#define AGENTX_GETNEXT_PDU 6
-#define AGENTX_GETBULK_PDU 7
-#define AGENTX_TESTSET_PDU 8
-#define AGENTX_COMMITSET_PDU 9
+#define AGENTX_OPEN_PDU 1
+#define AGENTX_CLOSE_PDU 2
+#define AGENTX_REGISTER_PDU 3
+#define AGENTX_UNREGISTER_PDU 4
+#define AGENTX_GET_PDU 5
+#define AGENTX_GETNEXT_PDU 6
+#define AGENTX_GETBULK_PDU 7
+#define AGENTX_TESTSET_PDU 8
+#define AGENTX_COMMITSET_PDU 9
#define AGENTX_UNDOSET_PDU 10
#define AGENTX_CLEANUPSET_PDU 11
#define AGENTX_NOTIFY_PDU 12
@@ -148,20 +148,20 @@ static const value_string type_values [] = {
{ AGENTX_RESPONSE_PDU, "Response-PDU" },
{ 0, NULL }
};
-
+static value_string_ext type_values_ext = VALUE_STRING_EXT_INIT(type_values);
/* VarBind types */
-#define VB_INT 2
-#define VB_OSTR 4
-#define VB_NULL 5
-#define VB_OID 6
-#define VB_IPADDR 64
-#define VB_COUNTER32 65
-#define VB_GAUGE32 66
-#define VB_TIMETICK 67
-#define VB_OPAQUE 68
-#define VB_COUNTER64 70
+#define VB_INT 2
+#define VB_OSTR 4
+#define VB_NULL 5
+#define VB_OID 6
+#define VB_IPADDR 64
+#define VB_COUNTER32 65
+#define VB_GAUGE32 66
+#define VB_TIMETICK 67
+#define VB_OPAQUE 68
+#define VB_COUNTER64 70
#define VB_NOSUCHOBJ 128
#define VB_NOSUCHINST 129
#define VB_ENDOFMIB 130
@@ -183,7 +183,7 @@ static const value_string vtag_values [] = {
{ VB_ENDOFMIB, "endOfMibView" },
{ 0, NULL }
};
-
+static value_string_ext vtag_values_ext = VALUE_STRING_EXT_INIT(vtag_values);
/* Close reasons */
#define CREASON_OTHER 1
@@ -206,25 +206,25 @@ static const value_string close_reasons[] = {
/* Response errors */
-#define AGENTX_NO_ERROR 0
-#define AGENTX_TOO_BIG 1
-#define AGENTX_NO_SUCH_NAME 2
-#define AGENTX_BAD_VALUE 3
-#define AGENTX_READ_ONLY 4
-#define AGENTX_GEN_ERROR 5
-#define AGENTX_NO_ACCESS 6
-#define AGENTX_WRONG_TYPE 7
-#define AGENTX_WRONG_LEN 8
-#define AGENTX_WRONG_ENCODE 9
-#define AGENTX_WRONG_VALUE 10
-#define AGENTX_NO_CREATION 11
-#define AGENTX_INCONSIST_VALUE 12
-#define AGENTX_RES_UNAVAIL 13
-#define AGENTX_COMMIT_FAILED 14
-#define AGENTX_UNDO_FAILED 15
-#define AGENTX_AUTH_ERROR 16
-#define AGENTX_NOTWRITABLE 17
-#define AGENTX_INCONSIS_NAME 18
+#define AGENTX_NO_ERROR 0
+#define AGENTX_TOO_BIG 1
+#define AGENTX_NO_SUCH_NAME 2
+#define AGENTX_BAD_VALUE 3
+#define AGENTX_READ_ONLY 4
+#define AGENTX_GEN_ERROR 5
+#define AGENTX_NO_ACCESS 6
+#define AGENTX_WRONG_TYPE 7
+#define AGENTX_WRONG_LEN 8
+#define AGENTX_WRONG_ENCODE 9
+#define AGENTX_WRONG_VALUE 10
+#define AGENTX_NO_CREATION 11
+#define AGENTX_INCONSIST_VALUE 12
+#define AGENTX_RES_UNAVAIL 13
+#define AGENTX_COMMIT_FAILED 14
+#define AGENTX_UNDO_FAILED 15
+#define AGENTX_AUTH_ERROR 16
+#define AGENTX_NOTWRITABLE 17
+#define AGENTX_INCONSIS_NAME 18
#define AGENTX_OPEN_FAILED 256
#define AGENTX_NOT_OPEN 257
#define AGENTX_IDX_WRONT_TYPE 258
@@ -269,6 +269,7 @@ static const value_string resp_errors[] = {
{ AGENTX_UNKNOWN_CAPS, "unknownAgentCaps" },
{ 0, NULL }
};
+static value_string_ext resp_errors_ext = VALUE_STRING_EXT_INIT(resp_errors);
/* OID usage indicators */
@@ -320,9 +321,9 @@ static int
convert_oid_to_str(guint32 *oid, int len, char* str, int slen, char prefix)
{
int i, tlen = 0;
- if(!oid) return 0;
- if(!str) return 0;
- if(!len) return 0;
+ if(!oid) return 0;
+ if(!str) return 0;
+ if(!len) return 0;
if(!slen) return 0;
if(slen < len) return 0;
@@ -352,7 +353,7 @@ dissect_object_id(tvbuff_t *tvb, proto_tree *tree, int offset, guint8 flags, enu
memset(str_oid, '\0', sizeof(str_oid));
n_subid = tvb_get_guint8(tvb, offset);
- prefix = tvb_get_guint8(tvb, offset + 1);
+ prefix = tvb_get_guint8(tvb, offset + 1);
include = tvb_get_guint8(tvb, offset + 2);
tvb_get_guint8(tvb, offset + 3);
@@ -374,7 +375,8 @@ dissect_object_id(tvbuff_t *tvb, proto_tree *tree, int offset, guint8 flags, enu
item = proto_tree_add_text(tree, tvb, offset, 4 + (n_subid * 4) ,
"Object Identifier: %s%s%s", range, str_oid, inclusion);
subtree = proto_item_add_subtree(item, ett_obj_ident);
- } else return offset;
+ } else
+ return offset;
proto_tree_add_uint(subtree, hf_oid_sub, tvb, offset, 1, n_subid);
proto_tree_add_uint(subtree, hf_oid_prefix, tvb, offset + 1, 1, prefix);
@@ -851,7 +853,7 @@ dissect_agentx_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "AgentX");
col_add_fstr(pinfo->cinfo, COL_INFO, "%s: sid=%d, tid=%d, packid=%d, plen=%d",
- val_to_str(type, type_values, "unknown"),
+ val_to_str_ext_const(type, &type_values_ext, "unknown"),
session_id, trans_id, packet_id, payload_len);
@@ -861,7 +863,7 @@ dissect_agentx_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/*t_item = proto_tree_add_item(tree, proto_agentx, tvb, 0, -1, ENC_NA);*/
t_item = proto_tree_add_protocol_format(tree, proto_agentx, tvb, 0, -1,
"Agent Extensibility (AgentX) Protocol: %s, sid=%d, tid=%d, packid=%d, plen=%d",
- val_to_str(type, type_values, "unknown"),
+ val_to_str_ext_const(type, &type_values_ext, "unknown"),
session_id, trans_id, packet_id, payload_len);
agentx_tree = proto_item_add_subtree(t_item, ett_agentx);
@@ -979,7 +981,7 @@ proto_register_agentx(void)
"header version", HFILL }},
{ &hf_type,
- { "Type", "agentx.type", FT_UINT8, BASE_DEC, VALS(type_values), 0x0,
+ { "Type", "agentx.type", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &type_values_ext, 0x0,
"header type", HFILL }},
{ &hf_flags,
@@ -1051,7 +1053,7 @@ proto_register_agentx(void)
NULL, HFILL }},
{ &hf_resp_error,
- { "Resp. error", "agentx.r.error", FT_UINT16, BASE_DEC, VALS(resp_errors), 0x0,
+ { "Resp. error", "agentx.r.error", FT_UINT16, BASE_DEC | BASE_EXT_STRING, &resp_errors_ext, 0x0,
"response error", HFILL }},
{ &hf_resp_index,
@@ -1059,7 +1061,7 @@ proto_register_agentx(void)
"response index", HFILL }},
{ &hf_vtag,
- { "Variable type", "agentx.v.tag", FT_UINT16, BASE_DEC, VALS(vtag_values), 0x0,
+ { "Variable type", "agentx.v.tag", FT_UINT16, BASE_DEC | BASE_EXT_STRING, &vtag_values_ext, 0x0,
"vtag", HFILL }},
{ &hf_val32,
diff --git a/epan/dissectors/packet-alcap.c b/epan/dissectors/packet-alcap.c
index 862bd3f042..f515d1dee9 100644
--- a/epan/dissectors/packet-alcap.c
+++ b/epan/dissectors/packet-alcap.c
@@ -66,6 +66,7 @@ static const value_string msg_type_strings[] = {
{ 14, "Modify Request (MOD)" },
{ 0, NULL }
};
+static value_string_ext msg_type_strings_ext = VALUE_STRING_EXT_INIT(msg_type_strings);
static const value_string send_notification[] = {
{ 0, "Do Not Send Notification"},
@@ -1225,42 +1226,42 @@ typedef struct _alcap_param_info_t {
} alcap_param_info_t;
static alcap_param_info_t param_infos[] = {
- {-1, "Unknown", dissect_fields_unknown , FALSE},
- {-1, "CAU", dissect_fields_cau, TRUE},
- {-1, "CEID", dissect_fields_ceid, TRUE},
- {-1, "DESEA", dissect_fields_desea, FALSE},
- {-1, "DNSEA", dissect_fields_dnsea, TRUE},
- {-1, "ALC", dissect_fields_alc, FALSE},
- {-1, "OSAID", dissect_fields_osaid, TRUE},
- {-1, "SUGR", dissect_fields_sugr, TRUE},
- {-1, "SUT", dissect_fields_sut, FALSE},
- {-1, "SSIA", dissect_fields_ssia, FALSE},
- {-1, "SSIM", dissect_fields_ssim, FALSE},
- {-1, "SSISA", dissect_fields_ssisa, FALSE},
- {-1, "SSISU", dissect_fields_ssisu, FALSE},
- {-1, "TCI", dissect_fields_none, FALSE},
- {-1, "MSLC", dissect_fields_none, FALSE},
- {-1, "MSSSI", dissect_fields_none, FALSE},
- {-1, "PT", dissect_fields_pt, FALSE},
- {-1, "PLC", dissect_fields_plc, FALSE},
- {-1, "PSSIAE", dissect_fields_pssiae, FALSE},
- {-1, "PSSIME", dissect_fields_pssime, FALSE},
- {-1, "SUCI", dissect_fields_suci, FALSE},
- {-1, "ONSEA", dissect_fields_onsea, TRUE},
- {-1, "SSIAE", dissect_fields_ssiae, FALSE},
- {-1, "SSIME", dissect_fields_ssime, FALSE},
- {-1, "ACC", dissect_fields_acc, FALSE},
- {-1, "CP", dissect_fields_cp, FALSE},
- {-1, "HC", dissect_fields_hc, FALSE},
- {-1, "OESEA", dissect_fields_oesea, FALSE},
- {-1, "PFBW", dissect_fields_pfbw, FALSE},
- {-1, "PVBWS", dissect_fields_pvbws, FALSE},
- {-1, "PVBWT", dissect_fields_pvbwt, FALSE},
- {-1, "TTC", dissect_fields_none, FALSE},
- {-1, "FBW", dissect_fields_fbw, FALSE},
- {-1, "VBWS", dissect_fields_vbws, FALSE},
- {-1, "VBWT", dissect_fields_vbwt, FALSE},
- {-1, "TCS", dissect_fields_none, FALSE}
+ {-1, "Unknown", dissect_fields_unknown, FALSE},
+ {-1, "CAU", dissect_fields_cau, TRUE},
+ {-1, "CEID", dissect_fields_ceid, TRUE},
+ {-1, "DESEA", dissect_fields_desea, FALSE},
+ {-1, "DNSEA", dissect_fields_dnsea, TRUE},
+ {-1, "ALC", dissect_fields_alc, FALSE},
+ {-1, "OSAID", dissect_fields_osaid, TRUE},
+ {-1, "SUGR", dissect_fields_sugr, TRUE},
+ {-1, "SUT", dissect_fields_sut, FALSE},
+ {-1, "SSIA", dissect_fields_ssia, FALSE},
+ {-1, "SSIM", dissect_fields_ssim, FALSE},
+ {-1, "SSISA", dissect_fields_ssisa, FALSE},
+ {-1, "SSISU", dissect_fields_ssisu, FALSE},
+ {-1, "TCI", dissect_fields_none, FALSE},
+ {-1, "MSLC", dissect_fields_none, FALSE},
+ {-1, "MSSSI", dissect_fields_none, FALSE},
+ {-1, "PT", dissect_fields_pt, FALSE},
+ {-1, "PLC", dissect_fields_plc, FALSE},
+ {-1, "PSSIAE", dissect_fields_pssiae, FALSE},
+ {-1, "PSSIME", dissect_fields_pssime, FALSE},
+ {-1, "SUCI", dissect_fields_suci, FALSE},
+ {-1, "ONSEA", dissect_fields_onsea, TRUE},
+ {-1, "SSIAE", dissect_fields_ssiae, FALSE},
+ {-1, "SSIME", dissect_fields_ssime, FALSE},
+ {-1, "ACC", dissect_fields_acc, FALSE},
+ {-1, "CP", dissect_fields_cp, FALSE},
+ {-1, "HC", dissect_fields_hc, FALSE},
+ {-1, "OESEA", dissect_fields_oesea, FALSE},
+ {-1, "PFBW", dissect_fields_pfbw, FALSE},
+ {-1, "PVBWS", dissect_fields_pvbws, FALSE},
+ {-1, "PVBWT", dissect_fields_pvbwt, FALSE},
+ {-1, "TTC", dissect_fields_none, FALSE},
+ {-1, "FBW", dissect_fields_fbw, FALSE},
+ {-1, "VBWS", dissect_fields_vbws, FALSE},
+ {-1, "VBWT", dissect_fields_vbwt, FALSE},
+ {-1, "TCS", dissect_fields_none, FALSE}
};
#define GET_PARAM_INFO(id) ( array_length(param_infos) <= id ? &(param_infos[0]) : &(param_infos[id]) )
@@ -1343,7 +1344,9 @@ static void alcap_leg_tree(proto_tree* tree, tvbuff_t* tvb, const alcap_leg_info
do {
pi_local = proto_tree_add_uint(tree_local,hf_alcap_leg_frame,tvb,0,0,msg->framenum);
- proto_item_set_text(pi_local,"%s in frame %u", val_to_str(msg->msg_type,msg_type_strings,"Unknown message"),msg->framenum);
+ proto_item_set_text(pi_local,"%s in frame %u",
+ val_to_str_ext_const(msg->msg_type,&msg_type_strings_ext,"Unknown message"),
+ msg->framenum);
PROTO_ITEM_SET_GENERATED(pi_local);
} while (( msg = msg->next));
@@ -1529,201 +1532,857 @@ proto_register_alcap(void)
module_t *alcap_module;
static hf_register_info hf[] = {
- { &hf_alcap_dsaid, { "DSAID", "alcap.dsaid", FT_UINT32, BASE_HEX, NULL, 0, "Destination Service Association ID", HFILL }},
- { &hf_alcap_msg_id, { "Message Type", "alcap.msg_type", FT_UINT8, BASE_DEC, VALS(msg_type_strings), 0, NULL, HFILL }},
- { &hf_alcap_compat, { "Message Compatibility", "alcap.compat", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
- { &hf_alcap_compat_pass_on_sni, { "Pass-On SNI", "alcap.compat.pass.sni", FT_UINT8, BASE_DEC, VALS(send_notification), 0x40, "Send Notificaation Indicator", HFILL }},
- { &hf_alcap_compat_pass_on_ii, { "Pass-On II", "alcap.compat.pass.ii", FT_UINT8, BASE_DEC, VALS(instruction_indicator), 0x30, "Instruction Indicator", HFILL }},
- { &hf_alcap_compat_general_sni, { "General SNI", "alcap.compat.general.sni", FT_UINT8, BASE_DEC, VALS(send_notification), 0x04, "Send Notificaation Indicator", HFILL }},
- { &hf_alcap_compat_general_ii, { "General II", "alcap.compat.general.ii", FT_UINT8, BASE_DEC, VALS(instruction_indicator), 0x03, "Instruction Indicator", HFILL }},
-
- { &hf_alcap_unknown, { "Unknown Field Data", "alcap.unknown.field", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
-
- { &hf_alcap_param_id, { "Parameter", "alcap.param", FT_UINT8, BASE_DEC, VALS(msg_parm_strings), 0, "Parameter Id", HFILL }},
- { &hf_alcap_param_len, { "Length", "alcap.param.len", FT_UINT8, BASE_DEC, NULL, 0, "Parameter Length", HFILL }},
-
- { &hf_alcap_cau_coding, { "Cause Coding", "alcap.cau.coding", FT_UINT8, BASE_DEC, VALS(cause_coding_vals), 0x03, NULL, HFILL }},
- { &hf_alcap_cau_value_itu, { "Cause Value (ITU)", "alcap.cau.value", FT_UINT8, BASE_DEC, VALS(cause_values_itu), 0x7f, NULL, HFILL }},
- { &hf_alcap_cau_value_non_itu, { "Cause Value (Other)", "alcap.cau.value", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL }},
- { &hf_alcap_cau_diag, { "Diagnostic", "alcap.cau.diag", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
- { &hf_alcap_cau_diag_len, { "Length", "alcap.cau.diag.len", FT_UINT8, BASE_DEC, NULL, 0, "Diagnostics Length", HFILL }},
- { &hf_alcap_cau_diag_msg, { "Message Identifier", "alcap.cau.diag.msg", FT_UINT8, BASE_DEC, VALS(msg_type_strings), 0, NULL, HFILL }},
- { &hf_alcap_cau_diag_param_id, { "Parameter Identifier", "alcap.cau.diag.param", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_cau_diag_field_num, { "Field Number", "alcap.cau.diag.field_num", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
-
- { &hf_alcap_ceid_pathid, { "Path ID", "alcap.ceid.pathid", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_ceid_cid, { "CID", "alcap.ceid.cid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
-
- { &hf_alcap_dnsea, { "Address", "alcap.dnsea.addr", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
-
- { &hf_alcap_alc_max_br_fw, { "Maximum Forward Bit Rate", "alcap.alc.bitrate.max.fw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_alc_max_br_bw, { "Maximum Backwards Bit Rate", "alcap.alc.bitrate.max.bw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_alc_avg_br_fw, { "Average Forward Bit Rate", "alcap.alc.bitrate.avg.fw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_alc_avg_br_bw, { "Average Backwards Bit Rate", "alcap.alc.bitrate.avg.bw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_alc_max_sdu_fw, { "Maximum Forward CPS SDU Size", "alcap.alc.sdusize.max.fw", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL }},
- { &hf_alcap_alc_max_sdu_bw, { "Maximum Backwards CPS SDU Size", "alcap.alc.sdusize.max.bw", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL }},
- { &hf_alcap_alc_avg_sdu_fw, { "Average Forward CPS SDU Size", "alcap.alc.sdusize.avg.fw", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL }},
- { &hf_alcap_alc_avg_sdu_bw, { "Average Backwards CPS SDU Size", "alcap.alc.sdusize.avg.bw", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL }},
-
- { &hf_alcap_osaid, { "OSAID", "alcap.osaid", FT_UINT32, BASE_HEX, NULL, 0, "Originating Service Association ID", HFILL }},
-
- { &hf_alcap_sugr, { "SUGR", "alcap.sugr", FT_BYTES, BASE_NONE, NULL, 0, "Served User Generated Reference", HFILL }},
-
- { &hf_alcap_sut_len, { "SUT Length", "alcap.sut.sut_len", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
- { &hf_alcap_sut, { "SUT", "alcap.sut.transport", FT_BYTES, BASE_NONE, NULL, 0, "Served User Transport", HFILL }},
-
- { &hf_alcap_ssia_pr_type, { "Profile Type", "alcap.ssia.profile.type", FT_UINT8, BASE_DEC, VALS(audio_profile_type), 0xc0, "I.366.2 Profile Type", HFILL }},
- { &hf_alcap_ssia_pr_id, { "Profile Id", "alcap.ssia.profile.id", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_ssia_frm, { "Frame Mode", "alcap.ssia.frm", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x80, NULL, HFILL }},
- { &hf_alcap_ssia_cmd, { "Circuit Mode", "alcap.ssia.cmd", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x40, NULL, HFILL }},
- { &hf_alcap_ssia_mfr2, { "Multi-Frequency R2", "alcap.ssia.mfr2", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x20, NULL, HFILL }},
- { &hf_alcap_ssia_mfr1, { "Multi-Frequency R1", "alcap.ssia.mfr1", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x10, NULL, HFILL }},
- { &hf_alcap_ssia_dtmf, { "DTMF", "alcap.ssia.dtmf", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x08, NULL, HFILL }},
- { &hf_alcap_ssia_cas, { "CAS", "alcap.ssia.cas", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x04, "Channel Associated Signalling", HFILL }},
- { &hf_alcap_ssia_fax, { "Fax", "alcap.ssia.fax", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x02, "Facsimile", HFILL }},
- { &hf_alcap_ssia_pcm, { "PCM Mode", "alcap.ssia.pcm", FT_UINT8, BASE_DEC, VALS(alaw_ulaw), 0x01, NULL, HFILL }},
- { &hf_alcap_ssia_max_len, { "Max Len of FM Data", "alcap.ssia.max_fmdata_len", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_ssia_oui, { "OUI", "alcap.ssia.oui", FT_BYTES, BASE_NONE, NULL, 0, "Organizational Unique Identifier", HFILL }},
-
- { &hf_alcap_ssim_frm, { "Frame Mode", "alcap.ssim.frm", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x80, NULL, HFILL }},
- { &hf_alcap_ssim_mult, { "Multiplier", "alcap.ssim.mult", FT_UINT8, BASE_DEC, NULL, 0x1f, NULL, HFILL }},
- { &hf_alcap_ssim_max, { "Max Len", "alcap.ssim.max", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
-
- { &hf_alcap_ssisa_max_sssar_fw, { "Maximum Len of SSSAR-SDU Forward", "alcap.ssisa.sssar.max_len.fw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_ssisa_max_sssar_bw, { "Maximum Len of SSSAR-SDU Backwards", "alcap.ssisa.sssar.max_len.fw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_ssisa_max_sscop_sdu_fw, { "Maximum Len of SSSAR-SDU Forward", "alcap.ssisa.sscop.max_sdu_len.fw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_ssisa_max_sscop_sdu_bw, { "Maximum Len of SSSAR-SDU Backwards", "alcap.ssisa.sscop.max_sdu_len.bw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_ssisa_max_sscop_uu_fw, { "Maximum Len of SSSAR-SDU Forward", "alcap.ssisa.sscop.max_uu_len.fw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_ssisa_max_sscop_uu_bw, { "Maximum Len of SSSAR-SDU Backwards", "alcap.ssisa.sscop.max_uu_len.bw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
-
- { &hf_alcap_ssisu_max_sssar_fw, { "Maximum Len of SSSAR-SDU Forward", "alcap.ssisu.sssar.max_len.fw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_ssisu_max_sssar_bw, { "Maximum Len of SSSAR-SDU Backwards", "alcap.ssisu.sssar.max_len.fw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_ssisu_ted, { "Transmission Error Detection", "alcap.ssisu.ted", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x80, NULL, HFILL }},
-
- { &hf_alcap_pt, { "QoS Codepoint", "alcap.pt.codepoint", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
-
- { &hf_alcap_plc_max_br_fw, { "Maximum Forward Bit Rate", "alcap.plc.bitrate.max.fw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_plc_max_br_bw, { "Maximum Backwards Bit Rate", "alcap.plc.bitrate.max.bw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_plc_avg_br_fw, { "Average Forward Bit Rate", "alcap.plc.bitrate.avg.fw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_plc_avg_br_bw, { "Average Backwards Bit Rate", "alcap.plc.bitrate.avg.bw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_plc_max_sdu_fw, { "Maximum Forward CPS SDU Size", "alcap.plc.sdusize.max.fw", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL }},
- { &hf_alcap_plc_max_sdu_bw, { "Maximum Backwards CPS SDU Size", "alcap.plc.sdusize.max.bw", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL }},
- { &hf_alcap_plc_avg_sdu_fw, { "Maximum Forward CPS SDU Size", "alcap.plc.sdusize.max.fw", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL }},
- { &hf_alcap_plc_avg_sdu_bw, { "Maximum Backwards CPS SDU Size", "alcap.plc.sdusize.max.bw", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL }},
-
- { &hf_alcap_pssiae_pr_type, { "Profile Type", "alcap.pssiae.profile.type", FT_UINT8, BASE_DEC, VALS(audio_profile_type), 0xc0, "I.366.2 Profile Type", HFILL }},
- { &hf_alcap_pssiae_pr_id, { "Profile Id", "alcap.pssiae.profile.id", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_pssiae_lb, { "Loopback", "alcap.pssiae.lb", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0xc0, NULL, HFILL }},
- { &hf_alcap_pssiae_rc, { "Rate Control", "alcap.pssiae.rc", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0xc0, NULL, HFILL }},
- { &hf_alcap_pssiae_syn, { "Synchronization", "alcap.pssiae.syn", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0xc0, "Transport of synchronization of change in SSCS operation", HFILL }},
- { &hf_alcap_pssiae_frm, { "Frame Mode", "alcap.pssiae.frm", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x80, NULL, HFILL }},
- { &hf_alcap_pssiae_cmd, { "Circuit Mode", "alcap.pssiae.cmd", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x40, NULL, HFILL }},
- { &hf_alcap_pssiae_mfr2, { "Multi-Frequency R2", "alcap.pssiae.mfr2", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x20, NULL, HFILL }},
- { &hf_alcap_pssiae_mfr1, { "Multi-Frequency R1", "alcap.pssiae.mfr1", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x10, NULL, HFILL }},
- { &hf_alcap_pssiae_dtmf, { "DTMF", "alcap.pssiae.dtmf", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x08, NULL, HFILL }},
- { &hf_alcap_pssiae_cas, { "CAS", "alcap.pssiae.cas", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x04, "Channel Associated Signalling", HFILL }},
- { &hf_alcap_pssiae_fax, { "Fax", "alcap.pssiae.fax", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x02, "Facsimile", HFILL }},
- { &hf_alcap_pssiae_pcm, { "PCM Mode", "alcap.pssiae.pcm", FT_UINT8, BASE_DEC, VALS(alaw_ulaw), 0x01, NULL, HFILL }},
- { &hf_alcap_pssiae_max_len, { "Max Len of FM Data", "alcap.pssiae.max_fmdata_len", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_pssiae_oui, { "OUI", "alcap.pssiae.oui", FT_BYTES, BASE_NONE, NULL, 0, "Organizational Unique Identifier", HFILL }},
-
- { &hf_alcap_pssime_frm, { "Frame Mode", "alcap.pssime.frm", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x80, NULL, HFILL }},
- { &hf_alcap_pssime_lb, { "Loopback", "alcap.pssime.lb", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x40, NULL, HFILL }},
- { &hf_alcap_pssime_mult, { "Multiplier", "alcap.pssime.mult", FT_UINT8, BASE_DEC, NULL, 0x1f, NULL, HFILL }},
- { &hf_alcap_pssime_max, { "Max Len", "alcap.pssime.max", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
-
- { &hf_alcap_suci, { "SUCI", "alcap.suci", FT_UINT8, BASE_HEX, NULL, 0, "Served User Correlation Id", HFILL }},
-
- { &hf_alcap_onsea, { "Address", "alcap.onsea.addr", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
-
- { &hf_alcap_ssiae_pr_type, { "Profile Type", "alcap.ssiae.profile.type", FT_UINT8, BASE_DEC, VALS(audio_profile_type), 0xc0, "I.366.2 Profile Type", HFILL }},
- { &hf_alcap_ssiae_lb, { "Loopback", "alcap.ssiae.lb", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0xc0, NULL, HFILL }},
- { &hf_alcap_ssiae_rc, { "Rate Control", "alcap.ssiae.rc", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0xc0, NULL, HFILL }},
- { &hf_alcap_ssiae_syn, { "Synchronization", "alcap.ssiae.syn", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0xc0, "Transport of synchronization of change in SSCS operation", HFILL }},
- { &hf_alcap_ssiae_pr_id, { "Profile Id", "alcap.ssiae.profile.id", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_ssiae_frm, { "Frame Mode", "alcap.ssiae.frm", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x80, NULL, HFILL }},
- { &hf_alcap_ssiae_cmd, { "Circuit Mode", "alcap.ssiae.cmd", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x40, NULL, HFILL }},
- { &hf_alcap_ssiae_mfr2, { "Multi-Frequency R2", "alcap.ssiae.mfr2", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x20, NULL, HFILL }},
- { &hf_alcap_ssiae_mfr1, { "Multi-Frequency R1", "alcap.ssiae.mfr1", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x10, NULL, HFILL }},
- { &hf_alcap_ssiae_dtmf, { "DTMF", "alcap.ssiae.dtmf", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x08, NULL, HFILL }},
- { &hf_alcap_ssiae_cas, { "CAS", "alcap.ssiae.cas", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x04, "Channel Associated Signalling", HFILL }},
- { &hf_alcap_ssiae_fax, { "Fax", "alcap.ssiae.fax", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x02, "Facsimile", HFILL }},
- { &hf_alcap_ssiae_pcm, { "PCM Mode", "alcap.ssiae.pcm", FT_UINT8, BASE_DEC, VALS(alaw_ulaw), 0x01, NULL, HFILL }},
- { &hf_alcap_ssiae_max_len, { "Max Len of FM Data", "alcap.ssiae.max_fmdata_len", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_ssiae_oui, { "OUI", "alcap.ssiae.oui", FT_BYTES, BASE_NONE, NULL, 0, "Organizational Unique Identifier", HFILL }},
-
- { &hf_alcap_ssime_frm, { "Frame Mode", "alcap.ssime.frm", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x80, NULL, HFILL }},
- { &hf_alcap_ssime_lb, { "Loopback", "alcap.ssime.lb", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x40, NULL, HFILL }},
- { &hf_alcap_ssime_mult, { "Multiplier", "alcap.ssime.mult", FT_UINT8, BASE_DEC, NULL, 0x1f, NULL, HFILL }},
- { &hf_alcap_ssime_max, { "Max Len", "alcap.ssime.max", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
-
- { &hf_alcap_acc_level, { "Congestion Level", "alcap.acc.level", FT_UINT8, BASE_DEC, VALS(congestion_level), 0, NULL, HFILL }},
-
- { &hf_alcap_cp, { "Level", "alcap.cp.level", FT_UINT8, BASE_DEC, VALS(connection_priority), 0x07, NULL, HFILL }},
-
- { &hf_alcap_hc, { "Codepoint", "alcap.hc.codepoint", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
-
- { &hf_alcap_pfbw_br_fw, { "CPS Forward Bitrate", "alcap.pfbw.bitrate.fw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_pfbw_br_bw, { "CPS Backwards Bitrate", "alcap.pfbw.bitrate.bw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_pfbw_bucket_fw, { "Forward CPS Bucket Size", "alcap.pfbw.bucket_size.fw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_pfbw_bucket_bw, { "Backwards CPS Bucket Size", "alcap.pfbw.bucket_size.bw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_pfbw_size_fw, { "Forward CPS Packet Size", "alcap.pfbw.max_size.fw", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_pfbw_size_bw, { "Backwards CPS Packet Size", "alcap.pfbw.max_size.bw", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
-
- { &hf_alcap_pvbws_br_fw, { "Peak CPS Forward Bitrate", "alcap.pvbws.bitrate.fw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_pvbws_br_bw, { "Peak CPS Backwards Bitrate", "alcap.pvbws.bitrate.bw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_pvbws_bucket_fw, { "Peak Forward CPS Bucket Size", "alcap.pvbws.bucket_size.fw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_pvbws_bucket_bw, { "Peak Backwards CPS Bucket Size", "alcap.pvbws.bucket_size.bw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_pvbws_size_fw, { "Forward CPS Packet Size", "alcap.pvbws.max_size.fw", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_pvbws_size_bw, { "Backwards CPS Packet Size", "alcap.pvbws.max_size.bw", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_pvbws_stt, { "Source Traffic Type", "alcap.pvbws.stt", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
-
- { &hf_alcap_pvbwt_peak_br_fw, { "Peak CPS Forward Bitrate", "alcap.pvbwt.bitrate.fw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_pvbwt_peak_br_bw, { "Peak CPS Backwards Bitrate", "alcap.pvbwt.bitrate.bw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_pvbwt_peak_bucket_fw, { "Peak Forward CPS Bucket Size", "alcap.pvbwt.bucket_size.fw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_pvbwt_peak_bucket_bw, { "Peak Backwards CPS Bucket Size", "alcap.pvbwt.bucket_size.bw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_pvbwt_sust_br_fw, { "Sustainable CPS Forward Bitrate", "alcap.pvbwt.bitrate.fw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_pvbwt_sust_br_bw, { "Sustainable CPS Backwards Bitrate", "alcap.pvbwt.bitrate.bw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_pvbwt_sust_bucket_fw, { "Sustainable Forward CPS Bucket Size", "alcap.pvbwt.bucket_size.fw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_pvbwt_sust_bucket_bw, { "Sustainable Backwards CPS Bucket Size", "alcap.pvbwt.bucket_size.bw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_pvbwt_size_fw, { "Forward CPS Packet Size", "alcap.pvbwt.max_size.fw", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_pvbwt_size_bw, { "Backwards CPS Packet Size", "alcap.pvbwt.max_size.bw", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
-
- { &hf_alcap_fbw_br_fw, { "CPS Forward Bitrate", "alcap.fbw.bitrate.fw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_fbw_br_bw, { "CPS Backwards Bitrate", "alcap.fbw.bitrate.bw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_fbw_bucket_fw, { "Forward CPS Bucket Size", "alcap.fbw.bucket_size.fw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_fbw_bucket_bw, { "Backwards CPS Bucket Size", "alcap.fbw.bucket_size.bw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_fbw_size_fw, { "Forward CPS Packet Size", "alcap.fbw.max_size.fw", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_fbw_size_bw, { "Backwards CPS Packet Size", "alcap.fbw.max_size.bw", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
-
- { &hf_alcap_vbws_br_fw, { "CPS Forward Bitrate", "alcap.vbws.bitrate.fw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_vbws_br_bw, { "CPS Backwards Bitrate", "alcap.vbws.bitrate.bw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_vbws_bucket_fw, { "Forward CPS Bucket Size", "alcap.vbws.bucket_size.fw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_vbws_bucket_bw, { "Backwards CPS Bucket Size", "alcap.vbws.bucket_size.bw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_vbws_size_fw, { "Forward CPS Packet Size", "alcap.vbws.max_size.fw", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_vbws_size_bw, { "Backwards CPS Packet Size", "alcap.vbws.max_size.bw", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_vbws_stt, { "Source Traffic Type", "alcap.vbws.stt", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
-
- { &hf_alcap_vbwt_peak_br_fw, { "Peak CPS Forward Bitrate", "alcap.vbwt.bitrate.fw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_vbwt_peak_br_bw, { "Peak CPS Backwards Bitrate", "alcap.vbwt.bitrate.bw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_vbwt_peak_bucket_fw, { "Peak Forward CPS Bucket Size", "alcap.vbwt.bucket_size.fw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_vbwt_peak_bucket_bw, { "Peak Backwards CPS Bucket Size", "alcap.vbwt.bucket_size.bw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_vbwt_sust_br_fw, { "Sustainable CPS Forward Bitrate", "alcap.vbwt.bitrate.fw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_vbwt_sust_br_bw, { "Sustainable CPS Backwards Bitrate", "alcap.vbwt.bitrate.bw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_vbwt_sust_bucket_fw, { "Sustainable Forward CPS Bucket Size", "alcap.vbwt.bucket_size.fw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_vbwt_sust_bucket_bw, { "Sustainable Backwards CPS Bucket Size", "alcap.vbwt.bucket_size.bw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_vbwt_size_fw, { "Forward CPS Packet Size", "alcap.vbwt.max_size.fw", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
- { &hf_alcap_vbwt_size_bw, { "Backwards CPS Packet Size", "alcap.vbwt.max_size.bw", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
-
- { &hf_alcap_leg_osaid, { "Leg's ERQ OSA id", "alcap.leg.osaid", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } },
- { &hf_alcap_leg_dsaid, { "Leg's ECF OSA id", "alcap.leg.dsaid", FT_UINT32, BASE_HEX, NULL, 0,NULL, HFILL } },
- { &hf_alcap_leg_pathid, { "Leg's path id", "alcap.leg.pathid", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } },
- { &hf_alcap_leg_cid, { "Leg's channel id", "alcap.leg.cid", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } },
- { &hf_alcap_leg_sugr, { "Leg's SUGR", "alcap.leg.sugr", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } },
- { &hf_alcap_leg_dnsea, { "Leg's destination NSAP", "alcap.leg.dnsea", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } },
- { &hf_alcap_leg_onsea, { "Leg's originating NSAP", "alcap.leg.onsea", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } },
- { &hf_alcap_leg_frame, { "a message of this leg", "alcap.leg.msg", FT_FRAMENUM, BASE_NONE, NULL, 0, NULL, HFILL } },
- { &hf_alcap_leg_release_cause, { "Leg's cause value in REL", "alcap.leg.cause", FT_UINT8, BASE_DEC, VALS(cause_values_itu), 0, NULL, HFILL }},
+ { &hf_alcap_dsaid,
+ { "DSAID", "alcap.dsaid",
+ FT_UINT32, BASE_HEX, NULL, 0,
+ "Destination Service Association ID", HFILL }
+ },
+ { &hf_alcap_msg_id,
+ { "Message Type", "alcap.msg_type",
+ FT_UINT8, BASE_DEC | BASE_EXT_STRING, &msg_type_strings_ext, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_compat,
+ { "Message Compatibility", "alcap.compat",
+ FT_BYTES, BASE_NONE, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_compat_pass_on_sni,
+ { "Pass-On SNI", "alcap.compat.pass.sni",
+ FT_UINT8, BASE_DEC, VALS(send_notification), 0x40,
+ "Send Notificaation Indicator", HFILL }
+ },
+ { &hf_alcap_compat_pass_on_ii,
+ { "Pass-On II", "alcap.compat.pass.ii",
+ FT_UINT8, BASE_DEC, VALS(instruction_indicator), 0x30,
+ "Instruction Indicator", HFILL }
+ },
+ { &hf_alcap_compat_general_sni,
+ { "General SNI", "alcap.compat.general.sni",
+ FT_UINT8, BASE_DEC, VALS(send_notification), 0x04,
+ "Send Notificaation Indicator", HFILL }
+ },
+ { &hf_alcap_compat_general_ii,
+ { "General II", "alcap.compat.general.ii",
+ FT_UINT8, BASE_DEC, VALS(instruction_indicator), 0x03,
+ "Instruction Indicator", HFILL }
+ },
+
+ { &hf_alcap_unknown,
+ { "Unknown Field Data", "alcap.unknown.field",
+ FT_BYTES, BASE_NONE, NULL, 0,
+ NULL, HFILL }
+ },
+
+ { &hf_alcap_param_id,
+ { "Parameter", "alcap.param",
+ FT_UINT8, BASE_DEC, VALS(msg_parm_strings), 0,
+ "Parameter Id", HFILL }
+ },
+ { &hf_alcap_param_len,
+ { "Length", "alcap.param.len",
+ FT_UINT8, BASE_DEC, NULL, 0,
+ "Parameter Length", HFILL }
+ },
+
+ { &hf_alcap_cau_coding,
+ { "Cause Coding", "alcap.cau.coding",
+ FT_UINT8, BASE_DEC, VALS(cause_coding_vals), 0x03,
+ NULL, HFILL }
+ },
+ { &hf_alcap_cau_value_itu,
+ { "Cause Value (ITU)", "alcap.cau.value",
+ FT_UINT8, BASE_DEC, VALS(cause_values_itu), 0x7f,
+ NULL, HFILL }
+ },
+ { &hf_alcap_cau_value_non_itu,
+ { "Cause Value (Other)", "alcap.cau.value",
+ FT_UINT8, BASE_DEC, NULL, 0x7f,
+ NULL, HFILL }
+ },
+ { &hf_alcap_cau_diag,
+ { "Diagnostic", "alcap.cau.diag",
+ FT_BYTES, BASE_NONE, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_cau_diag_len,
+ { "Length", "alcap.cau.diag.len",
+ FT_UINT8, BASE_DEC, NULL, 0,
+ "Diagnostics Length", HFILL }
+ },
+ { &hf_alcap_cau_diag_msg,
+ { "Message Identifier", "alcap.cau.diag.msg",
+ FT_UINT8, BASE_DEC | BASE_EXT_STRING, &msg_type_strings_ext, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_cau_diag_param_id,
+ { "Parameter Identifier", "alcap.cau.diag.param",
+ FT_UINT8, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_cau_diag_field_num,
+ { "Field Number", "alcap.cau.diag.field_num",
+ FT_UINT8, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+
+ { &hf_alcap_ceid_pathid,
+ { "Path ID", "alcap.ceid.pathid",
+ FT_UINT32, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_ceid_cid,
+ { "CID", "alcap.ceid.cid",
+ FT_UINT8, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+
+ { &hf_alcap_dnsea,
+ { "Address", "alcap.dnsea.addr",
+ FT_BYTES, BASE_NONE, NULL, 0,
+ NULL, HFILL }
+ },
+
+ { &hf_alcap_alc_max_br_fw,
+ { "Maximum Forward Bit Rate", "alcap.alc.bitrate.max.fw",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_alc_max_br_bw,
+ { "Maximum Backwards Bit Rate", "alcap.alc.bitrate.max.bw",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_alc_avg_br_fw,
+ { "Average Forward Bit Rate", "alcap.alc.bitrate.avg.fw",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_alc_avg_br_bw,
+ { "Average Backwards Bit Rate", "alcap.alc.bitrate.avg.bw",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_alc_max_sdu_fw,
+ { "Maximum Forward CPS SDU Size", "alcap.alc.sdusize.max.fw",
+ FT_UINT8, BASE_DEC, NULL, 0x7f,
+ NULL, HFILL }
+ },
+ { &hf_alcap_alc_max_sdu_bw,
+ { "Maximum Backwards CPS SDU Size", "alcap.alc.sdusize.max.bw",
+ FT_UINT8, BASE_DEC, NULL, 0x7f,
+ NULL, HFILL }
+ },
+ { &hf_alcap_alc_avg_sdu_fw,
+ { "Average Forward CPS SDU Size", "alcap.alc.sdusize.avg.fw",
+ FT_UINT8, BASE_DEC, NULL, 0x7f,
+ NULL, HFILL }
+ },
+ { &hf_alcap_alc_avg_sdu_bw,
+ { "Average Backwards CPS SDU Size", "alcap.alc.sdusize.avg.bw",
+ FT_UINT8, BASE_DEC, NULL, 0x7f,
+ NULL, HFILL }
+ },
+
+ { &hf_alcap_osaid,
+ { "OSAID", "alcap.osaid",
+ FT_UINT32, BASE_HEX, NULL, 0,
+ "Originating Service Association ID", HFILL }
+ },
+
+ { &hf_alcap_sugr,
+ { "SUGR", "alcap.sugr",
+ FT_BYTES, BASE_NONE, NULL, 0,
+ "Served User Generated Reference", HFILL }
+ },
+
+ { &hf_alcap_sut_len,
+ { "SUT Length", "alcap.sut.sut_len",
+ FT_UINT8, BASE_HEX, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_sut,
+ { "SUT", "alcap.sut.transport",
+ FT_BYTES, BASE_NONE, NULL, 0,
+ "Served User Transport", HFILL }
+ },
+
+ { &hf_alcap_ssia_pr_type,
+ { "Profile Type", "alcap.ssia.profile.type",
+ FT_UINT8, BASE_DEC, VALS(audio_profile_type), 0xc0,
+ "I.366.2 Profile Type", HFILL }
+ },
+ { &hf_alcap_ssia_pr_id,
+ { "Profile Id", "alcap.ssia.profile.id",
+ FT_UINT8, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_ssia_frm,
+ { "Frame Mode", "alcap.ssia.frm",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x80,
+ NULL, HFILL }
+ },
+ { &hf_alcap_ssia_cmd,
+ { "Circuit Mode", "alcap.ssia.cmd",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x40,
+ NULL, HFILL }
+ },
+ { &hf_alcap_ssia_mfr2,
+ { "Multi-Frequency R2", "alcap.ssia.mfr2",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x20,
+ NULL, HFILL }
+ },
+ { &hf_alcap_ssia_mfr1,
+ { "Multi-Frequency R1", "alcap.ssia.mfr1",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x10,
+ NULL, HFILL }
+ },
+ { &hf_alcap_ssia_dtmf,
+ { "DTMF", "alcap.ssia.dtmf",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x08,
+ NULL, HFILL }
+ },
+ { &hf_alcap_ssia_cas,
+ { "CAS", "alcap.ssia.cas",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x04,
+ "Channel Associated Signalling", HFILL }
+ },
+ { &hf_alcap_ssia_fax,
+ { "Fax", "alcap.ssia.fax",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x02,
+ "Facsimile", HFILL }
+ },
+ { &hf_alcap_ssia_pcm,
+ { "PCM Mode", "alcap.ssia.pcm",
+ FT_UINT8, BASE_DEC, VALS(alaw_ulaw), 0x01,
+ NULL, HFILL }
+ },
+ { &hf_alcap_ssia_max_len,
+ { "Max Len of FM Data", "alcap.ssia.max_fmdata_len",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_ssia_oui,
+ { "OUI", "alcap.ssia.oui",
+ FT_BYTES, BASE_NONE, NULL, 0,
+ "Organizational Unique Identifier", HFILL }
+ },
+
+ { &hf_alcap_ssim_frm,
+ { "Frame Mode", "alcap.ssim.frm",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x80,
+ NULL, HFILL }
+ },
+ { &hf_alcap_ssim_mult,
+ { "Multiplier", "alcap.ssim.mult",
+ FT_UINT8, BASE_DEC, NULL, 0x1f,
+ NULL, HFILL }
+ },
+ { &hf_alcap_ssim_max,
+ { "Max Len", "alcap.ssim.max",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+
+ { &hf_alcap_ssisa_max_sssar_fw,
+ { "Maximum Len of SSSAR-SDU Forward", "alcap.ssisa.sssar.max_len.fw",
+ FT_UINT24, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_ssisa_max_sssar_bw,
+ { "Maximum Len of SSSAR-SDU Backwards", "alcap.ssisa.sssar.max_len.fw",
+ FT_UINT24, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_ssisa_max_sscop_sdu_fw,
+ { "Maximum Len of SSSAR-SDU Forward", "alcap.ssisa.sscop.max_sdu_len.fw",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_ssisa_max_sscop_sdu_bw,
+ { "Maximum Len of SSSAR-SDU Backwards", "alcap.ssisa.sscop.max_sdu_len.bw",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_ssisa_max_sscop_uu_fw,
+ { "Maximum Len of SSSAR-SDU Forward", "alcap.ssisa.sscop.max_uu_len.fw",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_ssisa_max_sscop_uu_bw,
+ { "Maximum Len of SSSAR-SDU Backwards", "alcap.ssisa.sscop.max_uu_len.bw",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+
+ { &hf_alcap_ssisu_max_sssar_fw,
+ { "Maximum Len of SSSAR-SDU Forward", "alcap.ssisu.sssar.max_len.fw",
+ FT_UINT24, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_ssisu_max_sssar_bw,
+ { "Maximum Len of SSSAR-SDU Backwards", "alcap.ssisu.sssar.max_len.fw",
+ FT_UINT24, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_ssisu_ted,
+ { "Transmission Error Detection", "alcap.ssisu.ted",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x80,
+ NULL, HFILL }
+ },
+
+ { &hf_alcap_pt,
+ { "QoS Codepoint", "alcap.pt.codepoint",
+ FT_UINT8, BASE_DEC, NULL, 0x0,
+ NULL, HFILL }
+ },
+
+ { &hf_alcap_plc_max_br_fw,
+ { "Maximum Forward Bit Rate", "alcap.plc.bitrate.max.fw",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_plc_max_br_bw,
+ { "Maximum Backwards Bit Rate", "alcap.plc.bitrate.max.bw",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_plc_avg_br_fw,
+ { "Average Forward Bit Rate", "alcap.plc.bitrate.avg.fw",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_plc_avg_br_bw,
+ { "Average Backwards Bit Rate", "alcap.plc.bitrate.avg.bw",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_plc_max_sdu_fw,
+ { "Maximum Forward CPS SDU Size", "alcap.plc.sdusize.max.fw",
+ FT_UINT8, BASE_DEC, NULL, 0x7f,
+ NULL, HFILL }
+ },
+ { &hf_alcap_plc_max_sdu_bw,
+ { "Maximum Backwards CPS SDU Size", "alcap.plc.sdusize.max.bw",
+ FT_UINT8, BASE_DEC, NULL, 0x7f,
+ NULL, HFILL }
+ },
+ { &hf_alcap_plc_avg_sdu_fw,
+ { "Maximum Forward CPS SDU Size", "alcap.plc.sdusize.max.fw",
+ FT_UINT8, BASE_DEC, NULL, 0x7f,
+ NULL, HFILL }
+ },
+ { &hf_alcap_plc_avg_sdu_bw,
+ { "Maximum Backwards CPS SDU Size", "alcap.plc.sdusize.max.bw",
+ FT_UINT8, BASE_DEC, NULL, 0x7f,
+ NULL, HFILL }
+ },
+
+ { &hf_alcap_pssiae_pr_type,
+ { "Profile Type", "alcap.pssiae.profile.type",
+ FT_UINT8, BASE_DEC, VALS(audio_profile_type), 0xc0,
+ "I.366.2 Profile Type", HFILL }
+ },
+ { &hf_alcap_pssiae_pr_id,
+ { "Profile Id", "alcap.pssiae.profile.id",
+ FT_UINT8, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pssiae_lb,
+ { "Loopback", "alcap.pssiae.lb",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0xc0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pssiae_rc,
+ { "Rate Control", "alcap.pssiae.rc",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0xc0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pssiae_syn,
+ { "Synchronization", "alcap.pssiae.syn",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0xc0,
+ "Transport of synchronization of change in SSCS operation", HFILL }
+ },
+ { &hf_alcap_pssiae_frm,
+ { "Frame Mode", "alcap.pssiae.frm",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x80,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pssiae_cmd,
+ { "Circuit Mode", "alcap.pssiae.cmd",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x40,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pssiae_mfr2,
+ { "Multi-Frequency R2", "alcap.pssiae.mfr2",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x20,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pssiae_mfr1,
+ { "Multi-Frequency R1", "alcap.pssiae.mfr1",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x10,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pssiae_dtmf,
+ { "DTMF", "alcap.pssiae.dtmf",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x08,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pssiae_cas,
+ { "CAS", "alcap.pssiae.cas",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x04,
+ "Channel Associated Signalling", HFILL }
+ },
+ { &hf_alcap_pssiae_fax,
+ { "Fax", "alcap.pssiae.fax",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x02,
+ "Facsimile", HFILL }
+ },
+ { &hf_alcap_pssiae_pcm,
+ { "PCM Mode", "alcap.pssiae.pcm",
+ FT_UINT8, BASE_DEC, VALS(alaw_ulaw), 0x01,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pssiae_max_len,
+ { "Max Len of FM Data", "alcap.pssiae.max_fmdata_len",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pssiae_oui,
+ { "OUI", "alcap.pssiae.oui",
+ FT_BYTES, BASE_NONE, NULL, 0,
+ "Organizational Unique Identifier", HFILL }
+ },
+
+ { &hf_alcap_pssime_frm,
+ { "Frame Mode", "alcap.pssime.frm",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x80,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pssime_lb,
+ { "Loopback", "alcap.pssime.lb",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x40,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pssime_mult,
+ { "Multiplier", "alcap.pssime.mult",
+ FT_UINT8, BASE_DEC, NULL, 0x1f,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pssime_max,
+ { "Max Len", "alcap.pssime.max",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+
+ { &hf_alcap_suci,
+ { "SUCI", "alcap.suci",
+ FT_UINT8, BASE_HEX, NULL, 0,
+ "Served User Correlation Id", HFILL }
+ },
+
+ { &hf_alcap_onsea,
+ { "Address", "alcap.onsea.addr",
+ FT_BYTES, BASE_NONE, NULL, 0,
+ NULL, HFILL }
+ },
+
+ { &hf_alcap_ssiae_pr_type,
+ { "Profile Type", "alcap.ssiae.profile.type",
+ FT_UINT8, BASE_DEC, VALS(audio_profile_type), 0xc0,
+ "I.366.2 Profile Type", HFILL }
+ },
+ { &hf_alcap_ssiae_lb,
+ { "Loopback", "alcap.ssiae.lb",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0xc0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_ssiae_rc,
+ { "Rate Control", "alcap.ssiae.rc",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0xc0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_ssiae_syn,
+ { "Synchronization", "alcap.ssiae.syn",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0xc0,
+ "Transport of synchronization of change in SSCS operation", HFILL }
+ },
+ { &hf_alcap_ssiae_pr_id,
+ { "Profile Id", "alcap.ssiae.profile.id",
+ FT_UINT8, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_ssiae_frm,
+ { "Frame Mode", "alcap.ssiae.frm",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x80,
+ NULL, HFILL }
+ },
+ { &hf_alcap_ssiae_cmd,
+ { "Circuit Mode", "alcap.ssiae.cmd",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x40,
+ NULL, HFILL }
+ },
+ { &hf_alcap_ssiae_mfr2,
+ { "Multi-Frequency R2", "alcap.ssiae.mfr2",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x20,
+ NULL, HFILL }
+ },
+ { &hf_alcap_ssiae_mfr1,
+ { "Multi-Frequency R1", "alcap.ssiae.mfr1",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x10,
+ NULL, HFILL }
+ },
+ { &hf_alcap_ssiae_dtmf,
+ { "DTMF", "alcap.ssiae.dtmf",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x08,
+ NULL, HFILL }
+ },
+ { &hf_alcap_ssiae_cas,
+ { "CAS", "alcap.ssiae.cas",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x04,
+ "Channel Associated Signalling", HFILL }
+ },
+ { &hf_alcap_ssiae_fax,
+ { "Fax", "alcap.ssiae.fax",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x02,
+ "Facsimile", HFILL }
+ },
+ { &hf_alcap_ssiae_pcm,
+ { "PCM Mode", "alcap.ssiae.pcm",
+ FT_UINT8, BASE_DEC, VALS(alaw_ulaw), 0x01,
+ NULL, HFILL }
+ },
+ { &hf_alcap_ssiae_max_len,
+ { "Max Len of FM Data", "alcap.ssiae.max_fmdata_len",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_ssiae_oui,
+ { "OUI", "alcap.ssiae.oui",
+ FT_BYTES, BASE_NONE, NULL, 0,
+ "Organizational Unique Identifier", HFILL }
+ },
+
+ { &hf_alcap_ssime_frm,
+ { "Frame Mode", "alcap.ssime.frm",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x80,
+ NULL, HFILL }
+ },
+ { &hf_alcap_ssime_lb,
+ { "Loopback", "alcap.ssime.lb",
+ FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x40,
+ NULL, HFILL }
+ },
+ { &hf_alcap_ssime_mult,
+ { "Multiplier", "alcap.ssime.mult",
+ FT_UINT8, BASE_DEC, NULL, 0x1f,
+ NULL, HFILL }
+ },
+ { &hf_alcap_ssime_max,
+ { "Max Len", "alcap.ssime.max",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+
+ { &hf_alcap_acc_level,
+ { "Congestion Level", "alcap.acc.level",
+ FT_UINT8, BASE_DEC, VALS(congestion_level), 0,
+ NULL, HFILL }
+ },
+
+ { &hf_alcap_cp,
+ { "Level", "alcap.cp.level",
+ FT_UINT8, BASE_DEC, VALS(connection_priority), 0x07,
+ NULL, HFILL }
+ },
+
+ { &hf_alcap_hc,
+ { "Codepoint", "alcap.hc.codepoint",
+ FT_UINT8, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+
+ { &hf_alcap_pfbw_br_fw,
+ { "CPS Forward Bitrate", "alcap.pfbw.bitrate.fw",
+ FT_UINT24, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pfbw_br_bw,
+ { "CPS Backwards Bitrate", "alcap.pfbw.bitrate.bw",
+ FT_UINT24, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pfbw_bucket_fw,
+ { "Forward CPS Bucket Size", "alcap.pfbw.bucket_size.fw",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pfbw_bucket_bw,
+ { "Backwards CPS Bucket Size", "alcap.pfbw.bucket_size.bw",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pfbw_size_fw,
+ { "Forward CPS Packet Size", "alcap.pfbw.max_size.fw",
+ FT_UINT8, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pfbw_size_bw,
+ { "Backwards CPS Packet Size", "alcap.pfbw.max_size.bw",
+ FT_UINT8, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+
+ { &hf_alcap_pvbws_br_fw,
+ { "Peak CPS Forward Bitrate", "alcap.pvbws.bitrate.fw",
+ FT_UINT24, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pvbws_br_bw,
+ { "Peak CPS Backwards Bitrate", "alcap.pvbws.bitrate.bw",
+ FT_UINT24, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pvbws_bucket_fw,
+ { "Peak Forward CPS Bucket Size", "alcap.pvbws.bucket_size.fw",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pvbws_bucket_bw,
+ { "Peak Backwards CPS Bucket Size", "alcap.pvbws.bucket_size.bw",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pvbws_size_fw,
+ { "Forward CPS Packet Size", "alcap.pvbws.max_size.fw",
+ FT_UINT8, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pvbws_size_bw,
+ { "Backwards CPS Packet Size", "alcap.pvbws.max_size.bw",
+ FT_UINT8, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pvbws_stt,
+ { "Source Traffic Type", "alcap.pvbws.stt",
+ FT_UINT8, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+
+ { &hf_alcap_pvbwt_peak_br_fw,
+ { "Peak CPS Forward Bitrate", "alcap.pvbwt.bitrate.fw",
+ FT_UINT24, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pvbwt_peak_br_bw,
+ { "Peak CPS Backwards Bitrate", "alcap.pvbwt.bitrate.bw",
+ FT_UINT24, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pvbwt_peak_bucket_fw,
+ { "Peak Forward CPS Bucket Size", "alcap.pvbwt.bucket_size.fw",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pvbwt_peak_bucket_bw,
+ { "Peak Backwards CPS Bucket Size", "alcap.pvbwt.bucket_size.bw",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pvbwt_sust_br_fw,
+ { "Sustainable CPS Forward Bitrate", "alcap.pvbwt.bitrate.fw",
+ FT_UINT24, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pvbwt_sust_br_bw,
+ { "Sustainable CPS Backwards Bitrate", "alcap.pvbwt.bitrate.bw",
+ FT_UINT24, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pvbwt_sust_bucket_fw,
+ { "Sustainable Forward CPS Bucket Size", "alcap.pvbwt.bucket_size.fw",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pvbwt_sust_bucket_bw,
+ { "Sustainable Backwards CPS Bucket Size", "alcap.pvbwt.bucket_size.bw",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pvbwt_size_fw,
+ { "Forward CPS Packet Size", "alcap.pvbwt.max_size.fw",
+ FT_UINT8, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_pvbwt_size_bw,
+ { "Backwards CPS Packet Size", "alcap.pvbwt.max_size.bw",
+ FT_UINT8, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+
+ { &hf_alcap_fbw_br_fw,
+ { "CPS Forward Bitrate", "alcap.fbw.bitrate.fw",
+ FT_UINT24, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_fbw_br_bw,
+ { "CPS Backwards Bitrate", "alcap.fbw.bitrate.bw",
+ FT_UINT24, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_fbw_bucket_fw,
+ { "Forward CPS Bucket Size", "alcap.fbw.bucket_size.fw",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_fbw_bucket_bw,
+ { "Backwards CPS Bucket Size", "alcap.fbw.bucket_size.bw",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_fbw_size_fw,
+ { "Forward CPS Packet Size", "alcap.fbw.max_size.fw",
+ FT_UINT8, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_fbw_size_bw,
+ { "Backwards CPS Packet Size", "alcap.fbw.max_size.bw",
+ FT_UINT8, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+
+ { &hf_alcap_vbws_br_fw,
+ { "CPS Forward Bitrate", "alcap.vbws.bitrate.fw",
+ FT_UINT24, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_vbws_br_bw,
+ { "CPS Backwards Bitrate", "alcap.vbws.bitrate.bw",
+ FT_UINT24, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_vbws_bucket_fw,
+ { "Forward CPS Bucket Size", "alcap.vbws.bucket_size.fw",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_vbws_bucket_bw,
+ { "Backwards CPS Bucket Size", "alcap.vbws.bucket_size.bw",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_vbws_size_fw,
+ { "Forward CPS Packet Size", "alcap.vbws.max_size.fw",
+ FT_UINT8, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_vbws_size_bw,
+ { "Backwards CPS Packet Size", "alcap.vbws.max_size.bw",
+ FT_UINT8, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_vbws_stt,
+ { "Source Traffic Type", "alcap.vbws.stt",
+ FT_UINT8, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+
+ { &hf_alcap_vbwt_peak_br_fw,
+ { "Peak CPS Forward Bitrate", "alcap.vbwt.bitrate.fw",
+ FT_UINT24, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_vbwt_peak_br_bw,
+ { "Peak CPS Backwards Bitrate", "alcap.vbwt.bitrate.bw",
+ FT_UINT24, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_vbwt_peak_bucket_fw,
+ { "Peak Forward CPS Bucket Size", "alcap.vbwt.bucket_size.fw",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_vbwt_peak_bucket_bw,
+ { "Peak Backwards CPS Bucket Size", "alcap.vbwt.bucket_size.bw",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_vbwt_sust_br_fw,
+ { "Sustainable CPS Forward Bitrate", "alcap.vbwt.bitrate.fw",
+ FT_UINT24, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_vbwt_sust_br_bw,
+ { "Sustainable CPS Backwards Bitrate", "alcap.vbwt.bitrate.bw",
+ FT_UINT24, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_vbwt_sust_bucket_fw,
+ { "Sustainable Forward CPS Bucket Size", "alcap.vbwt.bucket_size.fw",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_vbwt_sust_bucket_bw,
+ { "Sustainable Backwards CPS Bucket Size", "alcap.vbwt.bucket_size.bw",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_vbwt_size_fw,
+ { "Forward CPS Packet Size", "alcap.vbwt.max_size.fw",
+ FT_UINT8, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_vbwt_size_bw,
+ { "Backwards CPS Packet Size", "alcap.vbwt.max_size.bw",
+ FT_UINT8, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+
+ { &hf_alcap_leg_osaid,
+ { "Leg's ERQ OSA id", "alcap.leg.osaid",
+ FT_UINT32, BASE_HEX, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_leg_dsaid,
+ { "Leg's ECF OSA id", "alcap.leg.dsaid",
+ FT_UINT32, BASE_HEX, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_leg_pathid,
+ { "Leg's path id", "alcap.leg.pathid",
+ FT_UINT32, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_leg_cid,
+ { "Leg's channel id", "alcap.leg.cid",
+ FT_UINT32, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_leg_sugr,
+ { "Leg's SUGR", "alcap.leg.sugr",
+ FT_UINT32, BASE_HEX, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_leg_dnsea,
+ { "Leg's destination NSAP", "alcap.leg.dnsea",
+ FT_STRING, BASE_NONE, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_leg_onsea,
+ { "Leg's originating NSAP", "alcap.leg.onsea",
+ FT_STRING, BASE_NONE, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_leg_frame,
+ { "a message of this leg", "alcap.leg.msg",
+ FT_FRAMENUM, BASE_NONE, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_alcap_leg_release_cause,
+ { "Leg's cause value in REL", "alcap.leg.cause",
+ FT_UINT8, BASE_DEC, VALS(cause_values_itu), 0,
+ NULL, HFILL }
+ },
};
@@ -1784,8 +2443,8 @@ proto_register_alcap(void)
"Whether persistent call leg information is to be kept",
&keep_persistent_info);
- legs_by_dsaid = se_tree_create(EMEM_TREE_TYPE_RED_BLACK, "legs_by_dsaid");
- legs_by_osaid = se_tree_create(EMEM_TREE_TYPE_RED_BLACK, "legs_by_osaid");
+ legs_by_dsaid = se_tree_create(EMEM_TREE_TYPE_RED_BLACK, "legs_by_dsaid");
+ legs_by_osaid = se_tree_create(EMEM_TREE_TYPE_RED_BLACK, "legs_by_osaid");
legs_by_bearer = se_tree_create(EMEM_TREE_TYPE_RED_BLACK, "legs_by_bearer");
}
@@ -1793,7 +2452,7 @@ proto_register_alcap(void)
void
proto_reg_handoff_alcap(void)
{
- dissector_handle_t alcap_handle = create_dissector_handle(dissect_alcap, proto_alcap);
+ dissector_handle_t alcap_handle = find_dissector("alcap");
dissector_add_uint("mtp3.service_indicator", MTP_SI_AAL2, alcap_handle);
}
diff --git a/epan/dissectors/packet-aodv.c b/epan/dissectors/packet-aodv.c
index ce660d9beb..81ed8f5b15 100644
--- a/epan/dissectors/packet-aodv.c
+++ b/epan/dissectors/packet-aodv.c
@@ -57,10 +57,10 @@
#define UDP_PORT_AODV 654
/* Message Types */
-#define RREQ 1
-#define RREP 2
-#define RERR 3
-#define RREP_ACK 4
+#define RREQ 1
+#define RREP 2
+#define RERR 3
+#define RREP_ACK 4
#define DRAFT_01_V6_RREQ 16
#define DRAFT_01_V6_RREP 17
#define DRAFT_01_V6_RERR 18
@@ -151,7 +151,7 @@ dissect_aodv_ext(tvbuff_t * tvb, int offset, proto_tree * tree)
{
proto_tree *ext_tree;
proto_item *ti;
- guint8 type, len;
+ guint8 type, len;
if (!tree)
return;
@@ -168,7 +168,7 @@ dissect_aodv_ext(tvbuff_t * tvb, int offset, proto_tree * tree)
proto_tree_add_text(ext_tree, tvb, offset, 1,
"Type: %u (%s)", type,
- val_to_str(type, exttype_vals, "Unknown"));
+ val_to_str_const(type, exttype_vals, "Unknown"));
if (len == 0) {
proto_tree_add_text(ext_tree, tvb, offset + 1, 1,
@@ -203,19 +203,19 @@ static void
dissect_aodv_rreq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *aodv_tree,
proto_item *ti, gboolean is_ipv6)
{
- int offset = 1;
- proto_item *tj;
- proto_tree *aodv_flags_tree;
- guint8 flags;
- guint8 hop_count;
- guint32 rreq_id;
- guint32 dest_addr_v4;
- struct e_in6_addr dest_addr_v6;
- guint32 dest_seqno;
- guint32 orig_addr_v4;
- struct e_in6_addr orig_addr_v6;
- guint32 orig_seqno;
- int extlen;
+ int offset = 1;
+ proto_item *tj;
+ proto_tree *aodv_flags_tree;
+ guint8 flags;
+ guint8 hop_count;
+ guint32 rreq_id;
+ guint32 dest_addr_v4;
+ struct e_in6_addr dest_addr_v6;
+ guint32 dest_seqno;
+ guint32 orig_addr_v4;
+ struct e_in6_addr orig_addr_v6;
+ guint32 orig_seqno;
+ int extlen;
flags = tvb_get_guint8(tvb, offset);
if (aodv_tree) {
@@ -332,19 +332,19 @@ static void
dissect_aodv_rrep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *aodv_tree,
proto_item *ti, gboolean is_ipv6)
{
- int offset = 1;
- proto_item *tj;
- proto_tree *aodv_flags_tree;
- guint8 flags;
- guint8 prefix_sz;
- guint8 hop_count;
- guint32 dest_addr_v4;
- struct e_in6_addr dest_addr_v6;
- guint32 dest_seqno;
- guint32 orig_addr_v4;
- struct e_in6_addr orig_addr_v6;
- guint32 lifetime;
- int extlen;
+ int offset = 1;
+ proto_item *tj;
+ proto_tree *aodv_flags_tree;
+ guint8 flags;
+ guint8 prefix_sz;
+ guint8 hop_count;
+ guint32 dest_addr_v4;
+ struct e_in6_addr dest_addr_v6;
+ guint32 dest_seqno;
+ guint32 orig_addr_v4;
+ struct e_in6_addr orig_addr_v6;
+ guint32 lifetime;
+ int extlen;
flags = tvb_get_guint8(tvb, offset);
if (aodv_tree) {
@@ -452,13 +452,13 @@ static void
dissect_aodv_rerr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *aodv_tree,
gboolean is_ipv6)
{
- int offset = 1;
+ int offset = 1;
proto_item *tj;
proto_tree *aodv_flags_tree;
proto_tree *aodv_unreach_dest_tree;
- guint8 flags;
- guint8 dest_count;
- int i;
+ guint8 flags;
+ guint8 dest_count;
+ int i;
flags = tvb_get_guint8(tvb, offset);
if (aodv_tree) {
@@ -512,17 +512,17 @@ static void
dissect_aodv_draft_01_v6_rreq(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *aodv_tree, proto_item *ti)
{
- int offset = 1;
- proto_item *tj;
- proto_tree *aodv_flags_tree;
- guint8 flags;
- guint8 hop_count;
- guint32 rreq_id;
- guint32 dest_seqno;
- guint32 orig_seqno;
- struct e_in6_addr dest_addr_v6;
- struct e_in6_addr orig_addr_v6;
- int extlen;
+ int offset = 1;
+ proto_item *tj;
+ proto_tree *aodv_flags_tree;
+ guint8 flags;
+ guint8 hop_count;
+ guint32 rreq_id;
+ guint32 dest_seqno;
+ guint32 orig_seqno;
+ struct e_in6_addr dest_addr_v6;
+ struct e_in6_addr orig_addr_v6;
+ int extlen;
flags = tvb_get_guint8(tvb, offset);
if (aodv_tree) {
@@ -615,17 +615,17 @@ static void
dissect_aodv_draft_01_v6_rrep(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *aodv_tree, proto_item *ti)
{
- int offset = 1;
- proto_item *tj;
- proto_tree *aodv_flags_tree;
- guint8 flags;
- guint8 prefix_sz;
- guint8 hop_count;
- guint32 dest_seqno;
- struct e_in6_addr dest_addr_v6;
- struct e_in6_addr orig_addr_v6;
- guint32 lifetime;
- int extlen;
+ int offset = 1;
+ proto_item *tj;
+ proto_tree *aodv_flags_tree;
+ guint8 flags;
+ guint8 prefix_sz;
+ guint8 hop_count;
+ guint32 dest_seqno;
+ struct e_in6_addr dest_addr_v6;
+ struct e_in6_addr orig_addr_v6;
+ guint32 lifetime;
+ int extlen;
flags = tvb_get_guint8(tvb, offset);
if (aodv_tree) {
@@ -708,13 +708,13 @@ static void
dissect_aodv_draft_01_v6_rerr(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *aodv_tree)
{
- int offset = 1;
+ int offset = 1;
proto_item *tj;
proto_tree *aodv_flags_tree;
proto_tree *aodv_unreach_dest_tree;
- guint8 flags;
- guint8 dest_count;
- int i;
+ guint8 flags;
+ guint8 dest_count;
+ int i;
flags = tvb_get_guint8(tvb, offset);
if (aodv_tree) {
@@ -754,10 +754,10 @@ dissect_aodv_draft_01_v6_rerr(tvbuff_t *tvb, packet_info *pinfo,
static int
dissect_aodv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- proto_item *ti = NULL;
+ proto_item *ti = NULL;
proto_tree *aodv_tree = NULL;
- gboolean is_ipv6;
- guint8 type;
+ gboolean is_ipv6;
+ guint8 type;
/* Make entries in Protocol column and Info column on summary display */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "AODV");
diff --git a/epan/dissectors/packet-asap.c b/epan/dissectors/packet-asap.c
index 71b00650dd..bba9f5bb44 100644
--- a/epan/dissectors/packet-asap.c
+++ b/epan/dissectors/packet-asap.c
@@ -108,8 +108,8 @@ dissect_asap(tvbuff_t *, packet_info *, proto_tree *);
#define ADD_PADDING(x) ((((x) + 3) >> 2) << 2)
-#define ASAP_UDP_PORT 3863
-#define ASAP_TCP_PORT 3863
+#define ASAP_UDP_PORT 3863
+#define ASAP_TCP_PORT 3863
#define ASAP_SCTP_PORT 3863
/* Dissectors for error causes. This is common for ASAP and ENRP. */
@@ -172,7 +172,8 @@ dissect_error_cause(tvbuff_t *cause_tvb, proto_tree *parameter_tree)
length = tvb_get_ntohs(cause_tvb, CAUSE_LENGTH_OFFSET);
padding_length = tvb_length(cause_tvb) - length;
- cause_item = proto_tree_add_text(parameter_tree, cause_tvb, CAUSE_HEADER_OFFSET, tvb_length(cause_tvb), "%s", val_to_str(code, cause_code_values, "Unknown error cause"));
+ cause_item = proto_tree_add_text(parameter_tree, cause_tvb, CAUSE_HEADER_OFFSET, tvb_length(cause_tvb),
+ "%s", val_to_str_const(code, cause_code_values, "Unknown error cause"));
cause_tree = proto_item_add_subtree(cause_item, ett_asap_cause);
proto_tree_add_item(cause_tree, hf_cause_code, cause_tvb, CAUSE_CODE_OFFSET, CAUSE_CODE_LENGTH, ENC_BIG_ENDIAN);
@@ -649,7 +650,7 @@ dissect_parameter(tvbuff_t *parameter_tvb, proto_tree *asap_tree)
padding_length = tvb_length(parameter_tvb) - length;
/* create proto_tree stuff */
- parameter_item = proto_tree_add_text(asap_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb), "%s", val_to_str(type, parameter_type_values, "Unknown Parameter"));
+ parameter_item = proto_tree_add_text(asap_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb), "%s", val_to_str_const(type, parameter_type_values, "Unknown Parameter"));
parameter_tree = proto_item_add_subtree(parameter_item, ett_asap_parameter);
/* add tag and length to the asap tree */
@@ -796,16 +797,16 @@ static const true_false_string reject_bit_value = {
static void
dissect_asap_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *asap_tree)
{
- tvbuff_t *parameters_tvb;
+ tvbuff_t *parameters_tvb;
proto_item *flags_item;
proto_tree *flags_tree;
- guint8 type;
+ guint8 type;
type = tvb_get_guint8(message_tvb, MESSAGE_TYPE_OFFSET);
/* pinfo is NULL only if dissect_asap_message is called via dissect_error_cause */
if (pinfo)
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(type, message_type_values, "Unknown ASAP type"));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(type, message_type_values, "Unknown ASAP type"));
if (asap_tree) {
proto_tree_add_item(asap_tree, hf_message_type, message_tvb, MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_LENGTH, ENC_BIG_ENDIAN);
diff --git a/epan/dissectors/packet-auto_rp.c b/epan/dissectors/packet-auto_rp.c
index fa78047f5e..3cbb85e53b 100644
--- a/epan/dissectors/packet-auto_rp.c
+++ b/epan/dissectors/packet-auto_rp.c
@@ -31,7 +31,6 @@
#include <glib.h>
#include <epan/packet.h>
-#include <epan/addr_resolv.h>
static gint proto_auto_rp = -1;
static gint ett_auto_rp = -1;
@@ -119,24 +118,24 @@ static void dissect_auto_rp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ver_type = tvb_get_guint8(tvb, 0);
rp_count = tvb_get_guint8(tvb, 1);
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s (v%s) for %u RP%s",
- val_to_str(lo_nibble(ver_type), auto_rp_type_vals, "Unknown"),
- val_to_str(hi_nibble(ver_type), auto_rp_ver_vals, "Unknown"),
- rp_count, plurality(rp_count, "", "s"));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s (v%s) for %u RP%s",
+ val_to_str_const(lo_nibble(ver_type), auto_rp_type_vals, "Unknown"),
+ val_to_str_const(hi_nibble(ver_type), auto_rp_ver_vals, "Unknown"),
+ rp_count, plurality(rp_count, "", "s"));
if (tree) {
proto_item *ti, *tv;
proto_tree *auto_rp_tree, *ver_type_tree;
- int i, offset;
- guint16 holdtime;
+ int i, offset;
+ guint16 holdtime;
offset = 0;
ti = proto_tree_add_item(tree, proto_auto_rp, tvb, offset, -1, ENC_NA);
auto_rp_tree = proto_item_add_subtree(ti, ett_auto_rp);
tv = proto_tree_add_text(auto_rp_tree, tvb, offset, 1, "Version: %s, Packet type: %s",
- val_to_str(hi_nibble(ver_type), auto_rp_ver_vals, "Unknown"),
- val_to_str(lo_nibble(ver_type), auto_rp_type_vals, "Unknown"));
+ val_to_str_const(hi_nibble(ver_type), auto_rp_ver_vals, "Unknown"),
+ val_to_str_const(lo_nibble(ver_type), auto_rp_type_vals, "Unknown"));
ver_type_tree = proto_item_add_subtree(tv, ett_auto_rp_ver_type);
proto_tree_add_uint(ver_type_tree, hf_auto_rp_version, tvb, offset, 1, ver_type);
proto_tree_add_uint(ver_type_tree, hf_auto_rp_type, tvb, offset, 1, ver_type);
@@ -163,6 +162,59 @@ static void dissect_auto_rp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
return;
}
+/*
+ * Handles one Auto-RP map entry. Returns the new offset.
+ */
+static int do_auto_rp_map(tvbuff_t *tvb, int offset, proto_tree *auto_rp_tree)
+{
+ proto_item *ti;
+ proto_tree *map_tree;
+ guint8 group_count;
+ guint32 rp_addr; /* In network byte order */
+ int i;
+
+ rp_addr = tvb_get_ipv4(tvb, offset);
+ group_count = tvb_get_guint8(tvb, offset + 5);
+
+ /* sizeof map header + n * sizeof encoded group addresses */
+ ti = proto_tree_add_text(auto_rp_tree, tvb, offset, 6 + group_count * 6,
+ "RP %s: %u group%s", ip_to_str((void *)&rp_addr),
+ group_count, plurality(group_count, "", "s"));
+ map_tree = proto_item_add_subtree(ti, ett_auto_rp_map);
+
+ proto_tree_add_ipv4(map_tree, hf_auto_rp_rp_addr, tvb, offset, 4, rp_addr);
+ offset += 4;
+ proto_tree_add_uint(map_tree, hf_auto_rp_pim_ver, tvb, offset, 1, tvb_get_guint8(tvb, offset));
+ offset++;
+ proto_tree_add_text(map_tree, tvb, offset, 1, "Number of groups this RP maps to: %u", group_count);
+ offset++;
+
+ for (i = 0; i < group_count; i++) {
+ proto_item *gi;
+ proto_tree *grp_tree;
+ guint8 sign, mask_len;
+ guint32 group_addr; /* In network byte order */
+
+ sign = tvb_get_guint8(tvb, offset);
+ mask_len = tvb_get_guint8(tvb, offset + 1);
+ group_addr = tvb_get_ipv4(tvb, offset + 2);
+ gi = proto_tree_add_text(map_tree, tvb, offset, 6, "Group %s/%u (%s)",
+ ip_to_str((void *)&group_addr), mask_len,
+ val_to_str_const(sign&AUTO_RP_SIGN_MASK, auto_rp_mask_sign_vals, ""));
+ grp_tree = proto_item_add_subtree(gi, ett_auto_rp_group);
+
+ proto_tree_add_uint(grp_tree, hf_auto_rp_prefix_sgn, tvb, offset, 1, sign);
+ offset++;
+ proto_tree_add_uint(grp_tree, hf_auto_rp_mask_len, tvb, offset, 1, mask_len);
+ offset++;
+ proto_tree_add_ipv4(grp_tree, hf_auto_rp_group_prefix, tvb, offset, 4, group_addr);
+ offset += 4;
+
+ }
+
+ return offset;
+}
+
void proto_register_auto_rp(void)
{
static hf_register_info hf[] = {
@@ -220,7 +272,7 @@ void proto_register_auto_rp(void)
};
proto_auto_rp = proto_register_protocol("Cisco Auto-RP",
- "Auto-RP", "auto_rp");
+ "Auto-RP", "auto_rp");
proto_register_field_array(proto_auto_rp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
@@ -230,62 +282,9 @@ void proto_register_auto_rp(void)
void
proto_reg_handoff_auto_rp(void)
{
- dissector_handle_t auto_rp_handle;
+ dissector_handle_t auto_rp_handle;
- auto_rp_handle = create_dissector_handle(dissect_auto_rp,
- proto_auto_rp);
- dissector_add_uint("udp.port", UDP_PORT_PIM_RP_DISC, auto_rp_handle);
-}
-
-/*
- * Handles one Auto-RP map entry. Returns the new offset.
- */
-static int do_auto_rp_map(tvbuff_t *tvb, int offset, proto_tree *auto_rp_tree)
-{
- proto_item *ti;
- proto_tree *map_tree;
- guint8 group_count;
- guint32 rp_addr; /* In network byte order */
- int i;
-
- rp_addr = tvb_get_ipv4(tvb, offset);
- group_count = tvb_get_guint8(tvb, offset + 5);
-
- /* sizeof map header + n * sizeof encoded group addresses */
- ti = proto_tree_add_text(auto_rp_tree, tvb, offset, 6 + group_count * 6,
- "RP %s: %u group%s", ip_to_str((void *)&rp_addr),
- group_count, plurality(group_count, "", "s"));
- map_tree = proto_item_add_subtree(ti, ett_auto_rp_map);
-
- proto_tree_add_ipv4(map_tree, hf_auto_rp_rp_addr, tvb, offset, 4, rp_addr);
- offset += 4;
- proto_tree_add_uint(map_tree, hf_auto_rp_pim_ver, tvb, offset, 1, tvb_get_guint8(tvb, offset));
- offset++;
- proto_tree_add_text(map_tree, tvb, offset, 1, "Number of groups this RP maps to: %u", group_count);
- offset++;
-
- for (i = 0; i < group_count; i++) {
- proto_item *gi;
- proto_tree *grp_tree;
- guint8 sign, mask_len;
- guint32 group_addr; /* In network byte order */
-
- sign = tvb_get_guint8(tvb, offset);
- mask_len = tvb_get_guint8(tvb, offset + 1);
- group_addr = tvb_get_ipv4(tvb, offset + 2);
- gi = proto_tree_add_text(map_tree, tvb, offset, 6, "Group %s/%u (%s)",
- ip_to_str((void *)&group_addr), mask_len,
- val_to_str(sign&AUTO_RP_SIGN_MASK, auto_rp_mask_sign_vals, ""));
- grp_tree = proto_item_add_subtree(gi, ett_auto_rp_group);
-
- proto_tree_add_uint(grp_tree, hf_auto_rp_prefix_sgn, tvb, offset, 1, sign);
- offset++;
- proto_tree_add_uint(grp_tree, hf_auto_rp_mask_len, tvb, offset, 1, mask_len);
- offset++;
- proto_tree_add_ipv4(grp_tree, hf_auto_rp_group_prefix, tvb, offset, 4, group_addr);
- offset += 4;
-
- }
-
- return offset;
+ auto_rp_handle = create_dissector_handle(dissect_auto_rp,
+ proto_auto_rp);
+ dissector_add_uint("udp.port", UDP_PORT_PIM_RP_DISC, auto_rp_handle);
}
diff --git a/epan/dissectors/packet-babel.c b/epan/dissectors/packet-babel.c
index f937969ec9..c955a334c9 100644
--- a/epan/dissectors/packet-babel.c
+++ b/epan/dissectors/packet-babel.c
@@ -60,29 +60,29 @@ static gint ett_subtree = -1;
#define UDP_PORT_BABEL 6696
#define UDP_PORT_BABEL_OLD 6697
-#define MESSAGE_PAD1 0
-#define MESSAGE_PADN 1
-#define MESSAGE_ACK_REQ 2
-#define MESSAGE_ACK 3
-#define MESSAGE_HELLO 4
-#define MESSAGE_IHU 5
-#define MESSAGE_ROUTER_ID 6
-#define MESSAGE_NH 7
-#define MESSAGE_UPDATE 8
-#define MESSAGE_REQUEST 9
+#define MESSAGE_PAD1 0
+#define MESSAGE_PADN 1
+#define MESSAGE_ACK_REQ 2
+#define MESSAGE_ACK 3
+#define MESSAGE_HELLO 4
+#define MESSAGE_IHU 5
+#define MESSAGE_ROUTER_ID 6
+#define MESSAGE_NH 7
+#define MESSAGE_UPDATE 8
+#define MESSAGE_REQUEST 9
#define MESSAGE_MH_REQUEST 10
static const value_string messages[] = {
- { MESSAGE_PAD1, "pad1"},
- { MESSAGE_PADN, "padn"},
- { MESSAGE_ACK_REQ, "ack-req"},
- { MESSAGE_ACK, "ack"},
- { MESSAGE_HELLO, "hello"},
- { MESSAGE_IHU, "ihu"},
- { MESSAGE_ROUTER_ID, "router-id"},
- { MESSAGE_NH, "nh"},
- { MESSAGE_UPDATE, "update"},
- { MESSAGE_REQUEST, "request"},
+ { MESSAGE_PAD1, "pad1"},
+ { MESSAGE_PADN, "padn"},
+ { MESSAGE_ACK_REQ, "ack-req"},
+ { MESSAGE_ACK, "ack"},
+ { MESSAGE_HELLO, "hello"},
+ { MESSAGE_IHU, "ihu"},
+ { MESSAGE_ROUTER_ID, "router-id"},
+ { MESSAGE_NH, "nh"},
+ { MESSAGE_UPDATE, "update"},
+ { MESSAGE_REQUEST, "request"},
{ MESSAGE_MH_REQUEST, "mh-request"},
{ 0, NULL}
};
@@ -126,7 +126,7 @@ network_prefix(int ae, int plen, unsigned int omitted,
const unsigned char *p, const unsigned char *dp,
unsigned int len, unsigned char *p_r)
{
- unsigned pb;
+ unsigned pb;
unsigned char prefix[16];
if(plen >= 0)
@@ -188,10 +188,10 @@ dissect_babel(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_item *ti;
unsigned char v4_prefix[16] = {0}, v6_prefix[16] = {0};
- int i = 0;
+ int i = 0;
proto_tree *babel_tree = NULL;
- guint8 version;
- guint16 bodylen;
+ guint8 version;
+ guint16 bodylen;
if(tvb_length(tvb) < 4)
return 0;
@@ -235,13 +235,12 @@ dissect_babel(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
- val_to_str(type, messages, "unknown"));
+ val_to_str_const(type, messages, "unknown"));
ti = proto_tree_add_uint_format(babel_tree, hf_babel_message,
tvb, message, total_length, type,
"Message %s (%u)",
- val_to_str(type, messages,
- "unknown"),
+ val_to_str_const(type, messages, "unknown"),
type);
if(tree) {
@@ -274,8 +273,8 @@ dissect_babel(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(message_tree, hf_babel_message_interval,
tvb, message + 6, 2, ENC_BIG_ENDIAN);
} else if(type == MESSAGE_IHU) {
- proto_tree *subtree;
- unsigned char address[16];
+ proto_tree *subtree;
+ unsigned char address[16];
int rc =
network_address(tvb_get_guint8(tvb, message + 2),
tvb_get_ptr(tvb, message + 8, len - 6),
@@ -299,8 +298,8 @@ dissect_babel(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(message_tree, hf_babel_message_routerid,
tvb, message + 4, 8, ENC_NA);
} else if(type == MESSAGE_NH) {
- proto_tree *subtree;
- unsigned char nh[16];
+ proto_tree *subtree;
+ unsigned char nh[16];
int rc =
network_address(tvb_get_guint8(tvb, message + 2),
tvb_get_ptr(tvb, message + 4, len - 2),
@@ -316,11 +315,12 @@ dissect_babel(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(subtree, hf_babel_message_prefix,
tvb, message + 4, len - 2, ENC_NA);
} else if(type == MESSAGE_UPDATE) {
- proto_tree *subtree;
- unsigned char p[16];
- guint8 ae = tvb_get_guint8(tvb, message + 2);
- guint8 flags = tvb_get_guint8(tvb, message + 3);
- guint8 plen = tvb_get_guint8(tvb, message + 4);
+
+ proto_tree *subtree;
+ unsigned char p[16];
+ guint8 ae = tvb_get_guint8(tvb, message + 2);
+ guint8 flags = tvb_get_guint8(tvb, message + 3);
+ guint8 plen = tvb_get_guint8(tvb, message + 4);
int rc =
network_prefix(ae, plen,
tvb_get_guint8(tvb, message + 5),
@@ -357,9 +357,9 @@ dissect_babel(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(subtree, hf_babel_message_prefix,
tvb, message + 12, len - 10, ENC_NA);
} else if(type == MESSAGE_REQUEST) {
- proto_tree *subtree;
- unsigned char p[16];
- guint8 plen = tvb_get_guint8(tvb, message + 3);
+ proto_tree *subtree;
+ unsigned char p[16];
+ guint8 plen = tvb_get_guint8(tvb, message + 3);
int rc =
network_prefix(tvb_get_guint8(tvb, message + 2), plen,
0,
@@ -379,9 +379,9 @@ dissect_babel(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(subtree, hf_babel_message_prefix,
tvb, message + 4, len - 2, ENC_NA);
} else if(type == MESSAGE_MH_REQUEST) {
- proto_tree *subtree;
- unsigned char p[16];
- guint8 plen = tvb_get_guint8(tvb, message + 3);
+ proto_tree *subtree;
+ unsigned char p[16];
+ guint8 plen = tvb_get_guint8(tvb, message + 3);
int rc =
network_prefix(tvb_get_guint8(tvb, message + 2), plen,
0,
diff --git a/epan/dissectors/packet-bacapp.c b/epan/dissectors/packet-bacapp.c
index 13f59e3067..2445f38345 100644
--- a/epan/dissectors/packet-bacapp.c
+++ b/epan/dissectors/packet-bacapp.c
@@ -2223,7 +2223,7 @@ uni_to_string(char * data, gsize str_length, char *dest_buf);
/* <<<< formerly bacapp.h */
/* some hashes for segmented messages */
-static GHashTable *msg_fragment_table = NULL;
+static GHashTable *msg_fragment_table = NULL;
static GHashTable *msg_reassembled_table = NULL;
/* some necessary forward function prototypes */
@@ -2231,7 +2231,7 @@ static guint
fApplicationTypesEnumerated (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset,
const gchar *label, const value_string *vs);
-static const char *bacapp_unknown_service_str = "unknown service";
+static const char *bacapp_unknown_service_str = "unknown service"; /* Usage: no format specifiers */
static const char *ASHRAE_Reserved_Fmt = "(%d) Reserved for Use by ASHRAE";
static const char *Vendor_Proprietary_Fmt = "(%d) Vendor Proprietary Value";
@@ -6884,8 +6884,10 @@ fVendorIdentifier (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint of
tag_len = fTagHeader (tvb, pinfo, offset, &tag_no, &tag_info, &lvt);
if (fUnsigned32 (tvb, offset + tag_len, lvt, &val))
ti = proto_tree_add_text(tree, tvb, offset, lvt+tag_len,
- "%s: %s (%u)", label,
- val_to_str(val,BACnetVendorIdentifiers,"Unknown Vendor"), val);
+ "%s: %s (%u)",
+ label,
+ val_to_str_const(val,BACnetVendorIdentifiers,"Unknown Vendor"),
+ val);
else
ti = proto_tree_add_text(tree, tvb, offset, lvt+tag_len,
"%s - %u octets (Unsigned)", label, lvt);
@@ -6921,7 +6923,7 @@ fRestartReason (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offse
if (fUnsigned32 (tvb, offset + tag_len, lvt, &val))
ti = proto_tree_add_text(tree, tvb, offset, lvt+tag_len,
"%s: %s (%u)", label,
- val_to_str(val,BACnetRestartReason,"Unknown reason"), val);
+ val_to_str_const(val,BACnetRestartReason,"Unknown reason"), val);
else
ti = proto_tree_add_text(tree, tvb, offset, lvt+tag_len,
"%s - %u octets (Unsigned)", label, lvt);
@@ -7311,7 +7313,7 @@ fNotificationParameters (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu
fTagHeader (tvb, pinfo, offset, &tag_no, &tag_info, &lvt);
tt = proto_tree_add_text(subtree, tvb, offset, 0, "notification parameters (%d) %s",
- tag_no, val_to_str(tag_no, BACnetEventType, "invalid type"));
+ tag_no, val_to_str_const(tag_no, BACnetEventType, "invalid type"));
subtree = proto_item_add_subtree(tt, ett_bacapp_value);
/* Opening tag for parameter choice */
offset += fTagHeaderTree(tvb, pinfo, subtree, offset, &tag_no, &tag_info, &lvt);
@@ -7619,7 +7621,7 @@ fEventParameter (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offs
fTagHeader (tvb, pinfo, offset, &tag_no, &tag_info, &lvt);
tt = proto_tree_add_text(subtree, tvb, offset, 0, "event parameters (%d) %s",
- tag_no, val_to_str(tag_no, BACnetEventType, "invalid type"));
+ tag_no, val_to_str_const(tag_no, BACnetEventType, "invalid type"));
subtree = proto_item_add_subtree(tt, ett_bacapp_value);
/* Opening tag for parameter choice */
offset += fTagHeaderTree(tvb, pinfo, subtree, offset, &tag_no, &tag_info, &lvt);
@@ -9345,7 +9347,7 @@ fReadRangeRequest (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint of
/* optional range choice */
fTagHeader (tvb, pinfo, offset, &tag_no, &tag_info, &lvt);
if (tag_is_opening(tag_info)) {
- tt = proto_tree_add_text(subtree, tvb, offset, 1, "%s", val_to_str(tag_no, BACnetReadRangeOptions, "unknown range option"));
+ tt = proto_tree_add_text(subtree, tvb, offset, 1, "%s", val_to_str_const(tag_no, BACnetReadRangeOptions, "unknown range option"));
subtree = proto_item_add_subtree(tt, ett_bacapp_value);
offset += fTagHeaderTree (tvb, pinfo, subtree, offset, &tag_no, &tag_info, &lvt);
switch (tag_no) {
@@ -9421,11 +9423,11 @@ fAccessMethod(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset)
fTagHeader (tvb, pinfo, offset, &tag_no, &tag_info, &lvt);
if (tag_is_opening(tag_info)) {
- tt = proto_tree_add_text(tree, tvb, offset, 1, "%s", val_to_str(tag_no, BACnetFileAccessOption, "invalid access method"));
+ tt = proto_tree_add_text(tree, tvb, offset, 1, "%s", val_to_str_const(tag_no, BACnetFileAccessOption, "invalid access method"));
subtree = proto_item_add_subtree(tt, ett_bacapp_value);
offset += fTagHeaderTree (tvb, pinfo, subtree, offset, &tag_no, &tag_info, &lvt);
- offset = fApplicationTypes (tvb, pinfo, subtree, offset, val_to_str(tag_no, BACnetFileStartOption, "invalid option"));
- offset = fApplicationTypes (tvb, pinfo, subtree, offset, val_to_str(tag_no, BACnetFileWriteInfo, "unknown option"));
+ offset = fApplicationTypes (tvb, pinfo, subtree, offset, val_to_str_const(tag_no, BACnetFileStartOption, "invalid option"));
+ offset = fApplicationTypes (tvb, pinfo, subtree, offset, val_to_str_const(tag_no, BACnetFileWriteInfo, "unknown option"));
if (tag_no == 1) {
while ((tvb_reported_length_remaining(tvb, offset) > 0)&&(offset>lastoffset)) {
@@ -9459,11 +9461,11 @@ fAtomicReadFileRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guin
fTagHeader (tvb, pinfo, offset, &tag_no, &tag_info, &lvt);
if (tag_is_opening(tag_info)) {
- tt = proto_tree_add_text(subtree, tvb, offset, 1, "%s", val_to_str(tag_no, BACnetFileAccessOption, "unknown access method"));
+ tt = proto_tree_add_text(subtree, tvb, offset, 1, "%s", val_to_str_const(tag_no, BACnetFileAccessOption, "unknown access method"));
subtree = proto_item_add_subtree(tt, ett_bacapp_value);
offset += fTagHeaderTree (tvb, pinfo, subtree, offset, &tag_no, &tag_info, &lvt);
- offset = fSignedTag (tvb, pinfo, subtree, offset, val_to_str(tag_no, BACnetFileStartOption, "unknown option"));
- offset = fUnsignedTag (tvb, pinfo, subtree, offset, val_to_str(tag_no, BACnetFileRequestCount, "unknown option"));
+ offset = fSignedTag (tvb, pinfo, subtree, offset, val_to_str_const(tag_no, BACnetFileStartOption, "unknown option"));
+ offset = fUnsignedTag (tvb, pinfo, subtree, offset, val_to_str_const(tag_no, BACnetFileRequestCount, "unknown option"));
offset += fTagHeaderTree (tvb, pinfo, subtree, offset, &tag_no, &tag_info, &lvt);
}
return offset;
@@ -9483,7 +9485,7 @@ static guint
fAtomicWriteFileAck (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset)
{
guint tag_no = fTagNo(tvb, offset);
- return fSignedTag (tvb, pinfo, tree, offset, val_to_str(tag_no, BACnetFileStartOption, "unknown option"));
+ return fSignedTag (tvb, pinfo, tree, offset, val_to_str_const(tag_no, BACnetFileStartOption, "unknown option"));
}
static guint
@@ -10235,7 +10237,7 @@ dissect_bacapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* show some descriptive text in the INFO column */
col_add_fstr(pinfo->cinfo, COL_INFO, "%-16s",
- val_to_str(bacapp_type, BACnetTypeName, "# unknown APDU #"));
+ val_to_str_const(bacapp_type, BACnetTypeName, "# unknown APDU #"));
bacinfo.service_type = NULL;
bacinfo.invoke_id = NULL;
@@ -10259,47 +10261,49 @@ dissect_bacapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
bacapp_service = tvb_get_guint8(tvb, offset + 3);
}
col_append_fstr(pinfo->cinfo, COL_INFO, "%s[%3u] ",
- val_to_str(bacapp_service,
- BACnetConfirmedServiceChoice,
- bacapp_unknown_service_str),bacapp_invoke_id);
+ val_to_str_const(bacapp_service,
+ BACnetConfirmedServiceChoice,
+ bacapp_unknown_service_str),
+ bacapp_invoke_id);
updateBacnetInfoValue(BACINFO_INVOKEID,
ep_strdup_printf("Invoke ID: %d", bacapp_invoke_id));
updateBacnetInfoValue(BACINFO_SERVICE,
- ep_strconcat(val_to_str(bacapp_service,
- BACnetConfirmedServiceChoice,
- bacapp_unknown_service_str),
+ ep_strconcat(val_to_str_const(bacapp_service,
+ BACnetConfirmedServiceChoice,
+ bacapp_unknown_service_str),
confsreqstr, NULL));
break;
case BACAPP_TYPE_UNCONFIRMED_SERVICE_REQUEST:
bacapp_service = tvb_get_guint8(tvb, offset + 1);
col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",
- val_to_str(bacapp_service,
- BACnetUnconfirmedServiceChoice,
- bacapp_unknown_service_str));
+ val_to_str_const(bacapp_service,
+ BACnetUnconfirmedServiceChoice,
+ bacapp_unknown_service_str));
updateBacnetInfoValue(BACINFO_SERVICE,
- ep_strconcat(val_to_str(bacapp_service,
- BACnetUnconfirmedServiceChoice,
- bacapp_unknown_service_str),
+ ep_strconcat(val_to_str_const(bacapp_service,
+ BACnetUnconfirmedServiceChoice,
+ bacapp_unknown_service_str),
uconfsreqstr, NULL));
break;
case BACAPP_TYPE_SIMPLE_ACK:
bacapp_invoke_id = tvb_get_guint8(tvb, offset + 1);
bacapp_service = tvb_get_guint8(tvb, offset + 2);
col_append_fstr(pinfo->cinfo, COL_INFO, "%s[%3u] ", /* "original-invokeID" replaced */
- val_to_str(bacapp_service,
- BACnetConfirmedServiceChoice,
- bacapp_unknown_service_str), bacapp_invoke_id);
+ val_to_str_const(bacapp_service,
+ BACnetConfirmedServiceChoice,
+ bacapp_unknown_service_str),
+ bacapp_invoke_id);
updateBacnetInfoValue(BACINFO_INVOKEID,
ep_strdup_printf("Invoke ID: %d", bacapp_invoke_id));
updateBacnetInfoValue(BACINFO_SERVICE,
- ep_strconcat(val_to_str(bacapp_service,
- BACnetConfirmedServiceChoice,
- bacapp_unknown_service_str),
+ ep_strconcat(val_to_str_const(bacapp_service,
+ BACnetConfirmedServiceChoice,
+ bacapp_unknown_service_str),
sackstr, NULL));
break;
case BACAPP_TYPE_COMPLEX_ACK:
@@ -10318,17 +10322,18 @@ dissect_bacapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
bacapp_service = tvb_get_guint8(tvb, offset + 2);
}
col_append_fstr(pinfo->cinfo, COL_INFO, "%s[%3u] ", /* "original-invokeID" replaced */
- val_to_str(bacapp_service,
- BACnetConfirmedServiceChoice,
- bacapp_unknown_service_str), bacapp_invoke_id);
+ val_to_str_const(bacapp_service,
+ BACnetConfirmedServiceChoice,
+ bacapp_unknown_service_str),
+ bacapp_invoke_id);
updateBacnetInfoValue(BACINFO_INVOKEID,
ep_strdup_printf("Invoke ID: %d", bacapp_invoke_id));
updateBacnetInfoValue(BACINFO_SERVICE,
- ep_strconcat(val_to_str(bacapp_service,
- BACnetConfirmedServiceChoice,
- bacapp_unknown_service_str),
+ ep_strconcat(val_to_str_const(bacapp_service,
+ BACnetConfirmedServiceChoice,
+ bacapp_unknown_service_str),
cackstr, NULL));
break;
case BACAPP_TYPE_SEGMENT_ACK:
@@ -10338,18 +10343,19 @@ dissect_bacapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
bacapp_invoke_id = tvb_get_guint8(tvb, offset + 1);
bacapp_service = tvb_get_guint8(tvb, offset + 2);
col_append_fstr(pinfo->cinfo, COL_INFO, "%s[%3u] ", /* "original-invokeID" replaced */
- val_to_str(bacapp_service,
- BACnetConfirmedServiceChoice,
- bacapp_unknown_service_str), bacapp_invoke_id);
+ val_to_str_const(bacapp_service,
+ BACnetConfirmedServiceChoice,
+ bacapp_unknown_service_str),
+ bacapp_invoke_id);
updateBacnetInfoValue(BACINFO_INVOKEID,
ep_strdup_printf("Invoke ID: %d", bacapp_invoke_id));
updateBacnetInfoValue(BACINFO_SERVICE,
ep_strconcat(errstr,
- val_to_str(bacapp_service,
- BACnetConfirmedServiceChoice,
- bacapp_unknown_service_str),
+ val_to_str_const(bacapp_service,
+ BACnetConfirmedServiceChoice,
+ bacapp_unknown_service_str),
NULL));
break;
case BACAPP_TYPE_REJECT:
diff --git a/epan/dissectors/packet-ber.c b/epan/dissectors/packet-ber.c
index b77b59d185..55fcf2beff 100644
--- a/epan/dissectors/packet-ber.c
+++ b/epan/dissectors/packet-ber.c
@@ -62,10 +62,6 @@
#endif
#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
#include <glib.h>
@@ -85,6 +81,7 @@
* Set a limit on recursion so we don't blow away the stack. Another approach
* would be to remove recursion completely but then we'd exhaust CPU+memory
* trying to read a hellabyte of nested indefinite lengths.
+
* XXX - Max nesting in the ASN.1 plugin is 32. Should they match?
*/
#define BER_MAX_NESTING 500
@@ -540,8 +537,13 @@ int dissect_ber_tagged_type(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree
if ((tmp_cls != tag_cls) || (tmp_tag != tag_tag)) {
cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, tmp_len, "wrong_tag",
"BER Error: Wrong tag in tagged type - expected class:%s(%d) tag:%d (%s) but found class:%s(%d) tag:%d",
- val_to_str(tag_cls, ber_class_codes, "Unknown"), tag_cls, tag_tag, val_to_str_ext(tag_tag, &ber_uni_tag_codes_ext,"Unknown"),
- val_to_str(tmp_cls, ber_class_codes, "Unknown"), tmp_cls, tmp_tag);
+ val_to_str_const(tag_cls, ber_class_codes, "Unknown"),
+ tag_cls,
+ tag_tag,
+ val_to_str_ext_const(tag_tag, &ber_uni_tag_codes_ext, "Unknown"),
+ val_to_str_const(tmp_cls, ber_class_codes, "Unknown"),
+ tmp_cls,
+ tmp_tag);
expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "BER Error: Wrong tag in tagged type");
}
@@ -829,7 +831,7 @@ try_dissect_unknown_ber(packet_info *pinfo, tvbuff_t *tvb, volatile int offset,
/* we can't dissect this directly as it is specific */
pi = proto_tree_add_none_format(tree, hf_ber_unknown_BER_primitive, tvb, offset, len,
- "[%s %d] ", val_to_str(ber_class,ber_class_codes,"Unknown"), tag);
+ "[%s %d] ", val_to_str_const(ber_class,ber_class_codes,"Unknown"), tag);
is_decoded_as = FALSE;
if (decode_primitive_as_ber && len >= 2) {
@@ -890,7 +892,7 @@ try_dissect_unknown_ber(packet_info *pinfo, tvbuff_t *tvb, volatile int offset,
switch(ber_class) {
case BER_CLASS_UNI:
- item=proto_tree_add_text(tree, tvb, offset, len, "%s", val_to_str_ext(tag,&ber_uni_tag_codes_ext,"Unknown"));
+ item=proto_tree_add_text(tree, tvb, offset, len, "%s", val_to_str_ext_const(tag,&ber_uni_tag_codes_ext,"Unknown"));
if(item){
next_tree=proto_item_add_subtree(item, ett_ber_SEQUENCE);
}
@@ -901,7 +903,7 @@ try_dissect_unknown_ber(packet_info *pinfo, tvbuff_t *tvb, volatile int offset,
case BER_CLASS_CON:
case BER_CLASS_PRI:
default:
- item=proto_tree_add_text(tree, tvb, offset, len, "[%s %d]", val_to_str(ber_class,ber_class_codes,"Unknown"), tag);
+ item=proto_tree_add_text(tree, tvb, offset, len, "[%s %d]", val_to_str_const(ber_class,ber_class_codes,"Unknown"), tag);
if(item){
next_tree=proto_item_add_subtree(item, ett_ber_SEQUENCE);
}
@@ -1398,7 +1400,7 @@ printf("OCTET STRING dissect_ber_octet_string(%s) entered\n",name);
if( (ber_class!=BER_CLASS_UNI)
||((tag<BER_UNI_TAG_NumericString)&&(tag!=BER_UNI_TAG_OCTETSTRING)&&(tag!=BER_UNI_TAG_UTF8String)) ){
tvb_ensure_bytes_exist(tvb, hoffset, 2);
- cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, len, "octetstring_expected", "BER Error: OctetString expected but class:%s(%d) %s tag:%d was unexpected", val_to_str(ber_class,ber_class_codes,"Unknown"), ber_class, pc ? ber_pc_codes_short.true_string : ber_pc_codes_short.false_string, tag);
+ cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, len, "octetstring_expected", "BER Error: OctetString expected but class:%s(%d) %s tag:%d was unexpected", val_to_str_const(ber_class,ber_class_codes,"Unknown"), ber_class, pc ? ber_pc_codes_short.true_string : ber_pc_codes_short.false_string, tag);
expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "BER Error: OctetString expected");
if (decode_unexpected) {
proto_tree *unknown_tree = proto_item_add_subtree(cause, ett_ber_unknown);
@@ -1523,7 +1525,7 @@ dissect_ber_null(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, tvbu
offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &ber_class, &pc, &tag);
if((pc) ||
(!implicit_tag && ((ber_class != BER_CLASS_UNI) || (tag != BER_UNI_TAG_NULL)))) {
- cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset_old, offset - offset_old, "null_expected", "BER Error: NULL expected but class:%s(%d) %s tag:%d was unexpected", val_to_str(ber_class,ber_class_codes,"Unknown"), ber_class, pc ? ber_pc_codes_short.true_string : ber_pc_codes_short.false_string, tag);
+ cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset_old, offset - offset_old, "null_expected", "BER Error: NULL expected but class:%s(%d) %s tag:%d was unexpected", val_to_str_const(ber_class,ber_class_codes,"Unknown"), ber_class, pc ? ber_pc_codes_short.true_string : ber_pc_codes_short.false_string, tag);
expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "BER Error: NULL expected");
}
@@ -1857,7 +1859,7 @@ printf("SEQUENCE dissect_ber_sequence(%s) entered\n",name);
||(!implicit_tag&&((classx!=BER_CLASS_UNI)
||(tagx!=BER_UNI_TAG_SEQUENCE)))) {
tvb_ensure_bytes_exist(tvb, hoffset, 2);
- cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, lenx, "sequence_expected", "BER Error: Sequence expected but class:%s(%d) %s tag:%d was unexpected", val_to_str(classx,ber_class_codes,"Unknown"), classx, pcx ? ber_pc_codes_short.true_string : ber_pc_codes_short.false_string, tagx);
+ cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, lenx, "sequence_expected", "BER Error: Sequence expected but class:%s(%d) %s tag:%d was unexpected", val_to_str_const(classx,ber_class_codes,"Unknown"), classx, pcx ? ber_pc_codes_short.true_string : ber_pc_codes_short.false_string, tagx);
expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "BER Error: Sequence expected");
if (decode_unexpected) {
proto_tree *unknown_tree = proto_item_add_subtree(cause, ett_ber_unknown);
@@ -1948,15 +1950,15 @@ ber_sequence_try_again:
if( seq->ber_class == BER_CLASS_UNI){
cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, len, "wrong_field",
"BER Error: Wrong field in SEQUENCE expected class:%s(%d) tag:%d (%s) but found class:%s(%d) tag:%d",
- val_to_str(seq->ber_class,ber_class_codes,"Unknown"),seq->ber_class,
- seq->tag,val_to_str_ext(seq->tag,&ber_uni_tag_codes_ext,"Unknown"),
- val_to_str(ber_class,ber_class_codes,"Unknown"),ber_class,tag);
+ val_to_str_const(seq->ber_class,ber_class_codes,"Unknown"),seq->ber_class,
+ seq->tag,val_to_str_ext_const(seq->tag,&ber_uni_tag_codes_ext,"Unknown"),
+ val_to_str_const(ber_class,ber_class_codes,"Unknown"),ber_class,tag);
expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "BER Error: Wrong field in SEQUENCE");
}else{
cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, len, "wrong_field",
"BER Error: Wrong field in SEQUENCE expected class:%s(%d) tag:%d but found class:%s(%d) tag:%d",
- val_to_str(seq->ber_class,ber_class_codes,"Unknown"),seq->ber_class,
- seq->tag,val_to_str(ber_class,ber_class_codes,"Unknown"),ber_class,tag);
+ val_to_str_const(seq->ber_class,ber_class_codes,"Unknown"),seq->ber_class,
+ seq->tag,val_to_str_const(ber_class,ber_class_codes,"Unknown"),ber_class,tag);
expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "BER Error: Wrong field in SEQUENCE");
}
if (decode_unexpected) {
@@ -1983,10 +1985,10 @@ ber_sequence_try_again:
offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, NULL, NULL);
if( seq->ber_class == BER_CLASS_UNI){
cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, len, "wrong_field", "BER Error: Wrong field in sequence expected class:%s(%d) tag:%d(%s) but found class:%s(%d) tag:%d",
- val_to_str(seq->ber_class,ber_class_codes,"Unknown"),seq->ber_class,seq->tag,val_to_str_ext(seq->tag,&ber_uni_tag_codes_ext,"Unknown"),val_to_str(ber_class,ber_class_codes,"Unknown"),ber_class,tag);
+ val_to_str_const(seq->ber_class,ber_class_codes,"Unknown"),seq->ber_class,seq->tag,val_to_str_ext_const(seq->tag,&ber_uni_tag_codes_ext,"Unknown"),val_to_str_const(ber_class,ber_class_codes,"Unknown"),ber_class,tag);
expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "BER Error: Wrong field in sequence");
}else{
- cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, len, "wrong_field", "BER Error: Wrong field in sequence expected class:%s(%d) tag:%d but found class:%s(%d) tag:%d",val_to_str(seq->ber_class,ber_class_codes,"Unknown"),seq->ber_class,seq->tag,val_to_str(ber_class,ber_class_codes,"Unknown"),ber_class,tag);
+ cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, len, "wrong_field", "BER Error: Wrong field in sequence expected class:%s(%d) tag:%d but found class:%s(%d) tag:%d",val_to_str_const(seq->ber_class,ber_class_codes,"Unknown"),seq->ber_class,seq->tag,val_to_str_const(ber_class,ber_class_codes,"Unknown"),ber_class,tag);
expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "BER Error: Wrong field in sequence");
}
if (decode_unexpected) {
@@ -2181,7 +2183,7 @@ printf("SEQUENCE dissect_ber_old_sequence(%s) entered\n",name);
||(!implicit_tag&&((classx!=BER_CLASS_UNI)
||(tagx!=BER_UNI_TAG_SEQUENCE)))) {
tvb_ensure_bytes_exist(tvb, hoffset, 2);
- cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, lenx, "sequence_expected", "BER Error: Sequence expected but class:%s(%d) %s tag:%d was unexpected", val_to_str(classx,ber_class_codes,"Unknown"), classx, pcx ? ber_pc_codes_short.true_string : ber_pc_codes_short.false_string, tagx);
+ cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, lenx, "sequence_expected", "BER Error: Sequence expected but class:%s(%d) %s tag:%d was unexpected", val_to_str_const(classx,ber_class_codes,"Unknown"), classx, pcx ? ber_pc_codes_short.true_string : ber_pc_codes_short.false_string, tagx);
expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "BER Error: Sequence expected");
if (decode_unexpected) {
proto_tree *unknown_tree = proto_item_add_subtree(cause, ett_ber_unknown);
@@ -2272,15 +2274,15 @@ ber_old_sequence_try_again:
if( seq->ber_class == BER_CLASS_UNI){
cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, len, "wrong_field",
"BER Error: Wrong field in SEQUENCE expected class:%s(%d) tag:%d (%s) but found class:%s(%d) tag:%d",
- val_to_str(seq->ber_class,ber_class_codes,"Unknown"),seq->ber_class,
- seq->tag,val_to_str_ext(seq->tag,&ber_uni_tag_codes_ext,"Unknown"),
- val_to_str(ber_class,ber_class_codes,"Unknown"),ber_class,tag);
+ val_to_str_const(seq->ber_class,ber_class_codes,"Unknown"),seq->ber_class,
+ seq->tag,val_to_str_ext_const(seq->tag,&ber_uni_tag_codes_ext,"Unknown"),
+ val_to_str_const(ber_class,ber_class_codes,"Unknown"),ber_class,tag);
expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "BER Error: Wrong field in SEQUENCE");
}else{
cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, len, "wrong_field"
"BER Error: Wrong field in SEQUENCE expected class:%s(%d) tag:%d but found class:%s(%d) tag:%d",
- val_to_str(seq->ber_class,ber_class_codes,"Unknown"),seq->ber_class,
- seq->tag,val_to_str(ber_class,ber_class_codes,"Unknown"),ber_class,tag);
+ val_to_str_const(seq->ber_class,ber_class_codes,"Unknown"),seq->ber_class,
+ seq->tag,val_to_str_const(ber_class,ber_class_codes,"Unknown"),ber_class,tag);
expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "BER Error: Wrong field in SEQUENCE");
}
if (decode_unexpected) {
@@ -2307,10 +2309,10 @@ ber_old_sequence_try_again:
offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, NULL, NULL);
if( seq->ber_class == BER_CLASS_UNI){
cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, len, "wrong_field", "BER Error: Wrong field in sequence expected class:%s(%d) tag:%d(%s) but found class:%s(%d) tag:%d",
- val_to_str(seq->ber_class,ber_class_codes,"Unknown"),seq->ber_class,seq->tag,val_to_str_ext(seq->tag,&ber_uni_tag_codes_ext,"Unknown"),val_to_str(ber_class,ber_class_codes,"Unknown"),ber_class,tag);
+ val_to_str_const(seq->ber_class,ber_class_codes,"Unknown"),seq->ber_class,seq->tag,val_to_str_ext_const(seq->tag,&ber_uni_tag_codes_ext,"Unknown"),val_to_str_const(ber_class,ber_class_codes,"Unknown"),ber_class,tag);
expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "BER Error: Wrong field in sequence");
}else{
- cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, len, "wrong_field", "BER Error: Wrong field in sequence expected class:%s(%d) tag:%d but found class:%s(%d) tag:%d",val_to_str(seq->ber_class,ber_class_codes,"Unknown"),seq->ber_class,seq->tag,val_to_str(ber_class,ber_class_codes,"Unknown"),ber_class,tag);
+ cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, len, "wrong_field", "BER Error: Wrong field in sequence expected class:%s(%d) tag:%d but found class:%s(%d) tag:%d",val_to_str_const(seq->ber_class,ber_class_codes,"Unknown"),seq->ber_class,seq->tag,val_to_str_const(ber_class,ber_class_codes,"Unknown"),ber_class,tag);
expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "BER Error: Wrong field in sequence");
}
if (decode_unexpected) {
@@ -2491,7 +2493,7 @@ printf("SET dissect_ber_set(%s) entered\n",name);
||(!implicit_tag&&((classx!=BER_CLASS_UNI)
||(tagx!=BER_UNI_TAG_SET)))) {
tvb_ensure_bytes_exist(tvb, hoffset, 2);
- cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, lenx, "set_expected", "BER Error: SET expected but class:%s(%d) %s tag:%d was found", val_to_str(classx,ber_class_codes,"Unknown"), classx, pcx ? ber_pc_codes_short.true_string : ber_pc_codes_short.false_string, tagx);
+ cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, lenx, "set_expected", "BER Error: SET expected but class:%s(%d) %s tag:%d was found", val_to_str_const(classx,ber_class_codes,"Unknown"), classx, pcx ? ber_pc_codes_short.true_string : ber_pc_codes_short.false_string, tagx);
expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "BER Error: SET expected");
if (decode_unexpected) {
proto_tree *unknown_tree = proto_item_add_subtree(cause, ett_ber_unknown);
@@ -2648,7 +2650,7 @@ printf("SET dissect_ber_set(%s) calling subdissector\n",name);
if(!cset->func) {
/* we didn't find a match */
- cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, len, "unknown_field", "BER Error: Unknown field in SET class:%s(%d) tag:%d",val_to_str(ber_class,ber_class_codes,"Unknown"),ber_class,tag);
+ cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, len, "unknown_field", "BER Error: Unknown field in SET class:%s(%d) tag:%d",val_to_str_const(ber_class,ber_class_codes,"Unknown"),ber_class,tag);
expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "BER Error: Unknown field in SET");
if (decode_unexpected) {
proto_tree *unknown_tree = proto_item_add_subtree(cause, ett_ber_unknown);
@@ -2669,7 +2671,7 @@ printf("SET dissect_ber_set(%s) calling subdissector\n",name);
/* here is something we should have seen - but didn't! */
cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, lenx, "missing_field",
"BER Error: Missing field in SET class:%s(%d) tag:%d expected",
- val_to_str(cset->ber_class,ber_class_codes,"Unknown"),cset->ber_class,
+ val_to_str_const(cset->ber_class,ber_class_codes,"Unknown"),cset->ber_class,
cset->tag);
expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "BER Error: Missing field in SET");
@@ -2753,7 +2755,7 @@ printf("SET dissect_old_ber_set(%s) entered\n",name);
||(!implicit_tag&&((classx!=BER_CLASS_UNI)
||(tagx!=BER_UNI_TAG_SET)))) {
tvb_ensure_bytes_exist(tvb, hoffset, 2);
- cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, lenx, "set_expected", "BER Error: SET expected but class:%s(%d) %s tag:%d was found", val_to_str(classx,ber_class_codes,"Unknown"), classx, pcx ? ber_pc_codes_short.true_string : ber_pc_codes_short.false_string, tagx);
+ cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, lenx, "set_expected", "BER Error: SET expected but class:%s(%d) %s tag:%d was found", val_to_str_const(classx,ber_class_codes,"Unknown"), classx, pcx ? ber_pc_codes_short.true_string : ber_pc_codes_short.false_string, tagx);
expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "BER Error: SET expected");
if (decode_unexpected) {
proto_tree *unknown_tree = proto_item_add_subtree(cause, ett_ber_unknown);
@@ -2907,7 +2909,7 @@ printf("SET dissect_old_ber_set(%s) calling subdissector\n",name);
if(!cset->func) {
/* we didn't find a match */
- cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, len, "unknown_field", "BER Error: Unknown field in SET class:%s(%d) tag:%d",val_to_str(ber_class,ber_class_codes,"Unknown"),ber_class,tag);
+ cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, len, "unknown_field", "BER Error: Unknown field in SET class:%s(%d) tag:%d",val_to_str_const(ber_class,ber_class_codes,"Unknown"),ber_class,tag);
expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "BER Error: Unknown field in SET");
if (decode_unexpected) {
proto_tree *unknown_tree = proto_item_add_subtree(cause, ett_ber_unknown);
@@ -2928,7 +2930,7 @@ printf("SET dissect_old_ber_set(%s) calling subdissector\n",name);
/* here is something we should have seen - but didn't! */
cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, lenx, "missing_field",
"BER Error: Missing field in SET class:%s(%d) tag:%d expected",
- val_to_str(cset->ber_class,ber_class_codes,"Unknown"),cset->ber_class,
+ val_to_str_const(cset->ber_class,ber_class_codes,"Unknown"),cset->ber_class,
cset->tag);
expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "BER Error: Missing field in SET");
@@ -3457,7 +3459,7 @@ dissect_ber_GeneralString(asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int
if( (ber_class!=BER_CLASS_UNI)
||(tag!=BER_UNI_TAG_GENSTR) ){
tvb_ensure_bytes_exist(tvb, hoffset, 2);
- cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, len, "generalstring_expected", "BER Error: GeneralString expected but class:%s(%d) %s tag:%d was unexpected", val_to_str(ber_class,ber_class_codes,"Unknown"), ber_class, pc ? ber_pc_codes_short.true_string : ber_pc_codes_short.false_string, tag);
+ cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, len, "generalstring_expected", "BER Error: GeneralString expected but class:%s(%d) %s tag:%d was unexpected", val_to_str_const(ber_class,ber_class_codes,"Unknown"), ber_class, pc ? ber_pc_codes_short.true_string : ber_pc_codes_short.false_string, tag);
expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "BER Error: GeneralString expected");
if (decode_unexpected) {
proto_tree *unknown_tree = proto_item_add_subtree(cause, ett_ber_unknown);
@@ -3517,7 +3519,7 @@ printf("RESTRICTED STRING dissect_ber_octet_string(%s) entered\n",name);
if( (ber_class!=BER_CLASS_UNI)
||(tag != type) ){
tvb_ensure_bytes_exist(tvb, hoffset, 2);
- cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, len, "string_expected", "BER Error: String with tag=%d expected but class:%s(%d) %s tag:%d was unexpected", type, val_to_str(ber_class,ber_class_codes,"Unknown"), ber_class, pc ? ber_pc_codes_short.true_string : ber_pc_codes_short.false_string, tag);
+ cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, len, "string_expected", "BER Error: String with tag=%d expected but class:%s(%d) %s tag:%d was unexpected", type, val_to_str_const(ber_class,ber_class_codes,"Unknown"), ber_class, pc ? ber_pc_codes_short.true_string : ber_pc_codes_short.false_string, tag);
expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "BER Error: String expected");
if (decode_unexpected) {
proto_tree *unknown_tree = proto_item_add_subtree(cause, ett_ber_unknown);
@@ -3607,7 +3609,7 @@ printf("OBJECT IDENTIFIER dissect_ber_object_identifier(%s) entered\n",name);
if( (ber_class!=BER_CLASS_UNI)
||(tag != BER_UNI_TAG_OID) ){
tvb_ensure_bytes_exist(tvb, hoffset, 2);
- cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, len, "oid_expected", "BER Error: Object Identifier expected but class:%s(%d) %s tag:%d was unexpected", val_to_str(ber_class,ber_class_codes,"Unknown"), ber_class, pc ? ber_pc_codes_short.true_string : ber_pc_codes_short.false_string, tag);
+ cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, len, "oid_expected", "BER Error: Object Identifier expected but class:%s(%d) %s tag:%d was unexpected", val_to_str_const(ber_class,ber_class_codes,"Unknown"), ber_class, pc ? ber_pc_codes_short.true_string : ber_pc_codes_short.false_string, tag);
expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "BER Error: Object Identifier expected");
if (decode_unexpected) {
proto_tree *unknown_tree = proto_item_add_subtree(cause, ett_ber_unknown);
@@ -3719,7 +3721,7 @@ printf("SQ OF dissect_ber_sq_of(%s) entered\n",name);
||(tagx!=type)))) {
tvb_ensure_bytes_exist(tvb, hoffsetx, 2);
causex = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, lenx, (type==BER_UNI_TAG_SEQUENCE)?"set_of_expected":"sequence_of_expected", "BER Error: %s Of expected but class:%s(%d) %s tag:%d was unexpected",
- (type==BER_UNI_TAG_SEQUENCE)?"Set":"Sequence", val_to_str(classx,ber_class_codes,"Unknown"), classx, pcx ? ber_pc_codes_short.true_string : ber_pc_codes_short.false_string, tagx);
+ (type==BER_UNI_TAG_SEQUENCE)?"Set":"Sequence", val_to_str_const(classx,ber_class_codes,"Unknown"), classx, pcx ? ber_pc_codes_short.true_string : ber_pc_codes_short.false_string, tagx);
expert_add_info_format(actx->pinfo, causex, PI_MALFORMED, PI_WARN, "BER Error: %s Of expected",(type==BER_UNI_TAG_SEQUENCE)?"Set":"Sequence");
if (decode_unexpected) {
proto_tree *unknown_tree = proto_item_add_subtree(causex, ett_ber_unknown);
@@ -3932,7 +3934,7 @@ printf("SQ OF dissect_ber_old_sq_of(%s) entered\n",name);
||(tagx!=type)))) {
tvb_ensure_bytes_exist(tvb, hoffsetx, 2);
causex = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, lenx, (type==BER_UNI_TAG_SEQUENCE)?"set_of_expected":"sequence_of_expected", "BER Error: %s Of expected but class:%s(%d) %s tag:%d was unexpected",
- (type==BER_UNI_TAG_SEQUENCE)?"Set":"Sequence", val_to_str(classx,ber_class_codes,"Unknown"), classx, pcx ? ber_pc_codes_short.true_string : ber_pc_codes_short.false_string, tagx);
+ (type==BER_UNI_TAG_SEQUENCE)?"Set":"Sequence", val_to_str_const(classx,ber_class_codes,"Unknown"), classx, pcx ? ber_pc_codes_short.true_string : ber_pc_codes_short.false_string, tagx);
expert_add_info_format(actx->pinfo, causex, PI_MALFORMED, PI_WARN, "BER Error: %s Of expected",(type==BER_UNI_TAG_SEQUENCE)?"Set":"Sequence");
if (decode_unexpected) {
proto_tree *unknown_tree = proto_item_add_subtree(causex, ett_ber_unknown);
@@ -4139,7 +4141,7 @@ dissect_ber_GeneralizedTime(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree
if( (ber_class!=BER_CLASS_UNI)
||(tag!=BER_UNI_TAG_GeneralizedTime)){
tvb_ensure_bytes_exist(tvb, hoffset, 2);
- cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, len, "generalized_time_expected", "BER Error: GeneralizedTime expected but class:%s(%d) %s tag:%d was unexpected", val_to_str(ber_class,ber_class_codes,"Unknown"), ber_class, pc ? ber_pc_codes_short.true_string : ber_pc_codes_short.false_string, tag);
+ cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, len, "generalized_time_expected", "BER Error: GeneralizedTime expected but class:%s(%d) %s tag:%d was unexpected", val_to_str_const(ber_class,ber_class_codes,"Unknown"), ber_class, pc ? ber_pc_codes_short.true_string : ber_pc_codes_short.false_string, tag);
expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "BER Error: GeneralizedTime expected");
if (decode_unexpected) {
proto_tree *unknown_tree = proto_item_add_subtree(cause, ett_ber_unknown);
@@ -4250,7 +4252,7 @@ dissect_ber_UTCTime(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, t
tvb_ensure_bytes_exist(tvb, hoffset, 2);
cause = proto_tree_add_string_format(tree, hf_ber_error, tvb, offset, len, "utctime_expected",
"BER Error: UTCTime expected but class:%s(%d) %s tag:%d was unexpected",
- val_to_str(ber_class,ber_class_codes,"Unknown"), ber_class,
+ val_to_str_const(ber_class,ber_class_codes,"Unknown"), ber_class,
pc ? ber_pc_codes_short.true_string : ber_pc_codes_short.false_string, tag);
expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "BER Error: UTCTime expected");
if (decode_unexpected) {
@@ -4399,7 +4401,7 @@ int dissect_ber_constrained_bitstring(gboolean implicit_tag, asn1_ctx_t *actx, p
if( (ber_class!=BER_CLASS_UNI)
||(tag!=BER_UNI_TAG_BITSTRING) ){
tvb_ensure_bytes_exist(tvb, hoffset, 2);
- cause = proto_tree_add_string_format(parent_tree, hf_ber_error, tvb, offset, len, "bitstring_expected", "BER Error: BitString expected but class:%s(%d) %s tag:%d was unexpected", val_to_str(ber_class,ber_class_codes,"Unknown"), ber_class, pc ? ber_pc_codes_short.true_string : ber_pc_codes_short.false_string, tag);
+ cause = proto_tree_add_string_format(parent_tree, hf_ber_error, tvb, offset, len, "bitstring_expected", "BER Error: BitString expected but class:%s(%d) %s tag:%d was unexpected", val_to_str_const(ber_class,ber_class_codes,"Unknown"), ber_class, pc ? ber_pc_codes_short.true_string : ber_pc_codes_short.false_string, tag);
expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "BER Error: BitString expected");
if (decode_unexpected) {
proto_tree *unknown_tree = proto_item_add_subtree(cause, ett_ber_unknown);
@@ -4747,6 +4749,10 @@ dissect_ber(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
+gboolean oid_has_dissector(const char *oid) {
+ return(dissector_get_string_handle(ber_oid_dissector_table, oid) != NULL);
+}
+
void
proto_register_ber(void)
{
@@ -5017,7 +5023,3 @@ proto_reg_handoff_ber(void)
ber_update_oids();
}
-
-gboolean oid_has_dissector(const char *oid) {
- return(dissector_get_string_handle(ber_oid_dissector_table, oid) != NULL);
-}
diff --git a/epan/dissectors/packet-bgp.c b/epan/dissectors/packet-bgp.c
index 0ee20c1ede..a9bf147ab8 100644
--- a/epan/dissectors/packet-bgp.c
+++ b/epan/dissectors/packet-bgp.c
@@ -1025,8 +1025,7 @@ decode_mcast_vpn_nlri(proto_tree *tree, tvbuff_t *tvb, gint offset, guint16 afi)
item = proto_tree_add_item(tree, hf_bgp_mcast_vpn_nlri_t, tvb, offset,
length, ENC_NA);
proto_item_set_text(item, "%s (%u byte%s)",
- val_to_str(route_type, mcast_vpn_route_type,
- "Unknown"),
+ val_to_str_const(route_type, mcast_vpn_route_type, "Unknown"),
length, plurality(length, "", "s"));
nlri_tree = proto_item_add_subtree(item, ett_bgp_mcast_vpn_nlri);
@@ -2445,10 +2444,10 @@ dissect_bgp_update(tvbuff_t *tvb, proto_tree *tree)
case BGPTYPE_ORIGIN:
if (tlen != 1)
goto default_attribute_top;
- msg = val_to_str(tvb_get_guint8(tvb, o + i + aoff), bgpattr_origin, "Unknown");
+ msg = val_to_str_const(tvb_get_guint8(tvb, o + i + aoff), bgpattr_origin, "Unknown");
ti = proto_tree_add_text(subtree, tvb, o + i, tlen + aoff,
"%s: %s (%u byte%s)",
- val_to_str(bgpa.bgpa_type, bgpattr_type, "Unknown"),
+ val_to_str_const(bgpa.bgpa_type, bgpattr_type, "Unknown"),
msg, tlen + aoff, plurality(tlen + aoff, "", "s"));
break;
case BGPTYPE_AS_PATH:
@@ -2554,7 +2553,7 @@ dissect_bgp_update(tvbuff_t *tvb, proto_tree *tree)
ti = proto_tree_add_text(subtree, tvb, o + i, tlen + aoff,
"%s: %s (%u byte%s)",
- val_to_str(bgpa.bgpa_type, bgpattr_type, "Unknown"),
+ val_to_str_const(bgpa.bgpa_type, bgpattr_type, "Unknown"),
as_path_emstr->str, tlen + aoff,
plurality(tlen + aoff, "", "s"));
break;
@@ -2564,7 +2563,7 @@ dissect_bgp_update(tvbuff_t *tvb, proto_tree *tree)
ipaddr = tvb_get_ipv4(tvb, o + i + aoff);
ti = proto_tree_add_text(subtree, tvb, o + i, tlen + aoff,
"%s: %s (%u byte%s)",
- val_to_str(bgpa.bgpa_type, bgpattr_type, "Unknown"),
+ val_to_str_const(bgpa.bgpa_type, bgpattr_type, "Unknown"),
ip_to_str((guint8 *)&ipaddr), tlen + aoff,
plurality(tlen + aoff, "", "s"));
break;
@@ -2573,7 +2572,7 @@ dissect_bgp_update(tvbuff_t *tvb, proto_tree *tree)
goto default_attribute_top;
ti = proto_tree_add_text(subtree, tvb, o + i, tlen + aoff,
"%s: %u (%u byte%s)",
- val_to_str(bgpa.bgpa_type, bgpattr_type, "Unknown"),
+ val_to_str_const(bgpa.bgpa_type, bgpattr_type, "Unknown"),
tvb_get_ntohl(tvb, o + i + aoff), tlen + aoff,
plurality(tlen + aoff, "", "s"));
break;
@@ -2582,7 +2581,7 @@ dissect_bgp_update(tvbuff_t *tvb, proto_tree *tree)
goto default_attribute_top;
ti = proto_tree_add_text(subtree, tvb, o + i, tlen + aoff,
"%s: %u (%u byte%s)",
- val_to_str(bgpa.bgpa_type, bgpattr_type, "Unknown"),
+ val_to_str_const(bgpa.bgpa_type, bgpattr_type, "Unknown"),
tvb_get_ntohl(tvb, o + i + aoff), tlen + aoff,
plurality(tlen + aoff, "", "s"));
break;
@@ -2591,7 +2590,7 @@ dissect_bgp_update(tvbuff_t *tvb, proto_tree *tree)
goto default_attribute_top;
ti = proto_tree_add_text(subtree, tvb, o + i, tlen + aoff,
"%s (%u byte%s)",
- val_to_str(bgpa.bgpa_type, bgpattr_type, "Unknown"),
+ val_to_str_const(bgpa.bgpa_type, bgpattr_type, "Unknown"),
tlen + aoff, plurality(tlen + aoff, "", "s"));
break;
case BGPTYPE_AGGREGATOR:
@@ -2604,7 +2603,7 @@ dissect_bgp_update(tvbuff_t *tvb, proto_tree *tree)
ipaddr = tvb_get_ipv4(tvb, o + i + aoff + asn_len);
ti = proto_tree_add_text(subtree, tvb, o + i, tlen + aoff,
"%s: AS: %u origin: %s (%u byte%s)",
- val_to_str(bgpa.bgpa_type, bgpattr_type, "Unknown"),
+ val_to_str_const(bgpa.bgpa_type, bgpattr_type, "Unknown"),
(asn_len == 2) ? tvb_get_ntohs(tvb, o + i + aoff) :
tvb_get_ntohl(tvb, o + i + aoff),
ip_to_str((guint8 *)&ipaddr),
@@ -2647,7 +2646,7 @@ dissect_bgp_update(tvbuff_t *tvb, proto_tree *tree)
ti = proto_tree_add_text(subtree, tvb, o + i, tlen + aoff,
"%s: %s (%u byte%s)",
- val_to_str(bgpa.bgpa_type, bgpattr_type, "Unknown"),
+ val_to_str_const(bgpa.bgpa_type, bgpattr_type, "Unknown"),
communities_emstr->str, tlen + aoff,
plurality(tlen + aoff, "", "s"));
break;
@@ -2657,7 +2656,7 @@ dissect_bgp_update(tvbuff_t *tvb, proto_tree *tree)
ipaddr = tvb_get_ipv4(tvb, o + i + aoff);
ti = proto_tree_add_text(subtree, tvb, o + i, tlen + aoff,
"%s: %s (%u byte%s)",
- val_to_str(bgpa.bgpa_type, bgpattr_type, "Unknown"),
+ val_to_str_const(bgpa.bgpa_type, bgpattr_type, "Unknown"),
ip_to_str((guint8 *)&ipaddr),
tlen + aoff, plurality(tlen + aoff, "", "s"));
break;
@@ -2688,7 +2687,7 @@ dissect_bgp_update(tvbuff_t *tvb, proto_tree *tree)
ti = proto_tree_add_text(subtree, tvb, o + i, tlen + aoff,
"%s: %s (%u byte%s)",
- val_to_str(bgpa.bgpa_type, bgpattr_type, "Unknown"),
+ val_to_str_const(bgpa.bgpa_type, bgpattr_type, "Unknown"),
cluster_list_emstr->str, tlen + aoff,
plurality(tlen + aoff, "", "s"));
break;
@@ -2697,14 +2696,14 @@ dissect_bgp_update(tvbuff_t *tvb, proto_tree *tree)
break;
ti = proto_tree_add_text(subtree,tvb,o+i,tlen+aoff,
"%s: (%u byte%s)",
- val_to_str(bgpa.bgpa_type,bgpattr_type,"Unknown"),
+ val_to_str_const(bgpa.bgpa_type,bgpattr_type,"Unknown"),
tlen + aoff,
plurality(tlen + aoff, "", "s"));
break;
case BGPTYPE_SAFI_SPECIFIC_ATTR:
ti = proto_tree_add_text(subtree,tvb,o+i,tlen+aoff,
"%s: (%u byte%s)",
- val_to_str(bgpa.bgpa_type,bgpattr_type,"Unknown"),
+ val_to_str_const(bgpa.bgpa_type,bgpattr_type,"Unknown"),
tlen + aoff,
plurality(tlen + aoff, "", "s"));
break;
@@ -2712,7 +2711,7 @@ dissect_bgp_update(tvbuff_t *tvb, proto_tree *tree)
default_attribute_top:
ti = proto_tree_add_text(subtree, tvb, o + i, tlen + aoff,
"%s (%u byte%s)",
- val_to_str(bgpa.bgpa_type, bgpattr_type, "Unknown"),
+ val_to_str_const(bgpa.bgpa_type, bgpattr_type, "Unknown"),
tlen + aoff, plurality(tlen + aoff, "", "s"));
} /* switch (bgpa.bgpa_type) */ /* end of first switch */
subtree2 = proto_item_add_subtree(ti, ett_bgp_attr);
@@ -2768,7 +2767,7 @@ dissect_bgp_update(tvbuff_t *tvb, proto_tree *tree)
proto_tree_add_text(subtree2, tvb,
o + i + offsetof(struct bgp_attr, bgpa_type), 1,
"Type code: %s (%u)",
- val_to_str(bgpa.bgpa_type, bgpattr_type, "Unknown"),
+ val_to_str_const(bgpa.bgpa_type, bgpattr_type, "Unknown"),
bgpa.bgpa_type);
proto_tree_add_text(subtree2, tvb, o + i + sizeof(bgpa),
@@ -2851,7 +2850,7 @@ dissect_bgp_update(tvbuff_t *tvb, proto_tree *tree)
as_path_tree = proto_item_add_subtree(ti, ett_bgp_as_paths);
proto_tree_add_text(as_path_tree, tvb, q - length * asn_len - 2,
1, "Path segment type: %s (%u)",
- val_to_str(type, as_segment_type, "Unknown"), type);
+ val_to_str_const(type, as_segment_type, "Unknown"), type);
proto_tree_add_text(as_path_tree, tvb, q - length * asn_len - 1,
1, "Path segment length: %u AS%s", length,
plurality(length, "", "s"));
@@ -2961,7 +2960,7 @@ dissect_bgp_update(tvbuff_t *tvb, proto_tree *tree)
proto_tree_add_text(communities_tree, tvb,
q - 3 + aoff, 4,
"Community: %s (0x%08x)",
- val_to_str(community, community_vals, "(reserved)"),
+ val_to_str_const(community, community_vals, "(reserved)"),
community);
}
else {
@@ -3006,11 +3005,11 @@ dissect_bgp_update(tvbuff_t *tvb, proto_tree *tree)
af = tvb_get_ntohs(tvb, o + i + aoff);
proto_tree_add_text(subtree2, tvb, o + i + aoff, 2,
"Address family: %s (%u)",
- val_to_str(af, afn_vals, "Unknown"), af);
+ val_to_str_const(af, afn_vals, "Unknown"), af);
saf = tvb_get_guint8(tvb, o + i + aoff + 2) ;
proto_tree_add_text(subtree2, tvb, o + i + aoff + 2, 1,
"Subsequent address family identifier: %s (%u)",
- val_to_str(saf, bgpattr_nlri_safi, saf >= 128 ? "Vendor specific" : "Unknown"),
+ val_to_str_const(saf, bgpattr_nlri_safi, saf >= 128 ? "Vendor specific" : "Unknown"),
saf);
nexthop_len = tvb_get_guint8(tvb, o + i + aoff + 3);
ti = proto_tree_add_text(subtree2, tvb, o + i + aoff + 3,
@@ -3104,11 +3103,11 @@ dissect_bgp_update(tvbuff_t *tvb, proto_tree *tree)
af = tvb_get_ntohs(tvb, o + i + aoff);
proto_tree_add_text(subtree2, tvb, o + i + aoff, 2,
"Address family: %s (%u)",
- val_to_str(af, afn_vals, "Unknown"), af);
+ val_to_str_const(af, afn_vals, "Unknown"), af);
saf = tvb_get_guint8(tvb, o + i + aoff + 2) ;
proto_tree_add_text(subtree2, tvb, o + i + aoff + 2, 1,
"Subsequent address family identifier: %s (%u)",
- val_to_str(saf, bgpattr_nlri_safi, saf >= 128 ? "Vendor specific" : "Unknown"),
+ val_to_str_const(saf, bgpattr_nlri_safi, saf >= 128 ? "Vendor specific" : "Unknown"),
saf);
ti = proto_tree_add_text(subtree2, tvb, o + i + aoff + 3,
tlen - 3, "Withdrawn routes (%u byte%s)", tlen - 3,
@@ -3201,7 +3200,7 @@ dissect_bgp_update(tvbuff_t *tvb, proto_tree *tree)
"QoS Set Number: 0x%02x", tvb_get_guint8(tvb,q+2));
proto_tree_add_text(subtree4, tvb, q+3, 1,
"Technology Type: 0x%02x (%s)", tvb_get_guint8(tvb,q+3),
- val_to_str(tvb_get_guint8(tvb,q+3),qos_tech_type,"Unknown"));
+ val_to_str_const(tvb_get_guint8(tvb,q+3),qos_tech_type,"Unknown"));
proto_tree_add_text(subtree4, tvb, q+4, 2,
"QoS Marking O (16 bit): %s", decode_numeric_bitfield(tvb_get_ntohs(tvb,q+4),
0xffff, 16, "0x%04x"));
@@ -3275,7 +3274,7 @@ dissect_bgp_update(tvbuff_t *tvb, proto_tree *tree)
is_extended_type = TRUE;
ipaddr = tvb_get_ipv4(tvb,q+2);
ep_strbuf_append_printf(junk_emstr, ": Area: %s, Type: %s", ip_to_str((guint8 *)&ipaddr),
- val_to_str(tvb_get_guint8(tvb,q+6),bgpext_ospf_rtype,"Unknown"));
+ val_to_str_const(tvb_get_guint8(tvb,q+6),bgpext_ospf_rtype,"Unknown"));
/* print OSPF Metric type if selected */
/* always print E2 even if not external route -- receiving router should ignore */
if ( (tvb_get_guint8(tvb,q+7)) & BGP_OSPF_RTYPE_METRIC_TYPE ) {
@@ -3298,7 +3297,7 @@ dissect_bgp_update(tvbuff_t *tvb, proto_tree *tree)
is_extended_type = TRUE;
ep_strbuf_append_printf(junk_emstr,
": %s, Control Flags: %s%s%s%s%s, MTU: %u byte%s",
- val_to_str(tvb_get_guint8(tvb,q+2),bgp_l2vpn_encaps,"Unknown"),
+ val_to_str_const(tvb_get_guint8(tvb,q+2),bgp_l2vpn_encaps,"Unknown"),
tvb_get_guint8(tvb,q+3) ? "" : "none",
tvb_get_ntohs(tvb,q+3)&0x08 ? "Q" : "",
tvb_get_ntohs(tvb,q+3)&0x04 ? "F" : "",
@@ -3310,7 +3309,7 @@ dissect_bgp_update(tvbuff_t *tvb, proto_tree *tree)
subtree4 = proto_item_add_subtree(ti,ett_bgp_extended_communities);
proto_tree_add_text(subtree4,tvb,q+2,1, "Encapsulation: %s",
- val_to_str(tvb_get_guint8(tvb,q+2),bgp_l2vpn_encaps,"Unknown"));
+ val_to_str_const(tvb_get_guint8(tvb,q+2),bgp_l2vpn_encaps,"Unknown"));
proto_tree_add_text(subtree4,tvb,q+3,1, "Control Flags: %s%sControl Word %s required, Sequenced delivery %s required",
tvb_get_ntohs(tvb,q+3)&0x08 ? "Q flag (Reserved) set" : "",
tvb_get_ntohs(tvb,q+3)&0x04 ? "F flag (reserved) set" : "",
@@ -3338,7 +3337,7 @@ dissect_bgp_update(tvbuff_t *tvb, proto_tree *tree)
ti = proto_tree_add_text(subtree2, tvb, q, MIN(ssa_len + 4, end - q),
"%s Information",
- val_to_str(ssa_type, bgp_ssa_type, "Unknown SSA"));
+ val_to_str_const(ssa_type, bgp_ssa_type, "Unknown SSA"));
subtree3 = proto_item_add_subtree(ti, ett_bgp_ssa);
proto_tree_add_item(subtree3, hf_bgp_ssa_t, tvb,
@@ -3347,7 +3346,7 @@ dissect_bgp_update(tvbuff_t *tvb, proto_tree *tree)
q, 2, ENC_BIG_ENDIAN);
PROTO_ITEM_SET_HIDDEN(hidden_item);
proto_tree_add_text(subtree3, tvb, q, 2,
- "Type: %s", val_to_str(ssa_type, bgp_ssa_type, "Unknown"));
+ "Type: %s", val_to_str_const(ssa_type, bgp_ssa_type, "Unknown"));
if ((ssa_len == 0) || (q + ssa_len > end)) {
proto_tree_add_text(subtree3, tvb, q + 2, end - q - 2,
"Invalid Length of %u", ssa_len);
@@ -3412,7 +3411,7 @@ dissect_bgp_update(tvbuff_t *tvb, proto_tree *tree)
encaps_tunnel_type = tvb_get_ntohs(tvb, q);
encaps_tunnel_len = tvb_get_ntohs(tvb, q + 2);
- ti = proto_tree_add_text(subtree3, tvb, q, encaps_tunnel_len + 4, "%s (%u bytes)", val_to_str(encaps_tunnel_type, tunnel_type, "Unknown"), encaps_tunnel_len + 4);
+ ti = proto_tree_add_text(subtree3, tvb, q, encaps_tunnel_len + 4, "%s (%u bytes)", val_to_str_const(encaps_tunnel_type, tunnel_type, "Unknown"), encaps_tunnel_len + 4);
subtree4 = proto_item_add_subtree(ti, ett_bgp_tunnel_tlv_subtree);
proto_tree_add_item(subtree4, hf_bgp_encaps_tunnel_tlv_type, tvb, q, 2, ENC_NA);
@@ -3427,7 +3426,7 @@ dissect_bgp_update(tvbuff_t *tvb, proto_tree *tree)
encaps_tunnel_subtype = tvb_get_guint8(tvb, q);
encaps_tunnel_sublen = tvb_get_guint8(tvb, q + 1);
- ti = proto_tree_add_text(subtree5, tvb, q, encaps_tunnel_sublen + 2, "%s (%u bytes)", val_to_str(encaps_tunnel_subtype, subtlv_type, "Unknown"), encaps_tunnel_sublen + 2);
+ ti = proto_tree_add_text(subtree5, tvb, q, encaps_tunnel_sublen + 2, "%s (%u bytes)", val_to_str_const(encaps_tunnel_subtype, subtlv_type, "Unknown"), encaps_tunnel_sublen + 2);
subtree6 = proto_item_add_subtree(ti, ett_bgp_tunnel_tlv_subtree);
proto_tree_add_item(subtree6, hf_bgp_encaps_tunnel_subtlv_type, tvb, q, 1, ENC_NA);
@@ -3443,7 +3442,7 @@ dissect_bgp_update(tvbuff_t *tvb, proto_tree *tree)
}
break;
case TUNNEL_SUBTLV_PROTO_TYPE:
- proto_tree_add_text(subtree6, tvb, q + 2, encaps_tunnel_sublen, "Protocol type: %s (0x%x)", val_to_str(tvb_get_ntohs(tvb, q + 2), etype_vals, "Unknown"), tvb_get_ntohs(tvb, q + 2));
+ proto_tree_add_text(subtree6, tvb, q + 2, encaps_tunnel_sublen, "Protocol type: %s (0x%x)", val_to_str_const(tvb_get_ntohs(tvb, q + 2), etype_vals, "Unknown"), tvb_get_ntohs(tvb, q + 2));
break;
case TUNNEL_SUBTLV_COLOR:
proto_tree_add_text(subtree6, tvb, q + 6, encaps_tunnel_sublen - 4, "Color value: %u", tvb_get_letohl(tvb, q + 6));
@@ -3614,7 +3613,7 @@ example 2
i = tvb_get_ntohs(tvb, p);
proto_tree_add_text(tree, tvb, p, 2,
"Address family identifier: %s (%u)",
- val_to_str(i, afn_vals, "Unknown"), i);
+ val_to_str_const(i, afn_vals, "Unknown"), i);
p += 2;
/* Reserved */
proto_tree_add_text(tree, tvb, p, 1,
@@ -3624,7 +3623,7 @@ example 2
i = tvb_get_guint8(tvb, p);
proto_tree_add_text(tree, tvb, p, 1,
"Subsequent address family identifier: %s (%u)",
- val_to_str(i, bgpattr_nlri_safi,
+ val_to_str_const(i, bgpattr_nlri_safi,
i >= 128 ? "Vendor specific" : "Unknown"),
i);
p++;
@@ -3637,8 +3636,8 @@ example 2
orflen = tvb_get_ntohs(tvb, p+2);
ti = proto_tree_add_text(tree, tvb, p , orflen + 4 , "ORF information (%u bytes)", orflen + 4);
subtree = proto_item_add_subtree(ti, ett_bgp_orf);
- proto_tree_add_text(subtree, tvb, p , 1, "ORF flag: %s", val_to_str(orfwhen, orf_when_vals,"UNKNOWN"));
- proto_tree_add_text(subtree, tvb, p+1 , 1, "ORF type: %s", val_to_str(orftype, orf_type_vals,"UNKNOWN"));
+ proto_tree_add_text(subtree, tvb, p , 1, "ORF flag: %s", val_to_str_const(orfwhen, orf_when_vals,"UNKNOWN"));
+ proto_tree_add_text(subtree, tvb, p+1 , 1, "ORF type: %s", val_to_str_const(orftype, orf_type_vals,"UNKNOWN"));
proto_tree_add_text(subtree, tvb, p+2 , 2, "ORF len: %u byte%s", orflen, plurality(orflen, "", "s"));
p += 4;
@@ -3663,9 +3662,9 @@ example 2
subtree1 = proto_item_add_subtree(ti1, ett_bgp_orf_entry);
proto_tree_add_text(subtree1, tvb, p, 1,
"ACTION: %s MATCH: %s",
- val_to_str(entryflag&BGP_ORF_ACTION,
+ val_to_str_const(entryflag&BGP_ORF_ACTION,
orf_entry_action_vals, "UNKNOWN"),
- val_to_str(entryflag&BGP_ORF_MATCH,
+ val_to_str_const(entryflag&BGP_ORF_MATCH,
orf_entry_match_vals, "UNKNOWN"));
p++;
entryseq = tvb_get_ntohl(tvb, p);
diff --git a/epan/dissectors/packet-bmc.c b/epan/dissectors/packet-bmc.c
index 2f590d1f60..2f9faea369 100644
--- a/epan/dissectors/packet-bmc.c
+++ b/epan/dissectors/packet-bmc.c
@@ -200,7 +200,7 @@ dissect_bmc_schedule_message(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
tvb, offset, 1, message_description_type,
"Message %d Message Description Type: %s (%d)",
bit,
- val_to_str(message_description_type, message_description_type_vals,"Unknown"),
+ val_to_str_const(message_description_type, message_description_type_vals,"Unknown"),
message_description_type);
offset += 1;
diff --git a/epan/dissectors/packet-bootp.c b/epan/dissectors/packet-bootp.c
index 252f0cefd7..0be3ee095e 100644
--- a/epan/dissectors/packet-bootp.c
+++ b/epan/dissectors/packet-bootp.c
@@ -1737,10 +1737,9 @@ bootp_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, int voff,
optoff = optoff + 5;
duidtype = tvb_get_ntohs(tvb, optoff);
proto_tree_add_text(v_tree, tvb, optoff, 2,
- "DUID type: %s (%u)",
- val_to_str(duidtype,
- duidtype_vals, "Unknown"),
- duidtype);
+ "DUID type: %s (%u)",
+ val_to_str_const(duidtype, duidtype_vals, "Unknown"),
+ duidtype);
switch (duidtype) {
case DUID_LLT:
if (optlen < 8) {
@@ -2130,7 +2129,7 @@ bootp_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, int voff,
i = rfc3825_fixpoint_to_decimal(&location_fp, &location);
if (i != RFC3825_NOERROR) {
- proto_tree_add_text(v_tree, tvb, optoff, optlen, "Error: %s", val_to_str(i, rfc3825_error_types, "Unknown"));
+ proto_tree_add_text(v_tree, tvb, optoff, optlen, "Error: %s", val_to_str_const(i, rfc3825_error_types, "Unknown"));
} else {
proto_tree_add_text(v_tree, tvb, optoff, 5, "Latitude: %15.10f", location.latitude);
proto_tree_add_text(v_tree, tvb, optoff+5, 5, "Longitude: %15.10f", location.longitude);
@@ -2138,8 +2137,8 @@ bootp_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, int voff,
proto_tree_add_text(v_tree, tvb, optoff+5, 1, "Longitude resolution: %15.10f", location.longitude_res);
proto_tree_add_text(v_tree, tvb, optoff+12, 4, "Altitude: %15.10f", location.altitude);
proto_tree_add_text(v_tree, tvb, optoff+10, 2, "Altitude resolution: %15.10f", location.altitude_res);
- proto_tree_add_text(v_tree, tvb, optoff+10, 1, "Altitude type: %s (%d)", val_to_str(location.altitude_type, altitude_type_values, "Unknown"), location.altitude_type);
- proto_tree_add_text(v_tree, tvb, optoff+15, 1, "Map Datum: %s (%d)", val_to_str(location.datum_type, map_datum_type_values, "Unknown"), location.datum_type);
+ proto_tree_add_text(v_tree, tvb, optoff+10, 1, "Altitude type: %s (%d)", val_to_str_const(location.altitude_type, altitude_type_values, "Unknown"), location.altitude_type);
+ proto_tree_add_text(v_tree, tvb, optoff+15, 1, "Map Datum: %s (%d)", val_to_str_const(location.datum_type, map_datum_type_values, "Unknown"), location.datum_type);
}
} else if (optlen < 69) { /* CableLabs DSS_ID */
@@ -2407,7 +2406,7 @@ bootp_dhcp_decode_agent_info(packet_info *pinfo, proto_item *v_ti, proto_tree *v
subopt_len = tvb_get_guint8(tvb, suboptoff);
vti = proto_tree_add_uint_format_value(v_tree, hf_bootp_option82_suboption,
- tvb, optoff, subopt_len+2, subopt, "(%d) %s", subopt, val_to_str(subopt, option82_suboption_vals, "Unknown"));
+ tvb, optoff, subopt_len+2, subopt, "(%d) %s", subopt, val_to_str_const(subopt, option82_suboption_vals, "Unknown"));
o82_v_tree = proto_item_add_subtree(vti, ett_bootp_option82_suboption);
proto_tree_add_item(o82_v_tree, hf_bootp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
@@ -2608,7 +2607,7 @@ dissect_vendor_pxeclient_suboption(packet_info *pinfo, proto_item *v_ti, proto_t
subopt_len = tvb_get_guint8(tvb, suboptoff);
vti = proto_tree_add_uint_format_value(v_tree, hf_bootp_option43_pxeclient_suboption,
tvb, optoff, subopt_len+2, subopt, "(%d) %s",
- subopt, val_to_str(subopt, option43_pxeclient_suboption_vals, "Unknown"));
+ subopt, val_to_str_const(subopt, option43_pxeclient_suboption_vals, "Unknown"));
o43pxeclient_v_tree = proto_item_add_subtree(vti, ett_bootp_option43_suboption);
proto_tree_add_item(o43pxeclient_v_tree, hf_bootp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
@@ -2910,7 +2909,7 @@ dissect_vendor_cablelabs_suboption(packet_info *pinfo, proto_item *v_ti, proto_t
subopt_len = tvb_get_guint8(tvb, suboptoff);
vti = proto_tree_add_uint_format_value(v_tree, hf_bootp_option43_cl_suboption,
tvb, optoff, subopt_len+2, subopt, "(%d) %s",
- subopt, val_to_str(subopt, option43_cl_suboption_vals, "Unknown"));
+ subopt, val_to_str_const(subopt, option43_cl_suboption_vals, "Unknown"));
o43cl_v_tree = proto_item_add_subtree(vti, ett_bootp_option43_suboption);
proto_tree_add_item(o43cl_v_tree, hf_bootp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
@@ -3012,7 +3011,7 @@ dissect_vendor_alcatel_suboption(packet_info *pinfo, proto_item *v_ti, proto_tre
subopt_len = tvb_get_guint8(tvb, suboptoff);
vti = proto_tree_add_uint_format_value(v_tree, hf_bootp_option43_alcatel_suboption,
tvb, optoff, subopt_len+2, subopt, "(%d) %s",
- subopt, val_to_str(subopt, option43_alcatel_suboption_vals, "Unknown"));
+ subopt, val_to_str_const(subopt, option43_alcatel_suboption_vals, "Unknown"));
o43alcatel_v_tree = proto_item_add_subtree(vti, ett_bootp_option43_suboption);
proto_tree_add_item(o43alcatel_v_tree, hf_bootp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
@@ -3133,7 +3132,7 @@ dissect_netware_ip_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v
subopt_len = tvb_get_guint8(tvb, suboptoff);
vti = proto_tree_add_uint_format_value(v_tree, hf_bootp_option63_suboption,
tvb, optoff, subopt_len+2, subopt, "(%d) %s",
- subopt, val_to_str(subopt, option63_suboption_vals, "Unknown"));
+ subopt, val_to_str_const(subopt, option63_suboption_vals, "Unknown"));
o63_v_tree = proto_item_add_subtree(vti, ett_bootp_option63_suboption);
proto_tree_add_item(o63_v_tree, hf_bootp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
@@ -3223,7 +3222,7 @@ dissect_vendor_tr111_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree
subopt_len = tvb_get_guint8(tvb, suboptoff);
vti = proto_tree_add_uint_format_value(v_tree, hf_bootp_option125_tr111_suboption,
tvb, optoff, subopt_len+2, subopt, "(%d) %s",
- subopt, val_to_str(subopt, option125_tr111_suboption_vals, "Unknown"));
+ subopt, val_to_str_const(subopt, option125_tr111_suboption_vals, "Unknown"));
o125_v_tree = proto_item_add_subtree(vti, hf_bootp_option125_tr111_suboption);
proto_tree_add_item(o125_v_tree, hf_bootp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
@@ -3316,7 +3315,7 @@ dissect_vendor_cl_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_
subopt_len = tvb_get_guint8(tvb, suboptoff);
vti = proto_tree_add_uint_format_value(v_tree, hf_bootp_option125_cl_suboption,
tvb, optoff, subopt_len+2, subopt, "(%d) %s",
- subopt, val_to_str(subopt, option125_cl_suboption_vals, "Unknown"));
+ subopt, val_to_str_const(subopt, option125_cl_suboption_vals, "Unknown"));
o125_v_tree = proto_item_add_subtree(vti, hf_bootp_option125_cl_suboption);
proto_tree_add_item(o125_v_tree, hf_bootp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
@@ -3585,14 +3584,14 @@ dissect_packetcable_mta_cap(proto_tree *v_tree, tvbuff_t *tvb, int voff, int len
tvb, off, (tlv_len * 2) + 4,
"0x%s: %s = ",
tvb_format_text(tvb, off, 2),
- val_to_str(raw_val, pkt_mdc_type_vals, "unknown"));
+ val_to_str_const(raw_val, pkt_mdc_type_vals, "unknown"));
switch (raw_val) {
case PKT_MDC_VERSION:
raw_val = tvb_get_ntohs(tvb, off + 4);
proto_item_append_text(ti,
"%s (%s)",
- val_to_str(raw_val, pkt_mdc_version_vals, "Reserved"),
+ val_to_str_const(raw_val, pkt_mdc_version_vals, "Reserved"),
tvb_format_stringzpad(tvb, off + 4, 2) );
break;
@@ -3629,7 +3628,7 @@ dissect_packetcable_mta_cap(proto_tree *v_tree, tvbuff_t *tvb, int voff, int len
raw_val = tvb_get_ntohs(tvb, off + 4);
proto_item_append_text(ti,
"%s (%s)",
- val_to_str(raw_val, pkt_mdc_boolean_vals, "unknown"),
+ val_to_str_const(raw_val, pkt_mdc_boolean_vals, "unknown"),
tvb_format_stringzpad(tvb, off + 4, 2) );
break;
@@ -3640,7 +3639,7 @@ dissect_packetcable_mta_cap(proto_tree *v_tree, tvbuff_t *tvb, int voff, int len
proto_item_append_text(ti,
"%s%s (%s)",
plurality(i + 1, "", ", "),
- val_to_str(raw_val, pkt_mdc_codec_vals, "unknown"),
+ val_to_str_const(raw_val, pkt_mdc_codec_vals, "unknown"),
tvb_format_stringzpad(tvb, off + 4 + (i * 2), 2) );
}
break;
@@ -3657,7 +3656,7 @@ dissect_packetcable_mta_cap(proto_tree *v_tree, tvbuff_t *tvb, int voff, int len
raw_val = tvb_get_ntohs(tvb, off + 4);
proto_item_append_text(ti,
"%s (%s)",
- val_to_str(raw_val, pkt_mdc_t38_version_vals, "unknown"),
+ val_to_str_const(raw_val, pkt_mdc_t38_version_vals, "unknown"),
tvb_format_stringzpad(tvb, off + 4, 2) );
break;
@@ -3665,7 +3664,7 @@ dissect_packetcable_mta_cap(proto_tree *v_tree, tvbuff_t *tvb, int voff, int len
raw_val = tvb_get_ntohs(tvb, off + 4);
proto_item_append_text(ti,
"%s (%s)",
- val_to_str(raw_val, pkt_mdc_t38_ec_vals, "unknown"),
+ val_to_str_const(raw_val, pkt_mdc_t38_ec_vals, "unknown"),
tvb_format_stringzpad(tvb, off + 4, 2) );
break;
@@ -3707,11 +3706,11 @@ dissect_packetcable_mta_cap(proto_tree *v_tree, tvbuff_t *tvb, int voff, int len
tvb_memcpy(tvb, asc_val, subopt_off, 2);
mib_ti = proto_tree_add_text(subtree, tvb, subopt_off, 2, "%s (%s)",
- val_to_str(raw_val, pkt_mdc_mib_orgs, "Unknown"), asc_val);
+ val_to_str_const(raw_val, pkt_mdc_mib_orgs, "Unknown"), asc_val);
if (subopt_off > off + 4 + 2) {
proto_item_append_text(ti, ", ");
}
- proto_item_append_text(ti, "%s", val_to_str(raw_val, pkt_mdc_mib_orgs, "Unknown"));
+ proto_item_append_text(ti, "%s", val_to_str_const(raw_val, pkt_mdc_mib_orgs, "Unknown"));
subopt_off += 2;
tvb_memcpy(tvb, asc_val, subopt_off, 2);
@@ -4057,7 +4056,7 @@ dissect_docsis_cm_cap(proto_tree *v_tree, tvbuff_t *tvb, int voff, int len, gboo
tlv_type,
"0x%02x: %s = ",
tlv_type,
- val_to_str(tlv_type, docsis_cm_cap_type_vals, "unknown"));
+ val_to_str_const(tlv_type, docsis_cm_cap_type_vals, "unknown"));
}
else
{
@@ -4070,7 +4069,7 @@ dissect_docsis_cm_cap(proto_tree *v_tree, tvbuff_t *tvb, int voff, int len, gboo
tlv_type,
"0x%02x: %s = ",
tlv_type,
- val_to_str(tlv_type, docsis_cm_cap_type_vals, "unknown"));
+ val_to_str_const(tlv_type, docsis_cm_cap_type_vals, "unknown"));
}
if (tlv_len == 1)
@@ -4101,33 +4100,33 @@ dissect_docsis_cm_cap(proto_tree *v_tree, tvbuff_t *tvb, int voff, int len, gboo
case DOCSIS_CM_CAP_IPV6_SUP:
proto_item_append_text(ti,
"%s",
- val_to_str(val_byte, docsis_cm_cap_supported_vals, "Reserved"));
+ val_to_str_const(val_byte, docsis_cm_cap_supported_vals, "Reserved"));
break;
case DOCSIS_CM_CAP_DOCSIS_VER:
proto_item_append_text(ti,
"%s",
- val_to_str(val_byte, docsis_cm_cap_version_vals, "Reserved"));
+ val_to_str_const(val_byte, docsis_cm_cap_version_vals, "Reserved"));
break;
case DOCSIS_CM_CAP_PRIV_SUP:
proto_item_append_text(ti,
"%s",
- val_to_str(val_byte, docsis_cm_cap_privacy_vals, "Reserved"));
+ val_to_str_const(val_byte, docsis_cm_cap_privacy_vals, "Reserved"));
break;
case DOCSIS_CM_CAP_FILT_SUP:
proto_item_append_text(ti,
"%s",
- val_to_str(val_byte, docsis_cm_cap_filt_vals, "Reserved"));
+ val_to_str_const(val_byte, docsis_cm_cap_filt_vals, "Reserved"));
break;
case DOCSIS_CM_CAP_L2VPN_SUP:
proto_item_append_text(ti,
"%s",
- val_to_str(val_byte, docsis_cm_cap_l2vpn_vals, "Reserved"));
+ val_to_str_const(val_byte, docsis_cm_cap_l2vpn_vals, "Reserved"));
break;
case DOCSIS_CM_CAP_L2VPN_HOST_SUP:
if (tlv_len == 7) {
proto_item_append_text(ti,
"eSAFE ifIndex %s (%i)/eSAFE MAC %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x",
- val_to_str(val_other[0], docsis_cm_cap_map_l2vpn_esafe_index_support_vals, "Reserved"),
+ val_to_str_const(val_other[0], docsis_cm_cap_map_l2vpn_esafe_index_support_vals, "Reserved"),
val_other[0],
val_other[1],
val_other[2],
@@ -4144,17 +4143,17 @@ dissect_docsis_cm_cap(proto_tree *v_tree, tvbuff_t *tvb, int voff, int len, gboo
case DOCSIS_CM_CAP_USFREQRNG_SUP:
proto_item_append_text(ti,
"%s",
- val_to_str(val_byte, docsis_cm_cap_usfreqrng_vals, "Reserved"));
+ val_to_str_const(val_byte, docsis_cm_cap_usfreqrng_vals, "Reserved"));
break;
case DOCSIS_CM_CAP_MAPUCDRECEIPT_SUP:
proto_item_append_text(ti,
"%s",
- val_to_str(val_byte, docsis_cm_cap_map_ucd_receipt_vals, "Reserved"));
+ val_to_str_const(val_byte, docsis_cm_cap_map_ucd_receipt_vals, "Reserved"));
break;
case DOCSIS_CM_CAP_DPV_SUP:
proto_item_append_text(ti,
"%s",
- val_to_str(val_byte, docsis_cm_cap_map_dpv_support_vals, "Reserved"));
+ val_to_str_const(val_byte, docsis_cm_cap_map_dpv_support_vals, "Reserved"));
break;
case DOCSIS_CM_CAP_DSAID_SUP:
case DOCSIS_CM_CAP_MULTTXCHAN_SUP:
@@ -4221,12 +4220,12 @@ dissect_docsis_cm_cap(proto_tree *v_tree, tvbuff_t *tvb, int voff, int len, gboo
case DOCSIS_CM_CAP_FCTF_SUP:
proto_item_append_text(ti,
"%s",
- val_to_str(val_byte, docsis_cm_cap_map_fctfc_support_vals, "Reserved"));
+ val_to_str_const(val_byte, docsis_cm_cap_map_fctfc_support_vals, "Reserved"));
break;
case DOCSIS_CM_CAP_MULTDSIDFW_SUP:
proto_item_append_text(ti,
"%s",
- val_to_str(val_byte, docsis_cm_cap_map_multDsidForward_support_vals, "Reserved"));
+ val_to_str_const(val_byte, docsis_cm_cap_map_multDsidForward_support_vals, "Reserved"));
break;
}
@@ -4344,7 +4343,7 @@ dissect_packetcable_i05_ccc(packet_info *pinfo, proto_item *v_ti, proto_tree *v_
vti = proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2,
"Suboption %u: %s: ", subopt,
- val_to_str(subopt, pkt_i05_ccc_opt_vals, "unknown/reserved") );
+ val_to_str_const(subopt, pkt_i05_ccc_opt_vals, "unknown/reserved") );
switch (subopt) {
@@ -4443,7 +4442,7 @@ dissect_packetcable_i05_ccc(packet_info *pinfo, proto_item *v_ti, proto_tree *v_
}
ticket_ctl = tvb_get_guint8(tvb, suboptoff);
proto_item_append_text(vti, "%s (%u) (%u byte%s%s)",
- val_to_str (ticket_ctl, pkt_i05_ccc_ticket_ctl_vals, "unknown/invalid"),
+ val_to_str_const (ticket_ctl, pkt_i05_ccc_ticket_ctl_vals, "unknown/invalid"),
ticket_ctl,
subopt_len,
plurality(subopt_len, "", "s"),
@@ -4494,7 +4493,7 @@ dissect_packetcable_ietf_ccc(packet_info *pinfo, proto_item *v_ti, proto_tree *v
vti = proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2,
"Suboption %u: %s: ", subopt,
- val_to_str(subopt, pkt_draft5_ccc_opt_vals, "unknown/reserved") );
+ val_to_str_const(subopt, pkt_draft5_ccc_opt_vals, "unknown/reserved") );
switch (subopt) {
diff --git a/epan/dissectors/packet-bssap.c b/epan/dissectors/packet-bssap.c
index 325814c7af..85994c8415 100644
--- a/epan/dissectors/packet-bssap.c
+++ b/epan/dissectors/packet-bssap.c
@@ -572,9 +572,10 @@ dissect_bssap_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bssap_tree,
default:
col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",
- val_to_str(pdu_type, ((bssap_or_bsap_global == BSSAP) ?
- bssap_pdu_type_acro_values : bsap_pdu_type_acro_values),
- "Unknown"));
+ val_to_str_const(pdu_type,
+ ((bssap_or_bsap_global == BSSAP) ?
+ bssap_pdu_type_acro_values : bsap_pdu_type_acro_values),
+ "Unknown"));
dissect_bssap_unknown_message(tvb, bssap_tree);
break;
}
diff --git a/epan/dissectors/packet-bt-dht.c b/epan/dissectors/packet-bt-dht.c
index 765232a70c..78b4cc0aa6 100644
--- a/epan/dissectors/packet-bt-dht.c
+++ b/epan/dissectors/packet-bt-dht.c
@@ -392,9 +392,9 @@ dissect_bencoded_dict_entry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
if( strlen(key)==1 )
- key = (char*)val_to_str( key[0], short_key_name_value_string, key );
+ key = (char*)val_to_str_const( key[0], short_key_name_value_string, key );
if( strlen(val)==1 )
- val = (char*)val_to_str( val[0], short_val_name_value_string, val );
+ val = (char*)val_to_str_const( val[0], short_val_name_value_string, val );
proto_item_set_text( ti, "%s: %s", key, val );
proto_item_set_len( ti, offset-orig_offset );
diff --git a/epan/dissectors/packet-btrfcomm.c b/epan/dissectors/packet-btrfcomm.c
index 50781e462c..05eecfbe62 100644
--- a/epan/dissectors/packet-btrfcomm.c
+++ b/epan/dissectors/packet-btrfcomm.c
@@ -672,7 +672,7 @@ dissect_btrfcomm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_append_str(pinfo->cinfo, COL_INFO, "MPX_CTRL ");
if(mcc_type){
- col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(mcc_type, vs_ctl, "Unknown"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(mcc_type, vs_ctl, "Unknown"));
}
offset += length;
diff --git a/epan/dissectors/packet-bvlc.c b/epan/dissectors/packet-bvlc.c
index b53da131c3..ea9e0692c6 100644
--- a/epan/dissectors/packet-bvlc.c
+++ b/epan/dissectors/packet-bvlc.c
@@ -198,8 +198,10 @@ dissect_bvlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* packet to dissect, see README.developer, 1.6.2, FID */
proto_tree_add_uint_format_value(bvlc_tree, hf_bvlc_result, tvb,
offset, 2, bvlc_result,"0x%04x (%s)",
- bvlc_result, val_to_str(bvlc_result,
- bvlc_result_names, "Unknown"));
+ bvlc_result,
+ val_to_str_const(bvlc_result,
+ bvlc_result_names,
+ "Unknown"));
offset += 2;
break;
case 0x01: /* Write-Broadcast-Distribution-Table */
diff --git a/epan/dissectors/packet-calcappprotocol.c b/epan/dissectors/packet-calcappprotocol.c
index 0b0171dc03..c3559e98b7 100644
--- a/epan/dissectors/packet-calcappprotocol.c
+++ b/epan/dissectors/packet-calcappprotocol.c
@@ -94,7 +94,7 @@ dissect_calcappprotocol_message(tvbuff_t *message_tvb, packet_info *pinfo, proto
guint8 type;
type = tvb_get_guint8(message_tvb, MESSAGE_TYPE_OFFSET);
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(type, message_type_values, "Unknown CalcAppProtocol type"));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(type, message_type_values, "Unknown CalcAppProtocol type"));
proto_tree_add_item(calcappprotocol_tree, hf_message_type, message_tvb, MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_item(calcappprotocol_tree, hf_message_flags, message_tvb, MESSAGE_FLAGS_OFFSET, MESSAGE_FLAGS_LENGTH, ENC_BIG_ENDIAN);
diff --git a/epan/dissectors/packet-cdp.c b/epan/dissectors/packet-cdp.c
index 84294ea715..b3d00e964d 100644
--- a/epan/dissectors/packet-cdp.c
+++ b/epan/dissectors/packet-cdp.c
@@ -467,11 +467,11 @@ dissect_cdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_text(tlv_tree, tvb, offset+4, 3,
"OUI: 0x%06X (%s)",
tvb_get_ntoh24(tvb,offset+4),
- val_to_str(tvb_get_ntoh24(tvb,offset+4), oui_vals, "Unknown"));
+ val_to_str_const(tvb_get_ntoh24(tvb,offset+4), oui_vals, "Unknown"));
proto_tree_add_text(tlv_tree, tvb, offset+7, 2,
"Protocol ID: 0x%04X (%s)",
tvb_get_ntohs(tvb, offset+7),
- val_to_str(tvb_get_ntohs(tvb, offset+7), type_hello_vals, "Unknown"));
+ val_to_str_const(tvb_get_ntohs(tvb, offset+7), type_hello_vals, "Unknown"));
switch(tvb_get_ntohs(tvb, offset+7)) {
diff --git a/epan/dissectors/packet-cip.c b/epan/dissectors/packet-cip.c
index edaa2a3e3c..f26870287d 100644
--- a/epan/dissectors/packet-cip.c
+++ b/epan/dissectors/packet-cip.c
@@ -2577,7 +2577,7 @@ dissect_deviceid(tvbuff_t *tvb, int offset, proto_tree *tree,
/* Add Major revision/Compatibility tree */
compatibility_item = proto_tree_add_uint_format_value(tree, hf_compatibility,
tvb, offset+6, 1, compatibility, "%s, Major Revision: %d",
- val_to_str( ( compatibility & 0x80 )>>7, cip_com_bit_vals , "" ),
+ val_to_str_const( ( compatibility & 0x80 )>>7, cip_com_bit_vals , "" ),
compatibility & 0x7F);
compatibility_tree = proto_item_add_subtree(compatibility_item, ett_mcsc);
@@ -2796,7 +2796,7 @@ void dissect_epath( tvbuff_t *tvb, packet_info *pinfo, proto_item *epath_item, i
it = proto_tree_add_uint(path_seg_tree, hf_cip_logical_seg_format, NULL, 0, 0, segment_type & CI_LOGICAL_SEG_FORMAT_MASK);
PROTO_ITEM_SET_GENERATED(it);
}
- cia_item = proto_tree_add_text(path_seg_tree, NULL, 0, 0, "%s", val_to_str( ((segment_type & (CI_LOGICAL_SEG_TYPE_MASK|CI_LOGICAL_SEG_FORMAT_MASK))), cip_logical_seg_vals, "Reserved"));
+ cia_item = proto_tree_add_text(path_seg_tree, NULL, 0, 0, "%s", val_to_str_const( ((segment_type & (CI_LOGICAL_SEG_TYPE_MASK|CI_LOGICAL_SEG_FORMAT_MASK))), cip_logical_seg_vals, "Reserved"));
PROTO_ITEM_SET_GENERATED(cia_item);
}
else
@@ -2804,10 +2804,10 @@ void dissect_epath( tvbuff_t *tvb, packet_info *pinfo, proto_item *epath_item, i
proto_tree_add_item(path_seg_tree, hf_cip_logical_seg_type, tvb, offset+pathpos, 1, ENC_LITTLE_ENDIAN );
if ((segment_type & CI_LOGICAL_SEG_TYPE_MASK) <= CI_LOGICAL_SEG_ATTR_ID)
proto_tree_add_item(path_seg_tree, hf_cip_logical_seg_format, tvb, offset + pathpos, 1, ENC_LITTLE_ENDIAN);
- cia_item = proto_tree_add_text(path_seg_tree, tvb, offset + pathpos, 1, "%s", val_to_str( ((segment_type & (CI_LOGICAL_SEG_TYPE_MASK|CI_LOGICAL_SEG_FORMAT_MASK))), cip_logical_seg_vals, "Reserved"));
+ cia_item = proto_tree_add_text(path_seg_tree, tvb, offset + pathpos, 1, "%s", val_to_str_const( ((segment_type & (CI_LOGICAL_SEG_TYPE_MASK|CI_LOGICAL_SEG_FORMAT_MASK))), cip_logical_seg_vals, "Reserved"));
}
- proto_item_append_text( path_seg_item, " (%s)", val_to_str( ((segment_type & (CI_LOGICAL_SEG_TYPE_MASK|CI_LOGICAL_SEG_FORMAT_MASK))), cip_logical_seg_vals, "Reserved"));
+ proto_item_append_text( path_seg_item, " (%s)", val_to_str_const( ((segment_type & (CI_LOGICAL_SEG_TYPE_MASK|CI_LOGICAL_SEG_FORMAT_MASK))), cip_logical_seg_vals, "Reserved"));
cia_tree = proto_item_add_subtree( cia_item, ett_cia_path );
switch( segment_type & CI_LOGICAL_SEG_TYPE_MASK )
@@ -2922,16 +2922,16 @@ void dissect_epath( tvbuff_t *tvb, packet_info *pinfo, proto_item *epath_item, i
{
it = proto_tree_add_uint(path_seg_tree, hf_cip_data_seg_type, NULL, 0, 0, segment_type & CI_DATA_SEG_TYPE_MASK);
PROTO_ITEM_SET_GENERATED(it);
- ds_item = proto_tree_add_text(path_seg_tree, NULL, 0, 0, "%s", val_to_str( (segment_type & CI_DATA_SEG_TYPE_MASK), cip_data_segment_type_vals, "Reserved"));
+ ds_item = proto_tree_add_text(path_seg_tree, NULL, 0, 0, "%s", val_to_str_const( (segment_type & CI_DATA_SEG_TYPE_MASK), cip_data_segment_type_vals, "Reserved"));
PROTO_ITEM_SET_GENERATED(ds_item);
}
else
{
proto_tree_add_item(path_seg_tree, hf_cip_data_seg_type, tvb, offset+pathpos, 1, ENC_LITTLE_ENDIAN );
- ds_item = proto_tree_add_text(path_seg_tree, tvb, offset + pathpos, 1, "%s", val_to_str( (segment_type & CI_DATA_SEG_TYPE_MASK), cip_data_segment_type_vals, "Reserved"));
+ ds_item = proto_tree_add_text(path_seg_tree, tvb, offset + pathpos, 1, "%s", val_to_str_const( (segment_type & CI_DATA_SEG_TYPE_MASK), cip_data_segment_type_vals, "Reserved"));
}
- proto_item_append_text( path_seg_item, " (%s)", val_to_str( (segment_type & CI_DATA_SEG_TYPE_MASK), cip_data_segment_type_vals, "Reserved"));
+ proto_item_append_text( path_seg_item, " (%s)", val_to_str_const( (segment_type & CI_DATA_SEG_TYPE_MASK), cip_data_segment_type_vals, "Reserved"));
ds_tree = proto_item_add_subtree( ds_item, ett_data_seg );
switch( segment_type & CI_DATA_SEG_TYPE_MASK)
@@ -3018,16 +3018,16 @@ void dissect_epath( tvbuff_t *tvb, packet_info *pinfo, proto_item *epath_item, i
{
it = proto_tree_add_uint(path_seg_tree, hf_cip_network_seg_type, NULL, 0, 0, segment_type & CI_NETWORK_SEG_TYPE_MASK);
PROTO_ITEM_SET_GENERATED(it);
- net_item = proto_tree_add_text(path_seg_tree, NULL, 0, 0, "%s", val_to_str( (segment_type & CI_NETWORK_SEG_TYPE_MASK), cip_network_segment_type_vals, "Reserved"));
+ net_item = proto_tree_add_text(path_seg_tree, NULL, 0, 0, "%s", val_to_str_const( (segment_type & CI_NETWORK_SEG_TYPE_MASK), cip_network_segment_type_vals, "Reserved"));
PROTO_ITEM_SET_GENERATED(net_item);
}
else
{
proto_tree_add_item(path_seg_tree, hf_cip_network_seg_type, tvb, offset+pathpos, 1, ENC_LITTLE_ENDIAN );
- net_item = proto_tree_add_text(path_seg_tree, tvb, offset + pathpos, 1, "%s", val_to_str( (segment_type & CI_NETWORK_SEG_TYPE_MASK), cip_network_segment_type_vals, "Reserved"));
+ net_item = proto_tree_add_text(path_seg_tree, tvb, offset + pathpos, 1, "%s", val_to_str_const( (segment_type & CI_NETWORK_SEG_TYPE_MASK), cip_network_segment_type_vals, "Reserved"));
}
- proto_item_append_text( path_seg_item, " (%s)", val_to_str( (segment_type & CI_NETWORK_SEG_TYPE_MASK), cip_network_segment_type_vals, "Reserved"));
+ proto_item_append_text( path_seg_item, " (%s)", val_to_str_const( (segment_type & CI_NETWORK_SEG_TYPE_MASK), cip_network_segment_type_vals, "Reserved"));
net_tree = proto_item_add_subtree( net_item, ett_network_seg );
switch( segment_type & CI_NETWORK_SEG_TYPE_MASK )
@@ -3072,7 +3072,7 @@ void dissect_epath( tvbuff_t *tvb, packet_info *pinfo, proto_item *epath_item, i
temp_data = tvb_get_guint8( tvb, offset + pathpos + 2 );
if (temp_data < 3)
{
- safety_item = proto_tree_add_text(net_tree, tvb, offset + pathpos+3, seg_size-1, "%s", val_to_str(temp_data, cip_safety_segment_format_type_vals, "Reserved"));
+ safety_item = proto_tree_add_text(net_tree, tvb, offset + pathpos+3, seg_size-1, "%s", val_to_str_const(temp_data, cip_safety_segment_format_type_vals, "Reserved"));
safety_tree = proto_item_add_subtree( safety_item, ett_network_seg_safety );
switch (temp_data)
{
@@ -4369,7 +4369,7 @@ dissect_cip_cm_data( proto_tree *item_tree, tvbuff_t *tvb, int offset, int item_
proto_item_append_text( rrsc_item, "%s (%s)",
val_to_str( ( service & 0x7F ),
cip_sc_vals_cm , "Unknown Service (0x%02x)"),
- val_to_str( ( service & 0x80 )>>7,
+ val_to_str_const( ( service & 0x80 )>>7,
cip_sc_rr, "") );
/* Add Service code */
@@ -4749,7 +4749,7 @@ dissect_cip_mb_data( proto_tree *item_tree, tvbuff_t *tvb, int offset, int item_
proto_item_append_text( rrsc_item, "%s (%s)",
val_to_str( ( service & 0x7F ),
cip_sc_vals_mb , "Unknown Service (0x%02x)"),
- val_to_str( ( service & 0x80 )>>7,
+ val_to_str_const( ( service & 0x80 )>>7,
cip_sc_rr, "") );
/* Add Service code */
@@ -5131,7 +5131,7 @@ dissect_cip_cco_data( proto_tree *item_tree, tvbuff_t *tvb, int offset, int item
proto_item_append_text( rrsc_item, "%s (%s)",
val_to_str( ( service & 0x7F ),
cip_sc_vals_cco , "Unknown Service (0x%02x)"),
- val_to_str( ( service & 0x80 )>>7,
+ val_to_str_const( ( service & 0x80 )>>7,
cip_sc_rr, "") );
/* Add Service code */
@@ -5385,7 +5385,7 @@ dissect_cip_data( proto_tree *item_tree, tvbuff_t *tvb, int offset, packet_info
rrsc_item = proto_tree_add_uint_format_value(cip_tree, hf_cip_service,
tvb, offset, 1, service, "%s (%s)",
val_to_str( ( service & 0x7F ), cip_sc_vals , "Unknown Service (0x%02x)"),
- val_to_str( ( service & 0x80 )>>7, cip_sc_rr, ""));
+ val_to_str_const( ( service & 0x80 )>>7, cip_sc_rr, ""));
rrsc_tree = proto_item_add_subtree( rrsc_item, ett_rrsc );
diff --git a/epan/dissectors/packet-cipsafety.c b/epan/dissectors/packet-cipsafety.c
index 95ed417f32..a23f484383 100644
--- a/epan/dissectors/packet-cipsafety.c
+++ b/epan/dissectors/packet-cipsafety.c
@@ -470,7 +470,7 @@ dissect_cip_s_supervisor_data( proto_tree *item_tree,
proto_item_append_text( rrsc_item, "%s (%s)",
val_to_str( ( service & 0x7F ), cip_sc_vals_ssupervisor , "Unknown Service (0x%02x)"),
- val_to_str( ( service & 0x80 )>>7, cip_sc_rr, "") );
+ val_to_str_const( ( service & 0x80 )>>7, cip_sc_rr, "") );
/* Add Service code */
proto_tree_add_item(rrsc_tree, hf_cip_ssupervisor_sc, tvb, offset, 1, ENC_LITTLE_ENDIAN );
@@ -1151,7 +1151,7 @@ dissect_cip_s_validator_data( proto_tree *item_tree,
proto_item_append_text( rrsc_item, "%s (%s)",
val_to_str( ( service & 0x7F ),
cip_sc_vals_svalidator , "Unknown Service (0x%02x)"),
- val_to_str( ( service & 0x80 )>>7,
+ val_to_str_const( ( service & 0x80 )>>7,
cip_sc_rr, "") );
/* Add Service code */
diff --git a/epan/dissectors/packet-cisco-sm.c b/epan/dissectors/packet-cisco-sm.c
index 4806079d71..0a50d1e11a 100644
--- a/epan/dissectors/packet-cisco-sm.c
+++ b/epan/dissectors/packet-cisco-sm.c
@@ -155,13 +155,13 @@ dissect_sm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "SM");
col_add_fstr(pinfo->cinfo, COL_INFO, "Cisco SM Packet (%s)",
- val_to_str(sm_message_type, sm_message_type_value_info,"reserved"));
+ val_to_str_const(sm_message_type, sm_message_type_value_info,"reserved"));
ti = proto_tree_add_item(tree, proto_sm, tvb, offset, 0, ENC_NA);
sm_tree = proto_item_add_subtree(ti, ett_sm);
proto_tree_add_uint_format(sm_tree, hf_sm_sm_msg_type, tvb, offset, 4, sm_message_type,
- "SM Message type: %s (0x%0x)", val_to_str(sm_message_type, sm_message_type_value, "reserved"), sm_message_type);
+ "SM Message type: %s (0x%0x)", val_to_str_const(sm_message_type, sm_message_type_value, "reserved"), sm_message_type);
offset = offset + 4;
if (sm_message_type == MESSAGE_TYPE_PDU) {
@@ -178,7 +178,7 @@ dissect_sm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset = offset +2;
msg_type = tvb_get_ntohs(tvb,offset);
proto_tree_add_uint_format(sm_tree, hf_sm_msg_type, tvb, offset, 2, msg_type,
- "Message type: %s (0x%0x)", val_to_str(msg_type, sm_pdu_type_value, "reserved"),
+ "Message type: %s (0x%0x)", val_to_str_const(msg_type, sm_pdu_type_value, "reserved"),
msg_type);
msg_type = tvb_get_ntohs(tvb,offset);
offset = offset + 2;
@@ -294,7 +294,7 @@ dissect_sm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset = offset +2;
msg_type = tvb_get_ntohs(tvb,offset);
proto_tree_add_uint_format(sm_tree, hf_sm_msg_type, tvb, offset, 2, msg_type,
- "Message type: %s (0x%0x)", val_to_str(msg_type, sm_pdu_type_value, "reserved"),
+ "Message type: %s (0x%0x)", val_to_str_const(msg_type, sm_pdu_type_value, "reserved"),
msg_type);
msg_type = tvb_get_ntohs(tvb,offset);
offset = offset + 2;
diff --git a/epan/dissectors/packet-coap.c b/epan/dissectors/packet-coap.c
index e821796ae9..e3f93145b5 100644
--- a/epan/dissectors/packet-coap.c
+++ b/epan/dissectors/packet-coap.c
@@ -368,7 +368,7 @@ dissect_coap_options(tvbuff_t *tvb, packet_info *pinfo, proto_tree *coap_tree, g
item = proto_tree_add_text(coap_tree, tvb, offset, opt_hlen + opt_length,
"Option #%u: %s (Type: %u)",
- opt_count, val_to_str(*opt_code, vals_opt_type, *opt_code % 14 == 0 ? "No-Op" : "Unknown Option"), *opt_code);
+ opt_count, val_to_str_const(*opt_code, vals_opt_type, *opt_code % 14 == 0 ? "No-Op" : "Unknown Option"), *opt_code);
subtree = proto_item_add_subtree(item, ett_coap_option);
proto_tree_add_item(subtree, hf_coap_opt_delta, tvb, offset, 1, ENC_BIG_ENDIAN);
diff --git a/epan/dissectors/packet-collectd.c b/epan/dissectors/packet-collectd.c
index 6a199121a2..df1757f90e 100644
--- a/epan/dissectors/packet-collectd.c
+++ b/epan/dissectors/packet-collectd.c
@@ -283,7 +283,7 @@ dissect_collectd_string (tvbuff_t *tvb, packet_info *pinfo, gint type_hf,
{
pi = proto_tree_add_text (tree_root, tvb, offset, length,
"collectd %s segment: Length = %i <BAD>",
- val_to_str (type, part_names, "UNKNOWN"),
+ val_to_str_const (type, part_names, "UNKNOWN"),
length);
expert_add_info_format (pinfo, pi, PI_MALFORMED, PI_ERROR,
"String part with invalid part length: "
@@ -298,7 +298,7 @@ dissect_collectd_string (tvbuff_t *tvb, packet_info *pinfo, gint type_hf,
pi = proto_tree_add_text (tree_root, tvb, offset, length,
"collectd %s segment: \"%s\"",
- val_to_str (type, part_names, "UNKNOWN"),
+ val_to_str_const (type, part_names, "UNKNOWN"),
*ret_string);
if (ret_item != NULL)
@@ -338,7 +338,7 @@ dissect_collectd_integer (tvbuff_t *tvb, packet_info *pinfo, gint type_hf,
{
pi = proto_tree_add_text (tree_root, tvb, offset, -1,
"collectd %s segment: <BAD>",
- val_to_str (type, part_names, "UNKNOWN"));
+ val_to_str_const (type, part_names, "UNKNOWN"));
pt = proto_item_add_subtree (pi, ett_collectd_integer);
proto_tree_add_uint (pt, hf_collectd_type, tvb, offset, 2,
@@ -358,7 +358,7 @@ dissect_collectd_integer (tvbuff_t *tvb, packet_info *pinfo, gint type_hf,
{
pi = proto_tree_add_text (tree_root, tvb, offset, -1,
"collectd %s segment: <BAD>",
- val_to_str (type, part_names, "UNKNOWN"));
+ val_to_str_const (type, part_names, "UNKNOWN"));
pt = proto_item_add_subtree (pi, ett_collectd_integer);
proto_tree_add_uint (pt, hf_collectd_type, tvb, offset, 2,
@@ -376,7 +376,7 @@ dissect_collectd_integer (tvbuff_t *tvb, packet_info *pinfo, gint type_hf,
pi = proto_tree_add_text (tree_root, tvb, offset, length,
"collectd %s segment: %"G_GINT64_MODIFIER"u",
- val_to_str (type, part_names, "UNKNOWN"),
+ val_to_str_const (type, part_names, "UNKNOWN"),
*ret_value);
if (ret_item != NULL)
*ret_item = pi;
@@ -546,7 +546,7 @@ dissect_collectd_part_values (tvbuff_t *tvb, packet_info *pinfo, gint offset,
{
pi = proto_tree_add_text (tree_root, tvb, offset, -1,
"collectd %s segment: <BAD>",
- val_to_str (type, part_names, "UNKNOWN"));
+ val_to_str_const (type, part_names, "UNKNOWN"));
pt = proto_item_add_subtree (pi, ett_collectd_part_value);
proto_tree_add_uint (pt, hf_collectd_type, tvb, offset, 2, type);
@@ -565,7 +565,7 @@ dissect_collectd_part_values (tvbuff_t *tvb, packet_info *pinfo, gint offset,
{
pi = proto_tree_add_text (tree_root, tvb, offset, -1,
"collectd %s segment: <BAD>",
- val_to_str (type, part_names, "UNKNOWN"));
+ val_to_str_const (type, part_names, "UNKNOWN"));
pt = proto_item_add_subtree (pi, ett_collectd_part_value);
proto_tree_add_uint (pt, hf_collectd_type, tvb, offset, 2, type);
@@ -584,7 +584,7 @@ dissect_collectd_part_values (tvbuff_t *tvb, packet_info *pinfo, gint offset,
{
pi = proto_tree_add_text (tree_root, tvb, offset, length,
"collectd %s segment: %d (%d) value%s <BAD>",
- val_to_str (type, part_names, "UNKNOWN"),
+ val_to_str_const (type, part_names, "UNKNOWN"),
values_count, corrected_values_count,
plurality(values_count, "", "s"));
}
@@ -592,7 +592,7 @@ dissect_collectd_part_values (tvbuff_t *tvb, packet_info *pinfo, gint offset,
{
pi = proto_tree_add_text (tree_root, tvb, offset, length,
"collectd %s segment: %d value%s",
- val_to_str (type, part_names, "UNKNOWN"),
+ val_to_str_const (type, part_names, "UNKNOWN"),
values_count,
plurality(values_count, "", "s"));
}
@@ -664,7 +664,7 @@ dissect_collectd_signature (tvbuff_t *tvb, packet_info *pinfo,
{
pi = proto_tree_add_text (tree_root, tvb, offset, -1,
"collectd %s segment: <BAD>",
- val_to_str (type, part_names, "UNKNOWN"));
+ val_to_str_const (type, part_names, "UNKNOWN"));
pt = proto_item_add_subtree (pi, ett_collectd_signature);
proto_tree_add_uint (pt, hf_collectd_type, tvb, offset, 2, type);
@@ -683,7 +683,7 @@ dissect_collectd_signature (tvbuff_t *tvb, packet_info *pinfo,
{
pi = proto_tree_add_text (tree_root, tvb, offset, -1,
"collectd %s segment: <BAD>",
- val_to_str (type, part_names, "UNKNOWN"));
+ val_to_str_const (type, part_names, "UNKNOWN"));
pt = proto_item_add_subtree (pi, ett_collectd_signature);
proto_tree_add_uint (pt, hf_collectd_type, tvb, offset, 2, type);
@@ -697,7 +697,7 @@ dissect_collectd_signature (tvbuff_t *tvb, packet_info *pinfo,
pi = proto_tree_add_text (tree_root, tvb, offset, length,
"collectd %s segment: HMAC-SHA-256",
- val_to_str (type, part_names, "UNKNOWN"));
+ val_to_str_const (type, part_names, "UNKNOWN"));
pt = proto_item_add_subtree (pi, ett_collectd_signature);
proto_tree_add_uint (pt, hf_collectd_type, tvb, offset, 2, type);
@@ -735,7 +735,7 @@ dissect_collectd_encrypted (tvbuff_t *tvb, packet_info *pinfo,
{
pi = proto_tree_add_text (tree_root, tvb, offset, -1,
"collectd %s segment: <BAD>",
- val_to_str (type, part_names, "UNKNOWN"));
+ val_to_str_const (type, part_names, "UNKNOWN"));
pt = proto_item_add_subtree (pi, ett_collectd_encryption);
proto_tree_add_uint (pt, hf_collectd_type, tvb, offset, 2, type);
@@ -754,7 +754,7 @@ dissect_collectd_encrypted (tvbuff_t *tvb, packet_info *pinfo,
{
pi = proto_tree_add_text (tree_root, tvb, offset, -1,
"collectd %s segment: <BAD>",
- val_to_str (type, part_names, "UNKNOWN"));
+ val_to_str_const (type, part_names, "UNKNOWN"));
pt = proto_item_add_subtree (pi, ett_collectd_encryption);
proto_tree_add_uint (pt, hf_collectd_type, tvb, offset, 2, type);
@@ -771,7 +771,7 @@ dissect_collectd_encrypted (tvbuff_t *tvb, packet_info *pinfo,
{
pi = proto_tree_add_text (tree_root, tvb, offset, -1,
"collectd %s segment: <BAD>",
- val_to_str (type, part_names, "UNKNOWN"));
+ val_to_str_const (type, part_names, "UNKNOWN"));
pt = proto_item_add_subtree (pi, ett_collectd_encryption);
proto_tree_add_uint (pt, hf_collectd_type, tvb, offset, 2, type);
@@ -787,7 +787,7 @@ dissect_collectd_encrypted (tvbuff_t *tvb, packet_info *pinfo,
pi = proto_tree_add_text (tree_root, tvb, offset, length,
"collectd %s segment: AES-256",
- val_to_str (type, part_names, "UNKNOWN"));
+ val_to_str_const (type, part_names, "UNKNOWN"));
pt = proto_item_add_subtree (pi, ett_collectd_encryption);
proto_tree_add_uint (pt, hf_collectd_type, tvb, offset, 2, type);
@@ -979,7 +979,7 @@ dissect_collectd (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pi = proto_tree_add_text (collectd_tree, tvb,
offset, part_length,
"collectd %s segment: Length = %i <BAD>",
- val_to_str (part_type, part_names, "UNKNOWN"),
+ val_to_str_const (part_type, part_names, "UNKNOWN"),
part_length);
pt = proto_item_add_subtree (pi, ett_collectd_invalid_length);
@@ -1187,7 +1187,7 @@ dissect_collectd (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ndispatch.time, ndispatch.time_str ? ndispatch.time_str : "(null)");
proto_tree_add_text (pt, tvb, ndispatch.severity_off, 8,
"Severity: %s (%#"G_GINT64_MODIFIER"x)",
- val_to_str((gint32)ndispatch.severity, severity_names, "UNKNOWN"),
+ val_to_str_const((gint32)ndispatch.severity, severity_names, "UNKNOWN"),
ndispatch.severity);
proto_tree_add_text (pt, tvb, ndispatch.message_off,
ndispatch.message_len,
@@ -1211,7 +1211,7 @@ dissect_collectd (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_item_set_text (pi,
"collectd SEVERITY segment: "
"%s (%"G_GINT64_MODIFIER"u)",
- val_to_str ((gint32)ndispatch.severity, severity_names, "UNKNOWN"),
+ val_to_str_const ((gint32)ndispatch.severity, severity_names, "UNKNOWN"),
ndispatch.severity);
}
@@ -1245,7 +1245,7 @@ dissect_collectd (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pi = proto_tree_add_text (collectd_tree, tvb,
offset, part_length,
"collectd %s segment: %i bytes",
- val_to_str(part_type, part_names, "UNKNOWN"),
+ val_to_str_const(part_type, part_names, "UNKNOWN"),
part_length);
pt = proto_item_add_subtree(pi, ett_collectd_unknown);
diff --git a/epan/dissectors/packet-componentstatus.c b/epan/dissectors/packet-componentstatus.c
index d5e0cac21d..709d91d1fe 100644
--- a/epan/dissectors/packet-componentstatus.c
+++ b/epan/dissectors/packet-componentstatus.c
@@ -194,7 +194,7 @@ dissect_componentstatusprotocol_message(tvbuff_t *message_tvb, packet_info *pinf
guint8 type;
type = tvb_get_guint8(message_tvb, MESSAGE_TYPE_OFFSET);
- col_add_str(pinfo->cinfo, COL_INFO, val_to_str(type, message_type_values, "Unknown ComponentStatusProtocol type"));
+ col_add_str(pinfo->cinfo, COL_INFO, val_to_str_const(type, message_type_values, "Unknown ComponentStatusProtocol type"));
proto_tree_add_item(componentstatusprotocol_tree, hf_message_type, message_tvb, MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_LENGTH, ENC_BIG_ENDIAN);
flags_item = proto_tree_add_item(componentstatusprotocol_tree, hf_message_flags, message_tvb, MESSAGE_FLAGS_OFFSET, MESSAGE_FLAGS_LENGTH, ENC_BIG_ENDIAN);
flags_tree = proto_item_add_subtree(flags_item, ett_message_flags);
diff --git a/epan/dissectors/packet-cops.c b/epan/dissectors/packet-cops.c
index 27d30176cd..5ead599b9f 100644
--- a/epan/dissectors/packet-cops.c
+++ b/epan/dissectors/packet-cops.c
@@ -913,7 +913,7 @@ dissect_cops_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
op_code = tvb_get_guint8(tvb, 1);
col_add_fstr(pinfo->cinfo, COL_INFO, "COPS %s",
- val_to_str(op_code, cops_op_code_vals, "Unknown Op Code"));
+ val_to_str_const(op_code, cops_op_code_vals, "Unknown Op Code"));
/* Currently used by PacketCable */
client_type = tvb_get_ntohs(tvb, 2);
@@ -926,7 +926,7 @@ dissect_cops_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tv = proto_tree_add_uint_format(cops_tree, hf_cops_ver_flags, tvb, offset, 1,
ver_flags, "Version: %u, Flags: %s",
hi_nibble(ver_flags),
- val_to_str(lo_nibble(ver_flags), cops_flags_vals, "Unknown"));
+ val_to_str_const(lo_nibble(ver_flags), cops_flags_vals, "Unknown"));
ver_flags_tree = proto_item_add_subtree(tv, ett_cops_ver_flags);
proto_tree_add_uint(ver_flags_tree, hf_cops_version, tvb, offset, 1, ver_flags);
proto_tree_add_uint(ver_flags_tree, hf_cops_flags, tvb, offset, 1, ver_flags);
@@ -1032,7 +1032,7 @@ static int dissect_cops_object(tvbuff_t *tvb, packet_info *pinfo, guint8 op_code
c_type = tvb_get_guint8(tvb, offset + 3);
ti = proto_tree_add_uint_format(tree, hf_cops_obj_c_num, tvb, offset, object_len, c_num,
- "%s: %s", val_to_str(c_num, cops_c_num_vals, "Unknown"),
+ "%s: %s", val_to_str_const(c_num, cops_c_num_vals, "Unknown"),
cops_c_type_to_str(c_num, c_type));
obj_tree = proto_item_add_subtree(ti, ett_cops_obj);
@@ -1085,7 +1085,7 @@ static void dissect_cops_pr_objects(tvbuff_t *tvb, packet_info *pinfo, guint32 o
s_num = tvb_get_guint8(tvb, offset + 2);
ti = proto_tree_add_uint_format(cops_pr_tree, hf_cops_obj_s_num, tvb, offset, object_len, s_num,
- "%s", val_to_str(s_num, cops_s_num_vals, "Unknown"));
+ "%s", val_to_str_const(s_num, cops_s_num_vals, "Unknown"));
obj_tree = proto_item_add_subtree(ti, ett_cops_pr_obj);
proto_tree_add_uint(obj_tree, hf_cops_obj_len, tvb, offset, 2, object_len);
@@ -1097,7 +1097,7 @@ static void dissect_cops_pr_objects(tvbuff_t *tvb, packet_info *pinfo, guint32 o
pr_len--;
s_type = tvb_get_guint8(tvb, offset);
- type_str = val_to_str(s_type, cops_s_type_vals, "Unknown");
+ type_str = val_to_str_const(s_type, cops_s_type_vals, "Unknown");
proto_tree_add_text(obj_tree, tvb, offset, 1, "S-Type: %s%s%u%s",
type_str,
strlen(type_str) ? " (" : "",
@@ -1138,7 +1138,7 @@ static void dissect_cops_object_data(tvbuff_t *tvb, packet_info *pinfo, guint32
r_type = tvb_get_ntohs(tvb, offset);
m_type = tvb_get_ntohs(tvb, offset + 2);
ti = proto_tree_add_text(tree, tvb, offset, 4, "Contents: R-Type: %s, M-Type: %u",
- val_to_str(r_type, cops_r_type_vals, "Unknown"),
+ val_to_str_const(r_type, cops_r_type_vals, "Unknown"),
m_type);
r_type_tree = proto_item_add_subtree(ti, ett_cops_r_type_flags);
@@ -1179,7 +1179,7 @@ static void dissect_cops_object_data(tvbuff_t *tvb, packet_info *pinfo, guint32
reason = tvb_get_ntohs(tvb, offset);
reason_sub = tvb_get_ntohs(tvb, offset + 2);
ti = proto_tree_add_text(tree, tvb, offset, 4, "Contents: Reason-Code: %s, Reason Sub-code: 0x%04x",
- val_to_str(reason, cops_reason_vals, "<Unknown value>"), reason_sub);
+ val_to_str_const(reason, cops_reason_vals, "<Unknown value>"), reason_sub);
reason_tree = proto_item_add_subtree(ti, ett_cops_reason);
proto_tree_add_uint(reason_tree, hf_cops_reason, tvb, offset, 2, reason);
offset += 2;
@@ -1197,8 +1197,8 @@ static void dissect_cops_object_data(tvbuff_t *tvb, packet_info *pinfo, guint32
cmd_code = tvb_get_ntohs(tvb, offset);
cmd_flags = tvb_get_ntohs(tvb, offset + 2);
ti = proto_tree_add_text(tree, tvb, offset, 4, "Contents: Command-Code: %s, Flags: %s",
- val_to_str(cmd_code, cops_dec_cmd_code_vals, "<Unknown value>"),
- val_to_str(cmd_flags, cops_dec_cmd_flag_vals, "<Unknown flag>"));
+ val_to_str_const(cmd_code, cops_dec_cmd_code_vals, "<Unknown value>"),
+ val_to_str_const(cmd_flags, cops_dec_cmd_flag_vals, "<Unknown flag>"));
dec_tree = proto_item_add_subtree(ti, ett_cops_decision);
proto_tree_add_uint(dec_tree, hf_cops_dec_cmd_code, tvb, offset, 2, cmd_code);
offset += 2;
@@ -1224,7 +1224,7 @@ static void dissect_cops_object_data(tvbuff_t *tvb, packet_info *pinfo, guint32
error = tvb_get_ntohs(tvb, offset);
error_sub = tvb_get_ntohs(tvb, offset + 2);
ti = proto_tree_add_text(tree, tvb, offset, 4, "Contents: Error-Code: %s, Error Sub-code: 0x%04x",
- val_to_str(error, cops_error_vals, "<Unknown value>"), error_sub);
+ val_to_str_const(error, cops_error_vals, "<Unknown value>"), error_sub);
error_tree = proto_item_add_subtree(ti, ett_cops_error);
proto_tree_add_uint(error_tree, hf_cops_error, tvb, offset, 2, error);
offset += 2;
@@ -1570,7 +1570,7 @@ static int dissect_cops_pr_object_data(tvbuff_t *tvb, packet_info *pinfo, guint3
gperror = tvb_get_ntohs(tvb, offset);
gperror_sub = tvb_get_ntohs(tvb, offset + 2);
ti = proto_tree_add_text(tree, tvb, offset, 4, "Contents: Error-Code: %s, Error Sub-code: 0x%04x",
- val_to_str(gperror, cops_gperror_vals, "<Unknown value>"), gperror_sub);
+ val_to_str_const(gperror, cops_gperror_vals, "<Unknown value>"), gperror_sub);
gperror_tree = proto_item_add_subtree(ti, ett_cops_gperror);
proto_tree_add_uint(gperror_tree, hf_cops_gperror, tvb, offset, 2, gperror);
offset += 2;
@@ -1589,7 +1589,7 @@ static int dissect_cops_pr_object_data(tvbuff_t *tvb, packet_info *pinfo, guint3
cperror = tvb_get_ntohs(tvb, offset);
cperror_sub = tvb_get_ntohs(tvb, offset + 2);
ti = proto_tree_add_text(tree, tvb, offset, 4, "Contents: Error-Code: %s, Error Sub-code: 0x%04x",
- val_to_str(cperror, cops_cperror_vals, "<Unknown value>"), cperror_sub);
+ val_to_str_const(cperror, cops_cperror_vals, "<Unknown value>"), cperror_sub);
cperror_tree = proto_item_add_subtree(ti, ett_cops_cperror);
proto_tree_add_uint(cperror_tree, hf_cops_cperror, tvb, offset, 2, cperror);
offset += 2;
@@ -2640,12 +2640,12 @@ info_to_display(tvbuff_t *tvb, proto_item *stt, int offset, int octets, const ch
/* Hexadecimal format */
pi = proto_tree_add_uint_format(
stt, *hf_proto_parameter,tvb, offset, octets, code8,
- "%-28s : %s (0x%02x)",str,val_to_str(code8, vsp, "Unknown"),code8);
+ "%-28s : %s (0x%02x)",str,val_to_str_const(code8, vsp, "Unknown"),code8);
else
/* String table indexed */
pi = proto_tree_add_uint_format(
stt, *hf_proto_parameter,tvb, offset, octets, code8,
- "%-28s : %s (%u)",str,val_to_str(code8, vsp, "Unknown"),code8);
+ "%-28s : %s (%u)",str,val_to_str_const(code8, vsp, "Unknown"),code8);
}
break;
@@ -2712,11 +2712,11 @@ info_to_display(tvbuff_t *tvb, proto_item *stt, int offset, int octets, const ch
/* Hexadecimal format */
if (mode==FMT_HEX)
pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,tvb, offset, octets,
- code32,"%-28s : %s (0x%08x)",str,val_to_str(code32, vsp, "Unknown"),code32);
+ code32,"%-28s : %s (0x%08x)",str,val_to_str_const(code32, vsp, "Unknown"),code32);
else
/* String table indexed */
pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,tvb, offset, octets,
- code32,"%-28s : %s (%u)",str,val_to_str(code32, vsp, "Unknown"),code32);
+ code32,"%-28s : %s (%u)",str,val_to_str_const(code32, vsp, "Unknown"),code32);
}
break;
@@ -2775,8 +2775,8 @@ cops_transaction_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *st, guint8 op
val_to_str(code16,table_cops_dqos_transaction_id, "Unknown (0x%04x)"),code16);
/* Write the right data into the 'info field' on the Gui */
- g_snprintf(info,sizeof(info),"COPS %-20s - %s",val_to_str(op_code,cops_op_code_vals, "Unknown"),
- val_to_str(code16,table_cops_dqos_transaction_id, "Unknown"));
+ g_snprintf(info,sizeof(info),"COPS %-20s - %s",val_to_str_const(op_code,cops_op_code_vals, "Unknown"),
+ val_to_str_const(code16,table_cops_dqos_transaction_id, "Unknown"));
col_clear(pinfo->cinfo, COL_INFO);
col_add_str(pinfo->cinfo, COL_INFO,info);
@@ -3168,8 +3168,8 @@ cops_mm_transaction_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *st, guint8
val_to_str(code16,table_cops_mm_transaction_id, "Unknown (0x%04x)"),code16);
/* Write the right data into the 'info field' on the Gui */
- g_snprintf(info,sizeof(info),"COPS %-20s - %s",val_to_str(op_code,cops_op_code_vals, "Unknown"),
- val_to_str(code16,table_cops_mm_transaction_id, "Unknown"));
+ g_snprintf(info,sizeof(info),"COPS %-20s - %s",val_to_str_const(op_code,cops_op_code_vals, "Unknown"),
+ val_to_str_const(code16,table_cops_mm_transaction_id, "Unknown"));
col_clear(pinfo->cinfo, COL_INFO);
col_add_str(pinfo->cinfo, COL_INFO,info);
@@ -5561,7 +5561,7 @@ cops_packetcable_mm_error(tvbuff_t *tvb, proto_tree *st, guint n, guint32 offset
code = tvb_get_ntohs(tvb, offset);
proto_tree_add_uint_format(stt, hf_cops_pcmm_packetcable_error_code, tvb, offset, 2, code,
- "Error Code: %s (%u)", val_to_str(code, pcmm_packetcable_error_code, "Unknown"),
+ "Error Code: %s (%u)", val_to_str_const(code, pcmm_packetcable_error_code, "Unknown"),
code);
offset += 2;
diff --git a/epan/dissectors/packet-dccp.c b/epan/dissectors/packet-dccp.c
index b34dc97f4a..2706afaa32 100644
--- a/epan/dissectors/packet-dccp.c
+++ b/epan/dissectors/packet-dccp.c
@@ -308,9 +308,9 @@ dissect_feature_options(proto_tree *dccp_options_tree, tvbuff_t *tvb,
dccp_item =
proto_tree_add_text(dccp_options_tree, tvb, offset, option_len, "%s(",
- val_to_str(option_type,
- dccp_feature_options_vals,
- "Unknown Type"));
+ val_to_str_const(option_type,
+ dccp_feature_options_vals,
+ "Unknown Type"));
/*
* decode the feature according to whether it is server-priority (list)
@@ -329,9 +329,9 @@ dissect_feature_options(proto_tree *dccp_options_tree, tvbuff_t *tvb,
case 9: /* Check Data Checksum; fall through */
case 192: /* Send Loss Event Rate, RFC 4342, section 8.4 */
proto_item_append_text(dccp_item, "%s",
- val_to_str(feature_number,
- dccp_feature_numbers_vals,
- "Unknown Type"));
+ val_to_str_const(feature_number,
+ dccp_feature_numbers_vals,
+ "Unknown Type"));
for (i = 0; i < option_len - 3; i++)
proto_item_append_text(dccp_item, "%s %d", i ? "," : "",
tvb_get_guint8(tvb,
@@ -343,9 +343,9 @@ dissect_feature_options(proto_tree *dccp_options_tree, tvbuff_t *tvb,
case 3: /* Sequence Window; fall through */
case 5: /* Ack Ratio */
proto_item_append_text(dccp_item, "%s",
- val_to_str(feature_number,
- dccp_feature_numbers_vals,
- "Unknown Type"));
+ val_to_str_const(feature_number,
+ dccp_feature_numbers_vals,
+ "Unknown Type"));
if (option_len > 3) /* could be empty Confirm */
proto_item_append_text(dccp_item, " %" G_GINT64_MODIFIER "u",
@@ -716,7 +716,7 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
"%s > %s [%s] Seq=%" G_GINT64_MODIFIER "u",
get_dccp_port(dccph->sport),
get_dccp_port(dccph->dport),
- val_to_str(dccph->type, dccp_packet_type_vals, "Unknown Type"),
+ val_to_str_const(dccph->type, dccp_packet_type_vals, "Unknown Type"),
dccph->seq);
if (tree) {
@@ -729,8 +729,8 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
" [%s] Seq=%" G_GINT64_MODIFIER "u",
get_dccp_port(dccph->sport), dccph->sport,
get_dccp_port(dccph->dport), dccph->dport,
- val_to_str(dccph->type, dccp_packet_type_vals,
- "Unknown Type"),
+ val_to_str_const(dccph->type, dccp_packet_type_vals,
+ "Unknown Type"),
dccph->seq);
} else {
dccp_item = proto_tree_add_item(tree, proto_dccp, tvb, offset, 8,
@@ -1016,8 +1016,8 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dccph->data3);
}
col_append_fstr(pinfo->cinfo, COL_INFO, " (code=%s)",
- val_to_str(dccph->reset_code, dccp_reset_code_vals,
- "Unknown"));
+ val_to_str_const(dccph->reset_code, dccp_reset_code_vals,
+ "Unknown"));
offset += 4; /* move offset past the Reset Code and data123 */
break;
diff --git a/epan/dissectors/packet-dcom.c b/epan/dissectors/packet-dcom.c
index 8b466c4c35..45348667fc 100644
--- a/epan/dissectors/packet-dcom.c
+++ b/epan/dissectors/packet-dcom.c
@@ -1104,7 +1104,7 @@ dissect_dcom_indexed_HRESULT(tvbuff_t *tvb, int offset, packet_info *pinfo,
/* special formatted output of indexed value */
item = proto_tree_add_uint_format(tree, hf_dcom_hresult, tvb, offset-4, 4, u32HResult,
"HResult[%u]: %s (0x%08x)", field_index,
- val_to_str(u32HResult, dcom_hresult_vals, "Unknown"),
+ val_to_str_const(u32HResult, dcom_hresult_vals, "Unknown"),
u32HResult);
}
/* expert info only if severity flag is set */
diff --git a/epan/dissectors/packet-dhcp-failover.c b/epan/dissectors/packet-dhcp-failover.c
index 1a2538331e..998c778039 100644
--- a/epan/dissectors/packet-dhcp-failover.c
+++ b/epan/dissectors/packet-dhcp-failover.c
@@ -400,7 +400,7 @@ dissect_dhcpfo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
hf_dhcpfo_type, tvb, offset, 1, type);
}
col_add_str(pinfo->cinfo, COL_INFO,
- val_to_str(type, failover_vals, "Unknown Packet"));
+ val_to_str_const(type, failover_vals, "Unknown Packet"));
offset += 1;
poffset = tvb_get_guint8(tvb, offset);
@@ -483,7 +483,7 @@ dissect_dhcpfo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/*** DHCP-Style-Options ****/
proto_item_append_text(oi, ", %s (%u)",
- val_to_str(opcode, option_code_vals, "Unknown Option"),
+ val_to_str_const(opcode, option_code_vals, "Unknown Option"),
opcode);
proto_tree_add_uint(option_tree, hf_dhcpfo_option_code, tvb,
@@ -501,7 +501,7 @@ dissect_dhcpfo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case DHCP_FO_PD_BINDING_STATUS:
binding_status = tvb_get_guint8(tvb, offset);
proto_item_append_text(oi, ", %s (%d)",
- val_to_str(binding_status,
+ val_to_str_const(binding_status,
binding_status_vals,
"Unknown Packet"),
binding_status);
@@ -611,7 +611,7 @@ dissect_dhcpfo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
reject_reason = tvb_get_guint8(tvb, offset);
proto_item_append_text(oi, ", %s (%d)",
- val_to_str(reject_reason, reject_reason_vals,
+ val_to_str_const(reject_reason, reject_reason_vals,
"Unknown Packet"),
reject_reason);
@@ -775,7 +775,7 @@ dissect_dhcpfo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
server_state = tvb_get_guint8(tvb, offset);
proto_item_append_text(oi, ", %s (%u)",
- val_to_str(server_state, server_state_vals,
+ val_to_str_const(server_state, server_state_vals,
"Unknown"),
server_state);
diff --git a/epan/dissectors/packet-dhcpv6.c b/epan/dissectors/packet-dhcpv6.c
index 6bf4fc9a5e..b2dd716c82 100644
--- a/epan/dissectors/packet-dhcpv6.c
+++ b/epan/dissectors/packet-dhcpv6.c
@@ -434,7 +434,7 @@ dissect_packetcable_ccc_option(proto_tree *v_tree, tvbuff_t *tvb, int optoff,
vti = proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 4,
"Sub element %u: %s: ", subopt,
- val_to_str(subopt, pkt_ccc_opt_vals, "unknown/reserved") );
+ val_to_str_const(subopt, pkt_ccc_opt_vals, "unknown/reserved") );
switch (subopt) {
case PKT_CCC_PRI_DHCP: /* IPv4 address values */
@@ -634,7 +634,7 @@ dissect_packetcable_cccV6_option(proto_tree *v_tree, tvbuff_t *tvb, int optoff,
vti = proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 4,
"Sub element %u: %s: ", subopt,
- val_to_str(subopt, pkt_cccV6_opt_vals, "unknown/reserved") );
+ val_to_str_const(subopt, pkt_cccV6_opt_vals, "unknown/reserved") );
switch (subopt) {
case PKT_CCCV6_PRI_DSS:
@@ -796,8 +796,8 @@ dissect_cablelabs_specific_opts(proto_tree *v_tree, tvbuff_t *tvb, int voff, int
/* Type */
type = tvb_get_ntohs(tvb, off);
ti = proto_tree_add_text(v_tree, tvb, off, 2,
- "Suboption %d: %s", type, val_to_str(type,
- cl_vendor_subopt_values, "unknown"));
+ "Suboption %d: %s", type, val_to_str_const(type,
+ cl_vendor_subopt_values, "unknown"));
/* Length */
tlv_len = tvb_get_ntohs(tvb, off+2);
@@ -1139,8 +1139,8 @@ dhcpv6_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree,
duidtype = tvb_get_ntohs(tvb, off);
proto_tree_add_text(subtree, tvb, off, 2,
"DUID type: %s (%u)",
- val_to_str(duidtype,
- duidtype_vals, "Unknown"),
+ val_to_str_const(duidtype,
+ duidtype_vals, "Unknown"),
duidtype);
switch (duidtype) {
case DUID_LLT:
@@ -1307,9 +1307,9 @@ dhcpv6_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree,
requested_opt_code = tvb_get_ntohs(tvb, off + i);
proto_tree_add_text(subtree, tvb, off + i,
2, "Requested Option code: %s (%d)",
- val_to_str(requested_opt_code,
- opttype_vals,
- "Unknown"),
+ val_to_str_const(requested_opt_code,
+ opttype_vals,
+ "Unknown"),
requested_opt_code);
}
break;
@@ -1381,8 +1381,8 @@ dhcpv6_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree,
status_code = tvb_get_ntohs(tvb, off);
proto_tree_add_text(subtree, tvb, off, 2,
"Status Code: %s (%d)",
- val_to_str(status_code, statuscode_vals,
- "Unknown"),
+ val_to_str_const(status_code, statuscode_vals,
+ "Unknown"),
status_code);
if (optlen - 2 > 0) {
diff --git a/epan/dissectors/packet-diameter.c b/epan/dissectors/packet-diameter.c
index 4708b745aa..3edc0f65c6 100644
--- a/epan/dissectors/packet-diameter.c
+++ b/epan/dissectors/packet-diameter.c
@@ -406,7 +406,7 @@ dissect_diameter_avp(diam_ctx_t* c, tvbuff_t* tvb, int offset)
if(vendor->vs_avps_ext == NULL) {
g_array_sort(vendor->vs_avps, compare_avps);
vendor->vs_avps_ext = value_string_ext_new(VND_AVP_VS(vendor), VND_AVP_VS_LEN(vendor)+1,
- g_strdup_printf("diameter_vendor_%s",val_to_str_ext(vendorid, &sminmpec_values_ext, "Unknown")));
+ g_strdup_printf("diameter_vendor_%s",val_to_str_ext_const(vendorid, &sminmpec_values_ext, "Unknown")));
#if 0
{ /* Debug code */
value_string* vendor_avp_vs=VALUE_STRING_EXT_VS_P(vendor->vs_avps_ext);
@@ -434,7 +434,7 @@ dissect_diameter_avp(diam_ctx_t* c, tvbuff_t* tvb, int offset)
"if you know what this is you can add it to dictionary.xml");
expert_add_info_format(c->pinfo, iu, PI_UNDECODED, PI_WARN,
"Unknown AVP %u (vendor=%s)", code,
- val_to_str_ext(vendorid, &sminmpec_values_ext, "Unknown"));
+ val_to_str_ext_const(vendorid, &sminmpec_values_ext, "Unknown"));
PROTO_ITEM_SET_GENERATED(iu);
}
@@ -928,7 +928,7 @@ dissect_diameter_common(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree)
break;
}
}
- cmd_str = val_to_str(cmd, cmd_vs, "Unknown");
+ cmd_str = val_to_str_const(cmd, cmd_vs, "Unknown");
col_add_fstr(pinfo->cinfo, COL_INFO,
"cmd=%s%s(%d) flags=%s %s=%s(%d) h2h=%x e2e=%x",
@@ -937,7 +937,7 @@ dissect_diameter_common(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree)
cmd,
msgflags_str[((flags_bits>>4)&0x0f)],
c->version_rfc ? "appl" : "vend",
- val_to_str(fourth, c->version_rfc ? dictionary.applications : vnd_short_vs, "Unknown"),
+ val_to_str_const(fourth, c->version_rfc ? dictionary.applications : vnd_short_vs, "Unknown"),
fourth,
tvb_get_ntohl(tvb,12),
tvb_get_ntohl(tvb,16));
diff --git a/epan/dissectors/packet-dis.c b/epan/dissectors/packet-dis.c
index cf5fd855f1..1a7eae6f3d 100644
--- a/epan/dissectors/packet-dis.c
+++ b/epan/dissectors/packet-dis.c
@@ -211,7 +211,7 @@ static gint dissect_dis(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Locate the string name for the PDU type enumeration,
* or default to "Unknown".
*/
- pduString = val_to_str(pduType, DIS_PDU_Type_Strings, "Unknown");
+ pduString = val_to_str_const(pduType, DIS_PDU_Type_Strings, "Unknown");
/* Locate the appropriate PDU parser, if type is known.
*/
@@ -413,8 +413,8 @@ static gint dissect_dis(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_add_fstr( pinfo->cinfo, COL_INFO,
"PDUType: %s, %s, %s",
pduString,
- val_to_str(entityKind, DIS_PDU_EntityKind_Strings, "Unknown Entity Kind"),
- val_to_str(entityDomain, DIS_PDU_Domain_Strings, "Unknown Entity Domain")
+ val_to_str_const(entityKind, DIS_PDU_EntityKind_Strings, "Unknown Entity Kind"),
+ val_to_str_const(entityDomain, DIS_PDU_Domain_Strings, "Unknown Entity Domain")
);
break;
@@ -423,7 +423,7 @@ static gint dissect_dis(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
"PDUType: %s, RadioID=%u, Encoding Type=%s, Number of Samples=%u",
pduString,
radioID,
- val_to_str(DIS_ENCODING_TYPE(encodingScheme), DIS_PDU_Encoding_Type_Strings, "Unknown Encoding Type"),
+ val_to_str_const(DIS_ENCODING_TYPE(encodingScheme), DIS_PDU_Encoding_Type_Strings, "Unknown Encoding Type"),
numSamples
);
break;
@@ -432,7 +432,7 @@ static gint dissect_dis(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
"PDUType: %s, RadioID=%u, Transmit State=%s",
pduString,
radioID,
- val_to_str(disRadioTransmitState, DIS_PDU_RadioTransmitState_Strings, "Unknown Transmit State")
+ val_to_str_const(disRadioTransmitState, DIS_PDU_RadioTransmitState_Strings, "Unknown Transmit State")
);
break;
default:
diff --git a/epan/dissectors/packet-dlm3.c b/epan/dissectors/packet-dlm3.c
index b2f39e3d31..971cefa1d8 100644
--- a/epan/dissectors/packet-dlm3.c
+++ b/epan/dissectors/packet-dlm3.c
@@ -465,9 +465,9 @@ dissect_dlm3_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
hf_dlm3_m_type, tvb, offset, 4, m_type);
col_append_fstr(pinfo->cinfo, COL_INFO,
": %s",
- val_to_str(m_type,
- dlm3_msg,
- "Unknown"));
+ val_to_str_const(m_type,
+ dlm3_msg,
+ "Unknown"));
offset += 4;
proto_tree_add_item(tree,
@@ -703,9 +703,9 @@ dissect_dlm3_rcom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
hf_dlm3_rc_type, tvb, offset, 4, rc_type);
col_append_fstr(pinfo->cinfo, COL_INFO,
": %s",
- val_to_str(rc_type,
- dlm3_rcom,
- "Unknown"));
+ val_to_str_const(rc_type,
+ dlm3_rcom,
+ "Unknown"));
offset += 4;
proto_tree_add_item(tree,
diff --git a/epan/dissectors/packet-dmp.c b/epan/dissectors/packet-dmp.c
index a9c81642fd..41cd5d30c3 100644
--- a/epan/dissectors/packet-dmp.c
+++ b/epan/dissectors/packet-dmp.c
@@ -1082,18 +1082,18 @@ static const gchar *msg_type_to_str (void)
case STANAG:
/* Include message type and precedence */
msg_type = ep_strdup_printf ("%s (%s) [%s]",
- val_to_str (dmp.msg_type, type_vals, "Unknown"),
- val_to_str (dmp.st_type, message_type_vals, "Unknown"),
+ val_to_str_const (dmp.msg_type, type_vals, "Unknown"),
+ val_to_str_const (dmp.st_type, message_type_vals, "Unknown"),
(dmp.prec == 0x6 || dmp.prec == 0x7) ?
- val_to_str (dmp.prec-4, precedence, "Unknown") :
- val_to_str (dmp.prec, precedence, "Unknown"));
+ val_to_str_const (dmp.prec-4, precedence, "Unknown") :
+ val_to_str_const (dmp.prec, precedence, "Unknown"));
break;
case IPM:
/* Include importance */
msg_type = ep_strdup_printf ("%s [%s]",
- val_to_str (dmp.msg_type, type_vals, "Unknown"),
- val_to_str (dmp.prec, importance, "Unknown"));
+ val_to_str_const (dmp.msg_type, type_vals, "Unknown"),
+ val_to_str_const (dmp.prec, importance, "Unknown"));
break;
case REPORT:
@@ -1104,7 +1104,7 @@ static const gchar *msg_type_to_str (void)
break;
case NOTIF:
- msg_type = val_to_str (dmp.notif_type, notif_type, "Unknown");
+ msg_type = val_to_str_const (dmp.notif_type, notif_type, "Unknown");
break;
case ACK:
@@ -1129,9 +1129,9 @@ static const gchar *non_del_reason_str (guint32 value)
{
if (value < 0x3D) {
/* Standard values according to P1 */
- return val_to_str (value, p1_NonDeliveryReasonCode_vals, "Unknown");
+ return val_to_str_const (value, p1_NonDeliveryReasonCode_vals, "Unknown");
} else {
- return val_to_str (value, non_del_reason, "Unknown");
+ return val_to_str_const (value, non_del_reason, "Unknown");
}
}
@@ -1139,25 +1139,25 @@ static const gchar *non_del_diagn_str (guint32 value)
{
if (value < 0x7C) {
/* Standard values according to P1 */
- return val_to_str (value, p1_NonDeliveryDiagnosticCode_vals, "Unknown");
+ return val_to_str_const (value, p1_NonDeliveryDiagnosticCode_vals, "Unknown");
} else {
- return val_to_str (value, non_del_diagn, "Unknown");
+ return val_to_str_const (value, non_del_diagn, "Unknown");
}
}
static const gchar *nrn_reason_str (guint32 value)
{
/* Standard values according to P22 */
- return val_to_str (value, p22_NonReceiptReasonField_vals, "Reserved");
+ return val_to_str_const (value, p22_NonReceiptReasonField_vals, "Reserved");
}
static const gchar *discard_reason_str (guint32 value)
{
if (value < 0xFE) {
/* Standard values according to P22 */
- return val_to_str (value, p22_DiscardReasonField_vals, "Reserved");
+ return val_to_str_const (value, p22_DiscardReasonField_vals, "Reserved");
} else {
- return val_to_str (value, discard_reason, "Unknown");
+ return val_to_str_const (value, discard_reason, "Unknown");
}
}
@@ -1956,7 +1956,7 @@ static gint dissect_dmp_direct_addr (tvbuff_t *tvb, packet_info *pinfo,
en = proto_tree_add_uint_format (field_tree, hf_addr_dir_address1, tvb,
offset, 1, value,
"%sDirect Address (bits 6-0): %d",
- val_to_str (addr_type, addr_type_str, ""),
+ val_to_str_const (addr_type, addr_type_str, ""),
value & 0x7F);
addr_tree = proto_item_add_subtree (en, ett_address_direct);
proto_tree_add_item (addr_tree, hf_addr_dir_addr_ext, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -1969,7 +1969,7 @@ static gint dissect_dmp_direct_addr (tvbuff_t *tvb, packet_info *pinfo,
en = proto_tree_add_uint_format (field_tree, hf_addr_dir_address2, tvb,
offset, 1, value,
"%sDirect Address (bits 12-7): %d",
- val_to_str (addr_type, addr_type_str, ""),
+ val_to_str_const (addr_type, addr_type_str, ""),
value & 0x3F);
addr_tree = proto_item_add_subtree (en, ett_address_direct);
proto_tree_add_item (addr_tree, hf_addr_dir_addr_ext, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -1988,7 +1988,7 @@ static gint dissect_dmp_direct_addr (tvbuff_t *tvb, packet_info *pinfo,
en = proto_tree_add_uint_format (field_tree, hf_addr_dir_address3, tvb,
offset, 1, value,
"%sDirect Address (bits 18-13): %d",
- val_to_str (addr_type,addr_type_str,""),
+ val_to_str_const (addr_type,addr_type_str,""),
value & 0x3F);
addr_tree = proto_item_add_subtree (en, ett_address_direct);
en = proto_tree_add_item (addr_tree, hf_reserved_0xC0, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -2003,14 +2003,14 @@ static gint dissect_dmp_direct_addr (tvbuff_t *tvb, packet_info *pinfo,
en = proto_tree_add_uint_format (field_tree, hf_addr_dir_address_generated,
tvb, offset, 0, dir_addr,
"%sDirect Address: %d",
- val_to_str (addr_type, addr_type_str, ""),
+ val_to_str_const (addr_type, addr_type_str, ""),
dir_addr);
PROTO_ITEM_SET_GENERATED (en);
} else {
en = proto_tree_add_uint_format (field_tree, hf_addr_dir_address, tvb,
offset, 1, value,
"%sDirect Address: %d",
- val_to_str (addr_type, addr_type_str, ""),
+ val_to_str_const (addr_type, addr_type_str, ""),
value & 0x7F);
addr_tree = proto_item_add_subtree (en, ett_address_direct);
proto_tree_add_item (addr_tree, hf_addr_dir_addr_ext, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -2025,7 +2025,7 @@ static gint dissect_dmp_direct_addr (tvbuff_t *tvb, packet_info *pinfo,
}
}
proto_item_append_text (tf, ", %sDirect Address: %d",
- val_to_str (addr_type, addr_type_str, ""), dir_addr);
+ val_to_str_const (addr_type, addr_type_str, ""), dir_addr);
return offset;
}
@@ -2051,13 +2051,13 @@ static gint dissect_dmp_ext_addr (tvbuff_t *tvb, packet_info *pinfo,
length = (value & 0x1F);
ef = proto_tree_add_none_format (field_tree, hf_addr_ext_address, tvb,
offset, -1, "%sExtended Address",
- val_to_str (addr_type, addr_type_str, ""));
+ val_to_str_const (addr_type, addr_type_str, ""));
ext_tree = proto_item_add_subtree (ef, ett_address_extended);
en = proto_tree_add_uint_format (ext_tree, hf_addr_ext_type, tvb,
offset, 1, value, "Address Type: %s",
- val_to_str (type, ext_addr_type,
- "Reserved"));
+ val_to_str_const (type, ext_addr_type,
+ "Reserved"));
addr_tree = proto_item_add_subtree (en, ett_address_ext_type);
proto_tree_add_item (addr_tree, hf_addr_ext_type, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -2077,8 +2077,8 @@ static gint dissect_dmp_ext_addr (tvbuff_t *tvb, packet_info *pinfo,
en = proto_tree_add_uint_format (ext_tree, hf_addr_ext_type_ext, tvb,
offset, 1, value, "Address Type Ext: %s",
- val_to_str (type, ext_addr_type_ext,
- "Reserved"));
+ val_to_str_const (type, ext_addr_type_ext,
+ "Reserved"));
addr_tree = proto_item_add_subtree (en, ett_address_ext_type);
proto_tree_add_item (addr_tree, hf_addr_ext_type, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -2118,7 +2118,7 @@ static gint dissect_dmp_ext_addr (tvbuff_t *tvb, packet_info *pinfo,
}
proto_item_append_text (ef, ", Type: %s, Length: %d",
- val_to_str (type, ext_addr_type, "Reserved"),
+ val_to_str_const (type, ext_addr_type, "Reserved"),
length);
if (rec_no != -1) {
@@ -2128,8 +2128,8 @@ static gint dissect_dmp_ext_addr (tvbuff_t *tvb, packet_info *pinfo,
}
}
proto_item_append_text (tf, ", %sExtended Address Type: %s",
- val_to_str (addr_type, addr_type_str, ""),
- val_to_str (type, ext_addr_type_short, "Reserved"));
+ val_to_str_const (addr_type, addr_type_str, ""),
+ val_to_str_const (type, ext_addr_type_short, "Reserved"));
proto_item_set_len (ef, offset - boffset);
@@ -2160,16 +2160,16 @@ static gint dissect_dmp_originator (tvbuff_t *tvb, packet_info *pinfo,
en = proto_tree_add_uint_format (field_tree, hf_addr_ext_form_orig_v1, tvb,
offset, 1, value,
"Address Form: %s",
- val_to_str (dmp_addr_form,
- addr_form_orig_v1, "Reserved"));
+ val_to_str_const (dmp_addr_form,
+ addr_form_orig_v1, "Reserved"));
rec_tree = proto_item_add_subtree (en, ett_address_ext_form);
proto_tree_add_item (rec_tree, hf_addr_ext_form_orig_v1, tvb, offset, 1, ENC_BIG_ENDIAN);
} else {
en = proto_tree_add_uint_format (field_tree, hf_addr_ext_form_orig, tvb,
offset, 1, value,
"Address Form: %s",
- val_to_str (dmp_addr_form,
- addr_form_orig, "Reserved"));
+ val_to_str_const (dmp_addr_form,
+ addr_form_orig, "Reserved"));
rec_tree = proto_item_add_subtree (en, ett_address_ext_form);
proto_tree_add_item (rec_tree, hf_addr_ext_form_orig, tvb, offset, 1, ENC_BIG_ENDIAN);
}
@@ -2268,12 +2268,12 @@ static void dmp_add_recipient_info (proto_item *tf, guint8 rep_req,
}
if (rep_req) {
proto_item_append_text (tf, "%s",
- val_to_str (rep_req, report_vals_short, ""));
+ val_to_str_const (rep_req, report_vals_short, ""));
}
if (not_req) {
dmp.notif_req = TRUE;
proto_item_append_text (tf, "%s",
- val_to_str (not_req, notif_vals_short, ""));
+ val_to_str_const (not_req, notif_vals_short, ""));
}
if (action) {
if (dmp.msg_type == STANAG) {
@@ -2472,8 +2472,8 @@ static gint dissect_dmp_ext_encoding (tvbuff_t *tvb, packet_info *pinfo,
en = proto_tree_add_uint_format (field_tree, hf_addr_ext_form, tvb,
offset, 1, value,
"Address Form: %s",
- val_to_str (dmp_addr_form,
- addr_form, "Reserved"));
+ val_to_str_const (dmp_addr_form,
+ addr_form, "Reserved"));
addr_tree = proto_item_add_subtree (en, ett_address_ext_form);
proto_tree_add_item (addr_tree, hf_addr_ext_form, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -2487,8 +2487,8 @@ static gint dissect_dmp_ext_encoding (tvbuff_t *tvb, packet_info *pinfo,
en = proto_tree_add_uint_format (field_tree, hf_addr_ext_rep_req, tvb,
offset, 1, value,
"Report Request: %s",
- val_to_str ((value & 0x0C) >> 2,
- report_vals, "Reserved"));
+ val_to_str_const ((value & 0x0C) >> 2,
+ report_vals, "Reserved"));
addr_tree = proto_item_add_subtree (en, ett_address_ext_rep_req);
proto_tree_add_item (addr_tree, hf_addr_ext_rep_req, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -2496,8 +2496,8 @@ static gint dissect_dmp_ext_encoding (tvbuff_t *tvb, packet_info *pinfo,
en = proto_tree_add_uint_format (field_tree, hf_addr_ext_not_req, tvb,
offset, 1, value,
"Notification Request: %s",
- val_to_str (value & 0x03,
- notif_vals, "Reserved"));
+ val_to_str_const (value & 0x03,
+ notif_vals, "Reserved"));
addr_tree = proto_item_add_subtree (en, ett_address_ext_not_req);
proto_tree_add_item (addr_tree, hf_addr_ext_not_req, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
@@ -2644,12 +2644,12 @@ static gint dissect_dmp_ack (tvbuff_t *tvb, packet_info *pinfo,
dmp.ack_reason = tvb_get_guint8 (tvb, offset);
proto_item_append_text (en, ", Reason: %s",
- val_to_str (dmp.ack_reason, ack_reason, "Reserved"));
+ val_to_str_const (dmp.ack_reason, ack_reason, "Reserved"));
rt = proto_tree_add_item (ack_tree, hf_ack_reason, tvb, offset, 1, ENC_BIG_ENDIAN);
if (dmp.ack_reason != 0) {
expert_add_info_format (pinfo, rt, PI_RESPONSE_CODE, PI_NOTE, "ACK reason: %s",
- val_to_str (dmp.ack_reason, ack_reason, "Reserved"));
+ val_to_str_const (dmp.ack_reason, ack_reason, "Reserved"));
}
offset += 1;
@@ -2879,8 +2879,8 @@ static gint dissect_dmp_envelope (tvbuff_t *tvb, packet_info *pinfo,
tf = proto_tree_add_uint_format (envelope_tree, hf_envelope_type,
tvb, offset, 1, envelope,
"Content Type: %s (%d)",
- val_to_str (envelope & 0x07,
- type_vals, "Unknown"),
+ val_to_str_const (envelope & 0x07,
+ type_vals, "Unknown"),
envelope & 0x07);
field_tree = proto_item_add_subtree (tf, ett_envelope_cont_type);
proto_tree_add_item (field_tree, hf_envelope_type, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -2909,7 +2909,7 @@ static gint dissect_dmp_envelope (tvbuff_t *tvb, packet_info *pinfo,
tf = proto_tree_add_uint_format (envelope_tree, hf_envelope_msg_id_type,
tvb, offset, 1, envelope,
"Message Identifier Type: %s (%d)",
- val_to_str (dmp.msg_id_type, msg_id_type_vals, "Unknown"),
+ val_to_str_const (dmp.msg_id_type, msg_id_type_vals, "Unknown"),
dmp.msg_id_type);
field_tree = proto_item_add_subtree (tf, ett_envelope_msg_id_type);
proto_tree_add_item (field_tree, hf_envelope_msg_id_type, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -3142,19 +3142,19 @@ static gint dissect_dmp_message (tvbuff_t *tvb, packet_info *pinfo,
/* Encoded Information Type */
tf = proto_tree_add_uint_format (message_tree, hf_message_eit,
tvb, offset, 1, message, "EIT: %s (%d)",
- val_to_str (eit, eit_vals, "Unknown"),
+ val_to_str_const (eit, eit_vals, "Unknown"),
eit);
field_tree = proto_item_add_subtree (tf, ett_message_eit);
proto_tree_add_item (field_tree, hf_message_eit, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_item_append_text (en, ", Type: %s",
- val_to_str (eit, eit_vals, "Unknown"));
+ val_to_str_const (eit, eit_vals, "Unknown"));
/* Compression Algorithm */
tf = proto_tree_add_uint_format (message_tree, hf_message_compr,
tvb, offset, 1, message,
"Compression Algorithm: %s (%d)",
- val_to_str (compr_alg, compression_vals,
- "Unknown"), compr_alg);
+ val_to_str_const (compr_alg, compression_vals, "Unknown"),
+ compr_alg);
field_tree = proto_item_add_subtree (tf, ett_message_compr);
tr = proto_tree_add_item (field_tree, hf_message_compr, tvb, offset, 1, ENC_BIG_ENDIAN);
if (compr_alg == ALGORITHM_ZLIB) {
@@ -3631,8 +3631,8 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo,
tf = proto_tree_add_uint_format (message_tree, hf_message_st_type,
tvb, offset, 1, message,
"Message Type: %s (%d)",
- val_to_str (dmp.st_type,
- message_type_vals, ""),
+ val_to_str_const (dmp.st_type,
+ message_type_vals, ""),
dmp.st_type);
field_tree = proto_item_add_subtree (tf, ett_message_st_type);
proto_tree_add_item (field_tree, hf_message_st_type, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -3653,7 +3653,7 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo,
tf = proto_tree_add_uint_format (message_tree, hf_message_precedence,
tvb, offset, 1, message,
"Precedence: %s (%d)",
- val_to_str (dmp.prec, precedence, ""),
+ val_to_str_const (dmp.prec, precedence, ""),
dmp.prec);
field_tree = proto_item_add_subtree (tf, ett_message_precedence);
proto_tree_add_item (field_tree, hf_message_precedence, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -3675,7 +3675,7 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo,
tf = proto_tree_add_uint_format (message_tree, hf_message_importance,
tvb, offset, 1, message,
"Importance: %s (%d)",
- val_to_str (dmp.prec, importance, ""),
+ val_to_str_const (dmp.prec, importance, ""),
dmp.prec);
field_tree = proto_item_add_subtree (tf, ett_message_importance);
proto_tree_add_item (field_tree, hf_message_importance, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -3685,8 +3685,8 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo,
tf = proto_tree_add_uint_format (message_tree, hf_message_body_format,
tvb, offset, 1, message,
"Body Format: %s (%d)",
- val_to_str (message & 0x03,
- body_format_vals, ""),
+ val_to_str_const (message & 0x03,
+ body_format_vals, ""),
message & 0x03);
field_tree = proto_item_add_subtree (tf, ett_message_body_format);
proto_tree_add_item (field_tree, hf_message_body_format, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -3708,7 +3708,7 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo,
class_name = dmp_national_sec_class (dmp_nation, dmp_sec_class);
}
if ((dmp_sec_pol == NATO || dmp_sec_pol == NATIONAL) && !class_name) {
- class_name = val_to_str (dmp_sec_class, sec_class, "");
+ class_name = val_to_str_const (dmp_sec_class, sec_class, "");
}
if (class_name && class_name[0]) {
tf = proto_tree_add_uint_format (message_tree, hf_message_sec_class_val,
@@ -3757,8 +3757,8 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo,
tf = proto_tree_add_uint_format (message_tree, hf_notif_type,
tvb, offset, 1, message,
"Notification Type: %s",
- val_to_str (dmp.notif_type, notif_type,
- "Reserved"));
+ val_to_str_const (dmp.notif_type, notif_type,
+ "Reserved"));
field_tree = proto_item_add_subtree (tf, ett_notif_type);
proto_tree_add_item (field_tree, hf_notif_type, tvb, offset, 1, ENC_BIG_ENDIAN);
} else if (message & 0x02) {
diff --git a/epan/dissectors/packet-dtls.c b/epan/dissectors/packet-dtls.c
index 81055996af..8cf30b9fdd 100644
--- a/epan/dissectors/packet-dtls.c
+++ b/epan/dissectors/packet-dtls.c
@@ -929,7 +929,7 @@ dissect_dtls_record(tvbuff_t *tvb, packet_info *pinfo,
proto_item_set_text(dtls_record_tree,
"%s Record Layer: %s Protocol: %s",
val_to_str_const(*conv_version, ssl_version_short_names, "SSL"),
- val_to_str(content_type, ssl_31_content_type, "unknown"),
+ val_to_str_const(content_type, ssl_31_content_type, "unknown"),
association?association->info:"Application Data");
/* show decrypted data info, if available */
@@ -1017,7 +1017,7 @@ dissect_dtls_change_cipher_spec(tvbuff_t *tvb,
proto_item_set_text(tree,
"%s Record Layer: %s Protocol: Change Cipher Spec",
val_to_str_const(*conv_version, ssl_version_short_names, "SSL"),
- val_to_str(content_type, ssl_31_content_type, "unknown"));
+ val_to_str_const(content_type, ssl_31_content_type, "unknown"));
proto_tree_add_item(tree, hf_dtls_change_cipher_spec, tvb,
offset, 1, ENC_NA);
}
@@ -1257,7 +1257,7 @@ dissect_dtls_handshake(tvbuff_t *tvb, packet_info *pinfo,
{
proto_item_set_text(tree, "%s Record Layer: %s Protocol: %s%s",
val_to_str_const(*conv_version, ssl_version_short_names, "SSL"),
- val_to_str(content_type, ssl_31_content_type, "unknown"),
+ val_to_str_const(content_type, ssl_31_content_type, "unknown"),
(msg_type_str!=NULL) ? msg_type_str :
"Encrypted Handshake Message",
(frag_str!=NULL) ? frag_str : "");
@@ -1266,7 +1266,7 @@ dissect_dtls_handshake(tvbuff_t *tvb, packet_info *pinfo,
{
proto_item_set_text(tree, "%s Record Layer: %s Protocol: %s%s",
val_to_str_const(*conv_version, ssl_version_short_names, "SSL"),
- val_to_str(content_type, ssl_31_content_type, "unknown"),
+ val_to_str_const(content_type, ssl_31_content_type, "unknown"),
"Multiple Handshake Messages",
(frag_str!=NULL) ? frag_str : "");
}
diff --git a/epan/dissectors/packet-dvbci.c b/epan/dissectors/packet-dvbci.c
index 64be06bdfe..04e0c9fcc5 100644
--- a/epan/dissectors/packet-dvbci.c
+++ b/epan/dissectors/packet-dvbci.c
@@ -2684,8 +2684,8 @@ dissect_dvbci_payload_mmi(guint32 tag, gint len_field,
break;
case T_DISPLAY_CONTROL:
disp_ctl_cmd = tvb_get_guint8(tvb,offset);
- disp_ctl_cmd_str = val_to_str(disp_ctl_cmd,
- dvbci_disp_ctl_cmd, "unknown command");
+ disp_ctl_cmd_str = val_to_str_const(disp_ctl_cmd,
+ dvbci_disp_ctl_cmd, "unknown command");
col_append_sep_fstr(pinfo->cinfo, COL_INFO, ": ",
"%s", disp_ctl_cmd_str);
proto_tree_add_item(tree, hf_dvbci_disp_ctl_cmd, tvb,
@@ -2707,7 +2707,7 @@ dissect_dvbci_payload_mmi(guint32 tag, gint len_field,
break;
case T_DISPLAY_REPLY:
disp_rep_id = tvb_get_guint8(tvb,offset);
- disp_rep_id_str = val_to_str(disp_rep_id,
+ disp_rep_id_str = val_to_str_const(disp_rep_id,
dvbci_disp_rep_id, "unknown command");
col_append_sep_fstr(pinfo->cinfo, COL_INFO, ": ",
"%s", disp_rep_id_str);
@@ -2856,7 +2856,7 @@ dissect_dvbci_payload_cup(guint32 tag, gint len_field _U_,
upgrade_type = tvb_get_guint8(tvb, offset);
proto_tree_add_item(tree, hf_dvbci_cup_type, tvb, offset, 1, ENC_BIG_ENDIAN);
col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "(%s)",
- val_to_str(upgrade_type, dvbci_cup_type, "unknown"));
+ val_to_str_const(upgrade_type, dvbci_cup_type, "unknown"));
offset++;
download_time = tvb_get_ntohs(tvb, offset);
if (download_time == 0) {
@@ -2875,7 +2875,7 @@ dissect_dvbci_payload_cup(guint32 tag, gint len_field _U_,
answer = tvb_get_guint8(tvb, offset);
proto_tree_add_item(tree, hf_dvbci_cup_answer, tvb, offset, 1, ENC_BIG_ENDIAN);
col_append_sep_fstr(pinfo->cinfo, COL_INFO, ": ", "%s",
- val_to_str(answer, dvbci_cup_answer, "unknown"));
+ val_to_str_const(answer, dvbci_cup_answer, "unknown"));
break;
case T_CAM_FIRMWARE_UPGRADE_PROGRESS:
progress = tvb_get_guint8(tvb, offset);
@@ -2932,7 +2932,7 @@ dissect_dvbci_payload_cc(guint32 tag, gint len_field _U_,
proto_tree_add_item(
tree, hf_dvbci_cc_status_field, tvb, offset, 1, ENC_BIG_ENDIAN);
col_append_sep_fstr(pinfo->cinfo, COL_INFO, ": ", "%s",
- val_to_str(status, dvbci_cc_status, "unknown"));
+ val_to_str_const(status, dvbci_cc_status, "unknown"));
break;
case T_CC_SAC_DATA_REQ:
case T_CC_SAC_DATA_CNF:
@@ -3049,7 +3049,7 @@ dissect_dvbci_payload_cc(guint32 tag, gint len_field _U_,
proto_tree_add_item(tree, hf_dvbci_pincode_status,
tvb, offset, 1, ENC_BIG_ENDIAN);
col_append_sep_fstr(pinfo->cinfo, COL_INFO, ": ", "%s",
- val_to_str(pin_stat, dvbci_pincode_status, "unknown"));
+ val_to_str_const(pin_stat, dvbci_pincode_status, "unknown"));
break;
case T_CC_PIN_EVENT:
proto_tree_add_item(tree, hf_dvbci_cc_prog_num,
@@ -3151,13 +3151,13 @@ dissect_dvbci_payload_ami(guint32 tag, gint len_field _U_,
proto_tree_add_item(
tree, hf_dvbci_ack_code, tvb, offset, 1, ENC_BIG_ENDIAN);
col_append_sep_fstr(pinfo->cinfo, COL_INFO, ": ", "%s",
- val_to_str(ack_code, dvbci_ack_code, "unknown"));
+ val_to_str_const(ack_code, dvbci_ack_code, "unknown"));
break;
case T_FILE_REQUEST:
req_type = tvb_get_guint8(tvb, offset);
proto_tree_add_item(tree, hf_dvbci_req_type, tvb, offset, 1, ENC_BIG_ENDIAN);
col_append_sep_fstr(pinfo->cinfo, COL_INFO, ": ", "%s",
- val_to_str(req_type, dvbci_req_type, "unknown"));
+ val_to_str_const(req_type, dvbci_req_type, "unknown"));
offset++;
if (req_type==REQ_TYPE_FILE_HASH) {
proto_tree_add_item(tree, hf_dvbci_file_hash,
@@ -3193,7 +3193,7 @@ dissect_dvbci_payload_ami(guint32 tag, gint len_field _U_,
offset++;
proto_tree_add_item(tree, hf_dvbci_req_type, tvb, offset, 1, ENC_BIG_ENDIAN);
col_append_sep_fstr(pinfo->cinfo, COL_INFO, ": ", "%s",
- val_to_str(req_type, dvbci_req_type, "unknown"));
+ val_to_str_const(req_type, dvbci_req_type, "unknown"));
offset++;
if (req_type==REQ_TYPE_FILE || req_type==REQ_TYPE_FILE_HASH) {
file_name_len = tvb_get_guint8(tvb, offset);
@@ -3755,7 +3755,7 @@ dissect_dvbci_apdu(tvbuff_t *tvb, circuit_t *circuit,
apdu_res_id = GPOINTER_TO_UINT(
(gpointer)circuit_get_proto_data(circuit, proto_dvbci));
- ai_res_class_str = val_to_str(ai->res_class, dvbci_res_class, "Unknown");
+ ai_res_class_str = val_to_str_const(ai->res_class, dvbci_res_class, "Unknown");
if(RES_CLASS(apdu_res_id) != ai->res_class) {
pi = proto_tree_add_text(app_tree, tvb, 0, APDU_TAG_SIZE,
@@ -4348,7 +4348,7 @@ dissect_dvbci_cis(tvbuff_t *tvb, gint offset,
tpl_tree = proto_item_add_subtree(ti_tpl, ett_dvbci_cis_tpl);
proto_tree_add_uint_format(tpl_tree, hf_dvbci_cistpl_code,
tvb, offset, 1, tpl_code, "Tuple code: %s (0x%x)",
- val_to_str(tpl_code, dvbci_cistpl_code, "unknown"), tpl_code);
+ val_to_str_const(tpl_code, dvbci_cistpl_code, "unknown"), tpl_code);
if (tpl_code != CISTPL_END) {
proto_tree_add_text(tpl_tree, tvb, offset+1, 1,
"Length: %d", len_field);
diff --git a/epan/dissectors/packet-ecp-oui.c b/epan/dissectors/packet-ecp-oui.c
index 9c0e322990..87b3983f0e 100644
--- a/epan/dissectors/packet-ecp-oui.c
+++ b/epan/dissectors/packet-ecp-oui.c
@@ -205,7 +205,7 @@ dissect_vdp_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32
oui = tvb_get_ntoh24(tvb, (tempOffset));
/* maintain previous OUI names. If not included, look in manuf database for OUI */
- ouiStr = val_to_str(oui, tlv_oui_subtype_vals, "Unknown");
+ ouiStr = val_to_str_const(oui, tlv_oui_subtype_vals, "Unknown");
if (strcmp(ouiStr, "Unknown")==0) {
ouiStr = uint_get_manuf_name_if_known(oui);
if(ouiStr==NULL) ouiStr="Unknown";
diff --git a/epan/dissectors/packet-edonkey.c b/epan/dissectors/packet-edonkey.c
index 39322cb18c..a2dd51f7b7 100644
--- a/epan/dissectors/packet-edonkey.c
+++ b/epan/dissectors/packet-edonkey.c
@@ -643,7 +643,7 @@ static int dissect_kademlia_search_condition(tvbuff_t *tvb, packet_info *pinfo _
proto_item * ti;
guint16 value = tvb_get_guint8(tvb, offset);
ti = proto_tree_add_item( tree, hf_kademlia_search_condition, tvb, offset, 1, ENC_BIG_ENDIAN );
- proto_item_append_text(ti, " [%s]", val_to_str( value, kademlia_search_conds, "Unknown") );
+ proto_item_append_text(ti, " [%s]", val_to_str_const( value, kademlia_search_conds, "Unknown") );
return offset + 1;
}
@@ -922,7 +922,7 @@ static int dissect_kademlia_tagname(tvbuff_t *tvb, packet_info *pinfo _U_,
if ( tagname && string_length == 1 ) {
tagname_value = *(guint8*)tagname;
/* lookup tagname */
- tag_full_name = val_to_str( tagname_value, kademlia_tags, tag_full_name );
+ tag_full_name = val_to_str_const( tagname_value, kademlia_tags, tag_full_name );
}
ti = proto_tree_add_item(tree, hf_kademlia_tag_name, tvb, offset+2, string_length, ENC_BIG_ENDIAN);
@@ -1581,7 +1581,7 @@ static int dissect_kademlia_peer(tvbuff_t *tvb, packet_info *pinfo _U_,
/* offset = dissect_kademlia_peertype(tvb, pinfo, offset, peer_tree); */
kad_version = tvb_get_guint8(tvb, offset);
ti = proto_tree_add_item(peer_tree, hf_kademlia_version, tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_item_append_text(ti, "%s", val_to_str(kad_version, kademlia_versions, " Unknown"));
+ proto_item_append_text(ti, "%s", val_to_str_const(kad_version, kademlia_versions, " Unknown"));
return offset + 1;
}
@@ -1637,7 +1637,7 @@ static int dissect_edonkey_search_query(tvbuff_t *tvb, packet_info *pinfo _U_,
/* Add query info */
proto_tree_add_text(search_tree, tvb, offset, 2, "Boolean search (0x%02x): %s (0x%02x)",
- search_type, val_to_str(operator, edonkey_search_ops, "Unknown"), operator);
+ search_type, val_to_str_const(operator, edonkey_search_ops, "Unknown"), operator);
offset+=2;
offset = dissect_edonkey_search_query(tvb, pinfo, offset, search_tree);
@@ -1702,7 +1702,7 @@ static int dissect_edonkey_search_query(tvbuff_t *tvb, packet_info *pinfo _U_,
/* Add query info */
proto_tree_add_text(search_tree, tvb, offset, 6, "Search by limit (0x%02x): %s %u",
- search_type, val_to_str(limit_type, edonkey_search_conds, "Unknown"), limit);
+ search_type, val_to_str_const(limit_type, edonkey_search_conds, "Unknown"), limit);
proto_tree_add_uint(search_tree, hf_edonkey_metatag_namesize, tvb, tag_name_offset, 2, tag_name_size);
edonkey_tree_add_metatag_name(search_tree, tvb, tag_name_offset+2, tag_name_size, special_tagtype);
offset += search_length;
@@ -2342,7 +2342,7 @@ static int dissect_kademlia_tag(tvbuff_t *tvb, packet_info *pinfo _U_,
subtree = proto_item_add_subtree( tag_node, ett_kademlia_tag );
type = tvb_get_guint8( tvb, offset );
- str_type = val_to_str(type, kademlia_tag_types, "Unknown" );
+ str_type = val_to_str_const(type, kademlia_tag_types, "Unknown" );
{
proto_item * ti_tagtype;
@@ -2393,11 +2393,11 @@ static int dissect_kademlia_tag(tvbuff_t *tvb, packet_info *pinfo _U_,
switch (tag_type) {
case KADEMLIA_TAG_SOURCETYPE:
{
- proto_item_append_text(ti," (%s)", val_to_str(value, kademlia_tag_sourcetype, "Unknown"));
+ proto_item_append_text(ti," (%s)", val_to_str_const(value, kademlia_tag_sourcetype, "Unknown"));
}
break;
case KADEMLIA_TAG_ENCRYPTION:
- proto_item_append_text(ti, " (%s)", val_to_str(value, kademlia_tag_encryption, "Unknown"));
+ proto_item_append_text(ti, " (%s)", val_to_str_const(value, kademlia_tag_encryption, "Unknown"));
break;
}
offset += 1;
@@ -2605,7 +2605,7 @@ static int dissect_kademlia2_prolog( tvbuff_t *tvb, packet_info *pinfo _U_,
kad_version = tvb_get_guint8(tvb, offset);
/* ti = proto_tree_add_text(tree, tvb, offset, 1, "Kad Version: %d", kad_version ); */
ti = proto_tree_add_item(tree, hf_kademlia_version, tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_item_append_text(ti, "%s", val_to_str(kad_version, kademlia_versions, " Unknown"));
+ proto_item_append_text(ti, "%s", val_to_str_const(kad_version, kademlia_versions, " Unknown"));
offset++;
return offset;
@@ -2714,7 +2714,7 @@ static int dissect_kademlia_udp_message(guint8 msg_type,
type = tvb_get_guint8(tvb, offset);
ti = proto_tree_add_uint_format_value(tree, hf_kademlia_request_type, tvb, offset, 1, type, "0x%02x", type );
- proto_item_append_text(ti, "%s", val_to_str(type, kademlia_parameter, " Unknown"));
+ proto_item_append_text(ti, "%s", val_to_str_const(type, kademlia_parameter, " Unknown"));
offset +=1;
/* get target id */
@@ -2997,13 +2997,13 @@ static void dissect_edonkey_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tre
msg_type = tvb_get_guint8(tvb, offset);
switch (protocol) {
case EDONKEY_PROTO_EDONKEY:
- message_name = val_to_str(msg_type, edonkey_tcp_msgs, "Unknown");
+ message_name = val_to_str_const(msg_type, edonkey_tcp_msgs, "Unknown");
dissector = dissect_edonkey_tcp_message;
break;
case EDONKEY_PROTO_EMULE_EXT:
- message_name = val_to_str(msg_type, emule_tcp_msgs,
- val_to_str(msg_type, edonkey_tcp_msgs, "Unknown"));
+ message_name = val_to_str_const(msg_type, emule_tcp_msgs,
+ val_to_str_const(msg_type, edonkey_tcp_msgs, "Unknown"));
dissector = dissect_emule_tcp_message;
break;
@@ -3013,7 +3013,7 @@ static void dissect_edonkey_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tre
* except that the payload (after the type byte) is a zlib compressed
* stream.
*/
- message_name = val_to_str(msg_type, edonkey_tcp_msgs, "Unknown");
+ message_name = val_to_str_const(msg_type, edonkey_tcp_msgs, "Unknown");
tvbraw = tvb_child_uncompress(tvb, tvb, offset+1, msg_len-1);
if (tvbraw) {
dissector = dissect_edonkey_tcp_message;
@@ -3079,13 +3079,13 @@ static void dissect_edonkey_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
if (tvb_length_remaining(tvb, offset) >= EDONKEY_UDP_HEADER_LENGTH) {
protocol = tvb_get_guint8(tvb, offset);
msg_type = tvb_get_guint8(tvb, offset+1);
- protocol_name = val_to_str(protocol, edonkey_protocols, "Unknown");
+ protocol_name = val_to_str_const(protocol, edonkey_protocols, "Unknown");
if (protocol == EDONKEY_PROTO_KADEMLIA || protocol == EDONKEY_PROTO_KADEMLIA_COMP
|| protocol == EDONKEY_PROTO_ADU_KADEMLIA || protocol == EDONKEY_PROTO_ADU_KADEMLIA_COMP)
- message_name = val_to_str( msg_type, kademlia_msgs, "Unknown");
+ message_name = val_to_str_const( msg_type, kademlia_msgs, "Unknown");
else
- message_name = val_to_str(msg_type, edonkey_udp_msgs, "Unknown");
+ message_name = val_to_str_const(msg_type, edonkey_udp_msgs, "Unknown");
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "%s UDP: %s", protocol_name, message_name);
diff --git a/epan/dissectors/packet-eigrp.c b/epan/dissectors/packet-eigrp.c
index b274921aa5..7288be4564 100644
--- a/epan/dissectors/packet-eigrp.c
+++ b/epan/dissectors/packet-eigrp.c
@@ -715,7 +715,7 @@ dissect_eigrp_auth_tlv (proto_tree *tree, tvbuff_t *tvb,
auth_type = tvb_get_ntohs(tvb, 0);
auth_len = tvb_get_ntohs(tvb, 2);
- proto_item_append_text(ti, " %s", val_to_str(auth_type, eigrp_auth2string, ""));
+ proto_item_append_text(ti, " %s", val_to_str_const(auth_type, eigrp_auth2string, ""));
ti_auth_type = proto_tree_add_item(tree, hf_eigrp_auth_type, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
@@ -1271,7 +1271,7 @@ dissect_eigrp_service (proto_item *ti, proto_tree *tree, tvbuff_t *tvb,
for (; tvb_length_remaining(sub_tvb, sub_offset) > 0; ) {
service = tvb_get_ntohs(sub_tvb, sub_offset);
proto_item_append_text(sub_ti, "%c %s", (sub_offset == 0 ? '=':','),
- val_to_str(service, eigrp_saf_srv2string, ""));
+ val_to_str_const(service, eigrp_saf_srv2string, ""));
sub_service = tvb_get_ntohs(sub_tvb, sub_offset+2);
proto_item_append_text(ti, "%c %u:%u", (sub_offset == 0 ? '=':','),
@@ -2523,8 +2523,7 @@ dissect_eigrp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_item(eigrp_tree, hf_eigrp_vrid, tvb, 16, 2,
ENC_BIG_ENDIAN);
vrid = (tvb_get_ntohs(tvb, 16) & EIGRP_VRID_MASK);
- proto_item_append_text(ti, " %s", val_to_str(vrid, eigrp_vrid2string,
- ""));
+ proto_item_append_text(ti, " %s", val_to_str_const(vrid, eigrp_vrid2string, ""));
/* print autonomous-system */
proto_tree_add_item(eigrp_tree, hf_eigrp_as, tvb, 18, 2,
diff --git a/epan/dissectors/packet-elcom.c b/epan/dissectors/packet-elcom.c
index e93acd4c03..85e9a18379 100644
--- a/epan/dissectors/packet-elcom.c
+++ b/epan/dissectors/packet-elcom.c
@@ -226,7 +226,7 @@ dissect_lower_address(proto_item *ti_arg, gint ett_arg,
return offset;
}
- proto_item_append_text(ti, " (%s)", val_to_str(suffix[1], suffix_vals, "<<-- WHAT?") );
+ proto_item_append_text(ti, " (%s)", val_to_str_const(suffix[1], suffix_vals, "<<-- WHAT?") );
return offset;
}
diff --git a/epan/dissectors/packet-enrp.c b/epan/dissectors/packet-enrp.c
index b7762cb253..58e06f80e9 100644
--- a/epan/dissectors/packet-enrp.c
+++ b/epan/dissectors/packet-enrp.c
@@ -178,7 +178,7 @@ dissect_error_cause(tvbuff_t *cause_tvb, proto_tree *parameter_tree)
length = tvb_get_ntohs(cause_tvb, CAUSE_LENGTH_OFFSET);
padding_length = tvb_length(cause_tvb) - length;
- cause_item = proto_tree_add_text(parameter_tree, cause_tvb, CAUSE_HEADER_OFFSET, tvb_length(cause_tvb), "%s", val_to_str(code, cause_code_values, "Unknown error cause"));
+ cause_item = proto_tree_add_text(parameter_tree, cause_tvb, CAUSE_HEADER_OFFSET, tvb_length(cause_tvb), "%s", val_to_str_const(code, cause_code_values, "Unknown error cause"));
cause_tree = proto_item_add_subtree(cause_item, ett_enrp_cause);
proto_tree_add_item(cause_tree, hf_cause_code, cause_tvb, CAUSE_CODE_OFFSET, CAUSE_CODE_LENGTH, ENC_BIG_ENDIAN);
@@ -645,7 +645,7 @@ dissect_parameter(tvbuff_t *parameter_tvb, proto_tree *enrp_tree)
padding_length = tvb_length(parameter_tvb) - length;
/* create proto_tree stuff */
- parameter_item = proto_tree_add_text(enrp_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb), "%s", val_to_str(type, parameter_type_values, "Unknown Parameter"));
+ parameter_item = proto_tree_add_text(enrp_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb), "%s", val_to_str_const(type, parameter_type_values, "Unknown Parameter"));
parameter_tree = proto_item_add_subtree(parameter_item, ett_enrp_parameter);
/* add tag and length to the enrp tree */
@@ -942,7 +942,7 @@ dissect_enrp_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *enrp
type = tvb_get_guint8(message_tvb, MESSAGE_TYPE_OFFSET);
/* pinfo is NULL only if dissect_enrp_message is called via dissect_error_cause */
if (pinfo && (check_col(pinfo->cinfo, COL_INFO)))
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(type, message_type_values, "Unknown ENRP Type"));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(type, message_type_values, "Unknown ENRP Type"));
if (enrp_tree) {
proto_tree_add_item(enrp_tree, hf_message_type, message_tvb, MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_LENGTH, ENC_BIG_ENDIAN);
diff --git a/epan/dissectors/packet-epl.c b/epan/dissectors/packet-epl.c
index ad30755c20..95695852db 100644
--- a/epan/dissectors/packet-epl.c
+++ b/epan/dissectors/packet-epl.c
@@ -1246,7 +1246,7 @@ dissect_epl_asnd_ires(proto_tree *epl_tree, tvbuff_t *tvb, packet_info *pinfo, g
additional = tvb_get_letohs(tvb, offset+2);
proto_tree_add_string_format(epl_tree, hf_epl_asnd_identresponse_dt, tvb, offset,
4, "", "Device Type: Profile %d (%s), Additional Information: 0x%4.4X",
- profile, val_to_str(profile, epl_device_profiles, "Unknown Profile"), additional);
+ profile, val_to_str_const(profile, epl_device_profiles, "Unknown Profile"), additional);
proto_tree_add_item(epl_tree, hf_epl_asnd_identresponse_profile, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 4;
diff --git a/epan/dissectors/packet-fcswils.c b/epan/dissectors/packet-fcswils.c
index 086c8d46e0..f1254c2a83 100644
--- a/epan/dissectors/packet-fcswils.c
+++ b/epan/dissectors/packet-fcswils.c
@@ -835,7 +835,7 @@ dissect_swils_elp(tvbuff_t *tvb, proto_tree *elp_tree, guint8 isreq _U_)
offset += 22;
proto_tree_add_string(elp_tree, hf_swils_elp_isl_fc_mode, tvb, offset, 2,
- val_to_str(elp.isl_flwctrl_mode, fcswils_elp_fc_val, "Vendor Unique"));
+ val_to_str_const(elp.isl_flwctrl_mode, fcswils_elp_fc_val, "Vendor Unique"));
offset += 2;
proto_tree_add_item(elp_tree, hf_swils_elp_fcplen, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
diff --git a/epan/dissectors/packet-ff.c b/epan/dissectors/packet-ff.c
index c9e47f7699..9805c961b7 100644
--- a/epan/dissectors/packet-ff.c
+++ b/epan/dissectors/packet-ff.c
@@ -1752,38 +1752,38 @@ val_to_str_err_code(guint8 class, guint8 code)
{
switch(class) {
case 1:
- return(val_to_str(code, names_err_code_vfd_state, "Unknown"));
+ return(val_to_str_const(code, names_err_code_vfd_state, "Unknown"));
case 2:
- return(val_to_str(code, names_err_code_appl_ref, "Unknown"));
+ return(val_to_str_const(code, names_err_code_appl_ref, "Unknown"));
case 3:
- return(val_to_str(code, names_err_code_def, "Unknown"));
+ return(val_to_str_const(code, names_err_code_def, "Unknown"));
case 4:
- return(val_to_str(code, names_err_code_res, "Unknown"));
+ return(val_to_str_const(code, names_err_code_res, "Unknown"));
case 5:
- return(val_to_str(code, names_err_code_srv, "Unknown"));
+ return(val_to_str_const(code, names_err_code_srv, "Unknown"));
case 6:
- return(val_to_str(code, names_err_code_access, "Unknown"));
+ return(val_to_str_const(code, names_err_code_access, "Unknown"));
case 7:
- return(val_to_str(code, names_err_code_od, "Unknown"));
+ return(val_to_str_const(code, names_err_code_od, "Unknown"));
case 8:
- return(val_to_str(code, names_err_code_other, "Unknown"));
+ return(val_to_str_const(code, names_err_code_other, "Unknown"));
case 9:
- return(val_to_str(code, names_err_code_reject, "Unknown"));
+ return(val_to_str_const(code, names_err_code_reject, "Unknown"));
case 10:
- return(val_to_str(code,
+ return(val_to_str_const(code,
names_err_code_h1_sm_reason_code, "Unknown"));
case 11:
- return(val_to_str(code, names_err_code_fms_init, "Unknown"));
+ return(val_to_str_const(code, names_err_code_fms_init, "Unknown"));
default:
return("Unknown");
diff --git a/epan/dissectors/packet-flip.c b/epan/dissectors/packet-flip.c
index cc1f908f9a..cb39b6c1af 100644
--- a/epan/dissectors/packet-flip.c
+++ b/epan/dissectors/packet-flip.c
@@ -191,9 +191,9 @@ dissect_flip_chksum_hdr(tvbuff_t *tvb,
/* ETYPE: 8 bits */
proto_tree_add_uint_format_value(chksum_hdr_tree, hf_flip_chksum_etype,
tvb, offset + 0, 1, dw,
- "%s", val_to_str(chksum_hdr_etype,
- flip_etype,
- "Unknown"));
+ "%s", val_to_str_const(chksum_hdr_etype,
+ flip_etype,
+ "Unknown"));
/* SPARE: 7 bits */
proto_tree_add_uint_format_value(chksum_hdr_tree, hf_flip_chksum_spare,
tvb, offset + 1, 1, dw,
@@ -203,9 +203,9 @@ dissect_flip_chksum_hdr(tvbuff_t *tvb,
/* EXT HDR: 1 bit */
proto_tree_add_uint_format_value(chksum_hdr_tree, hf_flip_chksum_e,
tvb, offset + 1, 1, dw,
- "%s", val_to_str(chksum_hdr_ext,
- flip_boolean,
- "Unknown"));
+ "%s", val_to_str_const(chksum_hdr_ext,
+ flip_boolean,
+ "Unknown"));
/* CHKSUM: 16 bits. */
proto_tree_add_uint_format_value(
chksum_hdr_tree,
@@ -457,9 +457,9 @@ dissect_flip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint_format_value(basic_hdr_tree,
hf_flip_basic_e,
flip_tvb, offset + 0, 1, dw1,
- "%s", val_to_str(basic_hdr_ext,
- flip_boolean,
- "Unknown"));
+ "%s", val_to_str_const(basic_hdr_ext,
+ flip_boolean,
+ "Unknown"));
/* Reserved: 3 bits. */
proto_tree_add_uint_format_value(basic_hdr_tree,
hf_flip_basic_reserved,
diff --git a/epan/dissectors/packet-fractalgeneratorprotocol.c b/epan/dissectors/packet-fractalgeneratorprotocol.c
index 43314b9376..b0e3e5d1df 100644
--- a/epan/dissectors/packet-fractalgeneratorprotocol.c
+++ b/epan/dissectors/packet-fractalgeneratorprotocol.c
@@ -152,7 +152,7 @@ dissect_fractalgeneratorprotocol_message(tvbuff_t *message_tvb, packet_info *pin
type = tvb_get_guint8(message_tvb, MESSAGE_TYPE_OFFSET);
if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(type, message_type_values, "Unknown FractalGeneratorProtocol type"));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(type, message_type_values, "Unknown FractalGeneratorProtocol type"));
}
proto_tree_add_item(fractalgeneratorprotocol_tree, hf_message_type, message_tvb, MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_item(fractalgeneratorprotocol_tree, hf_message_flags, message_tvb, MESSAGE_FLAGS_OFFSET, MESSAGE_FLAGS_LENGTH, ENC_BIG_ENDIAN);
diff --git a/epan/dissectors/packet-glusterfs.c b/epan/dissectors/packet-glusterfs.c
index e1fc53e7b6..787be24b45 100644
--- a/epan/dissectors/packet-glusterfs.c
+++ b/epan/dissectors/packet-glusterfs.c
@@ -417,7 +417,7 @@ glusterfs_rpc_dissect_flags(proto_tree *tree, tvbuff_t *tvb, int offset)
accmode_hf = proto_registrar_get_nth(hf_glusterfs_flags_accmode);
accmode = tvb_get_ntohl(tvb, offset);
proto_tree_add_uint_format_value(flag_tree, hf_glusterfs_flags_accmode, tvb, offset, 4, accmode,
- "%s", val_to_str((accmode & accmode_hf->bitmask), glusterfs_accmode_vals, "Unknown"));
+ "%s", val_to_str_const((accmode & accmode_hf->bitmask), glusterfs_accmode_vals, "Unknown"));
if ((accmode & accmode_hf->bitmask) == accmode_hf->bitmask)
proto_item_append_text(flag_tree, ", %s", proto_registrar_get_nth(hf_glusterfs_flags_accmode)->name);
}
diff --git a/epan/dissectors/packet-gmhdr.c b/epan/dissectors/packet-gmhdr.c
index f9b53da511..136d933147 100644
--- a/epan/dissectors/packet-gmhdr.c
+++ b/epan/dissectors/packet-gmhdr.c
@@ -148,7 +148,7 @@ dissect_gmtlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *gmhdr_tree, gui
break;
}
ti = proto_tree_add_item(gmhdr_tree, hf_gmhdr_timestamp, tvb, offset, fl, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
- proto_item_append_text(ti, "; Source: %s", val_to_str(tl>>8, gmhdr_ftype_timestamp, "Unknown"));
+ proto_item_append_text(ti, "; Source: %s", val_to_str_const(tl>>8, gmhdr_ftype_timestamp, "Unknown"));
break;
default:
ti = proto_tree_add_item(gmhdr_tree, hf_gmhdr_generic, tvb, offset, fl, ENC_NA);
diff --git a/epan/dissectors/packet-gsm_a_dtap.c b/epan/dissectors/packet-gsm_a_dtap.c
index fd5d6e2cda..4fb7081108 100644
--- a/epan/dissectors/packet-gsm_a_dtap.c
+++ b/epan/dissectors/packet-gsm_a_dtap.c
@@ -2405,7 +2405,7 @@ de_call_state(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 o
default:
proto_tree_add_uint_format_value(subtree, hf_gsm_a_dtap_call_state, tvb,
offset, 1, call_state, "%s (%u)",
- val_to_str(call_state, gsm_a_dtap_call_state_vals, "Reserved"),
+ val_to_str_const(call_state, gsm_a_dtap_call_state_vals, "Reserved"),
call_state);
break;
}
@@ -3124,7 +3124,7 @@ de_prog_ind(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 off
default:
proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_progress_description, tvb,
curr_offset, 1, progress_description, "%s (%u)",
- val_to_str(progress_description, gsm_a_dtap_progress_description_vals, "Unspecific"),
+ val_to_str_const(progress_description, gsm_a_dtap_progress_description_vals, "Unspecific"),
progress_description);
break;
}
@@ -3496,13 +3496,13 @@ de_ca_of_no_cli(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32
oct = tvb_get_guint8(tvb, curr_offset);
proto_tree_add_uint_format(tree, hf_gsm_a_dtap_cause_of_no_cli, tvb, curr_offset, 1, oct,
"Cause of no CLI: %s (%u)",
- val_to_str(oct, gsm_a_cause_of_no_cli_values, "Unavailable"),
+ val_to_str_const(oct, gsm_a_cause_of_no_cli_values, "Unavailable"),
oct);
curr_offset++;
if (add_string)
- g_snprintf(add_string, string_len, " - (%s)", val_to_str(oct, gsm_a_cause_of_no_cli_values, "Unavailable"));
+ g_snprintf(add_string, string_len, " - (%s)", val_to_str_const(oct, gsm_a_cause_of_no_cli_values, "Unavailable"));
EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
@@ -6313,7 +6313,7 @@ dissect_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
hf_idx = -1;
dtap_msg_fcn = NULL;
nsd = FALSE;
- col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) ",val_to_str(pd,gsm_a_pd_short_str_vals,"unknown"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) ",val_to_str_const(pd,gsm_a_pd_short_str_vals,"unknown"));
/*
* octet 1
diff --git a/epan/dissectors/packet-gsm_a_rr.c b/epan/dissectors/packet-gsm_a_rr.c
index 41f0b7647c..44b39592d1 100644
--- a/epan/dissectors/packet-gsm_a_rr.c
+++ b/epan/dissectors/packet-gsm_a_rr.c
@@ -7787,7 +7787,7 @@ de_rr_ext_meas_result(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, g
for (i=0; i<21; i++)
{
value = tvb_get_bits8(tvb,bit_offset,6);
- proto_tree_add_text(tree, tvb, bit_offset>>3, 1, "RXLEV carrier %d: %s (%d)",i,val_to_str_ext(value, &gsm_a_rr_rxlev_vals_ext, "Unknown"),value);
+ proto_tree_add_text(tree, tvb, bit_offset>>3, 1, "RXLEV carrier %d: %s (%d)",i,val_to_str_ext_const(value, &gsm_a_rr_rxlev_vals_ext, "Unknown"),value);
bit_offset += 6;
}
diff --git a/epan/dissectors/packet-gsm_sms.c b/epan/dissectors/packet-gsm_sms.c
index 8d80c667b7..c60fa87268 100644
--- a/epan/dissectors/packet-gsm_sms.c
+++ b/epan/dissectors/packet-gsm_sms.c
@@ -2179,12 +2179,12 @@ dis_iei_tf(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint8 length)
subtree_colour = proto_item_add_subtree(item_colour, ett_udh_tfc);
- str = val_to_str(oct & 0x0f, text_color_values, "Unknown");
+ str = val_to_str_const(oct & 0x0f, text_color_values, "Unknown");
proto_tree_add_text(subtree_colour, tvb, offset, 1,
"Foreground Colour : 0x%x %s",
oct & 0x0f , str);
- str = val_to_str((oct >> 4) & 0x0f, text_color_values, "Unknown");
+ str = val_to_str_const((oct >> 4) & 0x0f, text_color_values, "Unknown");
proto_tree_add_text(subtree_colour,
tvb, offset, 1,
"Background Colour : 0x%x %s",
diff --git a/epan/dissectors/packet-h264.c b/epan/dissectors/packet-h264.c
index 557d36bf2c..1ba1043e94 100644
--- a/epan/dissectors/packet-h264.c
+++ b/epan/dissectors/packet-h264.c
@@ -447,7 +447,7 @@ dissect_h264_exp_golomb_code(proto_tree *tree, int hf_index, tvbuff_t *tvb, gint
proto_tree_add_int_format(tree, hf_index, tvb, start_offset, 1, codenum,
"%s: %s (%d)",
str,
- val_to_str(codenum, cVALS(hf_field->strings), "Unknown "),
+ val_to_str_const(codenum, cVALS(hf_field->strings), "Unknown "),
codenum);
}else{
switch(hf_field->display){
@@ -472,7 +472,7 @@ dissect_h264_exp_golomb_code(proto_tree *tree, int hf_index, tvbuff_t *tvb, gint
proto_tree_add_uint_format(tree, hf_index, tvb, start_offset, 1, codenum,
"%s: %s (%u)",
str,
- val_to_str(codenum, cVALS(hf_field->strings), "Unknown "),
+ val_to_str_const(codenum, cVALS(hf_field->strings), "Unknown "),
codenum);
}else{
switch(hf_field->display){
@@ -590,7 +590,7 @@ dissect_h264_exp_golomb_code(proto_tree *tree, int hf_index, tvbuff_t *tvb, gint
proto_tree_add_uint_format(tree, hf_index, tvb, start_offset, 1, codenum,
"%s: %s (%u)",
str,
- val_to_str(codenum, cVALS(hf_field->strings), "Unknown "),
+ val_to_str_const(codenum, cVALS(hf_field->strings), "Unknown "),
codenum);
}else{
switch(hf_field->display){
@@ -616,7 +616,7 @@ dissect_h264_exp_golomb_code(proto_tree *tree, int hf_index, tvbuff_t *tvb, gint
proto_tree_add_int_format(tree, hf_index, tvb, start_offset, 1, codenum,
"%s: %s (%d)",
str,
- val_to_str(codenum, cVALS(hf_field->strings), "Unknown "),
+ val_to_str_const(codenum, cVALS(hf_field->strings), "Unknown "),
se_value);
}else{
switch(hf_field->display){
@@ -1028,7 +1028,7 @@ dissect_h264_profile(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
if((level_idc==11)&&(constraint_set3_flag==1)){
proto_item_append_text(level_item," [Level 1b (128kb/s)]");
}else{
- proto_item_append_text(level_item," [Level %.1f %s]",((double)level_idc/10),val_to_str(level_idc, h264_level_bitrate_values, "Unknown "));
+ proto_item_append_text(level_item," [Level %.1f %s]",((double)level_idc/10),val_to_str_const(level_idc, h264_level_bitrate_values, "Unknown "));
}
}
@@ -1398,7 +1398,7 @@ dissect_h264_seq_parameter_set_rbsp(proto_tree *tree, tvbuff_t *tvb, packet_info
if((level_idc==11)&&(constraint_set3_flag==1)){
proto_item_append_text(level_item,"[Level 1b]");
}else{
- proto_item_append_text(level_item," [Level %.1f %s]",((double)level_idc/10),val_to_str(level_idc, h264_level_bitrate_values, "Unknown "));
+ proto_item_append_text(level_item," [Level %.1f %s]",((double)level_idc/10),val_to_str_const(level_idc, h264_level_bitrate_values, "Unknown "));
}
offset++;
/* seq_parameter_set_id 0 ue(v)
diff --git a/epan/dissectors/packet-hip.c b/epan/dissectors/packet-hip.c
index 34b4124443..33d95dd004 100644
--- a/epan/dissectors/packet-hip.c
+++ b/epan/dissectors/packet-hip.c
@@ -564,7 +564,7 @@ dissect_hip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti_tlv = proto_tree_add_uint_format(hip_tlv_tree, hf_hip_type, tvb,
offset, 4 + tlv_length_h, tlv_type_h,
"%s (type=%u, length=%u)",
- val_to_str(tlv_type_h, hip_param_vals, "Unknown"),
+ val_to_str_const(tlv_type_h, hip_param_vals, "Unknown"),
tlv_type_h, tlv_length_h);
/* Parse value */
@@ -788,7 +788,7 @@ dissect_hip_tlv(tvbuff_t *tvb, int offset, proto_item *ti, int type, int tlv_len
/* First Group ID*/
proto_tree_add_uint_format(t, hf_hip_tlv_dh_group_id, tvb, newoffset,
1, n, "%u (%s)", n,
- val_to_str(n, dh_group_id_vals, "Unknown"));
+ val_to_str_const(n, dh_group_id_vals, "Unknown"));
/* First Public value len */
newoffset++;
pv_len = tvb_get_ntohs(tvb, newoffset);
@@ -803,7 +803,7 @@ dissect_hip_tlv(tvbuff_t *tvb, int offset, proto_item *ti, int type, int tlv_len
newoffset += pv_len;
proto_tree_add_uint_format(t, hf_hip_tlv_dh_group_id, tvb, newoffset,
1, n, "%u (%s)", n,
- val_to_str(n, dh_group_id_vals, "Unknown"));
+ val_to_str_const(n, dh_group_id_vals, "Unknown"));
/* Second Public value len */
newoffset += 1;
pv_len = tvb_get_ntohs(tvb, newoffset);
@@ -827,7 +827,7 @@ dissect_hip_tlv(tvbuff_t *tvb, int offset, proto_item *ti, int type, int tlv_len
trans = tvb_get_ntohs(tvb, newoffset);
proto_tree_add_uint_format(t, hf_hip_tlv_trans_id, tvb,
newoffset, 2, trans, "%u (%s)", trans,
- val_to_str(trans, transform_id_vals, "Unknown"));
+ val_to_str_const(trans, transform_id_vals, "Unknown"));
tlv_len -= 2;
newoffset += 2;
}
@@ -840,7 +840,7 @@ dissect_hip_tlv(tvbuff_t *tvb, int offset, proto_item *ti, int type, int tlv_len
trans = tvb_get_ntohs(tvb, newoffset);
proto_tree_add_uint_format(t, hf_hip_tlv_trans_id, tvb,
newoffset, 2, trans, "%u (%s)", trans,
- val_to_str(trans, transform_id_vals, "Unknown"));
+ val_to_str_const(trans, transform_id_vals, "Unknown"));
tlv_len -= 2;
newoffset += 2;
}
@@ -857,7 +857,7 @@ dissect_hip_tlv(tvbuff_t *tvb, int offset, proto_item *ti, int type, int tlv_len
trans = tvb_get_ntohs(tvb, newoffset);
proto_tree_add_uint_format(t, hf_hip_tlv_nat_traversal_mode_id, tvb,
newoffset, 2, trans, "%u (%s)", trans,
- val_to_str(trans, mode_id_vals, "Unknown"));
+ val_to_str_const(trans, mode_id_vals, "Unknown"));
tlv_len -= 2;
newoffset += 2;
}
@@ -1100,7 +1100,7 @@ dissect_hip_tlv(tvbuff_t *tvb, int offset, proto_item *ti, int type, int tlv_len
reg_type = tvb_get_guint8(tvb, newoffset);
proto_tree_add_uint_format(t, hf_hip_tlv_reg_type, tvb,
newoffset, 1, reg_type, "%u (%s)", reg_type,
- val_to_str(reg_type, reg_type_vals, "Unknown"));
+ val_to_str_const(reg_type, reg_type_vals, "Unknown"));
/* one byte per registration type */
tlv_len--;
newoffset++;
@@ -1122,7 +1122,7 @@ dissect_hip_tlv(tvbuff_t *tvb, int offset, proto_item *ti, int type, int tlv_len
n = tvb_get_guint8(tvb, offset+4);
proto_tree_add_uint_format(t, hf_hip_tlv_sig_alg, tvb, newoffset, 1,
n, "%u (%s)", n,
- val_to_str(n, sig_alg_vals, "Unknown"));
+ val_to_str_const(n, sig_alg_vals, "Unknown"));
newoffset++;
/* Signature */
proto_tree_add_item(t, hf_hip_tlv_sig, tvb, newoffset, tlv_len-1,
diff --git a/epan/dissectors/packet-hsrp.c b/epan/dissectors/packet-hsrp.c
index 1b2d35ccc8..52bfa0d558 100644
--- a/epan/dissectors/packet-hsrp.c
+++ b/epan/dissectors/packet-hsrp.c
@@ -351,19 +351,19 @@ dissect_hsrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
opcode = tvb_get_guint8(tvb, 1);
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_str(pinfo->cinfo, COL_INFO,
- val_to_str(opcode, hsrp_opcode_vals, "Unknown"));
+ val_to_str_const(opcode, hsrp_opcode_vals, "Unknown"));
}
if (opcode < 3) {
state = tvb_get_guint8(tvb, 2);
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, " (state %s)",
- val_to_str(state, hsrp_state_vals, "Unknown"));
+ val_to_str_const(state, hsrp_state_vals, "Unknown"));
}
} else if (opcode == 3) {
state = tvb_get_guint8(tvb, 6);
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, " (state %s)",
- val_to_str(state, hsrp_adv_state_vals, "Unknown"));
+ val_to_str_const(state, hsrp_adv_state_vals, "Unknown"));
}
}
@@ -464,13 +464,13 @@ dissect_hsrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
opcode = tvb_get_guint8(tvb, offset+1);
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "%s",
- val_to_str(opcode, hsrp2_opcode_vals, "Unknown"));
+ val_to_str_const(opcode, hsrp2_opcode_vals, "Unknown"));
}
state = tvb_get_guint8(tvb, offset+2);
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, " (state %s)",
- val_to_str(state, hsrp2_state_vals, "Unknown"));
+ val_to_str_const(state, hsrp2_state_vals, "Unknown"));
}
if (tree) {
diff --git a/epan/dissectors/packet-iapp.c b/epan/dissectors/packet-iapp.c
index 746711e60f..1f92f5760d 100644
--- a/epan/dissectors/packet-iapp.c
+++ b/epan/dissectors/packet-iapp.c
@@ -259,8 +259,8 @@ static void dissect_authinfo(proto_item *pitem, tvbuff_t *tvb, int offset, int s
ti = proto_tree_add_text(authtree, tvb, offset, len + 3,
"%s(%d)",
- val_to_str(pduhdr.pdu_type, iapp_auth_type_vals,
- "Unknown PDU Type"),
+ val_to_str_const(pduhdr.pdu_type, iapp_auth_type_vals,
+ "Unknown PDU Type"),
pduhdr.pdu_type);
append_authval_str(ti, pduhdr.pdu_type, len, tvb, offset);
@@ -329,13 +329,13 @@ append_pduval_str(proto_item *ti, int type, int len, tvbuff_t *tvb, int offset,
break;
case IAPP_PDU_PHYTYPE:
val = tvb_get_guint8(tvb, offset + 3);
- strval = val_to_str(val, iapp_phy_vals, "Unknown");
+ strval = val_to_str_const(val, iapp_phy_vals, "Unknown");
proto_item_append_text(ti, "%s", strval);
is_fhss = (val == IAPP_PHY_FHSS);
break;
case IAPP_PDU_REGDOMAIN:
val = tvb_get_guint8(tvb, offset + 3);
- strval = val_to_str(val, iapp_dom_vals, "Unknown");
+ strval = val_to_str_const(val, iapp_dom_vals, "Unknown");
proto_item_append_text(ti, "%s", strval);
break;
case IAPP_PDU_CHANNEL:
@@ -349,7 +349,7 @@ append_pduval_str(proto_item *ti, int type, int len, tvbuff_t *tvb, int offset,
case IAPP_PDU_OUIIDENT:
for (val = z = 0; z < 3; z++)
val = (val << 8) | tvb_get_guint8(tvb, offset + 3 + z);
- strval = val_to_str(val, oui_vals, "Unknown");
+ strval = val_to_str_const(val, oui_vals, "Unknown");
proto_item_append_text(ti, "%s", strval);
break;
}
@@ -380,8 +380,8 @@ dissect_pdus(tvbuff_t *tvb, int offset, proto_tree *pdutree, int pdulen)
ti = proto_tree_add_text(pdutree, tvb, offset, len + 3,
"%s(%d)",
- val_to_str(pduhdr.pdu_type, iapp_pdu_type_vals,
- "Unknown PDU Type"),
+ val_to_str_const(pduhdr.pdu_type, iapp_pdu_type_vals,
+ "Unknown PDU Type"),
pduhdr.pdu_type);
is_fhss = append_pduval_str(ti, pduhdr.pdu_type, len, tvb,
offset, is_fhss);
@@ -416,7 +416,7 @@ dissect_iapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ia_version = (int)ih.ia_version;
ia_type = (int)ih.ia_type;
- codestrval = val_to_str(ia_type, iapp_vals, "Unknown Packet");
+ codestrval = val_to_str_const(ia_type, iapp_vals, "Unknown Packet");
if (check_col(pinfo->cinfo, COL_INFO))
{
col_add_fstr(pinfo->cinfo, COL_INFO, "%s(%d) (version=%d)",
diff --git a/epan/dissectors/packet-iax2.c b/epan/dissectors/packet-iax2.c
index 09d5f95e94..a218054582 100644
--- a/epan/dissectors/packet-iax2.c
+++ b/epan/dissectors/packet-iax2.c
@@ -1236,7 +1236,7 @@ static guint32 dissect_ies (tvbuff_t * tvb, guint32 offset,
ies_tree = proto_item_add_subtree(ti, ett_iax2_ie);
proto_tree_add_text(ies_tree, tvb, offset, 1, "IE id: %s (0x%02X)",
- val_to_str(ies_type, iax_ies_type, "Unknown"),
+ val_to_str_const(ies_type, iax_ies_type, "Unknown"),
ies_type);
proto_tree_add_text(ies_tree, tvb, offset+1, 1, "Length: %u",ies_len);
@@ -1366,7 +1366,7 @@ static guint32 dissect_ies (tvbuff_t * tvb, guint32 offset,
/* we don't understand this ie: add a generic one */
guint32 value;
const guint8 *ptr;
- const gchar *ie_name = val_to_str(ies_type, iax_ies_type, "Unknown");
+ const gchar *ie_name = val_to_str_const(ies_type, iax_ies_type, "Unknown");
switch(ies_len) {
case 1:
diff --git a/epan/dissectors/packet-icep.c b/epan/dissectors/packet-icep.c
index a67ca83dfe..a11103f4c3 100644
--- a/epan/dissectors/packet-icep.c
+++ b/epan/dissectors/packet-icep.c
@@ -961,9 +961,9 @@ static void dissect_icep_reply(tvbuff_t *tvb, guint32 offset,
if ( check_col(mypinfo->cinfo, COL_INFO) ) {
col_append_fstr(mypinfo->cinfo, COL_INFO, " %s",
- val_to_str(tvb_get_guint8(tvb, offset),
- icep_replystatus_vals,
- "unknown reply status"));
+ val_to_str_const(tvb_get_guint8(tvb, offset),
+ icep_replystatus_vals,
+ "unknown reply status"));
}
offset++;
diff --git a/epan/dissectors/packet-icmpv6.c b/epan/dissectors/packet-icmpv6.c
index 514209ad8e..12ba9481c6 100644
--- a/epan/dissectors/packet-icmpv6.c
+++ b/epan/dissectors/packet-icmpv6.c
@@ -3149,7 +3149,7 @@ dissect_icmpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
switch (icmp6_type) {
case ICMP6_DST_UNREACH:
- code_name = val_to_str(icmp6_code, icmpv6_unreach_code_val, "Unknown");
+ code_name = val_to_str_const(icmp6_code, icmpv6_unreach_code_val, "Unknown");
break;
case ICMP6_TIME_EXCEEDED:
code_name = val_to_str(icmp6_code, icmpv6_timeex_code_val, "Unknown (%d)");
diff --git a/epan/dissectors/packet-icp.c b/epan/dissectors/packet-icp.c
index 383ad04d2f..7e60daaba2 100644
--- a/epan/dissectors/packet-icp.c
+++ b/epan/dissectors/packet-icp.c
@@ -160,7 +160,7 @@ static void dissect_icp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (check_col(pinfo->cinfo, COL_INFO))
{
col_add_fstr(pinfo->cinfo,COL_INFO,"Opcode: %s (%u), Req Nr: %u",
- val_to_str(opcode, opcode_vals, "Unknown"), opcode,
+ val_to_str_const(opcode, opcode_vals, "Unknown"), opcode,
request_number);
}
diff --git a/epan/dissectors/packet-icq.c b/epan/dissectors/packet-icq.c
index 147611cc4c..91ff88ec07 100644
--- a/epan/dissectors/packet-icq.c
+++ b/epan/dissectors/packet-icq.c
@@ -366,7 +366,7 @@ table_v5 [] = {
static const char*
findMsgType(int num)
{
- return val_to_str(num, msgTypeCode, "Unknown");
+ return val_to_str_const(num, msgTypeCode, "Unknown");
}
static const char*
@@ -1516,7 +1516,7 @@ dissect_icqv5Client(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint_format(icq_header_tree, hf_icq_client_cmd,
decr_tvb, ICQ5_CL_CMD, 2, cmd,
"Command: %s (%u)",
- val_to_str(cmd, clientCmdCode, "Unknown"), cmd);
+ val_to_str_const(cmd, clientCmdCode, "Unknown"), cmd);
proto_tree_add_text(icq_header_tree, decr_tvb, ICQ5_CL_SEQNUM1, 2,
"Seq Number 1: 0x%04x",
tvb_get_letohs(decr_tvb, ICQ5_CL_SEQNUM1));
@@ -1616,7 +1616,7 @@ dissect_icqv5Server(tvbuff_t *tvb, int offset, packet_info *pinfo,
offset + ICQ5_SRV_SESSIONID, 4, ENC_LITTLE_ENDIAN);
proto_tree_add_uint_format(icq_header_tree, hf_icq_server_cmd, tvb,
offset + ICQ5_SRV_CMD, 2, cmd, "Command: %s (%u)",
- val_to_str(cmd, serverCmdCode, "Unknown"), cmd);
+ val_to_str_const(cmd, serverCmdCode, "Unknown"), cmd);
proto_tree_add_text(icq_header_tree, tvb, offset + ICQ5_SRV_SEQNUM1, 2,
"Seq Number 1: 0x%04x",
tvb_get_letohs(tvb, offset + ICQ5_SRV_SEQNUM1));
diff --git a/epan/dissectors/packet-iec104.c b/epan/dissectors/packet-iec104.c
index 2ff2e40650..daab5b6fb5 100644
--- a/epan/dissectors/packet-iec104.c
+++ b/epan/dissectors/packet-iec104.c
@@ -1121,7 +1121,7 @@ static void dissect_iec104asdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
it104 = proto_tree_add_item(tree, proto_iec104asdu, tvb, 0, -1, ENC_NA);
/* 'Packet Details': ROOT ITEM */
- proto_item_append_text(it104, ": %s'%s'", res->str, Len >= ASDU_HEAD_LEN ? val_to_str(asduh->TypeId, asdu_lngtypes, "<Unknown TypeId>") : "");
+ proto_item_append_text(it104, ": %s'%s'", res->str, Len >= ASDU_HEAD_LEN ? val_to_str_const(asduh->TypeId, asdu_lngtypes, "<Unknown TypeId>") : "");
/* 'Packet Details': TREE */
if (Len < ASDU_HEAD_LEN) return;
@@ -1567,7 +1567,7 @@ static void dissect_iec104apci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (Brossa != TcpLen) {
if (apcih->ApduLen <= APDU_MAX_LEN) {
/* APCI in 'Paquet List' */
- ep_strbuf_append_printf(res, "%s%s(", pinfo->srcport == iec104port ? "->" : "<-", val_to_str(apcih->Type, apci_types, "<ERR>"));
+ ep_strbuf_append_printf(res, "%s%s(", pinfo->srcport == iec104port ? "->" : "<-", val_to_str_const(apcih->Type, apci_types, "<ERR>"));
switch(apcih->Type) { /* APCI in 'Packet List' */
case I_TYPE:
ep_strbuf_append_printf(res, "%d,", apcih->Tx);
@@ -1580,7 +1580,7 @@ static void dissect_iec104apci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
ep_strbuf_append_c(res, ' ');
break;
case U_TYPE:
- ep_strbuf_append_printf(res, "%s)", val_to_str(apcih->UType >> 2, u_types, "<ERR>"));
+ ep_strbuf_append_printf(res, "%s)", val_to_str_const(apcih->UType >> 2, u_types, "<ERR>"));
break;
}
if (apcih->Type != I_TYPE && apcih->ApduLen > APDU_MIN_LEN) ep_strbuf_append_printf(res, "<ERR %u bytes> ", apcih->ApduLen- APDU_MIN_LEN);
diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c
index dba31020d2..8ba919292e 100644
--- a/epan/dissectors/packet-ieee80211.c
+++ b/epan/dissectors/packet-ieee80211.c
@@ -6222,7 +6222,7 @@ dissect_vendor_ie_atheros(proto_item * item _U_, proto_tree * ietree,
}
proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_type, tvb, offset, 1, ENC_NA);
type = tvb_get_guint8(tvb, offset);
- proto_item_append_text(item, ": %s", val_to_str(type, atheros_ie_type_vals, "Unknown"));
+ proto_item_append_text(item, ": %s", val_to_str_const(type, atheros_ie_type_vals, "Unknown"));
offset += 1;
tag_len -= 1;
@@ -6380,7 +6380,7 @@ dissect_vendor_ie_aironet(proto_item * aironet_item, proto_tree * ietree,
}
if (!dont_change) {
proto_item_append_text(aironet_item, ": Aironet %s",
- val_to_str(type, aironet_ie_type_vals, "Unknown"));
+ val_to_str_const(type, aironet_ie_type_vals, "Unknown"));
}
}
@@ -7678,9 +7678,9 @@ static int ieee80211_tag_supp_rates(packet_info *pinfo, proto_tree *tree,
proto_tree_add_item(tree, hf_ieee80211_tag_supp_rates, tvb, offset, 1,
ENC_BIG_ENDIAN);
proto_item_append_text(ti, " %s,",
- val_to_str(tvb_get_guint8(tvb, offset),
- ieee80211_supported_rates_vals,
- "Unknown Rate") );
+ val_to_str_const(tvb_get_guint8(tvb, offset),
+ ieee80211_supported_rates_vals,
+ "Unknown Rate") );
offset++;
}
@@ -8973,7 +8973,7 @@ add_tagged_field(packet_info * pinfo, proto_tree * tree, tvbuff_t * tvb, int off
while(offset < tag_end)
{
proto_tree_add_item(tree, hf_ieee80211_tag_ext_supp_rates, tvb, offset, 1, ENC_NA);
- proto_item_append_text(ti, " %s,", val_to_str(tvb_get_guint8(tvb, offset), ieee80211_supported_rates_vals, "Unknown Rate") );
+ proto_item_append_text(ti, " %s,", val_to_str_const(tvb_get_guint8(tvb, offset), ieee80211_supported_rates_vals, "Unknown Rate") );
offset += 1;
}
proto_item_append_text(ti, " [Mbit/sec]");
diff --git a/epan/dissectors/packet-ieee802154.c b/epan/dissectors/packet-ieee802154.c
index b3f29d8584..28f79d0e4a 100644
--- a/epan/dissectors/packet-ieee802154.c
+++ b/epan/dissectors/packet-ieee802154.c
@@ -362,7 +362,7 @@ static gboolean ieee802154_extend_auth = TRUE;
if (!(_x_)) \
expert_add_info_format(_pinfo_, _item_, PI_MALFORMED, PI_WARN, \
"Invalid Addressing for %s", \
- val_to_str(_cmdid_, ieee802154_cmd_names, "Unknown Command"))
+ val_to_str_const(_cmdid_, ieee802154_cmd_names, "Unknown Command"))
/* CRC definitions. IEEE 802.15.4 CRCs vary from CCITT by using an initial value of
* 0x0000, and no XOR out. IEEE802154_CRC_XOR is defined as 0xFFFF in order to un-XOR
@@ -412,14 +412,14 @@ dissect_ieee802154_fcf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, ieee
packet->src_addr_mode = (fcf & IEEE802154_FCF_SADDR_MASK) >> 14;
/* Display the frame type. */
- if (tree) proto_item_append_text(tree, " %s", val_to_str(packet->frame_type, ieee802154_frame_types, "Reserved"));
+ if (tree) proto_item_append_text(tree, " %s", val_to_str_const(packet->frame_type, ieee802154_frame_types, "Reserved"));
if (check_col(pinfo->cinfo, COL_INFO)) col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(packet->frame_type, ieee802154_frame_types, "Reserved"));
/* Add the FCF to the protocol tree. */
if (tree) {
/* Create the FCF subtree. */
ti = proto_tree_add_text(tree, tvb, *offset, 2, "Frame Control Field: %s (0x%04x)",
- val_to_str(packet->frame_type, ieee802154_frame_types, "Unknown"), fcf);
+ val_to_str_const(packet->frame_type, ieee802154_frame_types, "Unknown"), fcf);
field_tree = proto_item_add_subtree(ti, ett_ieee802154_fcf);
/* FCF Fields. */
@@ -1459,7 +1459,7 @@ dissect_ieee802154_assoc_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
/* Create a subtree for this command frame. */
if (tree) {
- ti = proto_tree_add_text(tree, tvb, 0, 1, "%s", val_to_str(packet->command_id, ieee802154_cmd_names, "Unknown Command"));
+ ti = proto_tree_add_text(tree, tvb, 0, 1, "%s", val_to_str_const(packet->command_id, ieee802154_cmd_names, "Unknown Command"));
subtree = proto_item_add_subtree(ti, ett_ieee802154_cmd);
}
@@ -1511,7 +1511,7 @@ dissect_ieee802154_assoc_rsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
/* Create a subtree for this command frame. */
if (tree) {
- ti = proto_tree_add_text(tree, tvb, offset, 3, "%s", val_to_str(packet->command_id,
+ ti = proto_tree_add_text(tree, tvb, offset, 3, "%s", val_to_str_const(packet->command_id,
ieee802154_cmd_names, "Unknown Command"));
subtree = proto_item_add_subtree(ti, ett_ieee802154_cmd);
}
@@ -1586,7 +1586,7 @@ dissect_ieee802154_disassoc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Create a subtree for this command frame. */
if (tree) {
- ti = proto_tree_add_text(tree, tvb, 0, 1, "%s", val_to_str(packet->command_id, ieee802154_cmd_names, "Unknown Command"));
+ ti = proto_tree_add_text(tree, tvb, 0, 1, "%s", val_to_str_const(packet->command_id, ieee802154_cmd_names, "Unknown Command"));
subtree = proto_item_add_subtree(ti, ett_ieee802154_cmd);
}
@@ -1652,7 +1652,7 @@ dissect_ieee802154_realign(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Create a subtree for this command frame. */
if (tree) {
- ti = proto_tree_add_text(tree, tvb, offset, 0, "%s", val_to_str(packet->command_id, ieee802154_cmd_names, "Unknown Command"));
+ ti = proto_tree_add_text(tree, tvb, offset, 0, "%s", val_to_str_const(packet->command_id, ieee802154_cmd_names, "Unknown Command"));
subtree = proto_item_add_subtree(ti, ett_ieee802154_cmd);
}
@@ -1738,8 +1738,8 @@ dissect_ieee802154_gtsreq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, i
/* Create a subtree for this command frame. */
if (tree) {
- ti = proto_tree_add_text(tree, tvb, 0, 1, "%s", val_to_str(packet->command_id, ieee802154_cmd_names,
- "Unknown Command"));
+ ti = proto_tree_add_text(tree, tvb, 0, 1, "%s", val_to_str_const(packet->command_id, ieee802154_cmd_names,
+ "Unknown Command"));
subtree = proto_item_add_subtree(ti, ett_ieee802154_cmd);
}
diff --git a/epan/dissectors/packet-ieee802a.c b/epan/dissectors/packet-ieee802a.c
index 85240236d7..c912e65b3f 100644
--- a/epan/dissectors/packet-ieee802a.c
+++ b/epan/dissectors/packet-ieee802a.c
@@ -106,7 +106,7 @@ dissect_ieee802a(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO,
"OUI 0x%06X (%s), PID 0x%04X",
- oui, val_to_str(oui, oui_vals, "Unknown"), etype);
+ oui, val_to_str_const(oui, oui_vals, "Unknown"), etype);
}
if (tree) {
proto_tree_add_uint(ieee802a_tree, hf_ieee802a_oui,
diff --git a/epan/dissectors/packet-igap.c b/epan/dissectors/packet-igap.c
index 808ab0628c..80f573092d 100644
--- a/epan/dissectors/packet-igap.c
+++ b/epan/dissectors/packet-igap.c
@@ -232,15 +232,15 @@ dissect_igap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int off
/* Challenge field indicates the result of the authenticaion */
proto_tree_add_text(tree, tvb, offset, msize,
"Authentication result: %s (0x%x)",
- val_to_str(message[0], igap_auth_result,
- "Unknown"), message[0]);
+ val_to_str_const(message[0], igap_auth_result, "Unknown"),
+ message[0]);
break;
case IGAP_SUBTYPE_ACCOUNTING_MESSAGE:
/* Challenge field indicates the accounting status */
proto_tree_add_text(tree, tvb, offset, msize,
"Accounting status: %s (0x%x)",
- val_to_str(message[0], igap_account_status,
- "Unknown"), message[0]);
+ val_to_str_const(message[0], igap_account_status, "Unknown"),
+ message[0]);
break;
default:
proto_tree_add_text(tree, tvb, offset, msize,
diff --git a/epan/dissectors/packet-igmp.c b/epan/dissectors/packet-igmp.c
index 54cb80a665..5450d55e86 100644
--- a/epan/dissectors/packet-igmp.c
+++ b/epan/dissectors/packet-igmp.c
@@ -467,7 +467,7 @@ dissect_v3_group_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tr
item = proto_tree_add_text(parent_tree, tvb, offset, -1,
"Group Record : %s %s",
ip_to_str((guint8*)&ip),
- val_to_str(tvb_get_guint8(tvb, offset), vs_record_type,"")
+ val_to_str_const(tvb_get_guint8(tvb, offset), vs_record_type,"")
);
tree = proto_item_add_subtree(item, ett_group_record);
@@ -835,8 +835,8 @@ dissect_igmp_mtrace(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int typ
"Response data block: %s -> %s, Proto: %s, Forwarding Code: %s",
tvb_ip_to_str(tvb, offset + 4),
tvb_ip_to_str(tvb, offset + 8),
- val_to_str(tvb_get_guint8(tvb, offset + 28), mtrace_rtg_vals, "Unknown"),
- val_to_str(tvb_get_guint8(tvb, offset + 31), mtrace_fwd_code_vals, "Unknown"));
+ val_to_str_const(tvb_get_guint8(tvb, offset + 28), mtrace_rtg_vals, "Unknown"),
+ val_to_str_const(tvb_get_guint8(tvb, offset + 31), mtrace_fwd_code_vals, "Unknown"));
block_tree = proto_item_add_subtree(bi, ett_mtrace_block);
/* Query Arrival Time */
diff --git a/epan/dissectors/packet-image-jfif.c b/epan/dissectors/packet-image-jfif.c
index ca690dde17..81b2f61f09 100644
--- a/epan/dissectors/packet-image-jfif.c
+++ b/epan/dissectors/packet-image-jfif.c
@@ -685,8 +685,8 @@ process_app1_segment(proto_tree *tree, tvbuff_t *tvb, guint32 len,
proto_tree_add_text(subtree, tvb, offset, 2,
"Exif Tag: 0x%04X (%s), Type: %u (%s), Count: %u, "
"Value offset from start of TIFF header: %u",
- tag, val_to_str(tag, vals_exif_tags, "Unknown Exif tag"),
- type, val_to_str(type, vals_exif_types, "Unknown Exif type"),
+ tag, val_to_str_const(tag, vals_exif_tags, "Unknown Exif tag"),
+ type, val_to_str_const(type, vals_exif_types, "Unknown Exif type"),
count, off);
offset += 12;
}
diff --git a/epan/dissectors/packet-ipmi-app.c b/epan/dissectors/packet-ipmi-app.c
index 0637666fef..fcf39b12e7 100644
--- a/epan/dissectors/packet-ipmi-app.c
+++ b/epan/dissectors/packet-ipmi-app.c
@@ -460,7 +460,7 @@ rs04(tvbuff_t *tvb, proto_tree *tree)
proto_tree_add_uint_format(tree, hf_ipmi_app_04_result, tvb, 0, 1,
res, "Self test result: %s (0x%02x)",
- val_to_str(res, vals_04_result, "Device-specific internal failure"),
+ val_to_str_const(res, vals_04_result, "Device-specific internal failure"),
res);
if (res == 0x55 || res == 0x56 || res == 0xff) {
diff --git a/epan/dissectors/packet-ipmi-picmg.c b/epan/dissectors/packet-ipmi-picmg.c
index 08500a0153..eb0a9771c2 100644
--- a/epan/dissectors/packet-ipmi-picmg.c
+++ b/epan/dissectors/packet-ipmi-picmg.c
@@ -661,7 +661,7 @@ parse_led_state(proto_tree *tree, tvbuff_t *tvb, guint offs, const char *desc)
v = tvb_get_guint8(tvb, offs + 2) & 0x0f;
ti = proto_tree_add_bitmask_text(tree, tvb, offs + 2, 1,
NULL, NULL, ett_ipmi_picmg_led_color, color, ENC_LITTLE_ENDIAN, 0);
- proto_item_set_text(ti, "%sColor: %s", desc, val_to_str(v, led_color_vals, "Reserved"));
+ proto_item_set_text(ti, "%sColor: %s", desc, val_to_str_const(v, led_color_vals, "Reserved"));
}
/* Set FRU LED State
@@ -814,7 +814,7 @@ parse_link_info_state(proto_tree *tree, tvbuff_t *tvb, guint offs, const char *n
proto_tree_add_bitmask_text(tree, tvb, offs, 4, buf, NULL,
ett_ipmi_picmg_link_info, link_info, ENC_LITTLE_ENDIAN, 0);
proto_tree_add_uint_format(tree, hf_ipmi_picmg_linkinfo_state, tvb, offs + 4, 1,
- v, "State%s: %s (0x%02x)", num, val_to_str(v, vs, "Reserved"), v);
+ v, "State%s: %s (0x%02x)", num, val_to_str_const(v, vs, "Reserved"), v);
}
/* Set Port State
@@ -1030,9 +1030,11 @@ rq17(tvbuff_t *tvb, proto_tree *tree)
}
proto_tree_add_uint_format_value(tree, hf_ipmi_picmg_17_cmd, tvb, 0, 1,
- cmd, "%s (0x%02x)", val_to_str(cmd,
- to_shmm ? vals_17_cmd_toshmm : vals_17_cmd_fromshmm,
- "Reserved"), cmd);
+ cmd, "%s (0x%02x)",
+ val_to_str_const(cmd,
+ to_shmm ? vals_17_cmd_toshmm : vals_17_cmd_fromshmm,
+ "Reserved"),
+ cmd);
proto_tree_add_item(tree, hf_ipmi_picmg_17_resid, tvb, 1, 1, ENC_LITTLE_ENDIAN);
}
@@ -1073,7 +1075,7 @@ rs17(tvbuff_t *tvb, proto_tree *tree)
status = tvb_get_guint8(tvb, 0);
val = (val << 8) | status;
proto_tree_add_uint_format_value(tree, hf_ipmi_picmg_17_status, tvb, 0, 1,
- status, "%s (0x%02x)", val_to_str(val, response_vals, "Reserved"), status);
+ status, "%s (0x%02x)", val_to_str_const(val, response_vals, "Reserved"), status);
}
/* Get IPMB Link Info
@@ -1525,7 +1527,7 @@ rs36(tvbuff_t *tvb, proto_tree *tree)
proto_tree_add_uint_format(tree, hf_ipmi_picmg_36_result, tvb, 0, 1,
res, "Self test result: %s (0x%02x)",
- val_to_str(res, vals_36_result, "Device-specific internal failure"),
+ val_to_str_const(res, vals_36_result, "Device-specific internal failure"),
res);
if (res == 0x55 || res == 0xff) {
diff --git a/epan/dissectors/packet-ipmi-se.c b/epan/dissectors/packet-ipmi-se.c
index dd33b9442d..96aa4fb8d7 100644
--- a/epan/dissectors/packet-ipmi-se.c
+++ b/epan/dissectors/packet-ipmi-se.c
@@ -542,11 +542,11 @@ eti_2_pst_sev(proto_tree *tree, tvbuff_t *tvb, const struct sensor_info *si,
ti = proto_tree_add_text(tree, tvb, 0, 1, "Previous state/severity");
s_tree = proto_item_add_subtree(ti, ett_ipmi_se_evt_evd_byte2);
tmp = d >> 4;
- desc = (tmp == 0x0f) ? "Unspecified" : val_to_str(tmp, etoff_07, "Unknown");
+ desc = (tmp == 0x0f) ? "Unspecified" : val_to_str_const(tmp, etoff_07, "Unknown");
proto_tree_add_text(s_tree, tvb, 0, 1, "%sSeverity: %s (0x%02x)",
ipmi_dcd8(d, 0xf0), desc, tmp);
tmp = d & 0xf;
- desc = (tmp == 0x0f) ? "Unspecified" : val_to_str(tmp, si->offsets, "Unknown");
+ desc = (tmp == 0x0f) ? "Unspecified" : val_to_str_const(tmp, si->offsets, "Unknown");
proto_tree_add_text(s_tree, tvb, 0, 1, "%sPrevious state: %s (0x%02x)",
ipmi_dcd8(d, 0x0f), desc, tmp);
return TRUE;
@@ -985,7 +985,7 @@ ssi_08_3(proto_tree *tree, tvbuff_t *tvb, const struct sensor_info *si _U_,
s_tree = proto_item_add_subtree(ti, ett_ipmi_se_evt_evd_byte3);
tmp = d & 0x0f;
proto_tree_add_text(s_tree, tvb, 0, 1, "%sError type: %s (0x%02x)",
- ipmi_dcd8(d, 0x0f), val_to_str(tmp, err_vals, "Reserved"), tmp);
+ ipmi_dcd8(d, 0x0f), val_to_str_const(tmp, err_vals, "Reserved"), tmp);
return TRUE;
}
return FALSE;
@@ -1054,12 +1054,12 @@ ssi_0f_2(proto_tree *tree, tvbuff_t *tvb, const struct sensor_info *si _U_,
if (b == 0x3 && offs == 0x00) {
proto_tree_add_text(tree, tvb, 0, 1, "Extension code: %s (0x%02x)",
- val_to_str(d, err_vals, "Reserved"), d);
+ val_to_str_const(d, err_vals, "Reserved"), d);
return TRUE;
}
if (b == 0x3 && (offs == 0x01 || offs == 0x02)) {
proto_tree_add_text(tree, tvb, 0, 1, "Extension code: %s (0x%02x)",
- val_to_str(d, progress_vals, "Reserved"), d);
+ val_to_str_const(d, progress_vals, "Reserved"), d);
return TRUE;
}
return FALSE;
@@ -1105,7 +1105,7 @@ ssi_10_3(proto_tree *tree, tvbuff_t *tvb, const struct sensor_info *si _U_,
ipmi_dcd8(d, 0x10), (d & 0x10) ? "Deassertion" : "Assertion");
d &= 0x0f;
proto_tree_add_text(s_tree, tvb, 0, 1, "%sEvent Offset: %s (0x%02x)",
- ipmi_dcd8(d, 0x0f), val_to_str(d, off_vals, "Unknown"), d);
+ ipmi_dcd8(d, 0x0f), val_to_str_const(d, off_vals, "Unknown"), d);
return TRUE;
}
if (b == 0x3 && offs == 0x05) {
@@ -1148,10 +1148,10 @@ ssi_12_2(proto_tree *tree, tvbuff_t *tvb, const struct sensor_info *si _U_,
s_tree = proto_item_add_subtree(ti, ett_ipmi_se_evt_evd_byte2);
tmp = d >> 4;
proto_tree_add_text(s_tree, tvb, 0, 1, "%sLog entry action: %s (0x%02x)",
- ipmi_dcd8(d, 0xf0), val_to_str(tmp, act_vals, "Reserved"), tmp);
+ ipmi_dcd8(d, 0xf0), val_to_str_const(tmp, act_vals, "Reserved"), tmp);
tmp = d & 0x0f;
proto_tree_add_text(s_tree, tvb, 0, 1, "%sLog type: %s (0x%02x)",
- ipmi_dcd8(d, 0x0f), val_to_str(tmp, type_vals, "Reserved"), tmp);
+ ipmi_dcd8(d, 0x0f), val_to_str_const(tmp, type_vals, "Reserved"), tmp);
return TRUE;
}
if (b == 0x3 && offs == 0x04) {
@@ -1178,7 +1178,7 @@ ssi_12_2(proto_tree *tree, tvbuff_t *tvb, const struct sensor_info *si _U_,
ipmi_dcd8(d, 0x80), (d & 0x80) ? "second" : "first");
tmp = d & 0x0f;
proto_tree_add_text(s_tree, tvb, 0, 1, "%sTimestamp clock type: %s (0x%02x)",
- ipmi_dcd8(d, 0x0f), val_to_str(tmp, clock_vals, "Reserved"), tmp);
+ ipmi_dcd8(d, 0x0f), val_to_str_const(tmp, clock_vals, "Reserved"), tmp);
}
return FALSE;
}
@@ -1189,7 +1189,7 @@ ssi_19_2(proto_tree *tree, tvbuff_t *tvb, const struct sensor_info *si _U_,
{
if (b == 0x3 && offs == 0x00) {
proto_tree_add_text(tree, tvb, 0, 1, "Requested power state: %s (0x%02x)",
- val_to_str(d, ssoff_22, "Reserved"), d);
+ val_to_str_const(d, ssoff_22, "Reserved"), d);
return TRUE;
}
return FALSE;
@@ -1201,7 +1201,7 @@ ssi_19_3(proto_tree *tree, tvbuff_t *tvb, const struct sensor_info *si _U_,
{
if (b == 0x3 && offs == 0x00) {
proto_tree_add_text(tree, tvb, 0, 1, "Power state at time of request: %s (0x%02x)",
- val_to_str(d, ssoff_22, "Reserved"), d);
+ val_to_str_const(d, ssoff_22, "Reserved"), d);
return TRUE;
}
return FALSE;
@@ -1236,7 +1236,7 @@ ssi_1d_2(proto_tree *tree, tvbuff_t *tvb, const struct sensor_info *si _U_,
s_tree = proto_item_add_subtree(ti, ett_ipmi_se_evt_evd_byte2);
tmp = d & 0x0f;
proto_tree_add_text(s_tree, tvb, 0, 1, "%sRestart cause: %s (0x%02x)",
- ipmi_dcd8(d, 0x0f), val_to_str(tmp, cause_vals, "Reserved"), tmp);
+ ipmi_dcd8(d, 0x0f), val_to_str_const(tmp, cause_vals, "Reserved"), tmp);
return TRUE;
}
return FALSE;
@@ -1278,7 +1278,7 @@ ssi_21_2(proto_tree *tree, tvbuff_t *tvb, const struct sensor_info *si _U_,
if (b == 0x3) {
proto_tree_add_text(tree, tvb, 0, 1, "Slot/connector type: %s (0x%02x)",
- val_to_str(d, type_vals, "Reserved"), d);
+ val_to_str_const(d, type_vals, "Reserved"), d);
return TRUE;
}
return FALSE;
@@ -1325,10 +1325,10 @@ ssi_23_2(proto_tree *tree, tvbuff_t *tvb, const struct sensor_info *si _U_,
s_tree = proto_item_add_subtree(ti, ett_ipmi_se_evt_evd_byte2);
tmp = d >> 4;
proto_tree_add_text(s_tree, tvb, 0, 1, "%sInterrupt type: %s (0x%02x)",
- ipmi_dcd8(d, 0xf0), val_to_str(tmp, intr_vals, "Reserved"), tmp);
+ ipmi_dcd8(d, 0xf0), val_to_str_const(tmp, intr_vals, "Reserved"), tmp);
tmp = d & 0x0f;
proto_tree_add_text(s_tree, tvb, 0, 1, "%sTimer use at expiration: %s (0x%02x)",
- ipmi_dcd8(d, 0x0f), val_to_str(tmp, use_vals, "Reserved"), tmp);
+ ipmi_dcd8(d, 0x0f), val_to_str_const(tmp, use_vals, "Reserved"), tmp);
return TRUE;
}
@@ -1426,7 +1426,7 @@ ssi_2a_3(proto_tree *tree, tvbuff_t *tvb, const struct sensor_info *si _U_,
s_tree = proto_item_add_subtree(ti, ett_ipmi_se_evt_evd_byte3);
tmp = (d >> 4) & 0x3;
proto_tree_add_text(s_tree, tvb, 0, 1, "%sSession deactivated by: %s (0x%02x)",
- ipmi_dcd8(d, 0x30), val_to_str(tmp, deact_vals, "Reserved"), tmp);
+ ipmi_dcd8(d, 0x30), val_to_str_const(tmp, deact_vals, "Reserved"), tmp);
ipmi_fmt_channel(s, d & 0xf);
proto_tree_add_text(s_tree, tvb, 0, 1, "%sChannel: %s",
ipmi_dcd8(d, 0x0f), s);
@@ -1469,7 +1469,7 @@ ssi_2b_2(proto_tree *tree, tvbuff_t *tvb, const struct sensor_info *si _U_,
if (b == 0x3) {
proto_tree_add_text(tree, tvb, 0, 1, "Version change type: %s",
- val_to_str(d, vctype_vals, "Reserved"));
+ val_to_str_const(d, vctype_vals, "Reserved"));
return TRUE;
}
return FALSE;
@@ -1503,10 +1503,10 @@ ssi_2c_2(proto_tree *tree, tvbuff_t *tvb, const struct sensor_info *si,
s_tree = proto_item_add_subtree(ti, ett_ipmi_se_evt_evd_byte2);
tmp = d >> 4;
proto_tree_add_text(s_tree, tvb, 0, 1, "%sCause: %s (0x%02x)",
- ipmi_dcd8(d, 0xf0), val_to_str(tmp, cause_vals, "Reserved"), tmp);
+ ipmi_dcd8(d, 0xf0), val_to_str_const(tmp, cause_vals, "Reserved"), tmp);
tmp = d & 0xf;
proto_tree_add_text(s_tree, tvb, 0, 1, "%sPrevious state: %s (0x%02x)",
- ipmi_dcd8(d, 0x0f), val_to_str(tmp, si->offsets, "Reserved"), tmp);
+ ipmi_dcd8(d, 0x0f), val_to_str_const(tmp, si->offsets, "Reserved"), tmp);
return TRUE;
}
return FALSE;
@@ -1539,10 +1539,10 @@ ssi_f0_2(proto_tree *tree, tvbuff_t *tvb, const struct sensor_info *si,
s_tree = proto_item_add_subtree(ti, ett_ipmi_se_evt_evd_byte2);
tmp = d >> 4;
proto_tree_add_text(s_tree, tvb, 0, 1, "%sCause: %s (0x%02x)",
- ipmi_dcd8(d, 0xf0), val_to_str(tmp, cause_vals, "Reserved"), tmp);
+ ipmi_dcd8(d, 0xf0), val_to_str_const(tmp, cause_vals, "Reserved"), tmp);
tmp = d & 0xf;
proto_tree_add_text(s_tree, tvb, 0, 1, "%sPrevious state: %s (0x%02x)",
- ipmi_dcd8(d, 0x0f), val_to_str(tmp, si->offsets, "Reserved"), tmp);
+ ipmi_dcd8(d, 0x0f), val_to_str_const(tmp, si->offsets, "Reserved"), tmp);
return TRUE;
}
return FALSE;
@@ -1609,13 +1609,13 @@ ssi_f1_3(proto_tree *tree, tvbuff_t *tvb, const struct sensor_info *si _U_,
ipmi_dcd8(d, 0x80), override_state[!!tmp]);
tmp = (d & 0x70) >> 4;
proto_tree_add_text(s_tree, tvb, 0, 1, "%sIPMB-B Local status: %s (0x%02x)",
- ipmi_dcd8(d, 0x70), val_to_str(tmp, status_vals, "Reserved"), tmp);
+ ipmi_dcd8(d, 0x70), val_to_str_const(tmp, status_vals, "Reserved"), tmp);
tmp = d & 0x08;
proto_tree_add_text(s_tree, tvb, 0, 1, "%sIPMB-A Override state: %s",
ipmi_dcd8(d, 0x08), override_state[!!tmp]);
tmp = d & 0x07;
proto_tree_add_text(s_tree, tvb, 0, 1, "%sIPMB-A Local status: %s (0x%02x)",
- ipmi_dcd8(d, 0x07), val_to_str(tmp, status_vals, "Reserved"), tmp);
+ ipmi_dcd8(d, 0x07), val_to_str_const(tmp, status_vals, "Reserved"), tmp);
return TRUE;
}
return FALSE;
@@ -1815,14 +1815,14 @@ parse_platform_event(tvbuff_t *tvb, proto_tree *tree)
s_tree = proto_item_add_subtree(ti, ett_ipmi_se_evt_evd_byte1);
proto_tree_add_uint_format(s_tree, hf_ipmi_se_evt_data1_b2, tvb, 4, 1, b2 << 6,
"%sByte 2: %s (0x%02x)",
- ipmi_dcd8(offs, 0xc0), val_to_str(b2, eti->byte2, "Reserved"), b2);
+ ipmi_dcd8(offs, 0xc0), val_to_str_const(b2, eti->byte2, "Reserved"), b2);
proto_tree_add_uint_format(s_tree, hf_ipmi_se_evt_data1_b3, tvb, 4, 1, b3 << 4,
"%sByte 3: %s (0x%02x)",
- ipmi_dcd8(offs, 0x30), val_to_str(b3, eti->byte3, "Reserved"), b3);
+ ipmi_dcd8(offs, 0x30), val_to_str_const(b3, eti->byte3, "Reserved"), b3);
offs &= 0x0f;
proto_tree_add_uint_format(s_tree, hf_ipmi_se_evt_data1_offs, tvb, 4, 1, offs,
"%sOffset: %s (0x%02x)",
- ipmi_dcd8(offs, 0x0f), val_to_str(offs, off_vals, "Reserved"), offs);
+ ipmi_dcd8(offs, 0x0f), val_to_str_const(offs, off_vals, "Reserved"), offs);
/* This is tricky. First, bytes 2-3 are optional and may be absent.
Second, the necessity to interpret them either in a generic way or in
diff --git a/epan/dissectors/packet-ipmi-session.c b/epan/dissectors/packet-ipmi-session.c
index a320759990..66110aa56f 100644
--- a/epan/dissectors/packet-ipmi-session.c
+++ b/epan/dissectors/packet-ipmi-session.c
@@ -171,7 +171,7 @@ dissect_ipmi_session(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_add_fstr(pinfo->cinfo, COL_INFO, "Session ID 0x%x", session_id);
if (authtype == IPMI_AUTH_RMCPP) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", payload type: %s",
- val_to_str(payloadtype, ipmi_payload_vals, "Unknown"));
+ val_to_str_const(payloadtype, ipmi_payload_vals, "Unknown"));
}
}
@@ -190,7 +190,7 @@ dissect_ipmi_session(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* IPMI v2.0+ */
ti = proto_tree_add_text(sess_tree, tvb, offset, 1,
"Payload type: %s (0x%02x), %sencrypted, %sauthenticated",
- val_to_str(payloadtype, ipmi_payload_vals, "Unknown"),
+ val_to_str_const(payloadtype, ipmi_payload_vals, "Unknown"),
payloadtype,
payloadtype_enc ? "" : "not ",
payloadtype_auth ? "" : "not ");
diff --git a/epan/dissectors/packet-ipmi-transport.c b/epan/dissectors/packet-ipmi-transport.c
index 3d543adccf..d97203651b 100644
--- a/epan/dissectors/packet-ipmi-transport.c
+++ b/epan/dissectors/packet-ipmi-transport.c
@@ -929,15 +929,15 @@ lan_24(tvbuff_t *tvb, proto_tree *tree)
v2 = v >> 4;
ti = proto_tree_add_text(tree, tvb, i + 1, 1,
"Cipher Suite #%d: %s (0x%02x), Cipher Suite #%d: %s (0x%02x)",
- i * 2 + 1, val_to_str(v1, lan24_priv_vals, "Reserved"), v1,
- i * 2 + 2, val_to_str(v2, lan24_priv_vals, "Reserved"), v2);
+ i * 2 + 1, val_to_str_const(v1, lan24_priv_vals, "Reserved"), v1,
+ i * 2 + 2, val_to_str_const(v2, lan24_priv_vals, "Reserved"), v2);
s_tree = proto_item_add_subtree(ti, *ett[i]);
proto_tree_add_uint_format(s_tree, hf_ipmi_trn_lan24_priv, tvb, i + 1, 1,
v2 << 4, "%sMaximum Privilege Level for Cipher Suite #%d: %s (0x%02x)",
- ipmi_dcd8(v, 0xf0), i * 2 + 2, val_to_str(v2, lan24_priv_vals, "Reserved"), v2);
+ ipmi_dcd8(v, 0xf0), i * 2 + 2, val_to_str_const(v2, lan24_priv_vals, "Reserved"), v2);
proto_tree_add_uint_format(s_tree, hf_ipmi_trn_lan24_priv, tvb, i + 1, 1,
v1, "%sMaximum Privilege Level for Cipher Suite #%d: %s (0x%02x)",
- ipmi_dcd8(v, 0x0f), i * 2 + 1, val_to_str(v1, lan24_priv_vals, "Reserved"), v1);
+ ipmi_dcd8(v, 0x0f), i * 2 + 1, val_to_str_const(v1, lan24_priv_vals, "Reserved"), v1);
}
}
diff --git a/epan/dissectors/packet-ipmi.c b/epan/dissectors/packet-ipmi.c
index c6bb3e84cf..8cb62f8a53 100644
--- a/epan/dissectors/packet-ipmi.c
+++ b/epan/dissectors/packet-ipmi.c
@@ -1048,7 +1048,7 @@ ipmi_get_completion_code(guint8 completion, ipmi_cmd_t *cmd)
return "Standard command-specific code";
}
- return val_to_str(completion, std_completion_codes, "Unknown");
+ return val_to_str_const(completion, std_completion_codes, "Unknown");
}
/* Guess the parsing flags for a message
diff --git a/epan/dissectors/packet-ipp.c b/epan/dissectors/packet-ipp.c
index 7f8165e273..39928d11d7 100644
--- a/epan/dissectors/packet-ipp.c
+++ b/epan/dissectors/packet-ipp.c
@@ -515,18 +515,18 @@ add_integer_tree(proto_tree *tree, tvbuff_t *tvb, int offset,
1 + 2 + name_length + 2 + value_length,
"%s: %s",
format_text(name_val, name_length),
- val_to_str(tvb_get_ntohl(tvb, offset + 1 + 2 + name_length + 2),
- printer_state_vals,
- "Unknown Printer State"));
+ val_to_str_const(tvb_get_ntohl(tvb, offset + 1 + 2 + name_length + 2),
+ printer_state_vals,
+ "Unknown Printer State"));
}
else if ((name_length > 5) && name_val && !tvb_memeql(tvb, offset + 1 + 2, "job-state", 9)) {
ti = proto_tree_add_text(tree, tvb, offset,
1 + 2 + name_length + 2 + value_length,
"%s: %s",
format_text(name_val, name_length),
- val_to_str(tvb_get_ntohl(tvb, offset + 1 + 2 + name_length + 2),
- job_state_vals,
- "Unknown Job State"));
+ val_to_str_const(tvb_get_ntohl(tvb, offset + 1 + 2 + name_length + 2),
+ job_state_vals,
+ "Unknown Job State"));
}
else {
ti = proto_tree_add_text(tree, tvb, offset,
diff --git a/epan/dissectors/packet-ipv6.c b/epan/dissectors/packet-ipv6.c
index 9348ef75eb..85e30e819d 100644
--- a/epan/dissectors/packet-ipv6.c
+++ b/epan/dissectors/packet-ipv6.c
@@ -595,7 +595,7 @@ dissect_routing6(tvbuff_t *tvb, int offset, proto_tree *tree, packet_info *pinfo
ti = proto_tree_add_uint_format(tree, hf_ipv6_routing_hdr_opt, tvb,
offset, len, rt.ip6r_type,
"Routing Header, Type : %s (%u)",
- val_to_str(rt.ip6r_type, routing_header_type, "Unknown"),
+ val_to_str_const(rt.ip6r_type, routing_header_type, "Unknown"),
rt.ip6r_type);
rthdr_tree = proto_item_add_subtree(ti, ett_ipv6);
@@ -1288,7 +1288,7 @@ dissect_shimopts(tvbuff_t *tvb, int offset, proto_tree *tree, packet_info *pinfo
if (tree)
{
/* Option Type */
- ctype = val_to_str( (tvb_get_ntohs(tvb, offset) & SHIM6_BITMASK_OPT_TYPE) >> 1, shimoptvals, "Unknown Option Type");
+ ctype = val_to_str_const( (tvb_get_ntohs(tvb, offset) & SHIM6_BITMASK_OPT_TYPE) >> 1, shimoptvals, "Unknown Option Type");
ti = proto_tree_add_text(tree, tvb, offset, total_len, "%s", ctype);
opt_tree = proto_item_add_subtree(ti, ett_ipv6_shim6_option);
@@ -1498,7 +1498,7 @@ dissect_shimctrl(tvbuff_t *tvb, gint offset, guint type, proto_tree *shim_tree)
"Probes Received: %u", probes_rcvd);
p++;
- sta = val_to_str((tvb_get_guint8(tvb, p) & SHIM6_BITMASK_STA) >> 6,
+ sta = val_to_str_const((tvb_get_guint8(tvb, p) & SHIM6_BITMASK_STA) >> 6,
shimreapstates, "Unknown REAP State");
proto_tree_add_uint_format(shim_tree, hf_ipv6_shim6_reap, tvb,
p, 1, (tvb_get_guint8(tvb, p) & SHIM6_BITMASK_STA) >> 6,
@@ -2089,7 +2089,7 @@ again:
}
else {
col_append_fstr(pinfo->cinfo, COL_INFO, "Shim6 (%s)",
- val_to_str(stype & SHIM6_BITMASK_TYPE, shimctrlvals, "Unknown"));
+ val_to_str_const(stype & SHIM6_BITMASK_TYPE, shimctrlvals, "Unknown"));
}
}
} else
diff --git a/epan/dissectors/packet-isakmp.c b/epan/dissectors/packet-isakmp.c
index 2beaa362b8..27bc921d8a 100644
--- a/epan/dissectors/packet-isakmp.c
+++ b/epan/dissectors/packet-isakmp.c
@@ -3470,22 +3470,22 @@ _U_
case 1: /* ISAKMP */
proto_tree_add_uint_format(tree, hf_isakmp_trans_id, tvb, offset, 1,
transform_id, "Transform ID: %s (%u)",
- val_to_str(transform_id, vs_v1_trans_isakmp, "UNKNOWN-TRANS-TYPE"), transform_id);
+ val_to_str_const(transform_id, vs_v1_trans_isakmp, "UNKNOWN-TRANS-TYPE"), transform_id);
break;
case 2: /* AH */
proto_tree_add_uint_format(tree, hf_isakmp_trans_id, tvb, offset, 1,
transform_id, "Transform ID: %s (%u)",
- val_to_str(transform_id, vs_v1_trans_ah, "UNKNOWN-AH-TRANS-TYPE"), transform_id);
+ val_to_str_const(transform_id, vs_v1_trans_ah, "UNKNOWN-AH-TRANS-TYPE"), transform_id);
break;
case 3: /* ESP */
proto_tree_add_uint_format(tree, hf_isakmp_trans_id, tvb, offset, 1,
transform_id, "Transform ID: %s (%u)",
- val_to_str(transform_id, vs_v1_trans_esp, "UNKNOWN-ESP-TRANS-TYPE"), transform_id);
+ val_to_str_const(transform_id, vs_v1_trans_esp, "UNKNOWN-ESP-TRANS-TYPE"), transform_id);
break;
case 4: /* IPCOMP */
proto_tree_add_uint_format(tree, hf_isakmp_trans_id, tvb, offset, 1,
transform_id, "Transform ID: %s (%u)",
- val_to_str(transform_id, transform_id_ipcomp, "UNKNOWN-IPCOMP-TRANS-TYPE"), transform_id);
+ val_to_str_const(transform_id, transform_id_ipcomp, "UNKNOWN-IPCOMP-TRANS-TYPE"), transform_id);
break;
default:
proto_tree_add_item(tree, hf_isakmp_trans_id, tvb, offset, 1, ENC_BIG_ENDIAN);
diff --git a/epan/dissectors/packet-isis-clv.c b/epan/dissectors/packet-isis-clv.c
index dd40427b8b..4d55767b4f 100644
--- a/epan/dissectors/packet-isis-clv.c
+++ b/epan/dissectors/packet-isis-clv.c
@@ -481,8 +481,8 @@ isis_dissect_nlpid_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int length)
*/
(tvb_get_guint8(tvb, offset) == NLPID_IEEE_8021AQ
? "IEEE 802.1aq (SPB)"
- : val_to_str(tvb_get_guint8(tvb, offset), nlpid_vals,
- "Unknown")),
+ : val_to_str_const(tvb_get_guint8(tvb, offset), nlpid_vals,
+ "Unknown")),
tvb_get_guint8(tvb, offset));
offset++;
first = FALSE;
diff --git a/epan/dissectors/packet-ismacryp.c b/epan/dissectors/packet-ismacryp.c
index 710da50b77..0aba99f994 100644
--- a/epan/dissectors/packet-ismacryp.c
+++ b/epan/dissectors/packet-ismacryp.c
@@ -265,7 +265,7 @@ static void dissect_ismacryp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tre
/* display mode */
if (pref_user_mode == FALSE){
if (check_col( pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",val_to_str(mode, modetypenames, "user mode"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",val_to_str_const(mode, modetypenames, "user mode"));
}
if (pref_user_mode == TRUE){
if ( check_col( pinfo->cinfo, COL_INFO))
diff --git a/epan/dissectors/packet-ismp.c b/epan/dissectors/packet-ismp.c
index 0959c3bb40..0e4674fba0 100644
--- a/epan/dissectors/packet-ismp.c
+++ b/epan/dissectors/packet-ismp.c
@@ -416,7 +416,7 @@ dissect_ismp_edp(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *ismp
tuple_type = tvb_get_ntohs(tvb, offset);
proto_tree_add_text(edp_tuples_leaf_tree, tvb, offset, 2,
- "Tuple Type: %s(%d)", val_to_str( tuple_type, edp_tuple_types, "Unknown"), tuple_type );
+ "Tuple Type: %s(%d)", val_to_str_const( tuple_type, edp_tuple_types, "Unknown"), tuple_type );
offset += 2;
proto_tree_add_text(edp_tuples_leaf_tree, tvb, offset, 2,
"Tuple Length: %d", tuple_length);
diff --git a/epan/dissectors/packet-isup.c b/epan/dissectors/packet-isup.c
index 1942c51c05..cca04a07f8 100644
--- a/epan/dissectors/packet-isup.c
+++ b/epan/dissectors/packet-isup.c
@@ -3194,7 +3194,7 @@ dissect_isup_circuit_group_supervision_message_type_parameter(tvbuff_t *paramete
cgs_message_type = tvb_get_guint8(parameter_tvb, 0);
proto_tree_add_uint(parameter_tree, hf_isup_cgs_message_type, parameter_tvb, 0, CIRC_GRP_SV_MSG_TYPE_LENGTH, cgs_message_type);
- proto_item_set_text(parameter_item, "Circuit group supervision message type: %s (%u)" ,val_to_str(cgs_message_type, isup_cgs_message_type_value,"unknown"), cgs_message_type);
+ proto_item_set_text(parameter_item, "Circuit group supervision message type: %s (%u)" ,val_to_str_const(cgs_message_type, isup_cgs_message_type_value,"unknown"), cgs_message_type);
}
/* ------------------------------------------------------------------
Dissector Parameter Facility indicator parameter
@@ -3206,7 +3206,7 @@ dissect_isup_facility_ind_parameter(tvbuff_t *parameter_tvb, proto_item *paramet
indicator = tvb_get_guint8(parameter_tvb, 0);
- proto_item_set_text(parameter_item, "Facility indicator: %s (%u)" ,val_to_str(indicator, isup_facility_ind_value,"spare"), indicator);
+ proto_item_set_text(parameter_item, "Facility indicator: %s (%u)" ,val_to_str_const(indicator, isup_facility_ind_value,"spare"), indicator);
}
/* ------------------------------------------------------------------
Dissector Parameter Circuit state indicator
@@ -3228,13 +3228,13 @@ dissect_isup_circuit_state_ind_parameter(tvbuff_t *parameter_tvb, proto_tree *pa
circuit_state = tvb_get_guint8(parameter_tvb, offset);
if ((circuit_state & DC_8BIT_MASK) == 0) {
proto_tree_add_uint(circuit_state_tree, hf_isup_mtc_blocking_state1, parameter_tvb, offset, 1, circuit_state);
- proto_item_set_text(circuit_state_item, "Circuit# CIC+%u state: %s", i++, val_to_str(circuit_state&BA_8BIT_MASK, isup_mtc_blocking_state_DC00_value, "unknown"));
+ proto_item_set_text(circuit_state_item, "Circuit# CIC+%u state: %s", i++, val_to_str_const(circuit_state&BA_8BIT_MASK, isup_mtc_blocking_state_DC00_value, "unknown"));
}
else {
proto_tree_add_uint(circuit_state_tree, hf_isup_mtc_blocking_state2, parameter_tvb, offset, 1, circuit_state);
proto_tree_add_uint(circuit_state_tree, hf_isup_call_proc_state, parameter_tvb, offset, 1, circuit_state);
proto_tree_add_uint(circuit_state_tree, hf_isup_hw_blocking_state, parameter_tvb, offset, 1, circuit_state);
- proto_item_set_text(circuit_state_item, "Circuit# CIC+%u state: %s", i++, val_to_str(circuit_state&BA_8BIT_MASK, isup_mtc_blocking_state_DCnot00_value, "unknown"));
+ proto_item_set_text(circuit_state_item, "Circuit# CIC+%u state: %s", i++, val_to_str_const(circuit_state&BA_8BIT_MASK, isup_mtc_blocking_state_DCnot00_value, "unknown"));
}
offset++;
}
@@ -3249,10 +3249,10 @@ dissect_isup_event_information_parameter(tvbuff_t *parameter_tvb, proto_tree *pa
guint8 indicators;
indicators = tvb_get_guint8(parameter_tvb, 0);
- proto_tree_add_uint_format(parameter_tree, hf_isup_event_ind, parameter_tvb, 0, EVENT_INFO_LENGTH, indicators, "Event indicator: %s (%u)", val_to_str(indicators & GFEDCBA_8BIT_MASK, isup_event_ind_value, "spare"), indicators & GFEDCBA_8BIT_MASK);
+ proto_tree_add_uint_format(parameter_tree, hf_isup_event_ind, parameter_tvb, 0, EVENT_INFO_LENGTH, indicators, "Event indicator: %s (%u)", val_to_str_const(indicators & GFEDCBA_8BIT_MASK, isup_event_ind_value, "spare"), indicators & GFEDCBA_8BIT_MASK);
proto_tree_add_boolean(parameter_tree, hf_isup_event_presentation_restricted_ind, parameter_tvb, 0, EVENT_INFO_LENGTH, indicators);
- proto_item_set_text(parameter_item,"Event information: %s (%u)", val_to_str(indicators & GFEDCBA_8BIT_MASK, isup_event_ind_value, "spare"),indicators);
+ proto_item_set_text(parameter_item,"Event information: %s (%u)", val_to_str_const(indicators & GFEDCBA_8BIT_MASK, isup_event_ind_value, "spare"),indicators);
}
/* ------------------------------------------------------------------
Dissector Parameter User-to-user information- no detailed dissection since defined in Rec. Q.931
@@ -4387,7 +4387,7 @@ dissect_isup_optional_forward_call_indicators_parameter(tvbuff_t *parameter_tvb,
proto_tree_add_boolean(parameter_tree, hf_isup_connected_line_identity_request_ind, parameter_tvb, 0, OPTIONAL_FORWARD_CALL_IND_LENGTH, indicators);
- proto_item_set_text(parameter_item,"Optional forward call indicators: %s (%u)", val_to_str(indicators & BA_8BIT_MASK, isup_CUG_call_ind_value, "spare"), indicators);
+ proto_item_set_text(parameter_item,"Optional forward call indicators: %s (%u)", val_to_str_const(indicators & BA_8BIT_MASK, isup_CUG_call_ind_value, "spare"), indicators);
}
/* ------------------------------------------------------------------
Dissector Parameter calling party number
@@ -4889,7 +4889,7 @@ dissect_isup_automatic_congestion_level_parameter(tvbuff_t *parameter_tvb, proto
congestion_level = tvb_get_guint8(parameter_tvb, 0);
proto_tree_add_uint(parameter_tree, hf_isup_automatic_congestion_level, parameter_tvb, 0, AUTO_CONGEST_LEVEL_LENGTH, congestion_level);
- proto_item_set_text(parameter_item, "Automatic congestion level: %s (%u)", val_to_str(congestion_level, isup_auto_congestion_level_value, "spare"), congestion_level);
+ proto_item_set_text(parameter_item, "Automatic congestion level: %s (%u)", val_to_str_const(congestion_level, isup_auto_congestion_level_value, "spare"), congestion_level);
}
/* ------------------------------------------------------------------
Dissector Parameter Optional backward Call indicators
@@ -5937,7 +5937,7 @@ dissect_isup_calling_geodetic_location_parameter(tvbuff_t *parameter_tvb, proto_
proto_tree_add_boolean(parameter_tree, hf_isup_extension_ind, parameter_tvb, 1, 1, oct);
proto_tree_add_text(parameter_tree, parameter_tvb, 1, 1,
"Calling geodetic location type of shape: %s (%u)",
- val_to_str(oct & GFEDCBA_8BIT_MASK, isup_location_type_of_shape_value, "spare/reserved"), oct);
+ val_to_str_const(oct & GFEDCBA_8BIT_MASK, isup_location_type_of_shape_value, "spare/reserved"), oct);
if (length > 2)
{
diff --git a/epan/dissectors/packet-itdm.c b/epan/dissectors/packet-itdm.c
index ef09c26cf1..79b58d4b91 100644
--- a/epan/dissectors/packet-itdm.c
+++ b/epan/dissectors/packet-itdm.c
@@ -201,7 +201,7 @@ dissect_itdm_125usec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_add_fstr(pinfo->cinfo, COL_INFO,
"Flow %d Chan %d ACT %d ACK %d %s",
flowid, chanid, actbit, ackbit,
- val_to_str(chcmd, chcmd_vals, "Reserved"));
+ val_to_str_const(chcmd, chcmd_vals, "Reserved"));
if (chcmd == ITDM_CMD_NEW_CHAN ||
chcmd == ITDM_CMD_CLOSE_CHAN ||
chcmd == ITDM_CMD_CYCLIC_REAF)
@@ -295,7 +295,7 @@ dissect_itdm_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
col_add_fstr(pinfo->cinfo, COL_INFO,
"Flow %d Command %s ",
- flowid, val_to_str(command, itdm_ctl_command_vals, "Reserved"));
+ flowid, val_to_str_const(command, itdm_ctl_command_vals, "Reserved"));
if (command != ITDM_CTL_CMD_AFI_REQ )
{
diff --git a/epan/dissectors/packet-iua.c b/epan/dissectors/packet-iua.c
index b4cc3dc93e..638d415b83 100644
--- a/epan/dissectors/packet-iua.c
+++ b/epan/dissectors/packet-iua.c
@@ -189,7 +189,7 @@ dissect_dlci_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree)
* dissect the protocol data */
sapi_item = proto_tree_add_item(parameter_tree, hf_dlci_sapi, parameter_tvb, DLCI_SAPI_OFFSET, DLCI_SAPI_LENGTH, ENC_BIG_ENDIAN);
sapi_val = (tvb_get_guint8(parameter_tvb, DLCI_SAPI_OFFSET) & SAPI_MASK) >> SAPI_SHIFT;
- proto_item_append_text(sapi_item, " (%s)", val_to_str( sapi_val, sapi_values, "Unknown/reserved"));
+ proto_item_append_text(sapi_item, " (%s)", val_to_str_const( sapi_val, sapi_values, "Unknown/reserved"));
sapi_val_assigned = TRUE;
proto_tree_add_item(parameter_tree, hf_dlci_one_bit, parameter_tvb, DLCI_TEI_OFFSET, DLCI_TEI_LENGTH, ENC_BIG_ENDIAN);
@@ -258,7 +258,7 @@ static void
dissect_asp_reason_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
{
proto_tree_add_item(parameter_tree, hf_asp_reason, parameter_tvb, ASP_REASON_OFFSET, ASP_REASON_LENGTH, ENC_BIG_ENDIAN);
- proto_item_append_text(parameter_item, " (%s)", val_to_str(tvb_get_ntohl(parameter_tvb, ASP_REASON_OFFSET), asp_reason_values, "unknown"));
+ proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, ASP_REASON_OFFSET), asp_reason_values, "unknown"));
}
#define OVER_RIDE_TRAFFIC_MODE_TYPE 1
@@ -277,7 +277,7 @@ dissect_traffic_mode_type_parameter(tvbuff_t *parameter_tvb, proto_tree *paramet
{
proto_tree_add_item(parameter_tree, hf_traffic_mode_type, parameter_tvb, TRAFFIC_MODE_TYPE_OFFSET, TRAFFIC_MODE_TYPE_LENGTH, ENC_BIG_ENDIAN);
proto_item_append_text(parameter_item, " (%s)",
- val_to_str(tvb_get_ntohl(parameter_tvb, TRAFFIC_MODE_TYPE_OFFSET), traffic_mode_type_values, "unknown"));
+ val_to_str_const(tvb_get_ntohl(parameter_tvb, TRAFFIC_MODE_TYPE_OFFSET), traffic_mode_type_values, "unknown"));
}
#define INVALID_VERSION_ERROR 0x01
@@ -337,7 +337,7 @@ dissect_error_code_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree
{
proto_tree_add_item(parameter_tree, support_IG?hf_error_code_ig:hf_error_code, parameter_tvb, ERROR_CODE_OFFSET, ERROR_CODE_LENGTH, ENC_BIG_ENDIAN);
proto_item_append_text(parameter_item, " (%s)",
- val_to_str(tvb_get_ntohl(parameter_tvb, ERROR_CODE_OFFSET), support_IG?error_code_ig_values:error_code_values, "unknown"));
+ val_to_str_const(tvb_get_ntohl(parameter_tvb, ERROR_CODE_OFFSET), support_IG?error_code_ig_values:error_code_values, "unknown"));
}
#define ASP_STATE_CHANGE_STATUS_TYPE 0x01
@@ -389,10 +389,10 @@ dissect_status_type_identification_parameter(tvbuff_t *parameter_tvb, proto_tree
proto_tree_add_item(parameter_tree, hf_status_type, parameter_tvb, STATUS_TYPE_OFFSET, STATUS_TYPE_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_uint_format(parameter_tree, hf_status_id, parameter_tvb, STATUS_IDENT_OFFSET, STATUS_IDENT_LENGTH,
status_id, "Status identification: %u (%s)", status_id,
- val_to_str(status_type * 256 * 256 + status_id, support_IG?status_type_id_ig_values:status_type_id_values, "unknown"));
+ val_to_str_const(status_type * 256 * 256 + status_id, support_IG?status_type_id_ig_values:status_type_id_values, "unknown"));
proto_item_append_text(parameter_item, " (%s)",
- val_to_str(status_type * 256 * 256 + status_id, support_IG?status_type_id_ig_values:status_type_id_values, "unknown status information"));
+ val_to_str_const(status_type * 256 * 256 + status_id, support_IG?status_type_id_ig_values:status_type_id_values, "unknown status information"));
}
#define PROTOCOL_DATA_OFFSET PARAMETER_VALUE_OFFSET
@@ -448,7 +448,7 @@ dissect_release_reason_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_
{
proto_tree_add_item(parameter_tree, hf_release_reason, parameter_tvb, RELEASE_REASON_OFFSET, RELEASE_REASON_LENGTH, ENC_BIG_ENDIAN);
proto_item_append_text(parameter_item, " (%s)",
- val_to_str(tvb_get_ntohl(parameter_tvb, RELEASE_REASON_OFFSET), release_reason_values, "unknown"));
+ val_to_str_const(tvb_get_ntohl(parameter_tvb, RELEASE_REASON_OFFSET), release_reason_values, "unknown"));
}
#define TEI_STATUS_ASSIGNED 0
@@ -467,7 +467,7 @@ dissect_tei_status_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree
{
proto_tree_add_item(parameter_tree, hf_tei_status, parameter_tvb, TEI_STATUS_OFFSET, TEI_STATUS_LENGTH, ENC_BIG_ENDIAN);
proto_item_append_text(parameter_item, " (%s)",
- val_to_str(tvb_get_ntohl(parameter_tvb, TEI_STATUS_OFFSET), tei_status_values, "unknown"));
+ val_to_str_const(tvb_get_ntohl(parameter_tvb, TEI_STATUS_OFFSET), tei_status_values, "unknown"));
}
#define ASP_ID_LENGTH 4
@@ -556,7 +556,7 @@ dissect_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *tree,
/* create proto_tree stuff */
parameter_item = proto_tree_add_text(iua_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb),
- "%s parameter", val_to_str(tag, support_IG?parameter_tag_ig_values:parameter_tag_values, "Unknown"));
+ "%s parameter", val_to_str_const(tag, support_IG?parameter_tag_ig_values:parameter_tag_values, "Unknown"));
parameter_tree = proto_item_add_subtree(parameter_item, ett_iua_parameter);
/* add tag and length to the iua tree */
@@ -845,7 +845,7 @@ dissect_common_header(tvbuff_t *common_header_tvb, packet_info *pinfo, proto_tre
message_class = tvb_get_guint8(common_header_tvb, MESSAGE_CLASS_OFFSET);
message_type = tvb_get_guint8(common_header_tvb, MESSAGE_TYPE_OFFSET);
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(message_class * 256 + message_type, support_IG?message_class_type_acro_ig_values:message_class_type_acro_values, "UNKNOWN"));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_class * 256 + message_type, support_IG?message_class_type_acro_ig_values:message_class_type_acro_values, "UNKNOWN"));
if (iua_tree) {
/* add the components of the common header to the protocol tree */
@@ -855,7 +855,7 @@ dissect_common_header(tvbuff_t *common_header_tvb, packet_info *pinfo, proto_tre
proto_tree_add_uint_format(iua_tree, hf_message_type,
common_header_tvb, MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_LENGTH,
message_type, "Message type: %u (%s)",
- message_type, val_to_str(message_class * 256 + message_type, support_IG?message_class_type_ig_values:message_class_type_values, "reserved"));
+ message_type, val_to_str_const(message_class * 256 + message_type, support_IG?message_class_type_ig_values:message_class_type_values, "reserved"));
proto_tree_add_item(iua_tree, hf_message_length, common_header_tvb, MESSAGE_LENGTH_OFFSET, MESSAGE_LENGTH_LENGTH, ENC_BIG_ENDIAN);
}
}
diff --git a/epan/dissectors/packet-juniper.c b/epan/dissectors/packet-juniper.c
index 9dca8cff30..8c94f36461 100644
--- a/epan/dissectors/packet-juniper.c
+++ b/epan/dissectors/packet-juniper.c
@@ -530,11 +530,11 @@ dissect_juniper_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, prot
proto_tree_add_uint_format (juniper_subtree, hf_juniper_direction, tvb, 3, 1,
direction, "Direction: %s",
- val_to_str(direction,juniper_direction_vals,"Unknown"));
+ val_to_str_const(direction,juniper_direction_vals,"Unknown"));
proto_tree_add_uint_format (juniper_subtree, hf_juniper_l2hdr_presence, tvb, 3, 1,
l2hdr_presence, "L2-header: %s",
- val_to_str(l2hdr_presence,juniper_l2hdr_presence_vals,"Unknown"));
+ val_to_str_const(l2hdr_presence,juniper_l2hdr_presence_vals,"Unknown"));
/* calculate hdr_len before cookie, payload */
@@ -555,7 +555,7 @@ dissect_juniper_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, prot
tisub = proto_tree_add_text (juniper_ext_subtree, tvb, ext_offset, EXT_TLV_HEADER_SIZE + ext_len,
"%s Extension TLV #%u, length: %u",
- val_to_str(ext_type, ext_tlv_vals, "Unknown"),
+ val_to_str_const(ext_type, ext_tlv_vals, "Unknown"),
ext_type,
ext_len);
@@ -626,7 +626,7 @@ dissect_juniper_payload_proto(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
guint8 nlpid;
proto_tree_add_text (juniper_subtree, tvb, offset, 0, "[Payload Type: %s]",
- val_to_str(proto,juniper_proto_vals,"Unknown"));
+ val_to_str_const(proto,juniper_proto_vals,"Unknown"));
next_tvb = tvb_new_subset_remaining(tvb, offset);
diff --git a/epan/dissectors/packet-kingfisher.c b/epan/dissectors/packet-kingfisher.c
index 14ed18ddba..249b843e01 100644
--- a/epan/dissectors/packet-kingfisher.c
+++ b/epan/dissectors/packet-kingfisher.c
@@ -208,7 +208,7 @@ dissect_kingfisher(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
case 0x80:
case 0x81:
col_set_str(pinfo->cinfo, COL_PROTOCOL, "Kingfisher");
- func_string = val_to_str(tvb_get_guint8(tvb, 0), function_code_vals, "Unknown function");
+ func_string = val_to_str_const(tvb_get_guint8(tvb, 0), function_code_vals, "Unknown function");
col_add_fstr(pinfo->cinfo, COL_INFO, "(%s)", func_string);
proto_tree_add_protocol_format(tree, proto_kingfisher, tvb, 0, -1, "Kingfisher Protocol, %s", func_string);
return TRUE;
@@ -268,7 +268,7 @@ dissect_kingfisher(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
/* Ok this does look like Kingfisher, so lets dissect it */
- func_string = val_to_str(kfp->function, function_code_vals, "Unknown function");
+ func_string = val_to_str_const(kfp->function, function_code_vals, "Unknown function");
col_set_str(pinfo->cinfo, COL_PROTOCOL, "Kingfisher");
col_add_fstr(pinfo->cinfo, COL_INFO, "%u > %u (%s)", kfp->from, kfp->target, func_string);
diff --git a/epan/dissectors/packet-kink.c b/epan/dissectors/packet-kink.c
index bee5ce5a48..7275121bbc 100644
--- a/epan/dissectors/packet-kink.c
+++ b/epan/dissectors/packet-kink.c
@@ -199,7 +199,7 @@ dissect_kink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree){
/* It shows kink type by the type value. */
if(check_col(pinfo->cinfo, COL_INFO)){
- col_add_str(pinfo->cinfo, COL_INFO, val_to_str(type, kink_type_vals, "unknown"));
+ col_add_str(pinfo->cinfo, COL_INFO, val_to_str_const(type, kink_type_vals, "unknown"));
}
/* Make the kink tree */
if(tree){
diff --git a/epan/dissectors/packet-kpasswd.c b/epan/dissectors/packet-kpasswd.c
index 60238102c4..4a04b96c7f 100644
--- a/epan/dissectors/packet-kpasswd.c
+++ b/epan/dissectors/packet-kpasswd.c
@@ -241,7 +241,7 @@ dissect_kpasswd_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboo
proto_tree_add_uint(kpasswd_tree, hf_kpasswd_message_len, tvb, offset, 2, message_len);
proto_tree_add_uint(kpasswd_tree, hf_kpasswd_version, tvb, offset+2, 2, version);
if (check_col(pinfo->cinfo, COL_INFO))
- col_add_str(pinfo->cinfo, COL_INFO, val_to_str(version, vers_vals, "Unknown command"));
+ col_add_str(pinfo->cinfo, COL_INFO, val_to_str_const(version, vers_vals, "Unknown command"));
proto_tree_add_uint(kpasswd_tree, hf_kpasswd_ap_req_len, tvb, offset+4, 2, ap_req_len);
offset+=6;
diff --git a/epan/dissectors/packet-ldp.c b/epan/dissectors/packet-ldp.c
index b8dde73923..7099a4a445 100644
--- a/epan/dissectors/packet-ldp.c
+++ b/epan/dissectors/packet-ldp.c
@@ -970,7 +970,7 @@ dissect_tlv_fec(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem)
rem-=addr_size;
proto_tree_add_text(fec_tree, tvb, offset-1, 1,
"Invalid prefix %u length for family %s",
- prefix_len, val_to_str(family, afn_vals, "Unknown Family"));
+ prefix_len, val_to_str_const(family, afn_vals, "Unknown Family"));
break;
}
@@ -1045,7 +1045,7 @@ dissect_tlv_fec(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem)
rem-=addr_size;
proto_tree_add_text(fec_tree, tvb, offset-1, 1,
"Invalid address length %u length for family %s",
- host_len, val_to_str(family, afn_vals, "Unknown Family"));
+ host_len, val_to_str_const(family, afn_vals, "Unknown Family"));
break;
}
@@ -1400,7 +1400,7 @@ dissect_tlv_frame_label(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem)
len=(guint8)(tvb_get_ntohs(tvb, offset)>>7) & 0x03;
proto_tree_add_uint_format(val_tree, hf_ldp_tlv_fr_label_len, tvb, offset, 2, len,
- "Number of DLCI bits: %s (%u)", val_to_str(len, tlv_fr_len_vals, "Unknown Length"), len);
+ "Number of DLCI bits: %s (%u)", val_to_str_const(len, tlv_fr_len_vals, "Unknown Length"), len);
id=tvb_get_ntoh24(tvb, offset+1)&0x7FFFFF;
proto_tree_add_uint_format(val_tree,
@@ -1430,7 +1430,7 @@ dissect_tlv_status(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem)
data=tvb_get_ntohl(tvb, offset)&0x3FFFFFFF;
proto_tree_add_uint_format(val_tree, hf_ldp_tlv_status_data, tvb, offset, 4,
- data, "Status Data: %s (0x%X)", val_to_str(data, tlv_status_data, "Unknown Status Data"), data);
+ data, "Status Data: %s (0x%X)", val_to_str_const(data, tlv_status_data, "Unknown Status Data"), data);
proto_tree_add_item(val_tree, hf_ldp_tlv_status_msg_id, tvb, offset+4, 4, ENC_BIG_ENDIAN);
proto_tree_add_item(val_tree, hf_ldp_tlv_status_msg_type, tvb, offset+8, 2, ENC_BIG_ENDIAN);
@@ -1495,7 +1495,7 @@ dissect_tlv_returned_message(tvbuff_t *tvb, guint offset, proto_tree *tree, int
type, "Message Type: Experimental (0x%X)", type);
} else {
proto_tree_add_uint_format(val_tree, hf_ldp_tlv_returned_msg_type, tvb, offset, 2,
- type, "Message Type: %s (0x%X)", val_to_str(type, ldp_message_types,"Unknown Message Type"), type);
+ type, "Message Type: %s (0x%X)", val_to_str_const(type, ldp_message_types,"Unknown Message Type"), type);
}
proto_tree_add_item(val_tree, hf_ldp_tlv_returned_msg_len, tvb, offset+2, 2, ENC_BIG_ENDIAN);
@@ -1726,7 +1726,7 @@ dissect_tlv_frame_relay_session_parms(tvbuff_t *tvb, guint offset,proto_tree *tr
len=(guint8)(tvb_get_ntohs(tvb, offset)>>7) & 0x03;
proto_tree_add_uint_format(lbl_tree, hf_ldp_tlv_sess_fr_len, tvb, offset, 2, len,
- "Number of DLCI bits: %s (%u)", val_to_str(len, tlv_fr_len_vals, "Unknown Length"), len);
+ "Number of DLCI bits: %s (%u)", val_to_str_const(len, tlv_fr_len_vals, "Unknown Length"), len);
id=tvb_get_ntoh24(tvb, offset+1)&0x7FFFFF;
proto_tree_add_uint_format(lbl_tree,
@@ -1768,7 +1768,7 @@ dissect_tlv_ft_session(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem)
flags = tvb_get_ntohs(tvb, offset);
proto_item_append_text(ti, " (%s%s)", (flags & 0x8000) ? "R, " : "",
- val_to_str(flags & 0xF, tlv_ft_flags, "Invalid"));
+ val_to_str_const(flags & 0xF, tlv_ft_flags, "Invalid"));
proto_tree_add_item(flags_tree, hf_ldp_tlv_ft_sess_flag_r, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(flags_tree, hf_ldp_tlv_ft_sess_flag_res, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(flags_tree, hf_ldp_tlv_ft_sess_flag_s, tvb, offset, 2, ENC_BIG_ENDIAN);
@@ -2183,7 +2183,7 @@ dissect_tlv(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem)
break;
default:
proto_tree_add_uint_format(tlv_tree, hf_ldp_tlv_type, tvb, offset, 2,
- type, "TLV Type: %s (0x%X)", val_to_str(type, tlv_type_names, "Unknown TLV type"), type );
+ type, "TLV Type: %s (0x%X)", val_to_str_const(type, tlv_type_names, "Unknown TLV type"), type );
}
proto_tree_add_item(tlv_tree, hf_ldp_tlv_len, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
@@ -2591,7 +2591,7 @@ dissect_msg(tvbuff_t *tvb, guint offset, packet_info *pinfo, proto_tree *tree)
break;
default:
proto_tree_add_uint_format(msg_tree, hf_ldp_msg_type, tvb, offset, 2,
- type, "Message Type: %s (0x%X)", val_to_str(type, ldp_message_types,"Unknown Message Type"), type);
+ type, "Message Type: %s (0x%X)", val_to_str_const(type, ldp_message_types,"Unknown Message Type"), type);
}
proto_tree_add_item(msg_tree, hf_ldp_msg_len, tvb, offset+2, 2, ENC_BIG_ENDIAN);
diff --git a/epan/dissectors/packet-ldss.c b/epan/dissectors/packet-ldss.c
index 970e20fbbe..02c74bfa27 100644
--- a/epan/dissectors/packet-ldss.c
+++ b/epan/dissectors/packet-ldss.c
@@ -296,7 +296,7 @@ dissect_ldss_broadcast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
port = tvb_get_ntohs (tvb, 64);
rate = tvb_get_ntohs (tvb, 66);
- packet_type = val_to_str(messageID, ldss_message_id_value, "unknown");
+ packet_type = val_to_str_const(messageID, ldss_message_id_value, "unknown");
if (messageID == MESSAGE_ID_WILLSEND) {
if (cookie == 0) {
@@ -323,7 +323,7 @@ dissect_ldss_broadcast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
else if (messageID == MESSAGE_ID_NEEDFILE) {
messageDetail = INFERRED_SEARCH;
}
- packet_detail = val_to_str(messageDetail, ldss_inferred_info, "unknown");
+ packet_detail = val_to_str_const(messageDetail, ldss_inferred_info, "unknown");
/* Set the info column */
if (check_col(pinfo->cinfo, COL_INFO)) {
diff --git a/epan/dissectors/packet-linx.c b/epan/dissectors/packet-linx.c
index 41627f73f5..ef4998bc33 100644
--- a/epan/dissectors/packet-linx.c
+++ b/epan/dissectors/packet-linx.c
@@ -375,9 +375,9 @@ dissect_linx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
conntype = (dword >>24) & 0xf;
/* Write non trivial header name to info column */
if ((thishdr != ETHCM_NONE) && (thishdr != ETHCM_MAIN)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(thishdr, linx_short_header_names, "unknown"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(thishdr, linx_short_header_names, "unknown"));
if(thishdr == ETHCM_CONN)
- col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(conntype, linx_conn_cmd, "unknown"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(conntype, linx_conn_cmd, "unknown"));
}
switch (thishdr) {
@@ -519,7 +519,7 @@ dissect_linx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dword = tvb_get_ntohl(linx_tvb, offset);
/* Write to info column */
- col_append_fstr(pinfo->cinfo, COL_INFO, "rlnh:%s ", val_to_str(dword, linx_short_rlnh_names, "unknown"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, "rlnh:%s ", val_to_str_const(dword, linx_short_rlnh_names, "unknown"));
/* create new paragraph for RLNH */
item = proto_tree_add_text(linx_tree, linx_tvb, offset, 4, "RLNH");
@@ -868,7 +868,7 @@ dissect_linx_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
size += (dword & 0xFFFFFFFF);
}
- col_append_fstr(pinfo->cinfo, COL_INFO, "tcpcm:%s ", val_to_str(type, linx_short_tcp_names, "unknown"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, "tcpcm:%s ", val_to_str_const(type, linx_short_tcp_names, "unknown"));
tvb_set_reported_length(tvb, size);
linx_tcp_tvb = tvb_new_subset(tvb, 0, size, size);
@@ -899,7 +899,7 @@ dissect_linx_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dword = tvb_get_ntohl(linx_tcp_tvb, offset);
/* Write to info column */
- col_append_fstr(pinfo->cinfo, COL_INFO, "rlnh:%s ", val_to_str(dword, linx_short_rlnh_names, "unknown"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, "rlnh:%s ", val_to_str_const(dword, linx_short_rlnh_names, "unknown"));
/* create new paragraph for RLNH */
item = proto_tree_add_text(linx_tcp_tree, linx_tcp_tvb, offset, 4, "RLNH");
diff --git a/epan/dissectors/packet-llc.c b/epan/dissectors/packet-llc.c
index e5a520365e..aa7c307bd5 100644
--- a/epan/dissectors/packet-llc.c
+++ b/epan/dissectors/packet-llc.c
@@ -595,7 +595,7 @@ dissect_snap(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO,
"; SNAP, OUI 0x%06X (%s), PID 0x%04X",
- oui, val_to_str(oui, oui_vals, "Unknown"), etype);
+ oui, val_to_str_const(oui, oui_vals, "Unknown"), etype);
}
if (tree) {
proto_tree_add_uint(snap_tree, hf_oui, tvb, offset, 3, oui);
diff --git a/epan/dissectors/packet-lldp.c b/epan/dissectors/packet-lldp.c
index f9546eca10..2184d5934e 100644
--- a/epan/dissectors/packet-lldp.c
+++ b/epan/dissectors/packet-lldp.c
@@ -692,7 +692,7 @@ dissect_lldp_chassis_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gui
{
/* Set chassis tree */
tf = proto_tree_add_text(tree, tvb, offset, (tempLen + 2), "Chassis Subtype = %s",
- val_to_str(tempType, chassis_id_subtypes, "Reserved" ));
+ val_to_str_const(tempType, chassis_id_subtypes, "Reserved" ));
chassis_tree = proto_item_add_subtree(tf, ett_chassis_id);
proto_tree_add_item(chassis_tree, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN);
@@ -818,7 +818,7 @@ dissect_lldp_port_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint3
{
/* Set port tree */
tf = proto_tree_add_text(tree, tvb, offset, (tempLen + 2), "Port Subtype = %s",
- val_to_str(tempType, port_id_subtypes, "Unknown" ));
+ val_to_str_const(tempType, port_id_subtypes, "Unknown" ));
port_tree = proto_item_add_subtree(tf, ett_port_id);
proto_tree_add_item(port_tree, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN);
@@ -1165,7 +1165,7 @@ dissect_lldp_management_address(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre
/* Get management address subtype */
tempByte = tvb_get_guint8(tvb, tempOffset);
proto_tree_add_text(system_mgm_addr, tvb, tempOffset, 1, "Address Subtype: %s (%u)",
- val_to_str(tempByte, afn_vals, "Undefined"),
+ val_to_str_const(tempByte, afn_vals, "Undefined"),
tempByte);
tempOffset++;
@@ -1190,7 +1190,7 @@ dissect_lldp_management_address(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre
/* Get interface numbering subtype */
tempByte = tvb_get_guint8(tvb, tempOffset);
proto_tree_add_text(system_mgm_addr, tvb, tempOffset, 1, "Interface Subtype: %s (%u)",
- val_to_str(tempByte, interface_subtype_values, "Undefined"),
+ val_to_str_const(tempByte, interface_subtype_values, "Undefined"),
tempByte);
tempOffset++;
@@ -1674,7 +1674,7 @@ dissect_ieee_802_3_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
tempShort = tvb_get_ntohs(tvb, tempOffset);
if (tree)
proto_tree_add_text(tree, tvb, tempOffset, 2, "Operational MAU Type: %s (0x%04X)",
- val_to_str(tempShort,operational_mau_type_values,"Unknown"),
+ val_to_str_const(tempShort,operational_mau_type_values,"Unknown"),
tempShort);
tempOffset += 2;
@@ -1740,8 +1740,8 @@ dissect_ieee_802_3_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
if (tree)
proto_tree_add_text(tree, tvb, tempOffset, 1, "%s %s %s",
decode_boolean_bitfield(tempByte, 0xC0, 8, "Power Type:", "Power Type:"),
- val_to_str(subType, power_type_802_3, "Unknown"),
- val_to_str(subType, media_power_type, "Unknown"));
+ val_to_str_const(subType, power_type_802_3, "Unknown"),
+ val_to_str_const(subType, media_power_type, "Unknown"));
/* Determine power source */
switch (subType)
@@ -1750,7 +1750,7 @@ dissect_ieee_802_3_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
case 2:
{
subType = ((tempByte & 0x30) >> 4);
- strPtr = val_to_str(subType, media_power_pse_device, "Reserved");
+ strPtr = val_to_str_const(subType, media_power_pse_device, "Reserved");
break;
}
@@ -1758,7 +1758,7 @@ dissect_ieee_802_3_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
case 3:
{
subType = ((tempByte & 0x30) >> 4);
- strPtr = val_to_str(subType, media_power_pd_device, "Reserved");
+ strPtr = val_to_str_const(subType, media_power_pd_device, "Reserved");
break;
}
@@ -1778,7 +1778,7 @@ dissect_ieee_802_3_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
if (tree)
proto_tree_add_text(tree, tvb, tempOffset, 1, "%s %s",
decode_boolean_bitfield(tempByte, 0x0F, 8, "Power Priority:", "Power Priority:"),
- val_to_str(subType, media_power_priority, "Reserved"));
+ val_to_str_const(subType, media_power_priority, "Reserved"));
tempOffset++;
@@ -1920,7 +1920,7 @@ dissect_media_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint
}
tempByte = tvb_get_guint8(tvb, tempOffset);
if (tree)
- proto_tree_add_text(tree, tvb, tempOffset, 1, "Class Type: %s", val_to_str(tempByte, media_class_values, "Unknown"));
+ proto_tree_add_text(tree, tvb, tempOffset, 1, "Class Type: %s", val_to_str_const(tempByte, media_class_values, "Unknown"));
tempOffset++;
tlvLen--;
@@ -1937,7 +1937,7 @@ dissect_media_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint
tempByte = tvb_get_guint8(tvb, tempOffset);
if (tree)
proto_tree_add_text(tree, tvb, tempOffset, 1, "Application Type: %s (%u)",
- val_to_str(tempByte, media_application_type, "Unknown"), tempByte);
+ val_to_str_const(tempByte, media_application_type, "Unknown"), tempByte);
tempOffset++;
tlvLen--;
@@ -2001,7 +2001,7 @@ dissect_media_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint
tempByte = tvb_get_guint8(tvb, tempOffset);
if (tree)
proto_tree_add_text(tree, tvb, tempOffset, 1, "Location Data Format: %s (%u)",
- val_to_str(tempByte, location_data_format, "Unknown"), tempByte);
+ val_to_str_const(tempByte, location_data_format, "Unknown"), tempByte);
tempOffset++;
tlvLen--;
@@ -2139,7 +2139,7 @@ dissect_media_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint
tempByte = tvb_get_guint8(tvb, tempOffset);
if (tree)
proto_tree_add_text(tree, tvb, tempOffset, 1, "What: %s (%u)",
- val_to_str(tempByte,civic_address_what_values,"Unknown"),
+ val_to_str_const(tempByte,civic_address_what_values,"Unknown"),
tempByte);
tempOffset++;
LCI_Length--;
@@ -2168,7 +2168,7 @@ dissect_media_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint
tempByte = tvb_get_guint8(tvb, tempOffset);
if (tree)
proto_tree_add_text(tree, tvb, tempOffset, 1, "CA Type: %s (%u)",
- val_to_str(tempByte,civic_address_type_values,"Unknown"),
+ val_to_str_const(tempByte,civic_address_type_values,"Unknown"),
tempByte);
tempOffset++;
@@ -2231,7 +2231,7 @@ dissect_media_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint
if (tree)
proto_tree_add_text(tree, tvb, tempOffset, 1, "%s %s",
decode_boolean_bitfield(tempByte, 0xC0, 8, "Power Type:", "Power Type:"),
- val_to_str(subType, media_power_type, "Unknown"));
+ val_to_str_const(subType, media_power_type, "Unknown"));
/* Determine power source */
switch (subType)
@@ -2239,14 +2239,14 @@ dissect_media_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint
case 0:
{
subType = ((tempByte & 0x30) >> 4);
- strPtr = val_to_str(subType, media_power_pse_device, "Reserved");
+ strPtr = val_to_str_const(subType, media_power_pse_device, "Reserved");
break;
}
case 1:
{
subType = ((tempByte & 0x30) >> 4);
- strPtr = val_to_str(subType, media_power_pd_device, "Reserved");
+ strPtr = val_to_str_const(subType, media_power_pd_device, "Reserved");
break;
}
@@ -2266,7 +2266,7 @@ dissect_media_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint
if (tree)
proto_tree_add_text(tree, tvb, tempOffset, 1, "%s %s",
decode_boolean_bitfield(tempByte, 0x0F, 8, "Power Priority:", "Power Priority:"),
- val_to_str(subType, media_power_priority, "Reserved"));
+ val_to_str_const(subType, media_power_priority, "Reserved"));
tempOffset++;
@@ -2600,7 +2600,7 @@ dissect_organizational_specific_tlv(tvbuff_t *tvb, packet_info *pinfo, proto_tre
return tLength;
}
/* maintain previous OUI names. If not included, look in manuf database for OUI */
- ouiStr = val_to_str(oui, tlv_oui_subtype_vals, "Unknown");
+ ouiStr = val_to_str_const(oui, tlv_oui_subtype_vals, "Unknown");
if (strcmp(ouiStr, "Unknown")==0) {
ouiStr = uint_get_manuf_name_if_known(oui);
if(ouiStr==NULL) ouiStr="Unknown";
diff --git a/epan/dissectors/packet-lmp.c b/epan/dissectors/packet-lmp.c
index cb4a27c00e..461ecdc06e 100644
--- a/epan/dissectors/packet-lmp.c
+++ b/epan/dissectors/packet-lmp.c
@@ -769,7 +769,7 @@ dissect_lmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
class = tvb_get_guint8(tvb, offset+1);
type = tvb_get_guint8(tvb, offset);
negotiable = (type >> 7); type &= 0x7f;
- object_type = val_to_str(class, lmp_class_vals, "Unknown");
+ object_type = val_to_str_const(class, lmp_class_vals, "Unknown");
hidden_item = proto_tree_add_uint(lmp_tree, hf_lmp_filter[LMPF_OBJECT], tvb,
offset, 1, class);
PROTO_ITEM_SET_HIDDEN(hidden_item);
diff --git a/epan/dissectors/packet-ltp.c b/epan/dissectors/packet-ltp.c
index 1f697abd38..36d1172792 100644
--- a/epan/dissectors/packet-ltp.c
+++ b/epan/dissectors/packet-ltp.c
@@ -514,7 +514,7 @@ dissect_cancel_segment(proto_tree * ltp_tree, tvbuff_t *tvb,int frame_offset){
ltp_cancel_tree = proto_item_add_subtree(ltp_cancel_item, ett_session_mgmt);
proto_tree_add_uint_format_value(ltp_cancel_tree, hf_ltp_cancel_code, tvb, frame_offset, 1, reason_code,
- "%x (%s)", reason_code, val_to_str(reason_code,ltp_cancel_codes,"Reserved"));
+ "%x (%s)", reason_code, val_to_str_const(reason_code,ltp_cancel_codes,"Reserved"));
return 1;
}
@@ -556,7 +556,7 @@ dissect_header_extn(proto_tree *ltp_tree, tvbuff_t *tvb,int frame_offset,int hdr
ltp_hdr_extn_tree = proto_item_add_subtree(ltp_hdr_extn_item, ett_hdr_extn);
for(i = 0; i < hdr_extn_cnt; i++){
- proto_tree_add_uint_format_value(ltp_hdr_extn_tree, hf_ltp_hdr_extn_tag, tvb, frame_offset, 1, extn_type[i], "%x (%s)", extn_type[i], val_to_str(extn_type[i],extn_tag_codes,"Unassigned/Reserved"));
+ proto_tree_add_uint_format_value(ltp_hdr_extn_tree, hf_ltp_hdr_extn_tag, tvb, frame_offset, 1, extn_type[i], "%x (%s)", extn_type[i], val_to_str_const(extn_type[i],extn_tag_codes,"Unassigned/Reserved"));
proto_tree_add_uint64_format(ltp_hdr_extn_tree, hf_ltp_hdr_extn_len, tvb, frame_offset, length_size[i],length[i], "Length [%d]: %"G_GINT64_MODIFIER"d",i+1,length[i]);
frame_offset += length_size[i];
@@ -610,7 +610,7 @@ dissect_trailer_extn(proto_tree *ltp_tree, tvbuff_t *tvb,int frame_offset,int tr
ltp_trl_extn_tree = proto_item_add_subtree(ltp_trl_extn_item, ett_trl_extn);
for(i = 0; i < trl_extn_cnt; i++){
- proto_tree_add_uint_format_value(ltp_trl_extn_tree, hf_ltp_trl_extn_tag, tvb, frame_offset, 1, extn_type[i], "%x (%s)", extn_type[i], val_to_str(extn_type[i],extn_tag_codes,"Unassigned/Reserved"));
+ proto_tree_add_uint_format_value(ltp_trl_extn_tree, hf_ltp_trl_extn_tag, tvb, frame_offset, 1, extn_type[i], "%x (%s)", extn_type[i], val_to_str_const(extn_type[i],extn_tag_codes,"Unassigned/Reserved"));
proto_tree_add_uint64_format(ltp_trl_extn_tree, hf_ltp_trl_extn_len, tvb, frame_offset, length_size[i], length[i], "Length [%d]: %"G_GINT64_MODIFIER"d",i+1,length[i]);
frame_offset += length_size[i];
@@ -687,7 +687,7 @@ dissect_ltp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint(ltp_header_tree,hf_ltp_version,tvb,frame_offset,1,hi_nibble(ltp_hdr));
ltp_type = lo_nibble(ltp_hdr);
proto_tree_add_uint_format_value(ltp_header_tree,hf_ltp_type,tvb,frame_offset,1,ltp_type,"%x (%s)",
- ltp_type,val_to_str(ltp_type,ltp_type_codes,"Invalid"));
+ ltp_type,val_to_str_const(ltp_type,ltp_type_codes,"Invalid"));
frame_offset++;
/* Adding the session id subtree */
diff --git a/epan/dissectors/packet-lwres.c b/epan/dissectors/packet-lwres.c
index e444e7ae81..f95efdda56 100644
--- a/epan/dissectors/packet-lwres.c
+++ b/epan/dissectors/packet-lwres.c
@@ -916,17 +916,17 @@ dissect_lwres(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
col_add_fstr(pinfo->cinfo, COL_INFO,
"%s, opcode=%s, serial=0x%x, result=%s",
- val_to_str((guint32)message_type,message_types_values,"unknown"),
- val_to_str(opcode, opcode_values, "unknown"),
+ val_to_str_const((guint32)message_type,message_types_values,"unknown"),
+ val_to_str_const(opcode, opcode_values, "unknown"),
serial,
- val_to_str(result,result_values,"unknown"));
+ val_to_str_const(result,result_values,"unknown"));
}
else
{
col_add_fstr(pinfo->cinfo, COL_INFO,
"%s, opcode=%s, serial=0x%x",
- val_to_str((guint32)message_type,message_types_values,"unknown"),
- val_to_str(opcode, opcode_values, "unknown"),
+ val_to_str_const((guint32)message_type,message_types_values,"unknown"),
+ val_to_str_const(opcode, opcode_values, "unknown"),
serial);
}
}
diff --git a/epan/dissectors/packet-m2pa.c b/epan/dissectors/packet-m2pa.c
index aba6269e06..617e2d235a 100644
--- a/epan/dissectors/packet-m2pa.c
+++ b/epan/dissectors/packet-m2pa.c
@@ -161,7 +161,7 @@ dissect_v2_header(tvbuff_t *header_tvb, packet_info *pinfo, proto_tree *m2pa_tre
message_type = tvb_get_ntohs(header_tvb, V2_TYPE_OFFSET);
if (check_col(pinfo->cinfo, COL_INFO))
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(message_type, v2_message_type_values, "reserved"));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_type, v2_message_type_values, "reserved"));
if (m2pa_tree) {
proto_tree_add_item(m2pa_tree, hf_version, header_tvb, VERSION_OFFSET, VERSION_LENGTH, ENC_BIG_ENDIAN);
@@ -179,7 +179,7 @@ dissect_v8_header(tvbuff_t *header_tvb, packet_info *pinfo, proto_tree *m2pa_tre
message_type = tvb_get_guint8(header_tvb, V8_TYPE_OFFSET);
if (check_col(pinfo->cinfo, COL_INFO))
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(message_type, v8_message_type_values, "Unknown"));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_type, v8_message_type_values, "Unknown"));
if (m2pa_tree) {
proto_tree_add_item(m2pa_tree, hf_version, header_tvb, VERSION_OFFSET, VERSION_LENGTH, ENC_BIG_ENDIAN);
@@ -202,7 +202,7 @@ dissect_header(tvbuff_t *header_tvb, packet_info *pinfo, proto_tree *m2pa_tree)
message_type = tvb_get_guint8(header_tvb, V8_TYPE_OFFSET);
if (check_col(pinfo->cinfo, COL_INFO))
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(message_type, v8_message_type_values, "Unknown"));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_type, v8_message_type_values, "Unknown"));
if (m2pa_tree) {
proto_tree_add_item(m2pa_tree, hf_version, header_tvb, VERSION_OFFSET, VERSION_LENGTH, ENC_BIG_ENDIAN);
@@ -319,7 +319,7 @@ static void
dissect_v2_link_status_message(tvbuff_t *message_data_tvb, packet_info *pinfo, proto_tree *m2pa_tree)
{
if (check_col(pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) ", val_to_str(tvb_get_ntohl(message_data_tvb, STATUS_OFFSET), v2_link_status_values, "Unknown"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) ", val_to_str_const(tvb_get_ntohl(message_data_tvb, STATUS_OFFSET), v2_link_status_values, "Unknown"));
if (m2pa_tree)
proto_tree_add_item(m2pa_tree, hf_v2_status, message_data_tvb, STATUS_OFFSET, STATUS_LENGTH, ENC_BIG_ENDIAN);
}
@@ -342,7 +342,7 @@ dissect_v8_link_status_message(tvbuff_t *message_data_tvb, packet_info *pinfo, p
guint16 filler_length;
if (check_col(pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) ", val_to_str(tvb_get_ntohl(message_data_tvb, STATUS_OFFSET), v8_link_status_values, "Unknown"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) ", val_to_str_const(tvb_get_ntohl(message_data_tvb, STATUS_OFFSET), v8_link_status_values, "Unknown"));
filler_length = tvb_length(message_data_tvb) - STATUS_LENGTH;
@@ -369,7 +369,7 @@ dissect_link_status_message(tvbuff_t *message_data_tvb, packet_info *pinfo, prot
guint16 filler_length;
if (check_col(pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) ", val_to_str(tvb_get_ntohl(message_data_tvb, STATUS_OFFSET), link_status_values, "Unknown"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) ", val_to_str_const(tvb_get_ntohl(message_data_tvb, STATUS_OFFSET), link_status_values, "Unknown"));
filler_length = tvb_length(message_data_tvb) - STATUS_LENGTH;
diff --git a/epan/dissectors/packet-m2tp.c b/epan/dissectors/packet-m2tp.c
index 43c697baba..3b36ea7f15 100644
--- a/epan/dissectors/packet-m2tp.c
+++ b/epan/dissectors/packet-m2tp.c
@@ -272,7 +272,7 @@ dissect_m2tp_common_header(tvbuff_t *common_header_tvb, packet_info *pinfo, prot
message_length = tvb_get_ntohl (common_header_tvb, MESSAGE_LENGTH_OFFSET);
if (check_col(pinfo->cinfo, COL_INFO))
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(message_class * 256 + message_type, m2tp_message_class_type_acro_values, "reserved"));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_class * 256 + message_type, m2tp_message_class_type_acro_values, "reserved"));
if (m2tp_tree) {
/* add the components of the common header to the protocol tree */
@@ -282,7 +282,7 @@ dissect_m2tp_common_header(tvbuff_t *common_header_tvb, packet_info *pinfo, prot
proto_tree_add_uint_format(m2tp_tree, hf_m2tp_message_type,
common_header_tvb, MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_LENGTH,
message_type, "Message type: %u (%s)",
- message_type, val_to_str(message_class * 256 + message_type, m2tp_message_class_type_values, "reserved"));
+ message_type, val_to_str_const(message_class * 256 + message_type, m2tp_message_class_type_values, "reserved"));
proto_tree_add_uint(m2tp_tree, hf_m2tp_message_length, common_header_tvb, MESSAGE_LENGTH_OFFSET, MESSAGE_LENGTH_LENGTH, message_length);
};
}
@@ -309,7 +309,7 @@ dissect_m2tp_master_slave_parameter (tvbuff_t *parameter_tvb, proto_tree *parame
if (parameter_tree) {
parameter_value = tvb_get_ntohl(parameter_tvb, PARAMETER_VALUE_OFFSET);
proto_tree_add_uint(parameter_tree, hf_m2tp_master_slave, parameter_tvb, MASTER_SLAVE_OFFSET, MASTER_SLAVE_LENGTH, parameter_value);
- proto_item_set_text(parameter_item, "Master Slave Indicator (%s)", val_to_str(parameter_value, m2tp_mode_values, "unknown"));
+ proto_item_set_text(parameter_item, "Master Slave Indicator (%s)", val_to_str_const(parameter_value, m2tp_mode_values, "unknown"));
}
}
@@ -379,7 +379,7 @@ dissect_m2tp_reason_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tre
if (parameter_tree) {
reason = tvb_get_ntohl(parameter_tvb, REASON_OFFSET);
proto_tree_add_uint(parameter_tree, hf_m2tp_reason, parameter_tvb, REASON_OFFSET, REASON_LENGTH, reason);
- proto_item_set_text(parameter_item, "Reason parameter (%s)", val_to_str(reason, m2tp_reason_code_values, "unknown"));
+ proto_item_set_text(parameter_item, "Reason parameter (%s)", val_to_str_const(reason, m2tp_reason_code_values, "unknown"));
}
}
@@ -392,7 +392,7 @@ dissect_m2tp_error_code_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter
if (parameter_tree) {
error_code = tvb_get_ntohl(parameter_tvb, ERROR_CODE_OFFSET);
proto_tree_add_uint(parameter_tree, hf_m2tp_error_code, parameter_tvb, ERROR_CODE_OFFSET, ERROR_CODE_LENGTH, error_code);
- proto_item_set_text(parameter_item, "Error code parameter (%s)", val_to_str(error_code, m2tp_error_code_values, "unknown"));
+ proto_item_set_text(parameter_item, "Error code parameter (%s)", val_to_str_const(error_code, m2tp_error_code_values, "unknown"));
}
}
diff --git a/epan/dissectors/packet-m2ua.c b/epan/dissectors/packet-m2ua.c
index 2eb969b82d..63a38bfd34 100644
--- a/epan/dissectors/packet-m2ua.c
+++ b/epan/dissectors/packet-m2ua.c
@@ -243,7 +243,7 @@ dissect_common_header(tvbuff_t *common_header_tvb, packet_info *pinfo, proto_tre
message_type = tvb_get_guint8(common_header_tvb, MESSAGE_TYPE_OFFSET);
if (check_col(pinfo->cinfo, COL_INFO))
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(message_class * 256 + message_type, message_class_type_acro_values, "reserved"));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_class * 256 + message_type, message_class_type_acro_values, "reserved"));
if (m2ua_tree) {
/* add the components of the common header to the protocol tree */
@@ -252,7 +252,7 @@ dissect_common_header(tvbuff_t *common_header_tvb, packet_info *pinfo, proto_tre
proto_tree_add_item(m2ua_tree, hf_message_class, common_header_tvb, MESSAGE_CLASS_OFFSET, MESSAGE_CLASS_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_uint_format(m2ua_tree, hf_message_type, common_header_tvb, MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_LENGTH, message_type,
"Message type: %s (%u)",
- val_to_str(message_class * 256 + message_type, message_class_type_values, "reserved"), message_type);
+ val_to_str_const(message_class * 256 + message_type, message_class_type_values, "reserved"), message_type);
proto_tree_add_item(m2ua_tree, hf_message_length, common_header_tvb, MESSAGE_LENGTH_OFFSET, MESSAGE_LENGTH_LENGTH, ENC_BIG_ENDIAN);
}
}
@@ -370,7 +370,7 @@ dissect_traffic_mode_type_parameter(tvbuff_t *parameter_tvb, proto_tree *paramet
{
proto_tree_add_item(parameter_tree, hf_traffic_mode_type, parameter_tvb, TRAFFIC_MODE_TYPE_OFFSET, TRAFFIC_MODE_TYPE_LENGTH, ENC_BIG_ENDIAN);
proto_item_append_text(parameter_item, " (%s)",
- val_to_str(tvb_get_ntohl(parameter_tvb, TRAFFIC_MODE_TYPE_OFFSET), traffic_mode_type_values, "unknown"));
+ val_to_str_const(tvb_get_ntohl(parameter_tvb, TRAFFIC_MODE_TYPE_OFFSET), traffic_mode_type_values, "unknown"));
}
#define INVALID_VERSION_ERROR_CODE 0x01
@@ -419,7 +419,7 @@ dissect_error_code_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree
{
proto_tree_add_item(parameter_tree, hf_error_code, parameter_tvb, ERROR_CODE_OFFSET, ERROR_CODE_LENGTH, ENC_BIG_ENDIAN);
proto_item_append_text(parameter_item, " (%s)",
- val_to_str(tvb_get_ntohl(parameter_tvb, ERROR_CODE_OFFSET), error_code_values, "unknown"));
+ val_to_str_const(tvb_get_ntohl(parameter_tvb, ERROR_CODE_OFFSET), error_code_values, "unknown"));
}
#define AS_STATE_CHANGE_TYPE 1
@@ -466,10 +466,10 @@ dissect_status_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, pr
proto_tree_add_item(parameter_tree, hf_status_type, parameter_tvb, STATUS_TYPE_OFFSET, STATUS_TYPE_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_uint_format(parameter_tree, hf_status_ident, parameter_tvb, STATUS_IDENT_OFFSET, STATUS_IDENT_LENGTH,
status_id, "Status identification: %u (%s)", status_id,
- val_to_str(status_type * 256 * 256 + status_id, status_type_id_values, "unknown"));
+ val_to_str_const(status_type * 256 * 256 + status_id, status_type_id_values, "unknown"));
proto_item_append_text(parameter_item, " (%s)",
- val_to_str(status_type * 256 * 256 + status_id, status_type_id_values, "unknown status information"));
+ val_to_str_const(status_type * 256 * 256 + status_id, status_type_id_values, "unknown status information"));
}
#define ASP_IDENTIFIER_OFFSET PARAMETER_VALUE_OFFSET
@@ -561,7 +561,7 @@ static void
dissect_state_request_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
{
proto_tree_add_item(parameter_tree, hf_state, parameter_tvb, STATE_OFFSET, STATE_LENGTH, ENC_BIG_ENDIAN);
- proto_item_append_text(parameter_item, " (%s)", val_to_str(tvb_get_ntohl(parameter_tvb, STATE_OFFSET), state_values, "unknown"));
+ proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, STATE_OFFSET), state_values, "unknown"));
}
#define EVENT_RPO_ENTER 0x1
@@ -583,7 +583,7 @@ static void
dissect_state_event_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
{
proto_tree_add_item(parameter_tree, hf_event, parameter_tvb, EVENT_OFFSET, EVENT_LENGTH, ENC_BIG_ENDIAN);
- proto_item_append_text(parameter_item, " (%s)", val_to_str(tvb_get_ntohl(parameter_tvb, STATE_OFFSET), event_values, "unknown"));
+ proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, STATE_OFFSET), event_values, "unknown"));
}
#define LEVEL_NONE 0x0
@@ -605,7 +605,7 @@ static void
dissect_congestion_status_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
{
proto_tree_add_item(parameter_tree, hf_congestion_status, parameter_tvb, CONGESTION_STATUS_OFFSET, CONGESTION_STATUS_LENGTH, ENC_BIG_ENDIAN);
- proto_item_append_text(parameter_item, " (%s)", val_to_str(tvb_get_ntohl(parameter_tvb, CONGESTION_STATUS_OFFSET), level_values, "unknown"));
+ proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, CONGESTION_STATUS_OFFSET), level_values, "unknown"));
}
#define DISCARD_STATUS_LENGTH 4
@@ -615,7 +615,7 @@ static void
dissect_discard_status_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
{
proto_tree_add_item(parameter_tree, hf_discard_status, parameter_tvb, DISCARD_STATUS_OFFSET, DISCARD_STATUS_LENGTH, ENC_BIG_ENDIAN);
- proto_item_append_text(parameter_item, " (%s)", val_to_str(tvb_get_ntohl(parameter_tvb, DISCARD_STATUS_OFFSET), level_values, "unknown"));
+ proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, DISCARD_STATUS_OFFSET), level_values, "unknown"));
}
#define ACTION_RTRV_BSN 0x1
@@ -634,7 +634,7 @@ static void
dissect_action_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
{
proto_tree_add_item(parameter_tree, hf_action, parameter_tvb, ACTION_OFFSET, ACTION_LENGTH, ENC_BIG_ENDIAN);
- proto_item_append_text(parameter_item, " (%s)", val_to_str(tvb_get_ntohl(parameter_tvb, ACTION_OFFSET), action_values, "unknown"));
+ proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, ACTION_OFFSET), action_values, "unknown"));
}
#define SEQUENCE_NUMBER_LENGTH 4
@@ -663,7 +663,7 @@ static void
dissect_retrieval_result_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
{
proto_tree_add_item(parameter_tree, hf_retrieval_result, parameter_tvb, RETRIEVAL_RESULT_OFFSET, RETRIEVAL_RESULT_LENGTH, ENC_BIG_ENDIAN);
- proto_item_append_text(parameter_item, " (%s)", val_to_str(tvb_get_ntohl(parameter_tvb, RETRIEVAL_RESULT_OFFSET), retrieval_result_values, "unknown"));
+ proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, RETRIEVAL_RESULT_OFFSET), retrieval_result_values, "unknown"));
}
static void
@@ -753,7 +753,7 @@ static void
dissect_registration_status_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
{
proto_tree_add_item(parameter_tree, hf_registration_status, parameter_tvb, REGISTRATION_STATUS_OFFSET, REGISTRATION_STATUS_LENGTH, ENC_BIG_ENDIAN);
- proto_item_append_text(parameter_item, " (%s)", val_to_str(tvb_get_ntohl(parameter_tvb, REGISTRATION_STATUS_OFFSET), registration_status_values, "unknown"));
+ proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, REGISTRATION_STATUS_OFFSET), registration_status_values, "unknown"));
}
static void
@@ -788,7 +788,7 @@ static void
dissect_deregistration_status_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
{
proto_tree_add_item(parameter_tree, hf_deregistration_status, parameter_tvb, DEREGISTRATION_STATUS_OFFSET, DEREGISTRATION_STATUS_LENGTH, ENC_BIG_ENDIAN);
- proto_item_append_text(parameter_item, " (%s)", val_to_str(tvb_get_ntohl(parameter_tvb, DEREGISTRATION_STATUS_OFFSET), deregistration_status_values, "unknown"));
+ proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, DEREGISTRATION_STATUS_OFFSET), deregistration_status_values, "unknown"));
}
static void
@@ -891,7 +891,7 @@ dissect_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *tree,
/* create proto_tree stuff */
parameter_item = proto_tree_add_text(m2ua_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb), "%s",
- val_to_str(tag, parameter_tag_values, "Unknown parameter"));
+ val_to_str_const(tag, parameter_tag_values, "Unknown parameter"));
parameter_tree = proto_item_add_subtree(parameter_item, ett_m2ua_parameter);
if ((protocol_data_1_global == PROTOCOL_DATA_1_DRAFT_7) &&
diff --git a/epan/dissectors/packet-m3ua.c b/epan/dissectors/packet-m3ua.c
index 09e99391e6..b8f4c47e5f 100644
--- a/epan/dissectors/packet-m3ua.c
+++ b/epan/dissectors/packet-m3ua.c
@@ -337,7 +337,7 @@ dissect_v5_common_header(tvbuff_t *common_header_tvb, packet_info *pinfo, proto_
message_type = tvb_get_guint8(common_header_tvb, MESSAGE_TYPE_OFFSET);
if (check_col(pinfo->cinfo, COL_INFO))
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(message_class * 256 + message_type, v5_message_class_type_acro_values, "reserved"));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_class * 256 + message_type, v5_message_class_type_acro_values, "reserved"));
if (m3ua_tree) {
/* add the components of the common header to the protocol tree */
@@ -345,7 +345,7 @@ dissect_v5_common_header(tvbuff_t *common_header_tvb, packet_info *pinfo, proto_
proto_tree_add_item(m3ua_tree, hf_reserved, common_header_tvb, RESERVED_OFFSET, RESERVED_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_item(m3ua_tree, hf_v5_message_class, common_header_tvb, MESSAGE_CLASS_OFFSET, MESSAGE_CLASS_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_uint_format(m3ua_tree, hf_message_type, common_header_tvb, MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_LENGTH, message_type,
- "Message type: %s (%u)", val_to_str(message_class * 256 + message_type, v5_message_class_type_values, "reserved"), message_type);
+ "Message type: %s (%u)", val_to_str_const(message_class * 256 + message_type, v5_message_class_type_values, "reserved"), message_type);
proto_tree_add_item(m3ua_tree, hf_message_length, common_header_tvb, MESSAGE_LENGTH_OFFSET, MESSAGE_LENGTH_LENGTH, ENC_BIG_ENDIAN);
}
}
@@ -360,7 +360,7 @@ dissect_common_header(tvbuff_t *common_header_tvb, packet_info *pinfo, proto_tre
message_type = tvb_get_guint8(common_header_tvb, MESSAGE_TYPE_OFFSET);
if (check_col(pinfo->cinfo, COL_INFO))
- col_add_fstr(pinfo->cinfo, COL_INFO,"%s ", val_to_str(message_class * 256 + message_type, message_class_type_acro_values, "reserved"));
+ col_add_fstr(pinfo->cinfo, COL_INFO,"%s ", val_to_str_const(message_class * 256 + message_type, message_class_type_acro_values, "reserved"));
if (m3ua_tree) {
/* add the components of the common header to the protocol tree */
@@ -368,7 +368,7 @@ dissect_common_header(tvbuff_t *common_header_tvb, packet_info *pinfo, proto_tre
proto_tree_add_item(m3ua_tree, hf_reserved, common_header_tvb, RESERVED_OFFSET, RESERVED_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_item(m3ua_tree, hf_message_class, common_header_tvb, MESSAGE_CLASS_OFFSET, MESSAGE_CLASS_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_uint_format(m3ua_tree, hf_message_type, common_header_tvb, MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_LENGTH, message_type,
- "Message type: %s (%u)", val_to_str(message_class * 256 + message_type, message_class_type_values, "reserved"), message_type);
+ "Message type: %s (%u)", val_to_str_const(message_class * 256 + message_type, message_class_type_values, "reserved"), message_type);
proto_tree_add_item(m3ua_tree, hf_message_length, common_header_tvb, MESSAGE_LENGTH_OFFSET, MESSAGE_LENGTH_LENGTH, ENC_BIG_ENDIAN);
}
}
@@ -538,8 +538,8 @@ dissect_user_cause_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree
proto_tree_add_item(parameter_tree, hf_cause, parameter_tvb, CAUSE_OFFSET, CAUSE_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_item(parameter_tree, hf_user, parameter_tvb, USER_OFFSET, USER_LENGTH, ENC_BIG_ENDIAN);
proto_item_append_text(parameter_item, " (%s: %s)",
- val_to_str(tvb_get_ntohs(parameter_tvb, USER_OFFSET), user_identity_values, "Unknown user"),
- val_to_str(tvb_get_ntohs(parameter_tvb, CAUSE_OFFSET), unavailability_cause_values, "unknown cause"));
+ val_to_str_const(tvb_get_ntohs(parameter_tvb, USER_OFFSET), user_identity_values, "Unknown user"),
+ val_to_str_const(tvb_get_ntohs(parameter_tvb, CAUSE_OFFSET), unavailability_cause_values, "unknown cause"));
}
#define UNSPECIFIED_REASON 0
@@ -559,7 +559,7 @@ static void
dissect_reason_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
{
proto_tree_add_item(parameter_tree, hf_reason, parameter_tvb, REASON_OFFSET, REASON_LENGTH, ENC_BIG_ENDIAN);
- proto_item_append_text(parameter_item, " (%s)", val_to_str(tvb_get_ntohl(parameter_tvb, REASON_OFFSET), reason_values, "unknown"));
+ proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, REASON_OFFSET), reason_values, "unknown"));
}
#define TRAFFIC_MODE_TYPE_LENGTH 4
@@ -576,7 +576,7 @@ static void
dissect_v5_traffic_mode_type_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
{
proto_tree_add_item(parameter_tree, hf_v5_traffic_mode_type, parameter_tvb, TRAFFIC_MODE_TYPE_OFFSET, TRAFFIC_MODE_TYPE_LENGTH, ENC_BIG_ENDIAN);
- proto_item_append_text(parameter_item, " (%s)", val_to_str(tvb_get_ntohl(parameter_tvb, TRAFFIC_MODE_TYPE_OFFSET), v5_traffic_mode_type_values, "unknown"));
+ proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, TRAFFIC_MODE_TYPE_OFFSET), v5_traffic_mode_type_values, "unknown"));
}
static const value_string v6_traffic_mode_type_values[] = {
@@ -590,7 +590,7 @@ static void
dissect_v6_traffic_mode_type_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
{
proto_tree_add_item(parameter_tree, hf_v6_traffic_mode_type, parameter_tvb, TRAFFIC_MODE_TYPE_OFFSET, TRAFFIC_MODE_TYPE_LENGTH, ENC_BIG_ENDIAN);
- proto_item_append_text(parameter_item, " (%s)", val_to_str(tvb_get_ntohl(parameter_tvb, TRAFFIC_MODE_TYPE_OFFSET), v6_traffic_mode_type_values, "unknown"));
+ proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, TRAFFIC_MODE_TYPE_OFFSET), v6_traffic_mode_type_values, "unknown"));
}
static const value_string v7_traffic_mode_type_values[] = {
@@ -602,7 +602,7 @@ static void
dissect_v7_traffic_mode_type_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
{
proto_tree_add_item(parameter_tree, hf_v7_traffic_mode_type, parameter_tvb, TRAFFIC_MODE_TYPE_OFFSET, TRAFFIC_MODE_TYPE_LENGTH, ENC_BIG_ENDIAN);
- proto_item_append_text(parameter_item, " (%s)", val_to_str(tvb_get_ntohl(parameter_tvb, TRAFFIC_MODE_TYPE_OFFSET), v7_traffic_mode_type_values, "unknown"));
+ proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, TRAFFIC_MODE_TYPE_OFFSET), v7_traffic_mode_type_values, "unknown"));
}
static const value_string traffic_mode_type_values[] = {
@@ -615,7 +615,7 @@ static void
dissect_traffic_mode_type_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
{
proto_tree_add_item(parameter_tree, hf_traffic_mode_type, parameter_tvb, TRAFFIC_MODE_TYPE_OFFSET, TRAFFIC_MODE_TYPE_LENGTH, ENC_BIG_ENDIAN);
- proto_item_append_text(parameter_item, " (%s)", val_to_str(tvb_get_ntohl(parameter_tvb, TRAFFIC_MODE_TYPE_OFFSET), traffic_mode_type_values, "unknown"));
+ proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, TRAFFIC_MODE_TYPE_OFFSET), traffic_mode_type_values, "unknown"));
}
#define ERROR_CODE_LENGTH 4
@@ -636,7 +636,7 @@ static void
dissect_v5_error_code_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
{
proto_tree_add_item(parameter_tree, hf_v5_error_code, parameter_tvb, ERROR_CODE_OFFSET, ERROR_CODE_LENGTH, ENC_BIG_ENDIAN);
- proto_item_append_text(parameter_item, " (%s)", val_to_str(tvb_get_ntohl(parameter_tvb, ERROR_CODE_OFFSET), v5_error_code_values, "unknown"));
+ proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, ERROR_CODE_OFFSET), v5_error_code_values, "unknown"));
}
static const value_string v6_error_code_values[] = {
@@ -657,7 +657,7 @@ static void
dissect_v6_error_code_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
{
proto_tree_add_item(parameter_tree, hf_v6_error_code, parameter_tvb, ERROR_CODE_OFFSET, ERROR_CODE_LENGTH, ENC_BIG_ENDIAN);
- proto_item_append_text(parameter_item, " (%s)", val_to_str(tvb_get_ntohl(parameter_tvb, ERROR_CODE_OFFSET), v6_error_code_values, "unknown"));
+ proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, ERROR_CODE_OFFSET), v6_error_code_values, "unknown"));
}
static const value_string v7_error_code_values[] = {
@@ -680,7 +680,7 @@ static void
dissect_v7_error_code_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
{
proto_tree_add_item(parameter_tree, hf_v7_error_code, parameter_tvb, ERROR_CODE_OFFSET, ERROR_CODE_LENGTH, ENC_BIG_ENDIAN);
- proto_item_append_text(parameter_item, " (%s)", val_to_str(tvb_get_ntohl(parameter_tvb, ERROR_CODE_OFFSET), v7_error_code_values, "unknown"));
+ proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, ERROR_CODE_OFFSET), v7_error_code_values, "unknown"));
}
static const value_string error_code_values[] = {
@@ -708,7 +708,7 @@ static void
dissect_error_code_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
{
proto_tree_add_item(parameter_tree, hf_error_code, parameter_tvb, ERROR_CODE_OFFSET, ERROR_CODE_LENGTH, ENC_BIG_ENDIAN);
- proto_item_append_text(parameter_item, " (%s)", val_to_str(tvb_get_ntohl(parameter_tvb, ERROR_CODE_OFFSET), error_code_values, "unknown"));
+ proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, ERROR_CODE_OFFSET), error_code_values, "unknown"));
}
#define AS_STATE_CHANGE_TYPE 1
@@ -754,9 +754,9 @@ dissect_v567_status_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tre
proto_tree_add_item(parameter_tree, hf_status_type, parameter_tvb, STATUS_TYPE_OFFSET, STATUS_TYPE_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_uint_format(parameter_tree, hf_status_info, parameter_tvb, STATUS_INFO_OFFSET, STATUS_INFO_LENGTH, status_info,
- "Status info: %s (%u)", val_to_str(status_type * 256 * 256 + status_info, v567_status_type_info_values, "unknown"), status_info);
+ "Status info: %s (%u)", val_to_str_const(status_type * 256 * 256 + status_info, v567_status_type_info_values, "unknown"), status_info);
- proto_item_append_text(parameter_item, " (%s)", val_to_str(status_type * 256 * 256 + status_info, v567_status_type_info_values, "unknown status information"));
+ proto_item_append_text(parameter_item, " (%s)", val_to_str_const(status_type * 256 * 256 + status_info, v567_status_type_info_values, "unknown status information"));
}
static const value_string status_type_info_values[] = {
@@ -779,9 +779,9 @@ dissect_status_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, pr
proto_tree_add_item(parameter_tree, hf_status_type, parameter_tvb, STATUS_TYPE_OFFSET, STATUS_TYPE_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_uint_format(parameter_tree, hf_status_info, parameter_tvb, STATUS_INFO_OFFSET, STATUS_INFO_LENGTH, status_info,
- "Status info: %s (%u)", val_to_str(status_type * 256 * 256 + status_info, status_type_info_values, "unknown"), status_info);
+ "Status info: %s (%u)", val_to_str_const(status_type * 256 * 256 + status_info, status_type_info_values, "unknown"), status_info);
- proto_item_append_text(parameter_item, " (%s)", val_to_str(status_type * 256 * 256 + status_info, status_type_info_values, "unknown status information"));
+ proto_item_append_text(parameter_item, " (%s)", val_to_str_const(status_type * 256 * 256 + status_info, status_type_info_values, "unknown status information"));
}
static const value_string congestion_level_values[] = {
@@ -802,7 +802,7 @@ dissect_congestion_indication_parameter(tvbuff_t *parameter_tvb, proto_tree *par
{
proto_tree_add_item(parameter_tree, hf_congestion_reserved, parameter_tvb, CONG_IND_RESERVED_OFFSET, CONG_IND_RESERVED_LENGTH, ENC_NA);
proto_tree_add_item(parameter_tree, hf_congestion_level, parameter_tvb, CONG_IND_LEVEL_OFFSET, CONG_IND_LEVEL_LENGTH, ENC_BIG_ENDIAN);
- proto_item_append_text(parameter_item, " (%s)", val_to_str(tvb_get_guint8(parameter_tvb, CONG_IND_LEVEL_OFFSET), congestion_level_values, "unknown"));
+ proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_guint8(parameter_tvb, CONG_IND_LEVEL_OFFSET), congestion_level_values, "unknown"));
}
#define ASP_IDENTIFIER_OFFSET PARAMETER_VALUE_OFFSET
@@ -1223,7 +1223,7 @@ static void
dissect_registration_status_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
{
proto_tree_add_item(parameter_tree, hf_registration_status, parameter_tvb, REG_STATUS_OFFSET, REG_STATUS_LENGTH, ENC_BIG_ENDIAN);
- proto_item_append_text(parameter_item, " (%s)", val_to_str(tvb_get_ntohl(parameter_tvb, REG_STATUS_OFFSET), registration_status_values, "unknown"));
+ proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, REG_STATUS_OFFSET), registration_status_values, "unknown"));
}
#define DEREG_STATUS_LENGTH 4
@@ -1242,7 +1242,7 @@ static void
dissect_deregistration_status_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
{
proto_tree_add_item(parameter_tree, hf_deregistration_status, parameter_tvb, DEREG_STATUS_OFFSET, DEREG_STATUS_LENGTH, ENC_BIG_ENDIAN);
- proto_item_append_text(parameter_item, " (%s)", val_to_str(tvb_get_ntohl(parameter_tvb, DEREG_STATUS_OFFSET), deregistration_status_values, "unknown"));
+ proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, DEREG_STATUS_OFFSET), deregistration_status_values, "unknown"));
}
static void
@@ -1324,7 +1324,7 @@ dissect_v5_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *tr
return; /* Nothing to do here */
/* create proto_tree stuff */
- parameter_item = proto_tree_add_text(m3ua_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb), "%s", val_to_str(tag, v5_parameter_tag_values, "Unknown parameter"));
+ parameter_item = proto_tree_add_text(m3ua_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb), "%s", val_to_str_const(tag, v5_parameter_tag_values, "Unknown parameter"));
parameter_tree = proto_item_add_subtree(parameter_item, ett_parameter);
/* add tag and length to the parameter tree */
@@ -1451,7 +1451,7 @@ dissect_v6_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *tr
return; /* Nothing to do here */
/* create proto_tree stuff */
- parameter_item = proto_tree_add_text(m3ua_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb), "%s", val_to_str(tag, v6_parameter_tag_values, "Unknown parameter"));
+ parameter_item = proto_tree_add_text(m3ua_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb), "%s", val_to_str_const(tag, v6_parameter_tag_values, "Unknown parameter"));
parameter_tree = proto_item_add_subtree(parameter_item, ett_parameter);
/* add tag and length to the parameter tree */
@@ -1618,7 +1618,7 @@ dissect_v7_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *tr
return; /* Nothing to do here */
/* create proto_tree stuff */
- parameter_item = proto_tree_add_text(m3ua_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb), "%s", val_to_str(tag, v7_parameter_tag_values, "Unknown parameter"));
+ parameter_item = proto_tree_add_text(m3ua_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb), "%s", val_to_str_const(tag, v7_parameter_tag_values, "Unknown parameter"));
parameter_tree = proto_item_add_subtree(parameter_item, ett_parameter);
/* add tag and length to the parameter tree */
@@ -1785,7 +1785,7 @@ dissect_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *tree,
return; /* Nothing to do here */
/* create proto_tree stuff */
- parameter_item = proto_tree_add_text(m3ua_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb), "%s", val_to_str(tag, parameter_tag_values, "Unknown parameter"));
+ parameter_item = proto_tree_add_text(m3ua_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb), "%s", val_to_str_const(tag, parameter_tag_values, "Unknown parameter"));
parameter_tree = proto_item_add_subtree(parameter_item, ett_parameter);
/* add tag and length to the parameter tree */
diff --git a/epan/dissectors/packet-mbtcp.c b/epan/dissectors/packet-mbtcp.c
index 67c820c5f0..ba29a668f6 100644
--- a/epan/dissectors/packet-mbtcp.c
+++ b/epan/dissectors/packet-mbtcp.c
@@ -259,11 +259,11 @@ dissect_mbtcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if ((function_code == ENCAP_INTERFACE_TRANSP) && (exception_code == 0)) {
- func_string = val_to_str(tvb_get_guint8(tvb, offset + 8), encap_interface_code_vals, "Encapsulated Interface Transport");
+ func_string = val_to_str_const(tvb_get_guint8(tvb, offset + 8), encap_interface_code_vals, "Encapsulated Interface Transport");
subfunction_code = 1;
}
else if ((function_code == DIAGNOSTICS) && (exception_code == 0)) {
- func_string = val_to_str(tvb_get_ntohs(tvb, offset + 8), diagnostic_code_vals, "Diagnostics");
+ func_string = val_to_str_const(tvb_get_ntohs(tvb, offset + 8), diagnostic_code_vals, "Diagnostics");
subfunction_code = 1;
}
else {
@@ -280,7 +280,7 @@ dissect_mbtcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case QUERY_PACKET :
pkt_type_str="query";
break;
- case RESPONSE_PACKET :
+ case RESPONSE_PACKET :
pkt_type_str="response";
break;
case CANNOT_CLASSIFY :
@@ -324,7 +324,7 @@ dissect_mbtcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/* if a tree exists, perform operations to add fields to it */
- if (tree)
+ if (tree)
{
mi = proto_tree_add_protocol_format(tree, proto_mbtcp, tvb, offset,
len+6, "Modbus/TCP");
@@ -448,7 +448,7 @@ dissect_mbtcp_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 f
static int
dissect_modbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- proto_tree *modbus_tree, *group_tree, *event_tree,
+ proto_tree *modbus_tree, *group_tree, *event_tree,
*event_item_tree, *device_objects_tree,
*device_objects_item_tree;
proto_item *mi, *mf, *me, *mei, *doe, *doie;
@@ -489,7 +489,7 @@ dissect_modbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
function_code);
/** detail payload as a function of exception/function code */
- func_string = val_to_str(function_code, function_code_vals, "Unknown function");
+ func_string = val_to_str_const(function_code, function_code_vals, "Unknown function");
payload_start = offset + 1;
payload_len = len - 1;
@@ -941,7 +941,7 @@ dissect_modbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
for (i = 1; i <= num_objects; i++)
{
device_objects_tree = proto_item_add_subtree(doe, ett_device_id_objects);
-
+
/* add each "object item" as its own subtree */
/* compute length of object */
diff --git a/epan/dissectors/packet-memcache.c b/epan/dissectors/packet-memcache.c
index c623926c83..206b64776e 100644
--- a/epan/dissectors/packet-memcache.c
+++ b/epan/dissectors/packet-memcache.c
@@ -606,7 +606,7 @@ dissect_memcache (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_item (memcache_tree, hf_value_missing, tvb, offset, 0, ENC_NA);
expert_add_info_format (pinfo, ti, PI_UNDECODED, PI_WARN, "%s with status %s (%d) must have Value",
val_to_str (opcode, opcode_vals, "Opcode %d"),
- val_to_str (status, status_vals, "Unknown"), status);
+ val_to_str_const (status, status_vals, "Unknown"), status);
}
}
diff --git a/epan/dissectors/packet-mikey.c b/epan/dissectors/packet-mikey.c
index 796d8acaad..a71de2f440 100644
--- a/epan/dissectors/packet-mikey.c
+++ b/epan/dissectors/packet-mikey.c
@@ -660,7 +660,7 @@ dissect_payload_hdr(mikey_t *mikey, tvbuff_t *tvb, packet_info *pinfo, proto_tre
proto_tree_add_item(tree, hf_mikey[POS_HDR_DATA_TYPE], tvb, offset+1, 1, ENC_BIG_ENDIAN);
parent = proto_tree_get_parent(tree);
- proto_item_append_text(parent, " Type: %s", val_to_str(mikey->type, data_type_vals, "Unknown"));
+ proto_item_append_text(parent, " Type: %s", val_to_str_const(mikey->type, data_type_vals, "Unknown"));
add_next_payload(tvb, tree, offset+2);
@@ -844,7 +844,7 @@ dissect_payload_t(mikey_t *mikey _U_, tvbuff_t *tvb, packet_info *pinfo _U_, pro
if (tree) {
parent = proto_tree_get_parent(tree);
- proto_item_append_text(parent, " Type: %s", val_to_str(ts_type, ts_type_vals, "Unknown"));
+ proto_item_append_text(parent, " Type: %s", val_to_str_const(ts_type, ts_type_vals, "Unknown"));
proto_tree_add_item(tree, hf_mikey[POS_TS_TYPE], tvb, offset+1, 1, ENC_BIG_ENDIAN);
}
@@ -886,7 +886,7 @@ dissect_payload_id(mikey_t *mikey _U_, tvbuff_t *tvb, packet_info *pinfo _U_, pr
proto_tree_add_item(tree, hf_mikey[POS_ID], tvb, 4, length, ENC_ASCII|ENC_NA);
parent = proto_tree_get_parent(tree);
- proto_item_append_text(parent, " %s: %s", val_to_str(type, id_type_vals, "Unknown"), tvb_get_ephemeral_string(tvb, 4, length));
+ proto_item_append_text(parent, " %s: %s", val_to_str_const(type, id_type_vals, "Unknown"), tvb_get_ephemeral_string(tvb, 4, length));
}
return 4 + length;
@@ -914,7 +914,7 @@ dissect_payload_cert(mikey_t *mikey _U_, tvbuff_t *tvb, packet_info *pinfo, prot
proto_tree_add_item(tree, hf_mikey[POS_CERT_TYPE], tvb, 1, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_mikey[POS_CERT_LEN], tvb, 1, 2, ENC_BIG_ENDIAN);
- proto_item_append_text(parent, " Type: %s", val_to_str(type, cert_type_vals, "Unknown"));
+ proto_item_append_text(parent, " Type: %s", val_to_str_const(type, cert_type_vals, "Unknown"));
}
subtvb = tvb_new_subset(tvb, offset+4, length, length);
@@ -1021,7 +1021,7 @@ dissect_payload_sp(mikey_t *mikey _U_, tvbuff_t *tvb, packet_info *pinfo _U_, pr
proto_tree_add_item(tree, hf_mikey[POS_SP_TYPE], tvb, 2, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_mikey[POS_SP_PARAM_LEN], tvb, 3, 2, ENC_BIG_ENDIAN);
- proto_item_append_text(parent, " No: %d, Type: %s", no, val_to_str(type, sp_prot_type_vals, "Unknown"));
+ proto_item_append_text(parent, " No: %d, Type: %s", no, val_to_str_const(type, sp_prot_type_vals, "Unknown"));
}
tvb_ensure_bytes_exist(tvb, offset+5, length);
@@ -1081,7 +1081,7 @@ dissect_payload_err(mikey_t *mikey _U_, tvbuff_t *tvb, packet_info *pinfo _U_, p
proto_tree_add_item(tree, hf_mikey[POS_ERR_RESERVED], tvb, 2, 2, ENC_NA);
}
parent = proto_tree_get_parent(tree);
- proto_item_append_text(parent, ": %s", val_to_str(err_no, err_vals, "Unknown"));
+ proto_item_append_text(parent, ": %s", val_to_str_const(err_no, err_vals, "Unknown"));
return 4;
}
@@ -1115,7 +1115,7 @@ dissect_payload_keydata(mikey_t *mikey _U_, tvbuff_t *tvb, packet_info *pinfo _U
proto_tree_add_item(tree, hf_mikey[POS_KEY_DATA], tvb, 4, data_len, ENC_NA);
parent = proto_tree_get_parent(tree);
- proto_item_append_text(parent, " Type: %s", val_to_str(key_type, kd_vals, "Unknown"));
+ proto_item_append_text(parent, " Type: %s", val_to_str_const(key_type, kd_vals, "Unknown"));
offset += data_len;
/* Dissect SALT key */
@@ -1191,7 +1191,7 @@ dissect_payload_general_ext(mikey_t *mikey _U_, tvbuff_t *tvb, packet_info *pinf
} else {
proto_tree_add_item(tree, hf_mikey[POS_GENERAL_EXT_DATA], tvb, 4, data_len, ENC_NA);
}
- proto_item_append_text(parent, " Type: %s", val_to_str(type, genext_type_vals, "Unknown"));
+ proto_item_append_text(parent, " Type: %s", val_to_str_const(type, genext_type_vals, "Unknown"));
}
return 4 + data_len;
}
@@ -1301,13 +1301,13 @@ dissect_mikey(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (ti) {
- proto_item_append_text(ti, ": %s", val_to_str(mikey->type, data_type_vals, "Unknown"));
+ proto_item_append_text(ti, ": %s", val_to_str_const(mikey->type, data_type_vals, "Unknown"));
}
col_append_str(pinfo->cinfo, COL_PROTOCOL, "/MIKEY");
if (check_col(pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO, ", Mikey: %s", val_to_str(mikey->type, data_type_vals, "Unknown"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", Mikey: %s", val_to_str_const(mikey->type, data_type_vals, "Unknown"));
/* Return the amount of data this dissector was able to dissect */
return tvb_length(tvb);
diff --git a/epan/dissectors/packet-mongo.c b/epan/dissectors/packet-mongo.c
index 74019a6838..a17813d009 100644
--- a/epan/dissectors/packet-mongo.c
+++ b/epan/dissectors/packet-mongo.c
@@ -612,7 +612,7 @@ dissect_mongo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_INFO, "Request :");
}
- 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 OP_REPLY:
diff --git a/epan/dissectors/packet-mpls-echo.c b/epan/dissectors/packet-mpls-echo.c
index c596aaf7d6..2c888cce8a 100644
--- a/epan/dissectors/packet-mpls-echo.c
+++ b/epan/dissectors/packet-mpls-echo.c
@@ -470,7 +470,7 @@ dissect_mpls_echo_tlv_fec(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem
/* FEC sub-TLV Type and Length */
proto_tree_add_uint_format(tlv_fec_tree, hf_mpls_echo_tlv_fec_type, tvb,
offset, 2, saved_type, "Type: %s (%u)",
- val_to_str(type, mpls_echo_tlv_fec_names, "Unknown sub-TLV type"), saved_type);
+ val_to_str_const(type, mpls_echo_tlv_fec_names, "Unknown sub-TLV type"), saved_type);
proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_len, tvb, offset + 2,
2, ENC_BIG_ENDIAN);
@@ -623,7 +623,7 @@ dissect_mpls_echo_tlv_fec(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem
if (label <= LABEL_MAX_RESERVED) {
proto_tree_add_uint_format(tlv_fec_tree, hf_mpls_echo_tlv_fec_nil_label,
tvb, offset + 4, 3, label, "Label %u: %u (%s)", nil_idx, label,
- val_to_str(label, special_labels, "Reserved - Unknown"));
+ val_to_str_const(label, special_labels, "Reserved - Unknown"));
} else {
proto_tree_add_uint_format(tlv_fec_tree, hf_mpls_echo_tlv_fec_nil_label,
tvb, offset + 4, 3, label, "Label %u: %u", nil_idx, label);
@@ -853,9 +853,9 @@ dissect_mpls_echo_tlv_ds_map(tvbuff_t *tvb, guint offset, proto_tree *tree, int
if (label <= LABEL_MAX_RESERVED) {
proto_tree_add_uint_format(tlv_ds_map_tree, hf_mpls_echo_tlv_ds_map_mp_label,
tvb, offset, 3, label, "Downstream Label: %u (%s)", label,
- val_to_str(label, special_labels, "Reserved - Unknown"));
- proto_item_append_text(ti, " (%s)", val_to_str(label, special_labels,
- "Reserved - Unknown"));
+ val_to_str_const(label, special_labels, "Reserved - Unknown"));
+ proto_item_append_text(ti, " (%s)", val_to_str_const(label, special_labels,
+ "Reserved - Unknown"));
} else {
proto_tree_add_uint_format(tlv_ds_map_tree, hf_mpls_echo_tlv_ds_map_mp_label,
tvb, offset, 3, label, "Downstream Label: %u", label);
@@ -867,8 +867,8 @@ dissect_mpls_echo_tlv_ds_map(tvbuff_t *tvb, guint offset, proto_tree *tree, int
tvb, offset + 2, 1, bos, "Downstream BOS: %u", bos);
proto_tree_add_item(tlv_ds_map_tree, hf_mpls_echo_tlv_ds_map_mp_proto,
tvb, offset + 3, 1, ENC_BIG_ENDIAN);
- proto_item_append_text(ti, ", Protocol: %u (%s)", proto, val_to_str(proto,
- mpls_echo_tlv_ds_map_mp_proto, "Unknown"));
+ proto_item_append_text(ti, ", Protocol: %u (%s)", proto, val_to_str_const(proto,
+ mpls_echo_tlv_ds_map_mp_proto, "Unknown"));
rem -= 4;
offset += 4;
idx++;
@@ -1194,9 +1194,9 @@ dissect_mpls_echo_tlv_ilso(tvbuff_t *tvb, guint offset, proto_tree *tree, int re
if (label <= LABEL_MAX_RESERVED) {
proto_tree_add_uint_format(tlv_ilso, hf_mpls_echo_tlv_ilso_label,
tvb, offset, 3, label, "Label: %u (%s)", label,
- val_to_str(label, special_labels, "Reserved - Unknown"));
- proto_item_append_text(ti, " (%s)", val_to_str(label, special_labels,
- "Reserved - Unknown"));
+ val_to_str_const(label, special_labels, "Reserved - Unknown"));
+ proto_item_append_text(ti, " (%s)", val_to_str_const(label, special_labels,
+ "Reserved - Unknown"));
} else {
proto_tree_add_uint_format(tlv_ilso, hf_mpls_echo_tlv_ilso_label,
tvb, offset, 3, label, "Label: %u", label);
@@ -1274,11 +1274,11 @@ dissect_mpls_echo_tlv(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem, gb
if (in_errored) {
proto_tree_add_uint_format(mpls_echo_tlv_tree, hf_mpls_echo_tlv_errored_type, tvb,
offset, 2, saved_type, "Errored TLV Type: %s (%u)",
- val_to_str(type, mpls_echo_tlv_type_names, "Unknown TLV type"), saved_type);
+ val_to_str_const(type, mpls_echo_tlv_type_names, "Unknown TLV type"), saved_type);
} else {
proto_tree_add_uint_format(mpls_echo_tlv_tree, hf_mpls_echo_tlv_type, tvb,
offset, 2, saved_type, "Type: %s (%u)",
- val_to_str(type, mpls_echo_tlv_type_names, "Unknown TLV type"), saved_type);
+ val_to_str_const(type, mpls_echo_tlv_type_names, "Unknown TLV type"), saved_type);
}
proto_tree_add_item(mpls_echo_tlv_tree, hf_mpls_echo_tlv_len, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
diff --git a/epan/dissectors/packet-mpls-psc.c b/epan/dissectors/packet-mpls-psc.c
index 28e6491f30..2fc562074e 100644
--- a/epan/dissectors/packet-mpls-psc.c
+++ b/epan/dissectors/packet-mpls-psc.c
@@ -132,7 +132,7 @@ dissect_mpls_psc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_add_fstr(pinfo->cinfo, COL_INFO,
"%s(%u,%u)",
- val_to_str(req, mpls_psc_req_short_vals, "Unknown-Request"),
+ val_to_str_const(req, mpls_psc_req_short_vals, "Unknown-Request"),
fpath, path);
if (!tree) {
diff --git a/epan/dissectors/packet-mrp-mmrp.c b/epan/dissectors/packet-mrp-mmrp.c
index 46353ed594..6f5b613047 100644
--- a/epan/dissectors/packet-mrp-mmrp.c
+++ b/epan/dissectors/packet-mrp-mmrp.c
@@ -266,8 +266,9 @@ dissect_mmrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
msg_tree = proto_item_add_subtree(msg_ti, ett_msg);
/* Append AttributeType description to the end of the "Message" heading */
- proto_item_append_text(msg_tree, ": %s (%d)", val_to_str(attribute_type,
- attribute_type_vals, "<Unknown>"), attribute_type);
+ proto_item_append_text(msg_tree, ": %s (%d)",
+ val_to_str_const(attribute_type, attribute_type_vals, "<Unknown>"),
+ attribute_type);
dissect_mmrp_common1(msg_tree, tvb, msg_offset);
diff --git a/epan/dissectors/packet-mrp-msrp.c b/epan/dissectors/packet-mrp-msrp.c
index 5326be934b..7eb5997ee8 100644
--- a/epan/dissectors/packet-mrp-msrp.c
+++ b/epan/dissectors/packet-mrp-msrp.c
@@ -503,8 +503,9 @@ dissect_msrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
msg_tree = proto_item_add_subtree(msg_ti, ett_msg);
/* Append AttributeType description to the end of the "Message" heading */
- proto_item_append_text(msg_tree, ": %s (%d)", val_to_str(attribute_type,
- attribute_type_vals, "<Unknown>"), attribute_type);
+ proto_item_append_text(msg_tree, ": %s (%d)",
+ val_to_str_const(attribute_type, attribute_type_vals, "<Unknown>"),
+ attribute_type);
dissect_msrp_common1(msg_tree, tvb, msg_offset);
diff --git a/epan/dissectors/packet-mrp-mvrp.c b/epan/dissectors/packet-mrp-mvrp.c
index b4273f53c4..b6824b07d7 100644
--- a/epan/dissectors/packet-mrp-mvrp.c
+++ b/epan/dissectors/packet-mrp-mvrp.c
@@ -263,8 +263,9 @@ dissect_mvrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
msg_tree = proto_item_add_subtree(msg_ti, ett_msg);
/* Append AttributeType description to the end of the "Message" heading */
- proto_item_append_text(msg_tree, ": %s (%d)", val_to_str(attribute_type,
- attribute_type_vals, "<Unknown>"), attribute_type);
+ proto_item_append_text(msg_tree, ": %s (%d)",
+ val_to_str_const(attribute_type, attribute_type_vals, "<Unknown>"),
+ attribute_type);
dissect_mvrp_common1(msg_tree, tvb, msg_offset);
diff --git a/epan/dissectors/packet-ms-mms.c b/epan/dissectors/packet-ms-mms.c
index dcbe3855f5..f843b7ec37 100644
--- a/epan/dissectors/packet-ms-mms.c
+++ b/epan/dissectors/packet-ms-mms.c
@@ -358,10 +358,10 @@ static gint dissect_msmms_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
/* Dissect command packet */
static gint dissect_msmms_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- gint offset = 0;
- proto_item *ti = NULL;
- proto_tree *msmms_tree = NULL;
- proto_tree *msmms_common_command_tree = NULL;
+ gint offset = 0;
+ proto_item *ti = NULL;
+ proto_tree *msmms_tree = NULL;
+ proto_tree *msmms_common_command_tree = NULL;
guint32 sequence_number;
guint16 command_id;
guint16 command_dir;
@@ -421,8 +421,8 @@ static gint dissect_msmms_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree
"",
"%s (to %s)",
(command_dir == TO_SERVER) ?
- val_to_str(command_id, to_server_command_vals, "Unknown") :
- val_to_str(command_id, to_client_command_vals, "Unknown"),
+ val_to_str_const(command_id, to_server_command_vals, "Unknown") :
+ val_to_str_const(command_id, to_client_command_vals, "Unknown"),
(command_dir == TO_SERVER) ? "server" : "client");
msmms_common_command_tree = proto_item_add_subtree(ti, ett_msmms_command_common_header);
}
@@ -486,8 +486,8 @@ static gint dissect_msmms_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree
sequence_number,
(command_dir == TO_SERVER) ? "-->" : "<--",
(command_dir == TO_SERVER) ?
- val_to_str(command_id, to_server_command_vals, "Unknown") :
- val_to_str(command_id, to_client_command_vals, "Unknown"));
+ val_to_str_const(command_id, to_server_command_vals, "Unknown") :
+ val_to_str_const(command_id, to_client_command_vals, "Unknown"));
/* Adjust length_remaining for command-specific details */
length_remaining = (length_remaining*8) - 8;
@@ -572,9 +572,9 @@ static gint dissect_msmms_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree
/* Parse the only known UDP command (0x01) */
static gint dissect_msmms_data_udp_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- proto_item *ti = NULL;
- proto_tree *msmms_tree = NULL;
- gint offset = 0;
+ proto_item *ti = NULL;
+ proto_tree *msmms_tree = NULL;
+ gint offset = 0;
/* Set protocol column */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "MSMMS");
@@ -654,7 +654,7 @@ static gint dissect_msmms_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
/* Flag value is in 5th byte */
value = tvb_get_letohs(tvb, 4) & 0xff00;
/* Reject packet if not a recognised packet type */
- if (strcmp(val_to_str(value, tcp_flags_vals, "Unknown"), "Unknown") == 0)
+ if (match_strval(value, tcp_flags_vals) == NULL)
{
return 0;
}
@@ -815,10 +815,10 @@ static void dissect_client_transport_info(tvbuff_t *tvb, packet_info *pinfo, pro
static void dissect_server_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint offset)
{
- guint32 server_version_length = 0;
- guint32 tool_version_length = 0;
- guint32 download_update_player_length = 0;
- guint32 password_encryption_type_length = 0;
+ guint32 server_version_length;
+ guint32 tool_version_length;
+ guint32 download_update_player_length;
+ guint32 password_encryption_type_length;
char *server_version;
char *tool_version;
char *download_update_player;
@@ -1116,7 +1116,7 @@ static void dissect_media_stream_mbr_selector(tvbuff_t *tvb, proto_tree *tree, g
/* Dissect header request */
static void dissect_header_request(tvbuff_t *tvb, proto_tree *tree, guint offset)
{
- gint n = 0;
+ gint n;
/* Command Level */
proto_tree_add_item(tree, hf_msmms_command_prefix1_command_level, tvb, offset, 4, ENC_LITTLE_ENDIAN);
@@ -1149,8 +1149,8 @@ static void dissect_stop_button_pressed(tvbuff_t *tvb, proto_tree *tree, guint o
/********************************************************/
static void msmms_data_add_address(packet_info *pinfo, address *addr, port_type pt, int port)
{
- address null_addr;
- conversation_t* p_conv;
+ address null_addr;
+ conversation_t *p_conv;
/* If this isn't the first time this packet has been processed,
* we've already done this work, so we don't need to do it
diff --git a/epan/dissectors/packet-mtp3.c b/epan/dissectors/packet-mtp3.c
index 2a1bc1098b..2b47c74cac 100644
--- a/epan/dissectors/packet-mtp3.c
+++ b/epan/dissectors/packet-mtp3.c
@@ -721,9 +721,9 @@ dissect_mtp3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (mtp3_heuristic_standard) {
heuristic_standard = heur_mtp3_standard(tvb, pinfo, si);
if (heuristic_standard == HEURISTIC_FAILED_STANDARD) {
- gen_item = proto_tree_add_text(tree, tvb, 0, 0, "Could not determine Heuristic using %s", val_to_str(mtp3_standard, mtp3_standard_vals, "unknown"));
+ gen_item = proto_tree_add_text(tree, tvb, 0, 0, "Could not determine Heuristic using %s", val_to_str_const(mtp3_standard, mtp3_standard_vals, "unknown"));
} else {
- gen_item = proto_tree_add_text(tree, tvb, 0, 0, "%s", val_to_str(heuristic_standard, mtp3_standard_vals, "unknown"));
+ gen_item = proto_tree_add_text(tree, tvb, 0, 0, "%s", val_to_str_const(heuristic_standard, mtp3_standard_vals, "unknown"));
mtp3_standard = heuristic_standard;
/* Register a frame-end routine to ensure mtp3_standard is set
diff --git a/epan/dissectors/packet-mtp3mg.c b/epan/dissectors/packet-mtp3mg.c
index e05ac81124..8db3fb9c5a 100644
--- a/epan/dissectors/packet-mtp3mg.c
+++ b/epan/dissectors/packet-mtp3mg.c
@@ -462,7 +462,7 @@ dissect_mtp3mg_chm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint8 h1)
{
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
- val_to_str(h1, chm_h1_message_type_acro_values, "Unknown"));
+ val_to_str_const(h1, chm_h1_message_type_acro_values, "Unknown"));
switch (h1)
{
@@ -521,7 +521,7 @@ dissect_mtp3mg_ecm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint8 h1)
{
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
- val_to_str(h1, ecm_h1_message_type_acro_values, "Unknown"));
+ val_to_str_const(h1, ecm_h1_message_type_acro_values, "Unknown"));
switch (h1)
{
@@ -547,7 +547,7 @@ dissect_mtp3mg_fcm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_item *apc_item;
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
- val_to_str(h1, fcm_h1_message_type_acro_values, "Unknown"));
+ val_to_str_const(h1, fcm_h1_message_type_acro_values, "Unknown"));
switch (h1)
{
@@ -637,7 +637,7 @@ dissect_mtp3mg_tfm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_item *apc_item;
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
- val_to_str(h1, tfm_h1_message_type_acro_values, "Unknown"));
+ val_to_str_const(h1, tfm_h1_message_type_acro_values, "Unknown"));
switch (h1)
{
@@ -722,7 +722,7 @@ dissect_mtp3mg_rsm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_item *apc_item;
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
- val_to_str(h1, rsm_h1_message_type_acro_values, "Unknown"));
+ val_to_str_const(h1, rsm_h1_message_type_acro_values, "Unknown"));
switch (h1)
{
@@ -812,7 +812,7 @@ dissect_mtp3mg_mim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint8 h1)
{
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
- val_to_str(h1, mim_h1_message_type_acro_values, "Unknown"));
+ val_to_str_const(h1, mim_h1_message_type_acro_values, "Unknown"));
switch (h1)
{
@@ -842,7 +842,7 @@ dissect_mtp3mg_trm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint8 h1)
{
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
- val_to_str(h1, trm_h1_message_type_acro_values, "Unknown"));
+ val_to_str_const(h1, trm_h1_message_type_acro_values, "Unknown"));
switch (h1)
{
@@ -865,7 +865,7 @@ dissect_mtp3mg_dlm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint8 h1)
{
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
- val_to_str(h1, dlm_h1_message_type_acro_values, "Unknown"));
+ val_to_str_const(h1, dlm_h1_message_type_acro_values, "Unknown"));
switch (h1)
{
@@ -899,7 +899,7 @@ dissect_mtp3mg_ufc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_item *apc_item;
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
- val_to_str(h1, ufc_h1_message_type_acro_values, "Unknown"));
+ val_to_str_const(h1, ufc_h1_message_type_acro_values, "Unknown"));
switch (h1)
{
@@ -971,7 +971,7 @@ dissect_mtp3mg_test(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint8 length;
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
- val_to_str(h1, test_h1_message_type_acro_values, "Unknown"));
+ val_to_str_const(h1, test_h1_message_type_acro_values, "Unknown"));
switch (h1)
{
@@ -1052,7 +1052,7 @@ dissect_mtp3mg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
JAPAN_SPARE_LENGTH, H0H1_LENGTH, ENC_NA);
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
- val_to_str(h0h1, japan_test_message_type_acro_values, "Unknown"));
+ val_to_str_const(h0h1, japan_test_message_type_acro_values, "Unknown"));
switch (h0h1)
{
diff --git a/epan/dissectors/packet-nbipx.c b/epan/dissectors/packet-nbipx.c
index 03717899be..83f685a01f 100644
--- a/epan/dissectors/packet-nbipx.c
+++ b/epan/dissectors/packet-nbipx.c
@@ -283,7 +283,7 @@ dissect_nbipx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
name_type = get_netbios_name(tvb, offset+2, name, (NETBIOS_NAME_LEN - 1)*4 + 1);
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s<%02x>",
- val_to_str(packet_type, nbipx_data_stream_type_vals, "Unknown"),
+ val_to_str_const(packet_type, nbipx_data_stream_type_vals, "Unknown"),
name, name_type);
}
if (nbipx_tree) {
@@ -332,7 +332,7 @@ dissect_nbipx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case NBIPX_SESSION_END_ACK:
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_str(pinfo->cinfo, COL_INFO,
- val_to_str(packet_type, nbipx_data_stream_type_vals, "Unknown"));
+ val_to_str_const(packet_type, nbipx_data_stream_type_vals, "Unknown"));
}
dissect_conn_control(tvb, offset, nbipx_tree);
offset += 1;
@@ -405,7 +405,7 @@ dissect_nbipx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case NBIPX_DIRECTED_DATAGRAM:
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_str(pinfo->cinfo, COL_INFO,
- val_to_str(packet_type, nbipx_data_stream_type_vals, "Unknown"));
+ val_to_str_const(packet_type, nbipx_data_stream_type_vals, "Unknown"));
}
dissect_conn_control(tvb, offset, nbipx_tree);
offset += 1;
@@ -432,7 +432,7 @@ dissect_nbipx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
default:
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_str(pinfo->cinfo, COL_INFO,
- val_to_str(packet_type, nbipx_data_stream_type_vals, "Unknown"));
+ val_to_str_const(packet_type, nbipx_data_stream_type_vals, "Unknown"));
}
/*
@@ -502,7 +502,7 @@ dissect_packet_type(tvbuff_t *tvb, int offset, guint8 packet_type,
if (tree) {
proto_tree_add_text(tree, tvb, offset, 1,
"Packet Type: %s (%02X)",
- val_to_str(packet_type, nbipx_data_stream_type_vals, "Unknown"),
+ val_to_str_const(packet_type, nbipx_data_stream_type_vals, "Unknown"),
packet_type);
}
}
@@ -745,11 +745,11 @@ dissect_nmpi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
proto_tree_add_text(nmpi_tree, tvb, offset, 1,
"Opcode: %s (0x%02x)",
- val_to_str(opcode, nmpi_opcode_vals, "Unknown"),
+ val_to_str_const(opcode, nmpi_opcode_vals, "Unknown"),
opcode);
proto_tree_add_text(nmpi_tree, tvb, offset+1, 1,
"Name Type: %s (0x%02x)",
- val_to_str(nmpi_name_type, nmpi_name_type_vals, "Unknown"),
+ val_to_str_const(nmpi_name_type, nmpi_name_type_vals, "Unknown"),
nmpi_name_type);
proto_tree_add_text(nmpi_tree, tvb, offset+2, 2,
"Message ID: 0x%04x",
diff --git a/epan/dissectors/packet-nbns.c b/epan/dissectors/packet-nbns.c
index f6d1abed30..bec18b4cc0 100644
--- a/epan/dissectors/packet-nbns.c
+++ b/epan/dissectors/packet-nbns.c
@@ -468,16 +468,16 @@ nbns_add_nbns_flags(column_info *cinfo, proto_tree *nbns_tree, tvbuff_t *tvb, in
#define MAX_BUF_SIZE (128+1)
buf=ep_alloc(MAX_BUF_SIZE);
opcode = (guint16) ((flags & F_OPCODE) >> OPCODE_SHIFT);
- g_snprintf(buf, MAX_BUF_SIZE, "%s", val_to_str(opcode, opcode_vals, "Unknown operation"));
+ g_snprintf(buf, MAX_BUF_SIZE, "%s", val_to_str_const(opcode, opcode_vals, "Unknown operation"));
if (flags & F_RESPONSE && !is_wack) {
g_strlcat(buf, " response", MAX_BUF_SIZE);
g_strlcat(buf, ", ", MAX_BUF_SIZE);
- g_strlcat(buf, val_to_str(flags & F_RCODE, rcode_vals, "Unknown error"), MAX_BUF_SIZE);
+ g_strlcat(buf, val_to_str_const(flags & F_RCODE, rcode_vals, "Unknown error"), MAX_BUF_SIZE);
buf[MAX_BUF_SIZE-1] = '\0';
if ((flags & F_RCODE))
col_append_fstr(cinfo, COL_INFO, ", %s",
- val_to_str(flags & F_RCODE, rcode_vals,
- "Unknown error"));
+ val_to_str_const(flags & F_RCODE, rcode_vals,
+ "Unknown error"));
}
tf = proto_tree_add_uint_format(nbns_tree, hf_nbns_flags,
tvb, offset, 2, flags, "Flags: 0x%04x (%s)", flags, buf);
@@ -521,7 +521,7 @@ nbns_add_nb_flags(proto_tree *rr_tree, tvbuff_t *tvb, int offset, gushort flags)
};
buf=ep_alloc(MAX_BUF_SIZE);
- g_snprintf(buf, MAX_BUF_SIZE, "%s", val_to_str(flags & NB_FLAGS_ONT, nb_flags_ont_vals,
+ g_snprintf(buf, MAX_BUF_SIZE, "%s", val_to_str_const(flags & NB_FLAGS_ONT, nb_flags_ont_vals,
"Unknown"));
g_strlcat(buf, ", ", MAX_BUF_SIZE);
if (flags & NB_FLAGS_G)
@@ -557,7 +557,7 @@ nbns_add_name_flags(proto_tree *rr_tree, tvbuff_t *tvb, int offset,
};
buf=ep_alloc(MAX_BUF_SIZE);
- g_snprintf(buf, MAX_BUF_SIZE, "%s", val_to_str(flags & NAME_FLAGS_ONT, name_flags_ont_vals,
+ g_snprintf(buf, MAX_BUF_SIZE, "%s", val_to_str_const(flags & NAME_FLAGS_ONT, name_flags_ont_vals,
"Unknown"));
g_strlcat(buf, ", ", MAX_BUF_SIZE);
if (flags & NAME_FLAGS_G)
diff --git a/epan/dissectors/packet-ncp-sss.c b/epan/dissectors/packet-ncp-sss.c
index bb1ecab2fa..4329cbd81e 100644
--- a/epan/dissectors/packet-ncp-sss.c
+++ b/epan/dissectors/packet-ncp-sss.c
@@ -687,7 +687,7 @@ dissect_sss_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, guint
if (tvb_length_remaining(tvb, foffset)<4) {
return;
}
- aitem = proto_tree_add_text(ncp_tree, tvb, foffset, -1, "Function: %s", val_to_str(subfunc, sss_func_enum, "val_to_str"));
+ aitem = proto_tree_add_text(ncp_tree, tvb, foffset, -1, "Function: %s", val_to_str_const(subfunc, sss_func_enum, "Unknown"));
atree = proto_item_add_subtree(aitem, ett_sss);
switch (subfunc) {
case 1:
diff --git a/epan/dissectors/packet-ndmp.c b/epan/dissectors/packet-ndmp.c
index d9a4ad2376..1577ca7fec 100644
--- a/epan/dissectors/packet-ndmp.c
+++ b/epan/dissectors/packet-ndmp.c
@@ -2416,7 +2416,7 @@ dissect_file_name(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *par
if (check_col(pinfo->cinfo, COL_INFO)){
col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)",
- val_to_str(type, file_fs_type_vals, "Unknown type") );
+ val_to_str_const(type, file_fs_type_vals, "Unknown type") );
}
proto_item_set_len(item, offset-old_offset);
diff --git a/epan/dissectors/packet-netbios.c b/epan/dissectors/packet-netbios.c
index 1e316a01a5..fb5d06d07e 100644
--- a/epan/dissectors/packet-netbios.c
+++ b/epan/dissectors/packet-netbios.c
@@ -333,7 +333,7 @@ int get_netbios_name( tvbuff_t *tvb, int offset, char *name_ret, int name_ret_le
const char *
netbios_name_type_descr(int name_type)
{
- return val_to_str(name_type, nb_name_type_vals, "Unknown");
+ return val_to_str_const(name_type, nb_name_type_vals, "Unknown");
}
void netbios_add_name(const char* label, tvbuff_t *tvb, int offset,
diff --git a/epan/dissectors/packet-netperfmeter.c b/epan/dissectors/packet-netperfmeter.c
index c3c4626f46..37110972bd 100644
--- a/epan/dissectors/packet-netperfmeter.c
+++ b/epan/dissectors/packet-netperfmeter.c
@@ -376,7 +376,7 @@ dissect_npmp_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *npmp
type = tvb_get_guint8(message_tvb, offset_message_type);
if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(type, message_type_values, "Unknown NetPerfMeterProtocol type"));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(type, message_type_values, "Unknown NetPerfMeterProtocol type"));
}
ADD_FIELD_UINT(npmp_tree, message_type);
diff --git a/epan/dissectors/packet-nettl.c b/epan/dissectors/packet-nettl.c
index 0f1f3c9721..f3f2ff0b7e 100644
--- a/epan/dissectors/packet-nettl.c
+++ b/epan/dissectors/packet-nettl.c
@@ -218,13 +218,13 @@ dissect_nettl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint_format(nettl_tree, hf_nettl_subsys, tvb,
0, 0, pinfo->pseudo_header->nettl.subsys,
"Subsystem: %d (%s)", pinfo->pseudo_header->nettl.subsys,
- val_to_str(pinfo->pseudo_header->nettl.subsys, subsystem, "Unknown"));
+ val_to_str_const(pinfo->pseudo_header->nettl.subsys, subsystem, "Unknown"));
proto_tree_add_int(nettl_tree, hf_nettl_devid, tvb,
0, 0, pinfo->pseudo_header->nettl.devid);
proto_tree_add_uint_format(nettl_tree, hf_nettl_kind, tvb,
0, 0, pinfo->pseudo_header->nettl.kind,
"Trace Kind: 0x%08x (%s)", pinfo->pseudo_header->nettl.kind,
- val_to_str(pinfo->pseudo_header->nettl.kind & ~NETTL_HDR_SUBSYSTEM_BITS_MASK, trace_kind, "Unknown"));
+ val_to_str_const(pinfo->pseudo_header->nettl.kind & ~NETTL_HDR_SUBSYSTEM_BITS_MASK, trace_kind, "Unknown"));
proto_tree_add_int(nettl_tree, hf_nettl_pid, tvb,
0, 0, pinfo->pseudo_header->nettl.pid);
proto_tree_add_uint(nettl_tree, hf_nettl_uid, tvb,
@@ -285,7 +285,7 @@ dissect_nettl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_add_fstr(pinfo->cinfo, COL_INFO,
"Unsupported nettl subsytem: %d (%s)",
pinfo->pseudo_header->nettl.subsys,
- val_to_str(pinfo->pseudo_header->nettl.subsys, subsystem, "Unknown"));
+ val_to_str_const(pinfo->pseudo_header->nettl.subsys, subsystem, "Unknown"));
call_dissector(data_handle, tvb, pinfo, tree);
}
}
diff --git a/epan/dissectors/packet-nsip.c b/epan/dissectors/packet-nsip.c
index 089aee3f27..f888290b29 100644
--- a/epan/dissectors/packet-nsip.c
+++ b/epan/dissectors/packet-nsip.c
@@ -288,9 +288,9 @@ check_correct_iei(nsip_ie_t *ie, build_info_t *bi) {
if (fetched_iei != ie->iei) {
proto_tree_add_text(bi->nsip_tree, bi->tvb, bi->offset, 1,
"Tried IEI %s (%#02x), found IEI %s (%#02x)",
- val_to_str(ie->iei, tab_nsip_ieis, "Unknown"),
+ val_to_str_const(ie->iei, tab_nsip_ieis, "Unknown"),
ie->iei,
- val_to_str(fetched_iei, tab_nsip_ieis, "Unknown"),
+ val_to_str_const(fetched_iei, tab_nsip_ieis, "Unknown"),
fetched_iei);
}
#endif
@@ -307,8 +307,8 @@ decode_iei_cause(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
bi->tvb, ie_start_offset, ie->total_length,
cause,
"Cause: %s (%#02x)",
- val_to_str(cause, tab_nsip_cause_values,
- "Unknown"), cause);
+ val_to_str_const(cause, tab_nsip_cause_values,
+ "Unknown"), cause);
if (check_col(bi->pinfo->cinfo, COL_INFO)) {
col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
"Cause: %s",
@@ -1011,15 +1011,15 @@ dissect_nsip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
proto_tree_add_uint_format(nsip_tree, hf_nsip_pdu_type, tvb, 0, 1,
pdu_type,
"PDU type: %s (%#02x)",
- val_to_str(pdu_type, tab_nsip_pdu_types,
- "Unknown"), pdu_type);
+ val_to_str_const(pdu_type, tab_nsip_pdu_types,
+ "Unknown"), pdu_type);
proto_item_append_text(bi.ti, ", PDU type: %s",
- val_to_str(pdu_type, tab_nsip_pdu_types, "Unknown"));
+ val_to_str_const(pdu_type, tab_nsip_pdu_types, "Unknown"));
bi.nsip_tree = nsip_tree;
}
col_add_str(pinfo->cinfo, COL_INFO,
- val_to_str(pdu_type, tab_nsip_pdu_types, "Unknown PDU type"));
+ val_to_str_const(pdu_type, tab_nsip_pdu_types, "Unknown PDU type"));
decode_pdu(pdu_type, &bi);
}
diff --git a/epan/dissectors/packet-nt-tpcp.c b/epan/dissectors/packet-nt-tpcp.c
index aaeb339f9e..d65dc54a47 100644
--- a/epan/dissectors/packet-nt-tpcp.c
+++ b/epan/dissectors/packet-nt-tpcp.c
@@ -134,7 +134,7 @@ dissect_tpcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO,"%s id %d CPort %s CIP %s SIP %s",
- val_to_str(tpcph.type, type_vals, "Unknown"),
+ val_to_str_const(tpcph.type, type_vals, "Unknown"),
tpcph.id,
get_udp_port(tpcph.cport),
ip_to_str((guint8 *)&tpcph.caddr),
@@ -150,7 +150,7 @@ dissect_tpcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint_format(tpcp_tree, hf_tpcp_type, tvb, 1, 1, tpcph.type,
"Type: %s (%d)",
- val_to_str(tpcph.type, type_vals, "Unknown"), tpcph.type);
+ val_to_str_const(tpcph.type, type_vals, "Unknown"), tpcph.type);
/* flags next , i'll do that when I can work out how to do it :-( */
tf = proto_tree_add_text(tpcp_tree, tvb, 2, 2, "Flags: 0x%04x",tpcph.flags);
diff --git a/epan/dissectors/packet-ntlmssp.c b/epan/dissectors/packet-ntlmssp.c
index a8b9ad7a39..5fb72c18ae 100644
--- a/epan/dissectors/packet-ntlmssp.c
+++ b/epan/dissectors/packet-ntlmssp.c
@@ -2171,9 +2171,9 @@ dissect_ntlmssp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 4;
col_append_sep_fstr(pinfo->cinfo, COL_INFO, ", ","%s",
- val_to_str(ntlmssph->type,
- ntlmssp_message_types,
- "Unknown NTLMSSP message type"));
+ val_to_str_const(ntlmssph->type,
+ ntlmssp_message_types,
+ "Unknown NTLMSSP message type"));
/* Call the appropriate dissector based on the Message Type */
switch (ntlmssph->type) {
diff --git a/epan/dissectors/packet-ntp.c b/epan/dissectors/packet-ntp.c
index f0c669b308..e18858edcc 100644
--- a/epan/dissectors/packet-ntp.c
+++ b/epan/dissectors/packet-ntp.c
@@ -660,14 +660,14 @@ dissect_ntp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Show version and mode in info column and NTP root */
col_add_fstr(pinfo->cinfo, COL_INFO, "%s, %s",
- val_to_str((flags & NTP_VN_MASK) >> 3, ver_nums,
- "Unknown version"),
- val_to_str(flags & NTP_MODE_MASK, info_mode_types, "Unknown"));
+ val_to_str_const((flags & NTP_VN_MASK) >> 3, ver_nums,
+ "Unknown version"),
+ val_to_str_const(flags & NTP_MODE_MASK, info_mode_types, "Unknown"));
proto_item_append_text(ti, " (%s, %s)",
- val_to_str((flags & NTP_VN_MASK) >> 3, ver_nums,
- "Unknown version"),
- val_to_str(flags & NTP_MODE_MASK, info_mode_types, "Unknown"));
+ val_to_str_const((flags & NTP_VN_MASK) >> 3, ver_nums,
+ "Unknown version"),
+ val_to_str_const(flags & NTP_MODE_MASK, info_mode_types, "Unknown"));
/* Dissect according to mode */
(*dissector)(tvb, ntp_tree, flags);
diff --git a/epan/dissectors/packet-olsr.c b/epan/dissectors/packet-olsr.c
index bb9bdae1c6..40708d4a8f 100644
--- a/epan/dissectors/packet-olsr.c
+++ b/epan/dissectors/packet-olsr.c
@@ -494,7 +494,7 @@ static int dissect_olsrorg_nameservice(tvbuff_t *tvb, packet_info *pinfo, proto_
total_length = 4 + 16 + ((length - 1) | 3) + 1;
olsr_ns_item = proto_tree_add_bytes_format(olsr_tree, hf_olsrorg_ns, tvb, offset, total_length,
- NULL, "Nameservice: %s (%d)", val_to_str(type, nameservice_type_vals, "UNKNOWN"), type);
+ NULL, "Nameservice: %s (%d)", val_to_str_const(type, nameservice_type_vals, "UNKNOWN"), type);
olsr_ns_tree = proto_item_add_subtree(olsr_ns_item, ett_olsr_message_ns);
@@ -587,7 +587,7 @@ static int dissect_olsr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
message_len = tvb_get_ntohs(tvb, offset + 2);
message_item = proto_tree_add_bytes_format(olsr_tree, hf_olsr_message, tvb, offset, message_len,
- NULL, "Message: %s (%d)", val_to_str(message_type, message_type_vals, "UNKNOWN"),
+ NULL, "Message: %s (%d)", val_to_str_const(message_type, message_type_vals, "UNKNOWN"),
message_type);
message_tree = proto_item_add_subtree(message_item, ett_olsr_message[message_type]);
diff --git a/epan/dissectors/packet-ositp.c b/epan/dissectors/packet-ositp.c
index baf1181e72..225509d948 100644
--- a/epan/dissectors/packet-ositp.c
+++ b/epan/dissectors/packet-ositp.c
@@ -360,7 +360,7 @@ static gboolean ositp_decode_var_part(tvbuff_t *tvb, int offset,
proto_tree_add_text(tree, tvb, offset, 1,
"Parameter code: 0x%02x (%s)",
code,
- val_to_str(code, tp_vpart_type_vals, "Unknown"));
+ val_to_str_const(code, tp_vpart_type_vals, "Unknown"));
offset += 1;
vp_length -= 1;
diff --git a/epan/dissectors/packet-ospf.c b/epan/dissectors/packet-ospf.c
index 78bd70ecb9..3976ee0286 100644
--- a/epan/dissectors/packet-ospf.c
+++ b/epan/dissectors/packet-ospf.c
@@ -1331,7 +1331,7 @@ dissect_ospfv2_lls_tlv(tvbuff_t *tvb, int offset, proto_tree *tree)
length = tvb_get_ntohs(tvb, offset + 2);
ti = proto_tree_add_text(tree, tvb, offset, length + 4, "%s",
- val_to_str(type, lls_tlv_type_vals, "Unknown TLV"));
+ val_to_str_const(type, lls_tlv_type_vals, "Unknown TLV"));
ospf_lls_tlv_tree = proto_item_add_subtree(ti, ett_ospf_lls_tlv);
proto_tree_add_text(ospf_lls_tlv_tree, tvb, offset, 2,
@@ -1400,7 +1400,7 @@ dissect_ospfv3_lls_tlv(tvbuff_t *tvb, int offset, proto_tree *tree)
break;
default:
ti = proto_tree_add_text(tree, tvb, offset, length + 4, "%s",
- val_to_str(type, lls_v3_tlv_type_vals, "Unknown TLV"));
+ val_to_str_const(type, lls_v3_tlv_type_vals, "Unknown TLV"));
}
ospf_lls_tlv_tree = proto_item_add_subtree(ti, ett_ospf_lls_tlv);
@@ -1678,7 +1678,7 @@ dissect_ospf_ls_req(tvbuff_t *tvb, int offset, proto_tree *tree, guint8 version,
(reserved == 0 ? "Reserved: %u" : "Reserved: %u [incorrect, should be 0]"), reserved);
ls_type = tvb_get_ntohs(tvb, offset+2);
proto_tree_add_text(ospf_lsr_tree, tvb, offset+2, 2, "LS Type: %s (0x%04x)",
- val_to_str(ls_type, v3_ls_type_vals, "Unknown"),
+ val_to_str_const(ls_type, v3_ls_type_vals, "Unknown"),
ls_type);
break;
}
@@ -1876,15 +1876,15 @@ dissect_ospf_lsa_mpls(tvbuff_t *tvb, int offset, proto_tree *tree,
while (stlv_offset < tlv_end_offset) {
stlv_type = tvb_get_ntohs(tvb, stlv_offset);
stlv_len = tvb_get_ntohs(tvb, stlv_offset + 2);
- stlv_name = val_to_str(stlv_type, mpls_link_stlv_str, "Unknown sub-TLV");
+ stlv_name = val_to_str_const(stlv_type, mpls_link_stlv_str, "Unknown sub-TLV");
switch (stlv_type) {
case MPLS_LINK_TYPE:
ti = proto_tree_add_text(tlv_tree, tvb, stlv_offset, stlv_len+4,
"%s: %u - %s", stlv_name,
tvb_get_guint8(tvb, stlv_offset + 4),
- val_to_str(tvb_get_guint8(tvb, stlv_offset + 4),
- mpls_link_stlv_ltype_str, "Unknown Link Type"));
+ val_to_str_const(tvb_get_guint8(tvb, stlv_offset + 4),
+ mpls_link_stlv_ltype_str, "Unknown Link Type"));
stlv_tree = proto_item_add_subtree(ti, ett_ospf_lsa_mpls_link_stlv);
proto_tree_add_text(stlv_tree, tvb, stlv_offset, 2,
"TLV Type: %u: %s", stlv_type, stlv_name);
@@ -2232,7 +2232,7 @@ dissect_ospf_lsa_mpls(tvbuff_t *tvb, int offset, proto_tree *tree,
while (stlv_offset < tlv_end_offset) {
stlv_type = tvb_get_ntohs(tvb, stlv_offset);
stlv_len = tvb_get_ntohs(tvb, stlv_offset + 2);
- stlv_name = val_to_str(stlv_type, oif_stlv_str, "Unknown sub-TLV");
+ stlv_name = val_to_str_const(stlv_type, oif_stlv_str, "Unknown sub-TLV");
switch (stlv_type) {
case OIF_NODE_ID:
@@ -2347,7 +2347,7 @@ static void dissect_ospf_lsa_grace_tlv (tvbuff_t *tvb, int offset,
tlv_length_with_pad, ENC_NA);
tlv_tree = proto_item_add_subtree(tree_item, ett_ospf_lsa_grace_tlv);
proto_tree_add_text(tlv_tree, tvb, offset, 2, "Type: %s (%u)",
- val_to_str(tlv_type, grace_tlv_type_vals, "Unknown grace-LSA TLV"), tlv_type);
+ val_to_str_const(tlv_type, grace_tlv_type_vals, "Unknown grace-LSA TLV"), tlv_type);
proto_tree_add_text(tlv_tree, tvb, offset + 2, 2, "Length: %u", tlv_length);
switch (tlv_type) {
@@ -2363,7 +2363,7 @@ static void dissect_ospf_lsa_grace_tlv (tvbuff_t *tvb, int offset,
proto_tree_add_item(tlv_tree, hf_ospf_filter[OSPFF_V2_GRACE_REASON], tvb, offset + 4,
tlv_length, ENC_BIG_ENDIAN);
proto_item_set_text(tree_item, "Restart Reason: %s (%u)",
- val_to_str(restart_reason, restart_reason_vals, "Unknown Restart Reason"),
+ val_to_str_const(restart_reason, restart_reason_vals, "Unknown Restart Reason"),
restart_reason);
break;
case GRACE_TLV_IP:
@@ -2846,7 +2846,7 @@ dissect_ospf_v3_lsa(tvbuff_t *tvb, int offset, proto_tree *tree,
if (disassemble_body) {
ti = proto_tree_add_text(tree, tvb, offset, ls_length,
- "%s (Type: 0x%04x)", val_to_str(ls_type, v3_ls_type_vals,"Unknown"), ls_type);
+ "%s (Type: 0x%04x)", val_to_str_const(ls_type, v3_ls_type_vals,"Unknown"), ls_type);
} else {
ti = proto_tree_add_text(tree, tvb, offset, OSPF_LSA_HEADER_LENGTH,
"LSA Header");
@@ -2859,7 +2859,7 @@ dissect_ospf_v3_lsa(tvbuff_t *tvb, int offset, proto_tree *tree,
(tvb_get_ntohs(tvb, offset) & OSPF_DNA_LSA) ? "True" : "False");
proto_tree_add_text(ospf_lsa_tree, tvb, offset + 2, 2, "LSA Type: 0x%04x (%s)",
- ls_type, val_to_str(ls_type, v3_ls_type_vals,"Unknown"));
+ ls_type, val_to_str_const(ls_type, v3_ls_type_vals,"Unknown"));
proto_tree_add_text(ospf_lsa_tree, tvb, offset + 4, 4, "Link State ID: %s",
tvb_ip_to_str(tvb, offset + 4));
@@ -3062,7 +3062,7 @@ dissect_ospf_v3_lsa(tvbuff_t *tvb, int offset, proto_tree *tree,
/* referenced LS type */
referenced_ls_type=tvb_get_ntohs(tvb, offset+6);
proto_tree_add_text(ospf_lsa_tree, tvb, offset+6, 2,"Referenced LS type 0x%04x (%s)",
- referenced_ls_type, val_to_str(referenced_ls_type, v3_ls_type_vals, "Unknown"));
+ referenced_ls_type, val_to_str_const(referenced_ls_type, v3_ls_type_vals, "Unknown"));
offset+=8;
@@ -3160,7 +3160,7 @@ dissect_ospf_v3_lsa(tvbuff_t *tvb, int offset, proto_tree *tree,
/* referenced LS type */
referenced_ls_type=tvb_get_ntohs(tvb, offset+2);
proto_tree_add_text(ospf_lsa_tree, tvb, offset+2, 2,"Referenced LS type 0x%04x (%s)",
- referenced_ls_type, val_to_str(referenced_ls_type, v3_ls_type_vals, "Unknown"));
+ referenced_ls_type, val_to_str_const(referenced_ls_type, v3_ls_type_vals, "Unknown"));
/* Referenced Link State ID */
proto_tree_add_text(ospf_lsa_tree, tvb, offset + 4, 4, "Referenced Link State ID: %s",
diff --git a/epan/dissectors/packet-p_mul.c b/epan/dissectors/packet-p_mul.c
index 35c3d69ae5..589e4267b1 100644
--- a/epan/dissectors/packet-p_mul.c
+++ b/epan/dissectors/packet-p_mul.c
@@ -258,7 +258,7 @@ static const true_false_string no_yes = {
static const gchar *get_type (guint8 value)
{
- return val_to_str (value, pdu_vals, "Unknown");
+ return val_to_str_const (value, pdu_vals, "Unknown");
}
diff --git a/epan/dissectors/packet-pagp.c b/epan/dissectors/packet-pagp.c
index c79a484f63..562ded89a3 100644
--- a/epan/dissectors/packet-pagp.c
+++ b/epan/dissectors/packet-pagp.c
@@ -196,7 +196,7 @@ dissect_pagp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_str(pinfo->cinfo, COL_INFO,
- val_to_str(raw_octet, pdu_vers, "Unknown PDU version"));
+ val_to_str_const(raw_octet, pdu_vers, "Unknown PDU version"));
}
if (raw_octet == PAGP_FLUSH_PDU) {
@@ -352,7 +352,7 @@ dissect_pagp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tlv_tree = proto_item_add_subtree (tlv_item, ett_pagp_tlvs);
proto_tree_add_uint_format (tlv_tree, hf_pagp_tlv, tvb,
offset,2,tlv,"Type = %d (%s)", tlv,
- val_to_str(tlv,tlv_types, "Unknown")) ;
+ val_to_str_const(tlv,tlv_types, "Unknown")) ;
proto_tree_add_text (tlv_tree, tvb, offset+2, 2,
"Length = %u bytes (includes Type and Length)", len) ;
if ( tvb_reported_length_remaining(tvb, offset) < len ) {
diff --git a/epan/dissectors/packet-pcep.c b/epan/dissectors/packet-pcep.c
index bdae0cda0f..3b3c3e4ff7 100644
--- a/epan/dissectors/packet-pcep.c
+++ b/epan/dissectors/packet-pcep.c
@@ -717,7 +717,7 @@ dissect_pcep_tlvs(proto_tree *pcep_obj, tvbuff_t *tvb, int offset, gint length,
case 4: /* OF TLV */
for (i=0; i<tlv_length/2; i++)
proto_tree_add_text(tlv, tvb, offset+4+j+i*2, 2, "OF-Code #%d: %s (%u)",
- i+1, val_to_str(tvb_get_ntohs(tvb, offset+4+j+i*2), pcep_of_vals, "Unknown"),
+ i+1, val_to_str_const(tvb_get_ntohs(tvb, offset+4+j+i*2), pcep_of_vals, "Unknown"),
tvb_get_ntohs(tvb, offset+4+j+i*2));
break;
@@ -800,7 +800,7 @@ dissect_subobj_ipv4(proto_tree *pcep_subobj_tree, tvbuff_t *tvb, int offset, int
proto_tree_add_text(pcep_subobj_ipv4, tvb, offset+1, 1, "Length: %u", length);
proto_tree_add_text(pcep_subobj_ipv4, tvb, offset+2, 4, "IPv4 Address: %s", tvb_ip_to_str(tvb, offset+2));
proto_tree_add_text(pcep_subobj_ipv4, tvb, offset+6, 1, "Prefix Length: %u", prefix_length);
- proto_tree_add_text(pcep_subobj_ipv4, tvb, offset+7, 1, "Attribute: %s (%u)",val_to_str(resvd, pcep_xro_attribute_obj_vals, "Unknown"), resvd);
+ proto_tree_add_text(pcep_subobj_ipv4, tvb, offset+7, 1, "Attribute: %s (%u)",val_to_str_const(resvd, pcep_xro_attribute_obj_vals, "Unknown"), resvd);
break;
default:
@@ -870,7 +870,7 @@ dissect_subobj_ipv6(proto_tree *pcep_subobj_tree, tvbuff_t *tvb, int offset, int
proto_tree_add_text(pcep_subobj_ipv6, tvb, offset+1, 1, "Length: %u", length);
proto_tree_add_text(pcep_subobj_ipv6, tvb, offset+2, 16, "IPv6 Address: %s", tvb_ip6_to_str(tvb, offset+2));
proto_tree_add_text(pcep_subobj_ipv6, tvb, offset+18, 1, "Prefix Length: %u", prefix_length);
- proto_tree_add_text(pcep_subobj_ipv6, tvb, offset+19, 1, "Attribute: %s (%u)", val_to_str(resv, pcep_xro_attribute_obj_vals, "Unknown"), resv);
+ proto_tree_add_text(pcep_subobj_ipv6, tvb, offset+19, 1, "Attribute: %s (%u)", val_to_str_const(resv, pcep_xro_attribute_obj_vals, "Unknown"), resv);
break;
default:
@@ -997,7 +997,7 @@ dissect_subobj_unnumb_interfaceID(proto_tree *pcep_subobj_tree, tvbuff_t *tvb, i
proto_tree_add_text(pcep_subobj_unnumb_interfaceID, tvb, offset, 1, "X: %x", (l_and_or_type & 0x01)>>7);
proto_tree_add_uint(pcep_subobj_unnumb_interfaceID, pcep_filter[PCEPF_SUBOBJ_XRO], tvb, offset, 1, (l_and_or_type & 0x7f));
proto_tree_add_text(pcep_subobj_unnumb_interfaceID, tvb, offset+2, 1, "Reserved: 0x%02x", (reserved_flags & 0xff00)>>4);
- proto_tree_add_text(pcep_subobj_unnumb_interfaceID, tvb, offset+3, 1, "Attribute: %s (%u)", val_to_str(reserved_flags & 0x00ff, pcep_xro_attribute_obj_vals, "Unknown"), reserved_flags & 0x00ff);
+ proto_tree_add_text(pcep_subobj_unnumb_interfaceID, tvb, offset+3, 1, "Attribute: %s (%u)", val_to_str_const(reserved_flags & 0x00ff, pcep_xro_attribute_obj_vals, "Unknown"), reserved_flags & 0x00ff);
break;
default:
@@ -1039,7 +1039,7 @@ dissect_subobj_autonomous_sys_num(proto_tree *pcep_subobj_tree, tvbuff_t *tvb, i
proto_tree_add_text(pcep_subobj_autonomous_sys_num, tvb, offset+1, 1, "Length: %u", length);
proto_tree_add_text(pcep_subobj_autonomous_sys_num, tvb, offset+2, 1, "Reserved: 0x%02x", reserved);
- proto_tree_add_text(pcep_subobj_autonomous_sys_num, tvb, offset+3, 1, "Attribute: %s (%u)", val_to_str(attribute, pcep_xro_attribute_obj_vals, "Unknown"), attribute);
+ proto_tree_add_text(pcep_subobj_autonomous_sys_num, tvb, offset+3, 1, "Attribute: %s (%u)", val_to_str_const(attribute, pcep_xro_attribute_obj_vals, "Unknown"), attribute);
proto_tree_add_text(pcep_subobj_autonomous_sys_num, tvb, offset+4, 2, "Optional AS Number High Octets: 0x%04x", AS_number);
proto_tree_add_text(pcep_subobj_autonomous_sys_num, tvb, offset+6, 2, "AS Number: 0x%04x", AS_number);
} else {
@@ -1092,7 +1092,7 @@ dissect_subobj_srlg(proto_tree *pcep_subobj_tree, tvbuff_t *tvb, int offset, gui
proto_tree_add_text(pcep_subobj_srlg, tvb, offset+2, 4, "SRLG ID: 0x%08x", srlg_id);
proto_tree_add_text(pcep_subobj_srlg, tvb, offset+6, 1, "Reserved: 0x%02x", reserved);
- proto_tree_add_text(pcep_subobj_srlg, tvb, offset+7, 1, "Attribute: %s (%u)", val_to_str(attribute, pcep_xro_attribute_obj_vals, "Unknown"), attribute);
+ proto_tree_add_text(pcep_subobj_srlg, tvb, offset+7, 1, "Attribute: %s (%u)", val_to_str_const(attribute, pcep_xro_attribute_obj_vals, "Unknown"), attribute);
}
static void
@@ -1459,7 +1459,7 @@ dissect_pcep_metric_obj(proto_tree *pcep_object_tree,
proto_tree_add_boolean(pcep_metric_obj_flags, pcep_metric_flags_b, tvb, offset2+2, 1, flags);
metric_type = tvb_get_guint8(tvb, offset2+3);
- proto_tree_add_text(pcep_object_tree, tvb, offset2+3, 1, "Type: %s (T=%u)", val_to_str(metric_type, pcep_metric_obj_vals, "Unknown"), metric_type);
+ proto_tree_add_text(pcep_object_tree, tvb, offset2+3, 1, "Type: %s (T=%u)", val_to_str_const(metric_type, pcep_metric_obj_vals, "Unknown"), metric_type);
metric_value = tvb_get_ntohieee_float(tvb, offset2+4);
proto_tree_add_text(pcep_object_tree, tvb, offset2+4, 4, "Metric Value: %f", metric_value);
@@ -1840,21 +1840,21 @@ dissect_pcep_error_obj(proto_tree *pcep_object_tree, tvbuff_t *tvb, int offset2,
err_str = default_str;
switch (error_type){
case ESTABLISH_FAILURE:
- err_str = val_to_str(error_value, pcep_error_value_1_vals, "Unknown");
+ err_str = val_to_str_const(error_value, pcep_error_value_1_vals, "Unknown");
break;
case CAP_NOT_SUPPORTED:
break;
case UNKNOWN_OBJ:
- err_str = val_to_str(error_value, pcep_error_value_3_vals, "Unknown");
+ err_str = val_to_str_const(error_value, pcep_error_value_3_vals, "Unknown");
break;
case NOT_SUPP_OBJ:
- err_str = val_to_str(error_value, pcep_error_value_4_vals, "Unknown");
+ err_str = val_to_str_const(error_value, pcep_error_value_4_vals, "Unknown");
break;
case POLICY_VIOLATION:
- err_str = val_to_str(error_value, pcep_error_value_5_vals, "Unknown");
+ err_str = val_to_str_const(error_value, pcep_error_value_5_vals, "Unknown");
break;
case MANDATORY_OBJ_MIS:
- err_str = val_to_str(error_value, pcep_error_value_6_vals, "Unknown");
+ err_str = val_to_str_const(error_value, pcep_error_value_6_vals, "Unknown");
break;
case SYNCH_PCREQ_MIS:
break;
@@ -1863,27 +1863,27 @@ dissect_pcep_error_obj(proto_tree *pcep_object_tree, tvbuff_t *tvb, int offset2,
case ATTEMPT_2_SESSION:
break;
case INVALID_OBJ:
- err_str = val_to_str(error_value, pcep_error_value_10_vals, "Unknown");
+ err_str = val_to_str_const(error_value, pcep_error_value_10_vals, "Unknown");
break;
case UNRECO_EXRS_SUBOBJ:
break;
case DIFFSERV_TE_ERROR:
- err_str = val_to_str(error_value, pcep_error_value_12_vals, "Unknown");
+ err_str = val_to_str_const(error_value, pcep_error_value_12_vals, "Unknown");
break;
case BRPC_FAILURE:
- err_str = val_to_str(error_value, pcep_error_value_13_vals, "Unknown");
+ err_str = val_to_str_const(error_value, pcep_error_value_13_vals, "Unknown");
break;
case GCO_ERROR:
- err_str = val_to_str(error_value, pcep_error_value_15_vals, "Unknown");
+ err_str = val_to_str_const(error_value, pcep_error_value_15_vals, "Unknown");
break;
case P2MP_CAPABILITY_ERROR:
- err_str = val_to_str(error_value, pcep_error_value_16_vals, "Unknown");
+ err_str = val_to_str_const(error_value, pcep_error_value_16_vals, "Unknown");
break;
case P2MP_END_POINTS_ERROR:
- err_str = val_to_str(error_value, pcep_error_value_17_vals, "Unknown");
+ err_str = val_to_str_const(error_value, pcep_error_value_17_vals, "Unknown");
break;
case P2MP_FRAGMENT_ERROR:
- err_str = val_to_str(error_value, pcep_error_value_18_vals, "Unknown");
+ err_str = val_to_str_const(error_value, pcep_error_value_18_vals, "Unknown");
break;
default:
proto_tree_add_text(pcep_object_tree, tvb, offset2+2, 1, "Error-Type: %u Non defined Error-Value", error_type);
@@ -1956,7 +1956,7 @@ dissect_pcep_close_obj(proto_tree *pcep_object_tree, tvbuff_t *tvb, int offset2,
proto_tree_add_text(pcep_object_tree, tvb, offset2+2, 1, "Flags: 0x%02x", flags);
reason = tvb_get_guint8(tvb, offset2+3);
- proto_tree_add_text(pcep_object_tree, tvb, offset2+3, 1, "Reason: %s (%u)", val_to_str(reason, pcep_close_reason_obj_vals, "Unknown"), reason);
+ proto_tree_add_text(pcep_object_tree, tvb, offset2+3, 1, "Reason: %s (%u)", val_to_str_const(reason, pcep_close_reason_obj_vals, "Unknown"), reason);
/*it's suppose that obj_length is a a valid date. The object can have optional TLV(s)*/
offset2 += CLOSE_OBJ_MIN_LEN;
@@ -2201,7 +2201,7 @@ dissect_pcep_of_obj(proto_tree *pcep_object_tree, tvbuff_t *tvb, int offset2, in
of_code = tvb_get_ntohs(tvb, offset2);
proto_tree_add_text(pcep_object_tree, tvb, offset2, 2, "OF-Code: %s (%u)",
- val_to_str(of_code, pcep_of_vals, "Unknown"), of_code);
+ val_to_str_const(of_code, pcep_of_vals, "Unknown"), of_code);
/*The object can have optional TLV(s)*/
offset2 += OPEN_OBJ_MIN_LEN;
diff --git a/epan/dissectors/packet-pgsql.c b/epan/dissectors/packet-pgsql.c
index 7d9d50d3ae..4090346f40 100644
--- a/epan/dissectors/packet-pgsql.c
+++ b/epan/dissectors/packet-pgsql.c
@@ -244,10 +244,10 @@ dissect_pgsql_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
else
typestr = "Unknown";
} else
- typestr = val_to_str(type, fe_messages, "Unknown");
+ typestr = val_to_str_const(type, fe_messages, "Unknown");
}
else {
- typestr = val_to_str(type, be_messages, "Unknown");
+ typestr = val_to_str_const(type, be_messages, "Unknown");
}
if (info) {
diff --git a/epan/dissectors/packet-pingpongprotocol.c b/epan/dissectors/packet-pingpongprotocol.c
index 61758414d5..ae1ad784f8 100644
--- a/epan/dissectors/packet-pingpongprotocol.c
+++ b/epan/dissectors/packet-pingpongprotocol.c
@@ -124,7 +124,7 @@ dissect_pingpongprotocol_message(tvbuff_t *message_tvb, packet_info *pinfo, prot
type = tvb_get_guint8(message_tvb, MESSAGE_TYPE_OFFSET);
if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(type, message_type_values, "Unknown PingPongProtocol type"));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(type, message_type_values, "Unknown PingPongProtocol type"));
}
proto_tree_add_item(pingpongprotocol_tree, hf_message_type, message_tvb, MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_item(pingpongprotocol_tree, hf_message_flags, message_tvb, MESSAGE_FLAGS_OFFSET, MESSAGE_FLAGS_LENGTH, ENC_BIG_ENDIAN);
diff --git a/epan/dissectors/packet-ppi.c b/epan/dissectors/packet-ppi.c
index 8e499c961e..663fd4e59d 100644
--- a/epan/dissectors/packet-ppi.c
+++ b/epan/dissectors/packet-ppi.c
@@ -179,7 +179,7 @@ typedef enum {
MOHAMED_THAGA_PRIVATE = 30001,
PPI_GPS_INFO = 30002, /* 30002 - 30005 described in PPI-GEOLOCATION specifcation */
PPI_VECTOR_INFO = 30003, /* currently available in draft from. jellch@harris.com */
- PPI_SENSOR_INFO = 30004,
+ PPI_SENSOR_INFO = 30004,
PPI_ANTENNA_INFO = 30005,
CACE_PRIVATE = 0xCACE
/* All others RESERVED. Contact the WinPcap team for an assignment */
@@ -329,22 +329,22 @@ static const true_false_string tfs_invalid_valid = { "Invalid", "Valid" };
static const true_false_string tfs_phy_error = { "PHY error", "No errors"};
static const value_string vs_ppi_field_type[] = {
- {PPI_80211_COMMON, "802.11-Common"},
- {PPI_80211N_MAC, "802.11n MAC Extensions"},
- {PPI_80211N_MAC_PHY, "802.11n MAC+PHY Extensions"},
- {PPI_SPECTRUM_MAP, "Spectrum-Map"},
- {PPI_PROCESS_INFO, "Process-Info"},
- {PPI_CAPTURE_INFO, "Capture-Info"},
+ {PPI_80211_COMMON, "802.11-Common"},
+ {PPI_80211N_MAC, "802.11n MAC Extensions"},
+ {PPI_80211N_MAC_PHY, "802.11n MAC+PHY Extensions"},
+ {PPI_SPECTRUM_MAP, "Spectrum-Map"},
+ {PPI_PROCESS_INFO, "Process-Info"},
+ {PPI_CAPTURE_INFO, "Capture-Info"},
{PPI_AGGREGATION_EXTENSION, "Aggregation Extension"},
- {PPI_8023_EXTENSION, "802.3 Extension"},
-
- {INTEL_CORP_PRIVATE, "Intel Corporation (private)"},
- {MOHAMED_THAGA_PRIVATE, "Mohamed Thaga (private)"},
- {PPI_GPS_INFO, "GPS Tagging"},
- {PPI_VECTOR_INFO, "Vector Tagging"},
- {PPI_SENSOR_INFO, "Sensor tagging"},
- {PPI_ANTENNA_INFO, "Antenna Tagging"},
- {CACE_PRIVATE, "CACE Technologies (private)"},
+ {PPI_8023_EXTENSION, "802.3 Extension"},
+
+ {INTEL_CORP_PRIVATE, "Intel Corporation (private)"},
+ {MOHAMED_THAGA_PRIVATE, "Mohamed Thaga (private)"},
+ {PPI_GPS_INFO, "GPS Tagging"},
+ {PPI_VECTOR_INFO, "Vector Tagging"},
+ {PPI_SENSOR_INFO, "Sensor tagging"},
+ {PPI_ANTENNA_INFO, "Antenna Tagging"},
+ {CACE_PRIVATE, "CACE Technologies (private)"},
{0, NULL}
};
@@ -374,9 +374,9 @@ static gboolean ppi_ampdu_reassemble = TRUE;
void
capture_ppi(const guchar *pd, int len, packet_counts *ld)
{
- guint32 dlt;
- guint ppi_len, data_type, data_len;
- guint offset = PPI_V0_HEADER_LEN;
+ guint32 dlt;
+ guint ppi_len, data_type, data_len;
+ guint offset = PPI_V0_HEADER_LEN;
gboolean is_htc = FALSE;
ppi_len = pletohs(pd+2);
@@ -420,7 +420,7 @@ capture_ppi(const guchar *pd, int len, packet_counts *ld)
static void
ptvcursor_add_invalid_check(ptvcursor_t *csr, int hf, gint len, guint64 invalid_val) {
proto_item *ti;
- guint64 val = invalid_val;
+ guint64 val = invalid_val;
switch (len) {
case 8:
@@ -451,7 +451,7 @@ ptvcursor_add_invalid_check(ptvcursor_t *csr, int hf, gint len, guint64 invalid_
static void
add_ppi_field_header(tvbuff_t *tvb, proto_tree *tree, int *offset)
{
- ptvcursor_t *csr = NULL;
+ ptvcursor_t *csr;
csr = ptvcursor_new(tree, tvb, *offset);
ptvcursor_add(csr, hf_ppi_field_type, 2, ENC_LITTLE_ENDIAN);
@@ -464,13 +464,13 @@ add_ppi_field_header(tvbuff_t *tvb, proto_tree *tree, int *offset)
static void
dissect_80211_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int data_len)
{
- proto_tree *ftree = NULL;
- proto_item *ti = NULL;
- ptvcursor_t *csr = NULL;
- gint rate_kbps;
- guint32 common_flags;
- guint16 common_frequency;
- gchar *chan_str;
+ proto_tree *ftree = NULL;
+ proto_item *ti = NULL;
+ ptvcursor_t *csr;
+ gint rate_kbps;
+ guint32 common_flags;
+ guint16 common_frequency;
+ gchar *chan_str;
ti = proto_tree_add_text(tree, tvb, offset, data_len, "802.11-Common");
ftree = proto_item_add_subtree(ti, ett_dot11_common);
@@ -550,10 +550,10 @@ dissect_80211_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of
static void
dissect_80211n_mac(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, int data_len, gboolean add_subtree, guint32 *n_mac_flags, guint32 *ampdu_id)
{
- proto_tree *ftree = tree;
- proto_item *ti = NULL;
- ptvcursor_t *csr = NULL;
- int subtree_off = add_subtree ? 4 : 0;
+ proto_tree *ftree = tree;
+ proto_item *ti = NULL;
+ ptvcursor_t *csr;
+ int subtree_off = add_subtree ? 4 : 0;
*n_mac_flags = tvb_get_letohl(tvb, offset + subtree_off);
*ampdu_id = tvb_get_letohl(tvb, offset + 4 + subtree_off);
@@ -596,11 +596,11 @@ dissect_80211n_mac(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int
static void
dissect_80211n_mac_phy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int data_len, guint32 *n_mac_flags, guint32 *ampdu_id)
{
- proto_tree *ftree = NULL;
- proto_item *ti = NULL;
- ptvcursor_t *csr = NULL;
- guint16 ext_frequency;
- gchar *chan_str;
+ proto_tree *ftree = NULL;
+ proto_item *ti = NULL;
+ ptvcursor_t *csr;
+ guint16 ext_frequency;
+ gchar *chan_str;
ti = proto_tree_add_text(tree, tvb, offset, data_len, "802.11n MAC+PHY");
ftree = proto_item_add_subtree(ti, ett_dot11n_mac_phy);
@@ -672,7 +672,7 @@ dissect_aggregation_extension(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
{
proto_tree *ftree = tree;
proto_item *ti = NULL;
- ptvcursor_t *csr = NULL;
+ ptvcursor_t *csr;
ti = proto_tree_add_text(tree, tvb, offset, data_len, "Aggregation Extension");
ftree = proto_item_add_subtree(ti, ett_aggregation_extension);
@@ -693,9 +693,9 @@ dissect_aggregation_extension(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
static void
dissect_8023_extension(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, int data_len)
{
- proto_tree *ftree = tree;
- proto_item *ti = NULL;
- ptvcursor_t *csr = NULL;
+ proto_tree *ftree = tree;
+ proto_item *ti = NULL;
+ ptvcursor_t *csr;
ti = proto_tree_add_text(tree, tvb, offset, data_len, "802.3 Extension");
ftree = proto_item_add_subtree(ti, ett_8023_extension);
@@ -732,24 +732,24 @@ dissect_8023_extension(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
static void
dissect_ppi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- proto_tree *ppi_tree = NULL, *ppi_flags_tree = NULL, *seg_tree = NULL, *ampdu_tree = NULL;
- proto_tree *agg_tree = NULL;
- proto_item *ti = NULL;
- tvbuff_t *next_tvb;
- int offset = 0;
- guint version, flags;
- gint tot_len, data_len;
- guint data_type;
- guint32 dlt;
- guint32 n_ext_flags = 0;
- guint32 ampdu_id = 0;
- fragment_data *fd_head = NULL, *ft_fdh = NULL;
+ proto_tree *ppi_tree = NULL, *ppi_flags_tree = NULL, *seg_tree = NULL, *ampdu_tree = NULL;
+ proto_tree *agg_tree = NULL;
+ proto_item *ti = NULL;
+ tvbuff_t *next_tvb;
+ int offset = 0;
+ guint version, flags;
+ gint tot_len, data_len;
+ guint data_type;
+ guint32 dlt;
+ guint32 n_ext_flags = 0;
+ guint32 ampdu_id = 0;
+ fragment_data *fd_head = NULL, *ft_fdh = NULL;
+ gint mpdu_count = 0;
+ gchar *mpdu_str;
+ gboolean first_mpdu = TRUE;
+ guint last_frame = 0;
+ gboolean is_ht = FALSE;
gint len_remain, /*pad_len = 0,*/ ampdu_len = 0;
- gint mpdu_count = 0;
- gchar *mpdu_str;
- gboolean first_mpdu = TRUE;
- guint last_frame = 0;
- gboolean is_ht = FALSE;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "PPI");
col_clear(pinfo->cinfo, COL_INFO);
@@ -833,7 +833,7 @@ dissect_ppi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (ppi_gps_handle == NULL)
{
proto_tree_add_text(ppi_tree, tvb, offset, data_len,
- "%s (%u bytes)", val_to_str(data_type, (value_string *)&vs_ppi_field_type, "GPS: "), data_len);
+ "%s (%u bytes)", val_to_str_const(data_type, vs_ppi_field_type, "GPS: "), data_len);
}
else /* we found a suitable dissector */
{
@@ -846,7 +846,7 @@ dissect_ppi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (ppi_vector_handle == NULL)
{
proto_tree_add_text(ppi_tree, tvb, offset, data_len,
- "%s (%u bytes)", val_to_str(data_type, (value_string *)&vs_ppi_field_type, "VECTOR: "), data_len);
+ "%s (%u bytes)", val_to_str_const(data_type, vs_ppi_field_type, "VECTOR: "), data_len);
}
else /* we found a suitable dissector */
{
@@ -859,7 +859,7 @@ dissect_ppi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (ppi_sensor_handle == NULL)
{
proto_tree_add_text(ppi_tree, tvb, offset, data_len,
- "%s (%u bytes)", val_to_str(data_type, (value_string *)&vs_ppi_field_type, "HARRIS: "), data_len);
+ "%s (%u bytes)", val_to_str_const(data_type, vs_ppi_field_type, "HARRIS: "), data_len);
}
else /* we found a suitable dissector */
{
@@ -872,7 +872,7 @@ dissect_ppi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (ppi_antenna_handle == NULL)
{
proto_tree_add_text(ppi_tree, tvb, offset, data_len,
- "%s (%u bytes)", val_to_str(data_type, (value_string *)&vs_ppi_field_type, "ANTENNA: "), data_len);
+ "%s (%u bytes)", val_to_str_const(data_type, vs_ppi_field_type, "ANTENNA: "), data_len);
}
else /* we found a suitable dissector */
{
@@ -885,7 +885,7 @@ dissect_ppi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
default:
if (tree)
proto_tree_add_text(ppi_tree, tvb, offset, data_len,
- "%s (%u bytes)", val_to_str(data_type, (value_string *)&vs_ppi_field_type, "Reserved"), data_len);
+ "%s (%u bytes)", val_to_str_const(data_type, vs_ppi_field_type, "Reserved"), data_len);
}
offset += data_len;
diff --git a/epan/dissectors/packet-pppoe.c b/epan/dissectors/packet-pppoe.c
index 7855820eef..6aae01ff22 100644
--- a/epan/dissectors/packet-pppoe.c
+++ b/epan/dissectors/packet-pppoe.c
@@ -308,7 +308,7 @@ const value_string datarate_scale_vals[] = {
#define CASE_VSPEC_DSLF_TAG_UINT(tag_name, relation, length, hf_var) case tag_name: \
if (!(poe_tag_length relation length)) { \
expert_add_info_format(pinfo, pppoe_tree, PI_MALFORMED, PI_WARN, "%s: Wrong length: %u (expected %s %d)", \
- val_to_str(poe_tag, vspec_tag_vals, "Unknown"), poe_tag_length, #relation, length); \
+ val_to_str_const(poe_tag, vspec_tag_vals, "Unknown"), poe_tag_length, #relation, length); \
} else { \
proto_tree_add_item(pppoe_tree, hf_var, tvb, \
tagstart+2, poe_tag_length, ENC_BIG_ENDIAN); \
@@ -318,7 +318,7 @@ const value_string datarate_scale_vals[] = {
#define CASE_VSPEC_DSLF_TAG_STRING(tag_name, relation, length, hf_var) case tag_name: \
if (!(poe_tag_length relation length)) { \
expert_add_info_format(pinfo, pppoe_tree, PI_MALFORMED, PI_WARN, "%s: Wrong length: %u (expected %s %d)", \
- val_to_str(poe_tag, vspec_tag_vals, "Unknown"), poe_tag_length, #relation, length); \
+ val_to_str_const(poe_tag, vspec_tag_vals, "Unknown"), poe_tag_length, #relation, length); \
} else { \
proto_tree_add_item(pppoe_tree, hf_var, tvb, \
tagstart+2, poe_tag_length, ENC_ASCII|ENC_NA); \
@@ -399,7 +399,7 @@ dissect_pppoe_subtags_dslf(tvbuff_t *tvb, packet_info *pinfo _U_, int offset, pr
if (poe_tag_length != 3) {
expert_add_info_format(pinfo, ti, PI_MALFORMED, PI_WARN,
"%s: Wrong length: %u (expected 3)",
- val_to_str(poe_tag, vspec_tag_vals, "Unknown"), poe_tag_length);
+ val_to_str_const(poe_tag, vspec_tag_vals, "Unknown"), poe_tag_length);
}
encaps_tree = proto_item_add_subtree(ti, ett_pppoed_tag_vspec_dslf_access_loop_encaps);
proto_tree_add_item(encaps_tree, hf_pppoed_tag_vspec_access_loop_encap_data_link,
@@ -710,7 +710,7 @@ static void dissect_pppoed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (check_col(pinfo->cinfo, COL_INFO))
{
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(pppoe_code, code_vals, "Unknown"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(pppoe_code, code_vals, "Unknown"));
}
/* Read length of payload */
@@ -1074,7 +1074,7 @@ static void dissect_pppoes(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(pppoe_code, code_vals, "Unknown"));
+ val_to_str_const(pppoe_code, code_vals, "Unknown"));
}
reported_payload_length = tvb_get_ntohs(tvb, 4);
diff --git a/epan/dissectors/packet-q2931.c b/epan/dissectors/packet-q2931.c
index 120f66e0a8..64527ad0f3 100644
--- a/epan/dissectors/packet-q2931.c
+++ b/epan/dissectors/packet-q2931.c
@@ -959,7 +959,7 @@ l2_done:
proto_tree_add_text(tree, tvb, offset, 3,
"Organization Code: 0x%06X (%s)",
organization_code,
- val_to_str(organization_code, oui_vals,
+ val_to_str_const(organization_code, oui_vals,
"Unknown"));
offset += 3;
len -= 3;
diff --git a/epan/dissectors/packet-q933.c b/epan/dissectors/packet-q933.c
index d1d751b8cf..8f7f4be89a 100644
--- a/epan/dissectors/packet-q933.c
+++ b/epan/dissectors/packet-q933.c
@@ -1180,7 +1180,7 @@ dissect_q933_pvc_status_ie(tvbuff_t *tvb, int offset, int len,
proto_tree_add_text(tree, tvb, offset, dlci_len, "DLCI: %u", dlci);
proto_tree_add_text(tree, tvb, offset+dlci_len, 1, "Status: %s",
- val_to_str(dlci_status, q933_pvc_status_vals, "Unknown"));
+ val_to_str_const(dlci_status, q933_pvc_status_vals, "Unknown"));
}
/*
diff --git a/epan/dissectors/packet-quake3.c b/epan/dissectors/packet-quake3.c
index 2b1349b6a3..ba9a06f267 100644
--- a/epan/dissectors/packet-quake3.c
+++ b/epan/dissectors/packet-quake3.c
@@ -256,7 +256,7 @@ dissect_quake3_ConnectionlessPacket(tvbuff_t *tvb, packet_info *pinfo _U_,
if (text_tree)
proto_tree_add_string(text_tree, hf_quake3_connectionless_command,
tvb, offset, command_len,
- val_to_str(command, names_command, "Unknown"));
+ val_to_str_const(command, names_command, "Unknown"));
command_finished = TRUE;
/* now we decode all the rest */
@@ -321,7 +321,7 @@ dissect_quake3_ConnectionlessPacket(tvbuff_t *tvb, packet_info *pinfo _U_,
if (text_tree && command_finished == FALSE) {
proto_tree_add_string(text_tree, hf_quake3_connectionless_command,
tvb, offset, command_len,
- val_to_str(command, names_command, "Unknown"));
+ val_to_str_const(command, names_command, "Unknown"));
}
offset += len + 1;
diff --git a/epan/dissectors/packet-radius.c b/epan/dissectors/packet-radius.c
index c51e870c6b..d16cccbf87 100644
--- a/epan/dissectors/packet-radius.c
+++ b/epan/dissectors/packet-radius.c
@@ -582,7 +582,7 @@ void radius_integer(radius_attr_info_t* a, proto_tree* tree, packet_info *pinfo
proto_tree_add_item(tree,a->hf,tvb, offset, len, ENC_BIG_ENDIAN);
if (a->vs) {
- proto_item_append_text(avp_item, "%s(%u)", val_to_str(uint, a->vs, "Unknown"),uint);
+ proto_item_append_text(avp_item, "%s(%u)", val_to_str_const(uint, a->vs, "Unknown"),uint);
} else {
proto_item_append_text(avp_item, "%u", uint);
}
@@ -618,7 +618,7 @@ void radius_signed(radius_attr_info_t* a, proto_tree* tree, packet_info *pinfo _
proto_tree_add_int(tree,a->hf,tvb,offset,len,uint);
if (a->vs) {
- proto_item_append_text(avp_item, "%s(%d)", val_to_str(uint, a->vs, "Unknown"),uint);
+ proto_item_append_text(avp_item, "%s(%d)", val_to_str_const(uint, a->vs, "Unknown"),uint);
} else {
proto_item_append_text(avp_item, "%d", uint);
}
@@ -1394,7 +1394,7 @@ dissect_radius(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (check_col(pinfo->cinfo, COL_INFO))
{
col_add_fstr(pinfo->cinfo,COL_INFO,"%s(%d) (id=%d, l=%d)",
- val_to_str_ext(rh.rh_code, &radius_pkt_type_codes_ext, "Unknown Packet"),
+ val_to_str_ext_const(rh.rh_code, &radius_pkt_type_codes_ext, "Unknown Packet"),
rh.rh_code, rh.rh_ident, rh.rh_pktlength);
}
diff --git a/epan/dissectors/packet-rdp.c b/epan/dissectors/packet-rdp.c
index de5932aa26..763303234e 100644
--- a/epan/dissectors/packet-rdp.c
+++ b/epan/dissectors/packet-rdp.c
@@ -1137,7 +1137,7 @@ dissect_rdp_shareDataHeader(tvbuff_t *tvb, int offset, packet_info *pinfo, proto
offset = dissect_rdp_fields(tvb, offset, pinfo, tree, share_fields);
if (pduType2 != PDUTYPE2_CONTROL)
- col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", val_to_str(pduType2, rdp_pduType2_vals, "Unknown"));
+ col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", val_to_str_const(pduType2, rdp_pduType2_vals, "Unknown"));
fields = NULL;
switch(pduType2) {
@@ -1202,7 +1202,7 @@ dissect_rdp_shareDataHeader(tvbuff_t *tvb, int offset, packet_info *pinfo, proto
}
if (pduType2 == PDUTYPE2_CONTROL)
- col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", val_to_str(action, rdp_action_vals, "Unknown"));
+ col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", val_to_str_const(action, rdp_action_vals, "Unknown"));
return offset;
}
@@ -1467,7 +1467,7 @@ dissect_rdp_SendData(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
offset = dissect_rdp_fields(tvb, offset, pinfo, next_tree, msg_fields);
- col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", val_to_str(bMsgType, rdp_bMsgType_vals, "Unknown"));
+ col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", val_to_str_const(bMsgType, rdp_bMsgType_vals, "Unknown"));
switch(bMsgType) {
case LICENSE_REQUEST:
@@ -1519,7 +1519,7 @@ dissect_rdp_SendData(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
pduType &= PDUTYPE_TYPE_MASK; /* mask out just the type */
if (pduType != PDUTYPE_DATAPDU)
- col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", val_to_str(pduType, rdp_pduTypeType_vals, "Unknown"));
+ col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", val_to_str_const(pduType, rdp_pduTypeType_vals, "Unknown"));
switch(pduType) {
case PDUTYPE_DEMANDACTIVEPDU:
@@ -1865,8 +1865,8 @@ dissect_rdp_ServerData(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
offset = dissect_rdp_fields(tvb, offset, pinfo, next_tree, ss_fields);
col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "Encryption: %s (%s)",
- val_to_str(encryptionMethod, rdp_encryptionMethod_vals, "Unknown"),
- val_to_str(encryptionLevel, rdp_encryptionLevel_vals, "Unknown"));
+ val_to_str_const(encryptionMethod, rdp_encryptionMethod_vals, "Unknown"),
+ val_to_str_const(encryptionLevel, rdp_encryptionLevel_vals, "Unknown"));
if ((encryptionLevel != 0) || (encryptionMethod != 0)) {
diff --git a/epan/dissectors/packet-rdt.c b/epan/dissectors/packet-rdt.c
index 8e469675b4..d2b283058b 100644
--- a/epan/dissectors/packet-rdt.c
+++ b/epan/dissectors/packet-rdt.c
@@ -330,7 +330,7 @@ static void dissect_rdt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
"",
"RDT packet (%s)",
packet_type < 0xff00 ? "Data" :
- val_to_str(packet_type, packet_type_vals, "Unknown"));
+ val_to_str_const(packet_type, packet_type_vals, "Unknown"));
rdt_packet_tree = proto_item_add_subtree(ti, ett_rdt_packet);
/* Dissect the details of the next packet in this frame */
diff --git a/epan/dissectors/packet-redbackli.c b/epan/dissectors/packet-redbackli.c
index aec77d5eca..ba56123281 100644
--- a/epan/dissectors/packet-redbackli.c
+++ b/epan/dissectors/packet-redbackli.c
@@ -75,7 +75,7 @@ redbackli_dissect_avp(guint8 avptype, guint8 avplen, tvbuff_t *tvb, gint offset,
const char *avpname;
proto_tree *ti, *st=NULL;
- avpname=val_to_str(avptype, avp_names, "Unknown");
+ avpname=val_to_str_const(avptype, avp_names, "Unknown");
ti = proto_tree_add_text(tree, tvb, offset, avplen+2, "%s AVP", avpname);
st = proto_item_add_subtree(ti, ett_redbackli);
diff --git a/epan/dissectors/packet-reload-framing.c b/epan/dissectors/packet-reload-framing.c
index 04a9c02140..5c27ba1b23 100644
--- a/epan/dissectors/packet-reload-framing.c
+++ b/epan/dissectors/packet-reload-framing.c
@@ -270,8 +270,8 @@ dissect_reload_framing_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
reload_framing_tree = proto_item_add_subtree(ti, ett_reload_framing);
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str(type, types, "Unknown"));
- proto_item_append_text(ti, ": %s", val_to_str(type, types, "Unknown"));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str_const(type, types, "Unknown"));
+ proto_item_append_text(ti, ": %s", val_to_str_const(type, types, "Unknown"));
/* Retransmission control */
if (type == DATA) {
diff --git a/epan/dissectors/packet-reload.c b/epan/dissectors/packet-reload.c
index f0a389b3b8..b42027dd19 100644
--- a/epan/dissectors/packet-reload.c
+++ b/epan/dissectors/packet-reload.c
@@ -1283,7 +1283,7 @@ dissect_destination(int anchor, tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
proto_item_append_text(ti_destination, " (Destination)");
}
destination_tree = proto_item_add_subtree(ti_destination, ett_reload_destination);
- proto_item_append_text(ti_destination, ": %s", val_to_str(destination_type, destinationtypes, "Unknown"));
+ proto_item_append_text(ti_destination, ": %s", val_to_str_const(destination_type, destinationtypes, "Unknown"));
proto_tree_add_item(destination_tree, hf_reload_destination_type, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_uint(destination_tree, hf_reload_length_uint8, tvb, offset+1, 1, destination_length);
@@ -1405,7 +1405,7 @@ dissect_ipaddressport(int anchor, tvbuff_t *tvb, proto_tree *tree, guint16 offse
ti_ipaddressport = proto_tree_add_item(tree, hf, tvb, offset, ipaddressport_length+2, ENC_NA);
if (hf == anchor) proto_item_append_text(ti_ipaddressport, " (IpAddressPort)");
ipaddressport_type = tvb_get_guint8(tvb, offset);
- proto_item_append_text(ti_ipaddressport, ": %s", val_to_str(ipaddressport_type, ipaddressporttypes,"Unknown Type"));
+ proto_item_append_text(ti_ipaddressport, ": %s", val_to_str_const(ipaddressport_type, ipaddressporttypes,"Unknown Type"));
if (ipaddressport_type == IPADDRESSPORTTYPE_IPV4) {
proto_item_append_text(ti_ipaddressport, " (%s:%d)", tvb_ip_to_str(tvb, offset+2),tvb_get_ntohs(tvb,offset+2+4));
}
@@ -1535,7 +1535,7 @@ dissect_icecandidates(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint
icecandidate_offset += 4;
proto_tree_add_item(icecandidate_tree, hf_reload_icecandidate_type, tvb,
offset+local_offset+icecandidates_offset+icecandidate_offset, 1, ENC_BIG_ENDIAN);
- proto_item_append_text(ti_icecandidate, ": %s, priority=%d", val_to_str(candtype, candtypes, "Unknown"), priority);
+ proto_item_append_text(ti_icecandidate, ": %s, priority=%d", val_to_str_const(candtype, candtypes, "Unknown"), priority);
}
icecandidate_offset += 1;
{
@@ -2884,7 +2884,7 @@ static int dissect_forwardingoption(tvbuff_t *tvb, packet_info *pinfo, proto_tre
proto_tree *option_tree;
ti_option = proto_tree_add_item(tree, hf_reload_forwarding_option, tvb, offset+local_offset, option_length + 4, ENC_NA);
- proto_item_append_text(ti_option, " type=%s, flags=%02x, length=%d", val_to_str(option_type, forwardingoptiontypes, "Unknown"), option_flags, option_length);
+ proto_item_append_text(ti_option, " type=%s, flags=%02x, length=%d", val_to_str_const(option_type, forwardingoptiontypes, "Unknown"), option_flags, option_length);
option_tree = proto_item_add_subtree(ti_option, ett_reload_forwarding_option);
proto_tree_add_item(option_tree, hf_reload_forwarding_option_type, tvb, offset+local_offset, 1, ENC_BIG_ENDIAN);
@@ -3150,8 +3150,8 @@ static int dissect_diagnosticinfo(tvbuff_t *tvb, proto_tree *tree, guint16 offse
offset+local_offset+messages_offset, 2,
message_code,
"%s_%s",
- val_to_str(MSGCODE_TO_METHOD(message_code), methods_short, "Unknown"),
- val_to_str(MSGCODE_TO_CLASS(message_code), classes_short, "Unknown"));
+ val_to_str_const(MSGCODE_TO_METHOD(message_code), methods_short, "Unknown"),
+ val_to_str_const(MSGCODE_TO_CLASS(message_code), classes_short, "Unknown"));
}
proto_tree_add_item(sent_rcvd_tree, hf_reload_diagnosticinfo_messages_sent,
tvb, offset+local_offset+messages_offset+2, 8, ENC_BIG_ENDIAN);
@@ -3754,8 +3754,8 @@ extern gint dissect_reload_messagecontents(tvbuff_t *tvb, packet_info *pinfo, pr
else {
proto_item_append_text(ti_message_body,
" (%s%s<%d>)",
- val_to_str(MSGCODE_TO_METHOD(message_code),methods,"opaque"),
- val_to_str(MSGCODE_TO_CLASS(message_code), classes_Short, ""),
+ val_to_str_const(MSGCODE_TO_METHOD(message_code),methods,"opaque"),
+ val_to_str_const(MSGCODE_TO_CLASS(message_code), classes_Short, ""),
message_body_length);
}
@@ -3791,7 +3791,7 @@ extern gint dissect_reload_messagecontents(tvbuff_t *tvb, packet_info *pinfo, pr
tvb, offset, 2 + 2 + error_length, ENC_NA);
error_tree = proto_item_add_subtree(ti_error, ett_reload_error_response);
proto_tree_add_item(error_tree, hf_reload_error_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
- proto_item_append_text(ti_error, ": %s", val_to_str(error_code, errorcodes, "Unknown"));
+ proto_item_append_text(ti_error, ": %s", val_to_str_const(error_code, errorcodes, "Unknown"));
switch(error_code) {
case ERRORCODE_GENERATIONCOUNTERTOOLOW:
{
@@ -4235,8 +4235,8 @@ dissect_reload_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (message_code == RELOAD_ERROR) {
error_code = tvb_get_ntohs(tvb, forwarding_length + 2+4);
msg_class_str = "Error Response";
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s", msg_class_str, val_to_str(error_code, errorcodes, "Unknown"));
- proto_item_append_text(ti, ": %s %s", msg_class_str, val_to_str(error_code, errorcodes, "Unknown"));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s", msg_class_str, val_to_str_const(error_code, errorcodes, "Unknown"));
+ proto_item_append_text(ti, ": %s %s", msg_class_str, val_to_str_const(error_code, errorcodes, "Unknown"));
}
else {
msg_class_str = val_to_str(MSGCODE_TO_CLASS(message_code), classes, "Unknown %d");
diff --git a/epan/dissectors/packet-rip.c b/epan/dissectors/packet-rip.c
index b67a7f6bb0..0897b236e3 100644
--- a/epan/dissectors/packet-rip.c
+++ b/epan/dissectors/packet-rip.c
@@ -126,7 +126,7 @@ dissect_rip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (check_col(pinfo->cinfo, COL_PROTOCOL))
col_add_str(pinfo->cinfo, COL_PROTOCOL,
- val_to_str(version, version_vals, "RIP"));
+ val_to_str_const(version, version_vals, "RIP"));
if (check_col(pinfo->cinfo, COL_INFO))
col_add_str(pinfo->cinfo, COL_INFO,
val_to_str(command, command_vals, "Unknown command (%u)"));
diff --git a/epan/dissectors/packet-rlogin.c b/epan/dissectors/packet-rlogin.c
index 71a43cfc9b..91f55686cb 100644
--- a/epan/dissectors/packet-rlogin.c
+++ b/epan/dissectors/packet-rlogin.c
@@ -230,7 +230,7 @@ static void rlogin_display(rlogin_hash_entry_t *hash_info,
if (check_col(pinfo->cinfo, COL_INFO))
{
col_append_fstr(pinfo->cinfo, COL_INFO,
- " (%s)", val_to_str(control_byte, control_message_vals, "Unknown"));
+ " (%s)", val_to_str_const(control_byte, control_message_vals, "Unknown"));
}
offset = urgent_offset + 1; /* adjust offset */
diff --git a/epan/dissectors/packet-rmi.c b/epan/dissectors/packet-rmi.c
index eadb261c77..4e6500c351 100644
--- a/epan/dissectors/packet-rmi.c
+++ b/epan/dissectors/packet-rmi.c
@@ -144,24 +144,24 @@ dissect_rmi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto = tvb_get_guint8(tvb, 6);
col_append_str(pinfo->cinfo, COL_INFO,
- val_to_str(proto, rmi_protocol_str,
- "Unknown protocol"));
+ val_to_str_const(proto, rmi_protocol_str,
+ "Unknown protocol"));
break;
case RMI_OUTPUTMESSAGE:
message = tvb_get_guint8(tvb,0);
col_set_str(pinfo->cinfo, COL_INFO,
"JRMI, ");
col_append_str(pinfo->cinfo, COL_INFO,
- val_to_str(message, rmi_output_message_str,
- "Unknown message"));
+ val_to_str_const(message, rmi_output_message_str,
+ "Unknown message"));
break;
case RMI_INPUTSTREAM:
message = tvb_get_guint8(tvb,0);
col_set_str(pinfo->cinfo, COL_INFO,
"JRMI, ");
col_append_str(pinfo->cinfo, COL_INFO,
- val_to_str(message, rmi_input_message_str,
- "Unknown message"));
+ val_to_str_const(message, rmi_input_message_str,
+ "Unknown message"));
break;
case SERIALIZATION_DATA:
version = tvb_get_ntohs(tvb,2);
diff --git a/epan/dissectors/packet-rmp.c b/epan/dissectors/packet-rmp.c
index 3bd1f033e8..897d6a72e3 100644
--- a/epan/dissectors/packet-rmp.c
+++ b/epan/dissectors/packet-rmp.c
@@ -114,7 +114,7 @@ dissect_rmp(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, rmp_type_vals, "Unknown Type"));
+ val_to_str_const(type, rmp_type_vals, "Unknown Type"));
}
if (tree) {
diff --git a/epan/dissectors/packet-rohc.c b/epan/dissectors/packet-rohc.c
index bc6cfff91e..d74a8bc4fe 100644
--- a/epan/dissectors/packet-rohc.c
+++ b/epan/dissectors/packet-rohc.c
@@ -1581,15 +1581,15 @@ dissect_rohc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
conf_item = proto_tree_add_uint(conf_tree, hf_rohc_ir_previous_frame, tvb, 0, 0, rohc_cid_context->prev_ir_frame_number);
PROTO_ITEM_SET_GENERATED(conf_item);
}
- conf_item = proto_tree_add_text(conf_tree, tvb, offset, 0, "Profile:(%s)", val_to_str(rohc_cid_context->profile, rohc_profile_vals, "Unknown"));
+ conf_item = proto_tree_add_text(conf_tree, tvb, offset, 0, "Profile:(%s)", val_to_str_const(rohc_cid_context->profile, rohc_profile_vals, "Unknown"));
PROTO_ITEM_SET_GENERATED(conf_item);
- conf_item = proto_tree_add_text(conf_tree, tvb, offset, 0, "IP version:(%s)", val_to_str(rohc_cid_context->rohc_ip_version, rohc_ip_version_vals, "Unknown"));
+ conf_item = proto_tree_add_text(conf_tree, tvb, offset, 0, "IP version:(%s)", val_to_str_const(rohc_cid_context->rohc_ip_version, rohc_ip_version_vals, "Unknown"));
PROTO_ITEM_SET_GENERATED(conf_item);
if(rohc_cid_context->mode == 0){
conf_item = proto_tree_add_text(conf_tree, tvb, offset, 0, "Mode not known");
PROTO_ITEM_SET_GENERATED(conf_item);
}else{
- conf_item = proto_tree_add_text(conf_tree, tvb, offset, 0, "Mode:(%s)", val_to_str(rohc_cid_context->mode, rohc_mode_vals, "Unknown"));
+ conf_item = proto_tree_add_text(conf_tree, tvb, offset, 0, "Mode:(%s)", val_to_str_const(rohc_cid_context->mode, rohc_mode_vals, "Unknown"));
PROTO_ITEM_SET_GENERATED(conf_item);
}
@@ -1612,7 +1612,7 @@ dissect_rohc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
rohc_cid_context->ir_frame_number = pinfo->fd->num;
#endif
#if 0
-/* "Profile:(%s)", val_to_str(p_rohc_info->profile, rohc_profile_vals, "Unknown")); */
+/* "Profile:(%s)", val_to_str_const(p_rohc_info->profile, rohc_profile_vals, "Unknown")); */
if(p_rohc_info->large_cid_present == FALSE){
item = proto_tree_add_text(rohc_tree, tvb, offset, -1, "Small CID configured");
PROTO_ITEM_SET_GENERATED(item);
diff --git a/epan/dissectors/packet-rpcap.c b/epan/dissectors/packet-rpcap.c
index 9a9e7c48f0..ef58fbabaf 100644
--- a/epan/dissectors/packet-rpcap.c
+++ b/epan/dissectors/packet-rpcap.c
@@ -562,7 +562,7 @@ dissect_rpcap_filterbpf_insn (tvbuff_t *tvb, packet_info *pinfo _U_,
code_tree = proto_item_add_subtree (code_ti, ett_filterbpf_insn_code);
proto_tree_add_item (code_tree, hf_code_class, tvb, offset, 2, ENC_BIG_ENDIAN);
class = tvb_get_guint8 (tvb, offset + 1) & 0x07;
- proto_item_append_text (ti, ": %s", val_to_str (class, bpf_class, ""));
+ proto_item_append_text (ti, ": %s", val_to_str_const (class, bpf_class, ""));
switch (class) {
case 0x00: /* ld */
case 0x01: /* ldx */
diff --git a/epan/dissectors/packet-rpl.c b/epan/dissectors/packet-rpl.c
index 022a0bd615..ef7b99d63c 100644
--- a/epan/dissectors/packet-rpl.c
+++ b/epan/dissectors/packet-rpl.c
@@ -110,7 +110,7 @@ dissect_rpl_container(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
type = tvb_get_ntohs(tvb, 2);
proto_tree_add_text(tree, tvb, 2, 2, "Type: %s",
- val_to_str(type, rpl_type_vals, "Unknown Type"));
+ val_to_str_const(type, rpl_type_vals, "Unknown Type"));
offset = 4;
switch (type) {
@@ -138,8 +138,10 @@ dissect_rpl_container(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(subtyp == 0xc005) ett_type = ett_rpl_c005;
if(subtyp == 0xc014) ett_type = ett_rpl_c014;
ti = proto_tree_add_text(tree, tvb,
- offset, sublen, "%s", val_to_str(subtyp,
- rpl_type_vals, "Unknown Type"));
+ offset, sublen, "%s",
+ val_to_str_const(subtyp,
+ rpl_type_vals,
+ "Unknown Type"));
rpl_container_tree = proto_item_add_subtree(ti,
ett_type);
length = tvb_length_remaining(tvb, offset);
diff --git a/epan/dissectors/packet-rtnet.c b/epan/dissectors/packet-rtnet.c
index bdc9da19f5..8ec9f3dca9 100644
--- a/epan/dissectors/packet-rtnet.c
+++ b/epan/dissectors/packet-rtnet.c
@@ -607,7 +607,7 @@ dissect_rtmac(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
}
} else {
if (!(flags & RTMAC_FLAG_TUNNEL))
- type_str = val_to_str(type, rtmac_type_vals, "Unknown");
+ type_str = val_to_str_const(type, rtmac_type_vals, "Unknown");
else {
if (dissector != data_handle)
type_str = dissector_handle_get_short_name(dissector);
diff --git a/epan/dissectors/packet-rtp.c b/epan/dissectors/packet-rtp.c
index a1c9f7244a..6ab66a1c31 100644
--- a/epan/dissectors/packet-rtp.c
+++ b/epan/dissectors/packet-rtp.c
@@ -1097,7 +1097,7 @@ dissect_rtp_rfc2198(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(rfc2198_hdr_tree, hf_rtp_rfc2198_follow, tvb, offset, 1, ENC_BIG_ENDIAN );
proto_tree_add_uint_format(rfc2198_hdr_tree, hf_rtp_payload_type, tvb,
offset, 1, octet1, "Payload type: %s (%u)",
- payload_type_str ? payload_type_str : val_to_str_ext(hdr_new->pt, &rtp_payload_type_vals_ext, "Unknown"),
+ payload_type_str ? payload_type_str : val_to_str_ext_const(hdr_new->pt, &rtp_payload_type_vals_ext, "Unknown"),
hdr_new->pt);
proto_item_append_text(ti, ": PT=%s",
payload_type_str ? payload_type_str :
@@ -1465,7 +1465,7 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
proto_tree_add_uint_format( rtp_tree, hf_rtp_payload_type, tvb,
offset, 1, octet2, "Payload type: %s (%u)",
- payload_type_str ? payload_type_str : val_to_str_ext( payload_type, &rtp_payload_type_vals_ext,"Unknown"),
+ payload_type_str ? payload_type_str : val_to_str_ext_const( payload_type, &rtp_payload_type_vals_ext,"Unknown"),
payload_type);
offset++;
diff --git a/epan/dissectors/packet-sbus.c b/epan/dissectors/packet-sbus.c
index 891503f757..593fbbfffb 100644
--- a/epan/dissectors/packet-sbus.c
+++ b/epan/dissectors/packet-sbus.c
@@ -761,15 +761,15 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
sbus_web_seq = tvb_get_guint8(tvb,13);
col_add_fstr(pinfo->cinfo, COL_INFO,
"Web Server Request: %s (Seq No: %d)",
- val_to_str(sbus_web_aid,
- webserver_aid_vals, "Unknown Request!"),
+ val_to_str_const(sbus_web_aid,
+ webserver_aid_vals, "Unknown Request!"),
sbus_web_seq);
break;
case SBUS_RD_WR_PCD_BLOCK:
sbus_rdwr_type = tvb_get_guint8(tvb, 12);
col_add_fstr( pinfo->cinfo, COL_INFO,
- "Request: %s", val_to_str( sbus_rdwr_type, rdwrblock_vals,
- "This RD/WR block telegram is not implemented"));
+ "Request: %s", val_to_str_const( sbus_rdwr_type, rdwrblock_vals,
+ "This RD/WR block telegram is not implemented"));
/* Add name of file to be written in case of start of file stream */
if (sbus_rdwr_type == SBUS_WR_START_OF_STREAM) {
sbus_rdwr_block_type = tvb_get_guint8(tvb, 14);
@@ -813,8 +813,8 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
default:
/* All other requests */
col_add_fstr(pinfo->cinfo, COL_INFO,
- "Request: %s", val_to_str(sbus_cmd_code,
- sbus_command_vals, "Unknown Command!"));
+ "Request: %s", val_to_str_const(sbus_cmd_code,
+ sbus_command_vals, "Unknown Command!"));
break;
}
/*mark retries*/
@@ -832,8 +832,8 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
sbus_web_aid = tvb_get_guint8(tvb,10);
col_add_fstr(pinfo->cinfo, COL_INFO,
"Response: %s",
- val_to_str(sbus_web_aid,
- webserver_aid_vals, "Unknown Request!"));
+ val_to_str_const(sbus_web_aid,
+ webserver_aid_vals, "Unknown Request!"));
if (sbus_web_size > 1) {
sbus_web_seq = tvb_get_guint8(tvb,11);
col_append_fstr(pinfo->cinfo, COL_INFO,
@@ -852,8 +852,8 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case SBUS_RD_ABORT_BLOCK_STREAM:
sbus_rdwr_ack_nak = tvb_get_guint8(tvb, 10);
col_add_fstr( pinfo->cinfo, COL_INFO,
- "Response: %s", val_to_str(sbus_rdwr_ack_nak,
- rdwrblock_sts, "Unknown response!"));
+ "Response: %s", val_to_str_const(sbus_rdwr_ack_nak,
+ rdwrblock_sts, "Unknown response!"));
break;
default:
sbus_rdwr_type = tvb_get_guint8(tvb, 9);
@@ -870,9 +870,9 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case SBUS_ACKNAK:
sbus_ack_code = tvb_get_ntohs(tvb,9);
col_add_fstr(pinfo->cinfo, COL_INFO,
- "%s", val_to_str(sbus_ack_code,
- sbus_ack_nak_vals,
- "Unknown NAK response code!"));
+ "%s", val_to_str_const(sbus_ack_code,
+ sbus_ack_nak_vals,
+ "Unknown NAK response code!"));
break;
default:
diff --git a/epan/dissectors/packet-sccpmg.c b/epan/dissectors/packet-sccpmg.c
index cce9a25259..6f7eda753e 100644
--- a/epan/dissectors/packet-sccpmg.c
+++ b/epan/dissectors/packet-sccpmg.c
@@ -211,7 +211,7 @@ dissect_sccpmg_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccpmg_tre
/* Extract the message type; all other processing is based on this */
message_type = tvb_get_guint8(tvb, SCCPMG_MESSAGE_TYPE_OFFSET);
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(message_type, sccpmg_message_type_acro_values, "Unknown"));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_type, sccpmg_message_type_acro_values, "Unknown"));
if (sccpmg_tree) {
/* add the message type to the protocol tree */
diff --git a/epan/dissectors/packet-scop.c b/epan/dissectors/packet-scop.c
index d18b4e263c..d661bb8e0c 100644
--- a/epan/dissectors/packet-scop.c
+++ b/epan/dissectors/packet-scop.c
@@ -281,8 +281,8 @@ dissect_scop_zip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Display the Packet type*/
proto_tree_add_uint(tree, hf_scop_type, tvb, offset, 1, type);
- proto_item_append_text(tree, ", %s", val_to_str(type, scop_types, "Reserved Type"));
- col_add_str(pinfo->cinfo, COL_INFO, val_to_str(type, scop_types, "Reserved Type"));
+ proto_item_append_text(tree, ", %s", val_to_str_const(type, scop_types, "Reserved Type"));
+ col_add_str(pinfo->cinfo, COL_INFO, val_to_str_const(type, scop_types, "Reserved Type"));
offset += 2;
if (type == SCOP_CMD_HELLO_RESP) {
diff --git a/epan/dissectors/packet-scsi-osd.c b/epan/dissectors/packet-scsi-osd.c
index f5978682e2..3c4c5c1773 100644
--- a/epan/dissectors/packet-scsi-osd.c
+++ b/epan/dissectors/packet-scsi-osd.c
@@ -2634,7 +2634,7 @@ dissect_osd_opcode(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if(check_col(pinfo->cinfo, COL_INFO)){
col_append_str(pinfo->cinfo, COL_INFO,
- val_to_str(svcaction, scsi_osd_svcaction_vals, "Unknown OSD Serviceaction"));
+ val_to_str_const(svcaction, scsi_osd_svcaction_vals, "Unknown OSD Serviceaction"));
}
dissector=find_svcaction_dissector(svcaction);
if(dissector){
@@ -2652,7 +2652,7 @@ dissect_osd_opcode(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
if(check_col(pinfo->cinfo, COL_INFO)){
col_append_str(pinfo->cinfo, COL_INFO,
- val_to_str(svcaction, scsi_osd_svcaction_vals, "Unknown OSD Serviceaction"));
+ val_to_str_const(svcaction, scsi_osd_svcaction_vals, "Unknown OSD Serviceaction"));
}
if(svcaction){
proto_item *it;
diff --git a/epan/dissectors/packet-sctp.c b/epan/dissectors/packet-sctp.c
index da83aa75c0..3ce5392d5f 100644
--- a/epan/dissectors/packet-sctp.c
+++ b/epan/dissectors/packet-sctp.c
@@ -1268,7 +1268,7 @@ dissect_supported_extensions_parameter(tvbuff_t *parameter_tvb, proto_tree *para
number_of_types = (tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH) / CHUNK_TYPE_LENGTH;
for(type_number = 1, offset = PARAMETER_VALUE_OFFSET; type_number <= number_of_types; type_number++, offset += CHUNK_TYPE_LENGTH) {
proto_tree_add_item(parameter_tree, hf_supported_chunk_type, parameter_tvb, offset, CHUNK_TYPE_LENGTH, ENC_BIG_ENDIAN);
- proto_item_append_text(parameter_item, "%s", val_to_str(tvb_get_guint8(parameter_tvb, offset), chunk_type_values, "Unknown"));
+ proto_item_append_text(parameter_item, "%s", val_to_str_const(tvb_get_guint8(parameter_tvb, offset), chunk_type_values, "Unknown"));
if (type_number < number_of_types)
proto_item_append_text(parameter_item, ", ");
@@ -1471,7 +1471,7 @@ dissect_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *chunk
return;
if (chunk_tree) {
- parameter_item = proto_tree_add_text(chunk_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_reported_length(parameter_tvb), "%s parameter", val_to_str(type, parameter_identifier_values, "Unknown"));
+ parameter_item = proto_tree_add_text(chunk_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_reported_length(parameter_tvb), "%s parameter", val_to_str_const(type, parameter_identifier_values, "Unknown"));
parameter_tree = proto_item_add_subtree(parameter_item, ett_sctp_chunk_parameter);
type_item = proto_tree_add_item(parameter_tree, hf_parameter_type, parameter_tvb, PARAMETER_TYPE_OFFSET, PARAMETER_TYPE_LENGTH, ENC_BIG_ENDIAN);
@@ -1702,7 +1702,7 @@ dissect_unrecognized_chunk_type_cause(tvbuff_t *cause_tvb, packet_info *pinfo,
MIN(chunk_length, tvb_reported_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)));
dissect_sctp_chunk(unrecognized_chunk_tvb, pinfo, cause_tree,cause_tree, NULL, FALSE);
unrecognized_type = tvb_get_guint8(unrecognized_chunk_tvb, CHUNK_TYPE_OFFSET);
- proto_item_append_text(cause_item, " (Type: %u (%s))", unrecognized_type, val_to_str(unrecognized_type, chunk_type_values, "unknown"));
+ proto_item_append_text(cause_item, " (Type: %u (%s))", unrecognized_type, val_to_str_const(unrecognized_type, chunk_type_values, "unknown"));
}
static void
@@ -1901,7 +1901,7 @@ dissect_error_cause(tvbuff_t *cause_tvb, packet_info *pinfo, proto_tree *chunk_t
length = tvb_get_ntohs(cause_tvb, CAUSE_LENGTH_OFFSET);
padding_length = tvb_reported_length(cause_tvb) - length;
- cause_item = proto_tree_add_text(chunk_tree, cause_tvb, CAUSE_HEADER_OFFSET, tvb_reported_length(cause_tvb), "%s cause", val_to_str(code, cause_code_values, "Unknown"));
+ cause_item = proto_tree_add_text(chunk_tree, cause_tvb, CAUSE_HEADER_OFFSET, tvb_reported_length(cause_tvb), "%s cause", val_to_str_const(code, cause_code_values, "Unknown"));
cause_tree = proto_item_add_subtree(cause_item, ett_sctp_chunk_cause);
proto_tree_add_item(cause_tree, hf_cause_code, cause_tvb, CAUSE_CODE_OFFSET, CAUSE_CODE_LENGTH, ENC_BIG_ENDIAN);
@@ -3687,11 +3687,11 @@ dissect_sctp_chunk(tvbuff_t *chunk_tvb,
padding_length = reported_length - length;
if (useinfo)
- col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(type, chunk_type_values, "RESERVED"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(type, chunk_type_values, "RESERVED"));
if (tree) {
/* create proto_tree stuff */
- chunk_item = proto_tree_add_text(sctp_tree, chunk_tvb, CHUNK_HEADER_OFFSET, reported_length, "%s chunk", val_to_str(type, chunk_type_values, "RESERVED"));
+ chunk_item = proto_tree_add_text(sctp_tree, chunk_tvb, CHUNK_HEADER_OFFSET, reported_length, "%s chunk", val_to_str_const(type, chunk_type_values, "RESERVED"));
chunk_tree = proto_item_add_subtree(chunk_item, ett_sctp_chunk);
/* then insert the chunk header components into the protocol tree */
diff --git a/epan/dissectors/packet-sflow.c b/epan/dissectors/packet-sflow.c
index d366336239..f7bb9090a7 100644
--- a/epan/dissectors/packet-sflow.c
+++ b/epan/dissectors/packet-sflow.c
@@ -1059,7 +1059,7 @@ dissect_sflow_245_extended_gateway(tvbuff_t *tvb, proto_tree *tree, gint offset)
len += 4;
kludge = 8;
ti = proto_tree_add_text(tree, tvb, offset + len - kludge, kludge,
- "%s, (%u entries)", val_to_str(path_type, sflow_245_as_types, "Unknown AS type"), dst_seg_len);
+ "%s, (%u entries)", val_to_str_const(path_type, sflow_245_as_types, "Unknown AS type"), dst_seg_len);
sflow_245_dst_as_seg_tree = proto_item_add_subtree(ti, ett_sflow_245_gw_as_dst_seg);
}
@@ -1188,7 +1188,7 @@ dissect_sflow_5_ipv4(tvbuff_t *tvb, proto_tree *tree, gint offset) {
/* 7 bits for type of service, plus 1 reserved bit */
tos = tvb_get_guint8(tvb, offset);
proto_tree_add_text(tree, tvb, offset, 1, "%s",
- val_to_str(tos >> 5, sflow_245_ipv4_precedence_types, "Unknown precedence type"));
+ val_to_str_const(tos >> 5, sflow_245_ipv4_precedence_types, "Unknown precedence type"));
(tos & 0x10) >> 4 ?
proto_tree_add_text(tree, tvb, offset, 1, "Delay: ...1... (Low)") :
proto_tree_add_text(tree, tvb, offset, 1, "Delay: ...0... (Normal)");
@@ -1592,7 +1592,7 @@ dissect_sflow_5_extended_80211_rx(tvbuff_t *tvb, proto_tree *tree, gint offset)
version = tvb_get_ntohl(tvb, offset);
proto_tree_add_text(tree, tvb, offset, 4, "Version: %s",
- val_to_str(version, sflow_5_ieee80211_versions, "Unknown"));
+ val_to_str_const(version, sflow_5_ieee80211_versions, "Unknown"));
offset += 4;
channel = tvb_get_ntohl(tvb, offset);
@@ -1648,7 +1648,7 @@ dissect_sflow_5_extended_80211_tx(tvbuff_t *tvb, proto_tree *tree, gint offset)
version = tvb_get_ntohl(tvb, offset);
proto_tree_add_text(tree, tvb, offset, 4, "Version: %s",
- val_to_str(version, sflow_5_ieee80211_versions, "Unknown"));
+ val_to_str_const(version, sflow_5_ieee80211_versions, "Unknown"));
offset += 4;
transmissions = tvb_get_ntohl(tvb, offset);
@@ -1769,7 +1769,7 @@ dissect_sflow_24_flow_sample(tvbuff_t *tvb, packet_info *pinfo,
* the end, so more info can be correct.
*/
ti = proto_tree_add_text(tree, tvb, offset, -1, "%s",
- val_to_str(ext_type, sflow_245_extended_data_types, "Unknown extended information"));
+ val_to_str_const(ext_type, sflow_245_extended_data_types, "Unknown extended information"));
extended_data_tree = proto_item_add_subtree(ti, ett_sflow_245_extended_data);
proto_tree_add_uint(extended_data_tree, hf_sflow_245_extended_information_type, tvb, offset, 4, ext_type);
offset += 4;
@@ -1813,7 +1813,7 @@ dissect_sflow_5_flow_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* only accept default enterprise 0 (InMon sFlow) */
if (enterprise == ENTERPRISE_DEFAULT) {
ti = proto_tree_add_text(tree, tvb, offset, -1, "%s",
- val_to_str(format, sflow_5_flow_record_type, "Unknown sample format"));
+ val_to_str_const(format, sflow_5_flow_record_type, "Unknown sample format"));
flow_data_tree = proto_item_add_subtree(ti, ett_sflow_5_flow_record);
proto_tree_add_text(flow_data_tree, tvb, offset, 4, "Enterprise: standard sFlow (%u)", enterprise);
@@ -2212,7 +2212,7 @@ dissect_sflow_5_counters_record(tvbuff_t *tvb, proto_tree *tree, gint offset) {
if (enterprise == ENTERPRISE_DEFAULT) { /* only accept default enterprise 0 (InMon sFlow) */
ti = proto_tree_add_text(tree, tvb, offset, -1, "%s",
- val_to_str(format, sflow_5_counters_record_type, "Unknown sample format"));
+ val_to_str_const(format, sflow_5_counters_record_type, "Unknown sample format"));
counter_data_tree = proto_item_add_subtree(ti, ett_sflow_5_counters_record);
proto_tree_add_text(counter_data_tree, tvb, offset, 4, "Enterprise: standard sFlow (%u)", enterprise);
@@ -2414,7 +2414,7 @@ dissect_sflow_24_counters_sample(tvbuff_t *tvb, proto_tree *tree, gint offset, p
"Sampling Interval: %u",
g_ntohl(counters_header.sampling_interval));
proto_tree_add_text(tree, tvb, offset + 12, 4, "Counters type: %s",
- val_to_str(g_ntohl(counters_header.counters_type),
+ val_to_str_const(g_ntohl(counters_header.counters_type),
sflow_245_counterstype, "Unknown type"));
offset += sizeof (counters_header);
@@ -2591,7 +2591,7 @@ dissect_sflow_245_samples(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g
if (enterprise == ENTERPRISE_DEFAULT) { /* only accept default enterprise 0 (InMon sFlow) */
ti = proto_tree_add_text(tree, tvb, offset, -1, "%s",
- val_to_str(format, sflow_245_sampletype, "Unknown sample format"));
+ val_to_str_const(format, sflow_245_sampletype, "Unknown sample format"));
sflow_245_sample_tree = proto_item_add_subtree(ti, ett_sflow_245_sample);
proto_tree_add_text(sflow_245_sample_tree, tvb, offset, 4, "Enterprise: standard sFlow (%u)", enterprise);
@@ -2630,7 +2630,7 @@ dissect_sflow_245_samples(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g
} else { /* version 2 or 4 */
ti = proto_tree_add_text(tree, tvb, offset, -1, "%s",
- val_to_str(sample_type, sflow_245_sampletype, "Unknown sample type"));
+ val_to_str_const(sample_type, sflow_245_sampletype, "Unknown sample type"));
sflow_245_sample_tree = proto_item_add_subtree(ti, ett_sflow_245_sample);
proto_tree_add_item(sflow_245_sample_tree, hf_sflow_245_sampletype, tvb, offset, 4, ENC_BIG_ENDIAN);
diff --git a/epan/dissectors/packet-sigcomp.c b/epan/dissectors/packet-sigcomp.c
index 64ecc7f608..4975ea2b72 100644
--- a/epan/dissectors/packet-sigcomp.c
+++ b/epan/dissectors/packet-sigcomp.c
@@ -833,8 +833,8 @@ dissect_sigcomp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sigcomp_tr
/* Add expert item for NACK */
expert_add_info_format(pinfo, reason_ti, PI_SEQUENCE, PI_WARN,
"SigComp NACK (reason=%s, opcode=%s)",
- val_to_str(octet, sigcomp_nack_reason_code_vals, "Unknown"),
- val_to_str(opcode, udvm_instruction_code_vals, "Unknown"));
+ val_to_str_const(octet, sigcomp_nack_reason_code_vals, "Unknown"),
+ val_to_str_const(opcode, udvm_instruction_code_vals, "Unknown"));
proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_pc, tvb, offset, 2, ENC_BIG_ENDIAN);
offset = offset +2;
@@ -843,8 +843,8 @@ dissect_sigcomp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sigcomp_tr
/* Add NACK info to info column */
col_append_fstr(pinfo->cinfo, COL_INFO, " NACK reason=%s, opcode=%s",
- val_to_str(octet, sigcomp_nack_reason_code_vals, "Unknown"),
- val_to_str(opcode, udvm_instruction_code_vals, "Unknown"));
+ val_to_str_const(octet, sigcomp_nack_reason_code_vals, "Unknown"),
+ val_to_str_const(opcode, udvm_instruction_code_vals, "Unknown"));
switch ( octet){
case SIGCOMP_NACK_STATE_NOT_FOUND:
diff --git a/epan/dissectors/packet-simulcrypt.c b/epan/dissectors/packet-simulcrypt.c
index eb73d67fb0..9679b95ea8 100644
--- a/epan/dissectors/packet-simulcrypt.c
+++ b/epan/dissectors/packet-simulcrypt.c
@@ -1243,7 +1243,7 @@ dissect_simulcrypt_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Message Type 2 Bytes */
proto_tree_add_item(simulcrypt_header_tree, hf_simulcrypt_message_type, tvb, offset, 2, ENC_BIG_ENDIAN);
simulcrypt_item = proto_tree_add_uint_format(simulcrypt_header_tree, hf_simulcrypt_interface, tvb, offset, 2, iftype,
- "Interface: %s", val_to_str(iftype, interfacenames, "Unknown"));
+ "Interface: %s", val_to_str_const(iftype, interfacenames, "Unknown"));
PROTO_ITEM_SET_GENERATED (simulcrypt_item);
offset+=2;
diff --git a/epan/dissectors/packet-slimp3.c b/epan/dissectors/packet-slimp3.c
index f39b48ae7b..8ae0a117cf 100644
--- a/epan/dissectors/packet-slimp3.c
+++ b/epan/dissectors/packet-slimp3.c
@@ -314,7 +314,7 @@ dissect_slimp3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
i1/625000, i1);
i1 = tvb_get_guint8(tvb, offset+6);
proto_tree_add_text(slimp3_tree, tvb, offset+6, 1, "Code identifier: 0x%0x: %s",
- i1, val_to_str(i1, slimp3_ir_types, "Unknown"));
+ i1, val_to_str_const(i1, slimp3_ir_types, "Unknown"));
proto_tree_add_text(slimp3_tree, tvb, offset+7, 1, "Code bits: %d",
tvb_get_guint8(tvb, offset+7));
@@ -325,14 +325,14 @@ dissect_slimp3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* This is the custom SLIMP3 remote. */
proto_tree_add_text(slimp3_tree, tvb, offset+8, 4,
"Infrared Code: %s: 0x%0x",
- val_to_str(i1, slimp3_ir_codes_slimp3, "Unknown"), i1);
+ val_to_str_const(i1, slimp3_ir_codes_slimp3, "Unknown"), i1);
}
else if (tvb_get_guint8(tvb, offset+6) == 0xff &&
tvb_get_guint8(tvb, offset+7) == 16) {
/* This is a JVC DVD player remote */
proto_tree_add_text(slimp3_tree, tvb, offset+8, 4,
"Infrared Code: %s: 0x%0x",
- val_to_str(i1, slimp3_ir_codes_jvc, "Unknown"), i1);
+ val_to_str_const(i1, slimp3_ir_codes_jvc, "Unknown"), i1);
} else {
/* Unknown code; just write it */
proto_tree_add_text(slimp3_tree, tvb, offset+8, 4, "Infrared Code: 0x%0x", i1);
diff --git a/epan/dissectors/packet-slsk.c b/epan/dissectors/packet-slsk.c
index 8baaece40a..8948e5032c 100644
--- a/epan/dissectors/packet-slsk.c
+++ b/epan/dissectors/packet-slsk.c
@@ -375,7 +375,7 @@ static void dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
offset += 4;
i=tvb_get_guint8(tvb, offset);
proto_tree_add_uint_format(slsk_tree, hf_slsk_login_successful, tvb, offset, 1, tvb_get_guint8(tvb, offset),
- "Login successful: %s (Byte: %d)", val_to_str(tvb_get_guint8(tvb, offset), slsk_yes_no, "Unknown"), tvb_get_guint8(tvb, offset));
+ "Login successful: %s (Byte: %d)", val_to_str_const(tvb_get_guint8(tvb, offset), slsk_yes_no, "Unknown"), tvb_get_guint8(tvb, offset));
offset += 1;
proto_tree_add_uint(slsk_tree, hf_slsk_string_length, tvb, offset, 4, tvb_get_letohl(tvb, offset));
proto_tree_add_item(slsk_tree, hf_slsk_login_message, tvb, offset+4, tvb_get_letohl(tvb, offset), ENC_ASCII|ENC_NA);
@@ -447,7 +447,7 @@ static void dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
proto_tree_add_item(slsk_tree, hf_slsk_username, tvb, offset+4, tvb_get_letohl(tvb, offset), ENC_ASCII|ENC_NA);
offset += 4+tvb_get_letohl(tvb, offset);
proto_tree_add_uint_format(slsk_tree, hf_slsk_user_exists, tvb, offset, 1, tvb_get_guint8(tvb, offset),
- "User exists: %s (Byte: %d)", val_to_str(tvb_get_guint8(tvb, offset), slsk_yes_no, "Unknown"), tvb_get_guint8(tvb, offset));
+ "User exists: %s (Byte: %d)", val_to_str_const(tvb_get_guint8(tvb, offset), slsk_yes_no, "Unknown"), tvb_get_guint8(tvb, offset));
offset += 1;
}
else if (check_slsk_format(tvb, offset, "is")) {
@@ -565,7 +565,7 @@ static void dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
hf_slsk_integer, uncompr_tvb,
uncompr_tvb_offset, 4,
tvb_get_letohl(uncompr_tvb, uncompr_tvb_offset),
- "Dir #%d File #%d Attr #%d type: %s (Code: %d)", i+1, i2+1, i3+1, val_to_str(tvb_get_letohl(uncompr_tvb, uncompr_tvb_offset), slsk_attr_type, "Unknown"), tvb_get_letohl(uncompr_tvb, uncompr_tvb_offset));
+ "Dir #%d File #%d Attr #%d type: %s (Code: %d)", i+1, i2+1, i3+1, val_to_str_const(tvb_get_letohl(uncompr_tvb, uncompr_tvb_offset), slsk_attr_type, "Unknown"), tvb_get_letohl(uncompr_tvb, uncompr_tvb_offset));
uncompr_tvb_offset += 4;
proto_tree_add_uint_format(slsk_compr_packet_tree,
hf_slsk_integer, uncompr_tvb,
@@ -605,7 +605,7 @@ static void dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
proto_tree_add_item(slsk_tree, hf_slsk_username, tvb, offset+4, tvb_get_letohl(tvb, offset), ENC_ASCII|ENC_NA);
offset += 4+tvb_get_letohl(tvb, offset);
proto_tree_add_uint_format(slsk_tree, hf_slsk_status_code, tvb, offset, 4, tvb_get_letohl(tvb, offset),
- "Status: %s (Code: %d)", val_to_str(tvb_get_letohl(tvb, offset), slsk_status_codes, "Unknown"), tvb_get_letohl(tvb, offset));
+ "Status: %s (Code: %d)", val_to_str_const(tvb_get_letohl(tvb, offset), slsk_status_codes, "Unknown"), tvb_get_letohl(tvb, offset));
offset += 4;
}
else if (check_slsk_format(tvb, offset, "is")) {
@@ -707,7 +707,7 @@ static void dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
if (check_slsk_format(uncompr_tvb, uncompr_tvb_offset, "ii*")) {
proto_tree_add_uint_format(slsk_compr_packet_tree, hf_slsk_integer,
uncompr_tvb, uncompr_tvb_offset, 4, tvb_get_letohl(uncompr_tvb, uncompr_tvb_offset),
- "File #%d Attr #%d type: %s (Code: %d)", i+1, i2+1, val_to_str(tvb_get_letohl(uncompr_tvb, uncompr_tvb_offset), slsk_attr_type, "Unknown"), tvb_get_letohl(uncompr_tvb, uncompr_tvb_offset));
+ "File #%d Attr #%d type: %s (Code: %d)", i+1, i2+1, val_to_str_const(tvb_get_letohl(uncompr_tvb, uncompr_tvb_offset), slsk_attr_type, "Unknown"), tvb_get_letohl(uncompr_tvb, uncompr_tvb_offset));
uncompr_tvb_offset += 4;
proto_tree_add_uint_format(slsk_compr_packet_tree, hf_slsk_integer,
uncompr_tvb, uncompr_tvb_offset, 4, tvb_get_letohl(uncompr_tvb, uncompr_tvb_offset),
@@ -720,7 +720,7 @@ static void dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
i++;
}
proto_tree_add_uint_format(slsk_compr_packet_tree, hf_slsk_byte, uncompr_tvb, uncompr_tvb_offset, 1, tvb_get_guint8(uncompr_tvb, uncompr_tvb_offset),
- "Free upload slots: %s (Byte: %d)", val_to_str(tvb_get_guint8(uncompr_tvb, uncompr_tvb_offset), slsk_yes_no, "Unknown"), tvb_get_guint8(uncompr_tvb, uncompr_tvb_offset));
+ "Free upload slots: %s (Byte: %d)", val_to_str_const(tvb_get_guint8(uncompr_tvb, uncompr_tvb_offset), slsk_yes_no, "Unknown"), tvb_get_guint8(uncompr_tvb, uncompr_tvb_offset));
uncompr_tvb_offset += 1;
proto_tree_add_uint_format(slsk_compr_packet_tree, hf_slsk_integer, uncompr_tvb, uncompr_tvb_offset, 4, tvb_get_letohl(uncompr_tvb, uncompr_tvb_offset),
"Upload speed: %d", tvb_get_letohl(uncompr_tvb, uncompr_tvb_offset));
@@ -814,7 +814,7 @@ static void dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
while (i<j){
if (check_slsk_format(tvb, offset, "i*")) {
proto_tree_add_uint_format(slsk_tree, hf_slsk_status_code, tvb, offset, 4, tvb_get_letohl(tvb, offset),
- "Status of User #%d: %s (Code: %d)", i+1, val_to_str(tvb_get_letohl(tvb, offset), slsk_status_codes, "Unknown"), tvb_get_letohl(tvb, offset));
+ "Status of User #%d: %s (Code: %d)", i+1, val_to_str_const(tvb_get_letohl(tvb, offset), slsk_status_codes, "Unknown"), tvb_get_letohl(tvb, offset));
offset += 4;
}
i++;
@@ -920,7 +920,7 @@ static void dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
proto_tree_add_item(slsk_tree, hf_slsk_user_description, tvb, offset+4, tvb_get_letohl(tvb, offset), ENC_ASCII|ENC_NA);
offset += 4+tvb_get_letohl(tvb, offset);
proto_tree_add_uint_format(slsk_tree, hf_slsk_picture_exists, tvb, offset, 1, tvb_get_guint8(tvb, offset),
- "Picture exists: %s (Byte: %d)", val_to_str(tvb_get_guint8(tvb, offset), slsk_yes_no, "Unknown"), tvb_get_guint8(tvb, offset));
+ "Picture exists: %s (Byte: %d)", val_to_str_const(tvb_get_guint8(tvb, offset), slsk_yes_no, "Unknown"), tvb_get_guint8(tvb, offset));
offset += 1;
if ( tvb_get_guint8(tvb, offset -1 ) == 1 ) {
proto_tree_add_uint_format(slsk_tree, hf_slsk_string_length, tvb, offset, 4, tvb_get_letohl(tvb, offset),
@@ -933,7 +933,7 @@ static void dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
proto_tree_add_uint(slsk_tree, hf_slsk_queued_uploads, tvb, offset, 4, tvb_get_letohl(tvb, offset));
offset += 4;
proto_tree_add_uint_format(slsk_tree, hf_slsk_slots_available, tvb, offset, 1, tvb_get_guint8(tvb, offset),
- "Upload Slots available: %s (Byte: %d)", val_to_str(tvb_get_guint8(tvb, offset), slsk_yes_no, "Unknown"), tvb_get_guint8(tvb, offset));
+ "Upload Slots available: %s (Byte: %d)", val_to_str_const(tvb_get_guint8(tvb, offset), slsk_yes_no, "Unknown"), tvb_get_guint8(tvb, offset));
offset += 1;
}
break;
@@ -1073,7 +1073,7 @@ static void dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
"Message Type: %s (Code: %02d)", message_type, msg_code);
offset += 4;
proto_tree_add_uint_format(slsk_tree, hf_slsk_status_code, tvb, offset, 4, tvb_get_letohl(tvb, offset),
- "Status: %s (Code: %d)", val_to_str(tvb_get_letohl(tvb, offset), slsk_status_codes, "Unknown"), tvb_get_letohl(tvb, offset));
+ "Status: %s (Code: %d)", val_to_str_const(tvb_get_letohl(tvb, offset), slsk_status_codes, "Unknown"), tvb_get_letohl(tvb, offset));
offset += 4;
}
break;
@@ -1277,7 +1277,7 @@ static void dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
proto_tree_add_uint_format(slsk_compr_packet_tree,
hf_slsk_integer, uncompr_tvb,
uncompr_tvb_offset, 4, tvb_get_letohl(uncompr_tvb, uncompr_tvb_offset),
- "Dir #%d File #%d Attr #%d type: %s (Code: %d)", i+1, i2+1, i3+1, val_to_str(tvb_get_letohl(uncompr_tvb, uncompr_tvb_offset), slsk_attr_type, "Unknown"), tvb_get_letohl(uncompr_tvb, uncompr_tvb_offset));
+ "Dir #%d File #%d Attr #%d type: %s (Code: %d)", i+1, i2+1, i3+1, val_to_str_const(tvb_get_letohl(uncompr_tvb, uncompr_tvb_offset), slsk_attr_type, "Unknown"), tvb_get_letohl(uncompr_tvb, uncompr_tvb_offset));
uncompr_tvb_offset += 4;
proto_tree_add_uint_format(slsk_compr_packet_tree,
hf_slsk_integer, uncompr_tvb,
@@ -1326,7 +1326,7 @@ static void dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
offset += 4;
i = tvb_get_letohl(tvb, offset);
proto_tree_add_uint_format(slsk_tree, hf_slsk_transfer_direction, tvb, offset, 4, tvb_get_letohl(tvb, offset),
- "Transfer Direction: %s (Code: %d)", val_to_str(tvb_get_letohl(tvb, offset), slsk_transfer_direction, "Unknown"), tvb_get_letohl(tvb, offset));
+ "Transfer Direction: %s (Code: %d)", val_to_str_const(tvb_get_letohl(tvb, offset), slsk_transfer_direction, "Unknown"), tvb_get_letohl(tvb, offset));
offset += 4;
proto_tree_add_uint(slsk_tree, hf_slsk_token, tvb, offset, 4, tvb_get_letohl(tvb, offset));
offset += 4;
@@ -1354,7 +1354,7 @@ static void dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
offset += 4;
i = tvb_get_guint8(tvb, offset);
proto_tree_add_uint_format(slsk_tree, hf_slsk_allowed, tvb, offset, 1, tvb_get_guint8(tvb, offset),
- "Download allowed: %s (Byte: %d)", val_to_str(tvb_get_guint8(tvb, offset), slsk_yes_no, "Unknown"), tvb_get_guint8(tvb, offset));
+ "Download allowed: %s (Byte: %d)", val_to_str_const(tvb_get_guint8(tvb, offset), slsk_yes_no, "Unknown"), tvb_get_guint8(tvb, offset));
offset += 1;
if ( i == 1 ) {
if ( tvb_length_remaining(tvb, offset) == 8 ) {
@@ -1834,7 +1834,7 @@ static void dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
while (i<j){
if (check_slsk_format(tvb, offset, "i*")) {
proto_tree_add_uint_format(slsk_tree, hf_slsk_status_code, tvb, offset, 4, tvb_get_letohl(tvb, offset),
- "Status of User #%d: %s (Code: %d)", i+1, val_to_str(tvb_get_letohl(tvb, offset), slsk_status_codes, "Unknown"), tvb_get_letohl(tvb, offset));
+ "Status of User #%d: %s (Code: %d)", i+1, val_to_str_const(tvb_get_letohl(tvb, offset), slsk_status_codes, "Unknown"), tvb_get_letohl(tvb, offset));
offset += 4;
}
i++;
diff --git a/epan/dissectors/packet-smb.c b/epan/dissectors/packet-smb.c
index 971ba52d73..4d2c844e25 100644
--- a/epan/dissectors/packet-smb.c
+++ b/epan/dissectors/packet-smb.c
@@ -8991,7 +8991,7 @@ dissect_nt_transaction_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
proto_tree_add_uint(tree, hf_smb_nt_trans_subcmd, tvb, offset, 2, subcmd);
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
- val_to_str_ext(subcmd, &nt_cmd_vals_ext, "<unknown>"));
+ val_to_str_ext_const(subcmd, &nt_cmd_vals_ext, "<unknown>"));
}
ntd.subcmd = subcmd;
if (!si->unidir && sip) {
diff --git a/epan/dissectors/packet-sna.c b/epan/dissectors/packet-sna.c
index e6842ac81b..651e7cf6c2 100644
--- a/epan/dissectors/packet-sna.c
+++ b/epan/dissectors/packet-sna.c
@@ -1545,7 +1545,7 @@ dissect_xid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO,
"SNA XID Format:%d Type:%s", format,
- val_to_str(lo_nibble(type), sna_xid_type_vals,
+ val_to_str_const(lo_nibble(type), sna_xid_type_vals,
"Unknown Type"));
if (tree) {
@@ -2451,11 +2451,11 @@ dissect_control(tvbuff_t *parent_tvb, int offset, int control_len,
if (((key == 0) || (key == 3) || (key == 5)) && hpr)
sub_item = proto_tree_add_text(tree, tvb, 0, -1, "%s",
- val_to_str(key, sna_control_hpr_vals,
+ val_to_str_const(key, sna_control_hpr_vals,
"Unknown Control Vector"));
else
sub_item = proto_tree_add_text(tree, tvb, 0, -1, "%s",
- val_to_str(key, sna_control_vals,
+ val_to_str_const(key, sna_control_vals,
"Unknown Control Vector"));
sub_tree = proto_item_add_subtree(sub_item, ett);
if (parse == LT) {
diff --git a/epan/dissectors/packet-sprt.c b/epan/dissectors/packet-sprt.c
index 18eacaa519..c6ac24d97e 100644
--- a/epan/dissectors/packet-sprt.c
+++ b/epan/dissectors/packet-sprt.c
@@ -964,7 +964,7 @@ dissect_sprt_data(tvbuff_t *tvb,
category_id = (word >> 12);
ti = proto_tree_add_uint_format_value(sprt_payload_tree, hf_sprt_payload_msg_jminfo_category_data, tvb, offset, 2, word,
- "Item #%d: %s (0x%04x)", category_count, val_to_str(category_id, sprt_jm_info_cat_id_name, "Unknown"), category_id);
+ "Item #%d: %s (0x%04x)", category_count, val_to_str_const(category_id, sprt_jm_info_cat_id_name, "Unknown"), category_id);
category_count++;
field_subtree = proto_item_add_subtree(ti, ett_jminfo_msg_cat_data);
proto_tree_add_item(field_subtree, hf_sprt_payload_msg_jminfo_category_id, tvb, offset, 2, ENC_BIG_ENDIAN);
diff --git a/epan/dissectors/packet-sqloracle.c b/epan/dissectors/packet-sqloracle.c
index 98f9188ce1..1856033cb7 100644
--- a/epan/dissectors/packet-sqloracle.c
+++ b/epan/dissectors/packet-sqloracle.c
@@ -569,7 +569,7 @@ dissect_sqloracle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if ( check_col(pinfo->cinfo, COL_INFO))
{
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(header_operation, sqloracle_operation_type, ""));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(header_operation, sqloracle_operation_type, ""));
}
if ( tree )
@@ -586,7 +586,7 @@ dissect_sqloracle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case NET8_TYPE_USERTOSERVER: /* 0x3 */
if ( check_col(pinfo->cinfo, COL_INFO))
{
- col_append_fstr(pinfo->cinfo, COL_INFO, ":%s ", val_to_str(func_type, sql_func_type, ""));
+ col_append_fstr(pinfo->cinfo, COL_INFO, ":%s ", val_to_str_const(func_type, sql_func_type, ""));
}
switch (func_type)
{
diff --git a/epan/dissectors/packet-srvloc.c b/epan/dissectors/packet-srvloc.c
index 389fc6fe3c..75f1d54de5 100644
--- a/epan/dissectors/packet-srvloc.c
+++ b/epan/dissectors/packet-srvloc.c
@@ -569,16 +569,16 @@ attr_list(proto_tree *tree, int hf, tvbuff_t *tvb, int offset, int length,
svc = tvb_get_guint8(tvb, foffset+1);
proto_tree_add_text(srvloc_tree, tvb, foffset+1, 1,
- "Service Type: %s", val_to_str(svc, srvloc_svc, "Unknown"));
+ "Service Type: %s", val_to_str_const(svc, srvloc_svc, "Unknown"));
ss = tvb_get_guint8(tvb, foffset+5);
proto_tree_add_text(srvloc_tree, tvb, foffset+5, 1,
- "Communication Type: %s", val_to_str(ss, srvloc_ss, "Unknown"));
+ "Communication Type: %s", val_to_str_const(ss, srvloc_ss, "Unknown"));
foffset += 9;
if (svc == 50) {
if (tvb_get_guint8(tvb, foffset)==54) { /* TCP */
prot = tvb_get_guint8(tvb, foffset);
proto_tree_add_text(srvloc_tree, tvb, foffset, 1,
- "Protocol: %s", val_to_str(prot, srvloc_prot, "Unknown"));
+ "Protocol: %s", val_to_str_const(prot, srvloc_prot, "Unknown"));
foffset += 2;
}
else
@@ -586,7 +586,7 @@ attr_list(proto_tree *tree, int hf, tvbuff_t *tvb, int offset, int length,
byte_value = unicode_to_bytes(tvb, foffset, 4, FALSE); /* UDP */
prot = atol(byte_value);
proto_tree_add_text(srvloc_tree, tvb, foffset, 4,
- "Protocol: %s", val_to_str(prot, srvloc_prot, "Unknown"));
+ "Protocol: %s", val_to_str_const(prot, srvloc_prot, "Unknown"));
foffset += 4;
}
}
@@ -595,7 +595,7 @@ attr_list(proto_tree *tree, int hf, tvbuff_t *tvb, int offset, int length,
byte_value = unicode_to_bytes(tvb, foffset, 8, FALSE); /* IPX */
prot = atol(byte_value);
proto_tree_add_text(srvloc_tree, tvb, foffset, 8,
- "Protocol: %s", val_to_str(prot, srvloc_prot, "Unknown"));
+ "Protocol: %s", val_to_str_const(prot, srvloc_prot, "Unknown"));
foffset += 8;
}
if (svc == 50) {
@@ -643,16 +643,16 @@ attr_list(proto_tree *tree, int hf, tvbuff_t *tvb, int offset, int length,
svc = tvb_get_guint8(tvb, foffset+1);
proto_tree_add_text(srvloc_tree, tvb, foffset+1, 1,
- "Service Type: %s", val_to_str(svc, srvloc_svc, "Unknown"));
+ "Service Type: %s", val_to_str_const(svc, srvloc_svc, "Unknown"));
ss = tvb_get_guint8(tvb, foffset+3);
proto_tree_add_text(srvloc_tree, tvb, foffset+3, 1,
- "Communication Type: %s", val_to_str(ss, srvloc_ss, "Unknown"));
+ "Communication Type: %s", val_to_str_const(ss, srvloc_ss, "Unknown"));
foffset += 5;
if (svc == 50) {
if (tvb_get_guint8(tvb, foffset)==54) { /* TCP */
prot = tvb_get_guint8(tvb, foffset);
proto_tree_add_text(srvloc_tree, tvb, foffset, 1,
- "Protocol: %s", val_to_str(prot, srvloc_prot, "Unknown"));
+ "Protocol: %s", val_to_str_const(prot, srvloc_prot, "Unknown"));
foffset += 1;
}
else
@@ -661,7 +661,7 @@ attr_list(proto_tree *tree, int hf, tvbuff_t *tvb, int offset, int length,
byte_value = unicode_to_bytes(tvb, foffset, 2, FALSE); /* UDP */
prot = atol(byte_value);
proto_tree_add_text(srvloc_tree, tvb, foffset, 2,
- "Protocol: %s", val_to_str(prot, srvloc_prot, "Unknown"));
+ "Protocol: %s", val_to_str_const(prot, srvloc_prot, "Unknown"));
foffset += 2;
}
}
@@ -670,7 +670,7 @@ attr_list(proto_tree *tree, int hf, tvbuff_t *tvb, int offset, int length,
byte_value = unicode_to_bytes(tvb, foffset, 4, FALSE); /* IPX */
prot = atol(byte_value);
proto_tree_add_text(srvloc_tree, tvb, foffset, 4,
- "Protocol: %s", val_to_str(prot, srvloc_prot, "Unknown"));
+ "Protocol: %s", val_to_str_const(prot, srvloc_prot, "Unknown"));
foffset += 4;
}
if (svc == 50) {
@@ -868,7 +868,7 @@ dissect_srvloc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
encoding = tvb_get_ntohs(tvb, offset + 8);
proto_tree_add_text(srvloc_tree, tvb, offset + 8, 2, "Encoding: %u (%s)",
encoding,
- val_to_str(encoding, charsets, "Unknown"));
+ val_to_str_const(encoding, charsets, "Unknown"));
proto_tree_add_text(srvloc_tree, tvb, offset + 10, 2, "Transaction ID: %u",
tvb_get_ntohs(tvb, offset + 10));
/* added echo of XID to info colomn by Greg Morris 0ct 14, 2005 */
diff --git a/epan/dissectors/packet-sscf-nni.c b/epan/dissectors/packet-sscf-nni.c
index 87bba12426..d04dd17d66 100644
--- a/epan/dissectors/packet-sscf-nni.c
+++ b/epan/dissectors/packet-sscf-nni.c
@@ -96,7 +96,7 @@ dissect_sscf_nni(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "SSCF-NNI");
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "STATUS (%s) ",
- val_to_str(sscf_status, sscf_status_vals, "Unknown"));
+ val_to_str_const(sscf_status, sscf_status_vals, "Unknown"));
proto_tree_add_item(sscf_tree, hf_status, tvb, SSCF_STATUS_OFFSET,
diff --git a/epan/dissectors/packet-ssl.c b/epan/dissectors/packet-ssl.c
index cf4b6c30c8..29337443aa 100644
--- a/epan/dissectors/packet-ssl.c
+++ b/epan/dissectors/packet-ssl.c
@@ -1616,7 +1616,7 @@ dissect_ssl3_record(tvbuff_t *tvb, packet_info *pinfo,
/*
* now dissect the next layer
*/
- ssl_debug_printf("dissect_ssl3_record: content_type %d %s\n",content_type, val_to_str(content_type, ssl_31_content_type, "unknown"));
+ ssl_debug_printf("dissect_ssl3_record: content_type %d %s\n",content_type, val_to_str_const(content_type, ssl_31_content_type, "unknown"));
/* PAOLO try to decrypt each record (we must keep ciphers "in sync")
* store plain text only for app data */
@@ -1697,7 +1697,7 @@ dissect_ssl3_record(tvbuff_t *tvb, packet_info *pinfo,
proto_item_set_text(ssl_record_tree,
"%s Record Layer: %s Protocol: %s",
val_to_str_const(*conv_version, ssl_version_short_names, "SSL"),
- val_to_str(content_type, ssl_31_content_type, "unknown"),
+ val_to_str_const(content_type, ssl_31_content_type, "unknown"),
association?association->info:"Application Data");
proto_tree_add_item(ssl_record_tree, hf_ssl_record_appdata, tvb,
@@ -1753,7 +1753,7 @@ dissect_ssl3_change_cipher_spec(tvbuff_t *tvb,
proto_item_set_text(tree,
"%s Record Layer: %s Protocol: Change Cipher Spec",
val_to_str_const(*conv_version, ssl_version_short_names, "SSL"),
- val_to_str(content_type, ssl_31_content_type, "unknown"));
+ val_to_str_const(content_type, ssl_31_content_type, "unknown"));
proto_tree_add_item(tree, hf_ssl_change_cipher_spec, tvb,
offset++, 1, ENC_NA);
}
@@ -1922,7 +1922,7 @@ dissect_ssl3_handshake(tvbuff_t *tvb, packet_info *pinfo,
{
proto_item_set_text(tree, "%s Record Layer: %s Protocol: %s",
val_to_str_const(*conv_version, ssl_version_short_names, "SSL"),
- val_to_str(content_type, ssl_31_content_type, "unknown"),
+ val_to_str_const(content_type, ssl_31_content_type, "unknown"),
(msg_type_str!=NULL) ? msg_type_str :
"Encrypted Handshake Message");
}
@@ -1930,7 +1930,7 @@ dissect_ssl3_handshake(tvbuff_t *tvb, packet_info *pinfo,
{
proto_item_set_text(tree, "%s Record Layer: %s Protocol: %s",
val_to_str_const(*conv_version, ssl_version_short_names, "SSL"),
- val_to_str(content_type, ssl_31_content_type, "unknown"),
+ val_to_str_const(content_type, ssl_31_content_type, "unknown"),
"Multiple Handshake Messages");
}
diff --git a/epan/dissectors/packet-stun.c b/epan/dissectors/packet-stun.c
index bc40e4874f..e52ff31496 100644
--- a/epan/dissectors/packet-stun.c
+++ b/epan/dissectors/packet-stun.c
@@ -611,7 +611,7 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole
att_length = tvb_get_ntohs(tvb, offset+2); /* Length field in attribute header */
ti = proto_tree_add_uint_format(att_all_tree, hf_stun_attr,
tvb, offset, ATTR_HDR_LEN+att_length,
- att_type, "%s", val_to_str(att_type, attributes, "Unknown"));
+ att_type, "%s", val_to_str_const(att_type, attributes, "Unknown"));
att_tree = proto_item_add_subtree(ti, ett_stun_att);
ti = proto_tree_add_uint(att_tree, stun_att_type, tvb,
offset, 2, att_type);
@@ -671,7 +671,7 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole
col_append_fstr(
pinfo->cinfo, COL_INFO,
" %s: %s:%d",
- val_to_str(att_type, attributes, "Unknown"),
+ val_to_str_const(att_type, attributes, "Unknown"),
ipstr,
tvb_get_ntohs(tvb,offset+2)
);
@@ -728,13 +728,13 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole
att_tree,
" %d (%s)",
human_error_num, /* human readable error code */
- val_to_str(human_error_num, error_code, "*Unknown error code*")
+ val_to_str_const(human_error_num, error_code, "*Unknown error code*")
);
col_append_fstr(
pinfo->cinfo, COL_INFO,
" error-code: %d (%s)",
human_error_num,
- val_to_str(human_error_num, error_code, "*Unknown error code*")
+ val_to_str_const(human_error_num, error_code, "*Unknown error code*")
);
}
if (att_length < 5)
@@ -829,7 +829,7 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole
col_append_fstr(
pinfo->cinfo, COL_INFO,
" %s: %s:%d",
- val_to_str(att_type, attributes, "Unknown"),
+ val_to_str_const(att_type, attributes, "Unknown"),
ipstr,
port
);
diff --git a/epan/dissectors/packet-sua.c b/epan/dissectors/packet-sua.c
index 998a8ccef6..2dc539274f 100644
--- a/epan/dissectors/packet-sua.c
+++ b/epan/dissectors/packet-sua.c
@@ -522,7 +522,7 @@ dissect_common_header(tvbuff_t *common_header_tvb, packet_info *pinfo, proto_tre
message_class = tvb_get_guint8(common_header_tvb, MESSAGE_CLASS_OFFSET);
message_type = tvb_get_guint8(common_header_tvb, MESSAGE_TYPE_OFFSET);
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(message_class * 256 + message_type, message_class_type_acro_values, "reserved"));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_class * 256 + message_type, message_class_type_acro_values, "reserved"));
if (sua_tree) {
/* add the components of the common header to the protocol tree */
@@ -530,7 +530,7 @@ dissect_common_header(tvbuff_t *common_header_tvb, packet_info *pinfo, proto_tre
proto_tree_add_item(sua_tree, hf_sua_reserved, common_header_tvb, RESERVED_OFFSET, RESERVED_LENGTH, ENC_NA);
proto_tree_add_item(sua_tree, hf_sua_message_class, common_header_tvb, MESSAGE_CLASS_OFFSET, MESSAGE_CLASS_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_uint_format(sua_tree, hf_sua_message_type, common_header_tvb, MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_LENGTH, message_type, "Message Type: %s (%u)",
- val_to_str(message_class * 256 + message_type, message_class_type_values, "reserved"), message_type);
+ val_to_str_const(message_class * 256 + message_type, message_class_type_values, "reserved"), message_type);
proto_tree_add_item(sua_tree, hf_sua_message_length, common_header_tvb, MESSAGE_LENGTH_OFFSET, MESSAGE_LENGTH_LENGTH, ENC_BIG_ENDIAN);
};
}
@@ -611,7 +611,7 @@ static void
dissect_traffic_mode_type_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
{
proto_tree_add_item(parameter_tree, hf_sua_traffic_mode_type, parameter_tvb, TRAFFIC_MODE_TYPE_OFFSET, TRAFFIC_MODE_TYPE_LENGTH, ENC_BIG_ENDIAN);
- proto_item_append_text(parameter_item, " (%s)", val_to_str(tvb_get_ntohl(parameter_tvb, TRAFFIC_MODE_TYPE_OFFSET), traffic_mode_type_values, "unknown"));
+ proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, TRAFFIC_MODE_TYPE_OFFSET), traffic_mode_type_values, "unknown"));
}
#define ERROR_CODE_OFFSET PARAMETER_VALUE_OFFSET
@@ -643,7 +643,7 @@ static void
dissect_v8_error_code_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
{
proto_tree_add_item(parameter_tree, hf_sua_v8_error_code, parameter_tvb, ERROR_CODE_OFFSET, ERROR_CODE_LENGTH, ENC_BIG_ENDIAN);
- proto_item_append_text(parameter_item, " (%s)", val_to_str(tvb_get_ntohl(parameter_tvb, ERROR_CODE_OFFSET), v8_error_code_values, "unknown"));
+ proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, ERROR_CODE_OFFSET), v8_error_code_values, "unknown"));
}
static const value_string error_code_values[] = {
@@ -673,7 +673,7 @@ static void
dissect_error_code_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
{
proto_tree_add_item(parameter_tree, hf_sua_error_code, parameter_tvb, ERROR_CODE_OFFSET, ERROR_CODE_LENGTH, ENC_BIG_ENDIAN);
- proto_item_append_text(parameter_item, " (%s)", val_to_str(tvb_get_ntohl(parameter_tvb, ERROR_CODE_OFFSET), error_code_values, "unknown"));
+ proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, ERROR_CODE_OFFSET), error_code_values, "unknown"));
}
#define STATUS_TYPE_LENGTH 2
@@ -718,9 +718,9 @@ dissect_status_type_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tre
proto_tree_add_item(parameter_tree, hf_sua_status_type, parameter_tvb, STATUS_TYPE_OFFSET, STATUS_TYPE_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_uint_format(parameter_tree, hf_sua_status_info, parameter_tvb, STATUS_INFO_OFFSET, STATUS_INFO_LENGTH,
- status_info, "Status info: %s (%u)", val_to_str(status_type * 256 * 256 + status_info, status_type_info_values, "unknown"), status_info);
+ status_info, "Status info: %s (%u)", val_to_str_const(status_type * 256 * 256 + status_info, status_type_info_values, "unknown"), status_info);
- proto_item_append_text(parameter_item, " (%s)", val_to_str(status_type * 256 * 256 + status_info, status_type_info_values, "unknown"));
+ proto_item_append_text(parameter_item, " (%s)", val_to_str_const(status_type * 256 * 256 + status_info, status_type_info_values, "unknown"));
}
#define ASP_IDENTIFIER_LENGTH 4
@@ -809,7 +809,7 @@ static void
dissect_registration_status_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
{
proto_tree_add_item(parameter_tree, hf_sua_registration_status, parameter_tvb, REGISTRATION_STATUS_OFFSET, REGISTRATION_STATUS_LENGTH, ENC_BIG_ENDIAN);
- proto_item_append_text(parameter_item, " (%s)", val_to_str(tvb_get_ntohl(parameter_tvb, REGISTRATION_STATUS_OFFSET), registration_status_values, "unknown"));
+ proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, REGISTRATION_STATUS_OFFSET), registration_status_values, "unknown"));
}
#define DEREGISTRATION_STATUS_LENGTH 4
@@ -828,7 +828,7 @@ static void
dissect_deregistration_status_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
{
proto_tree_add_item(parameter_tree, hf_sua_deregistration_status, parameter_tvb, DEREGISTRATION_STATUS_OFFSET, DEREGISTRATION_STATUS_LENGTH, ENC_BIG_ENDIAN);
- proto_item_append_text(parameter_item, " (%s)", val_to_str(tvb_get_ntohl(parameter_tvb, DEREGISTRATION_STATUS_OFFSET), deregistration_status_values, "unknown"));
+ proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, DEREGISTRATION_STATUS_OFFSET), deregistration_status_values, "unknown"));
}
#define LOCAL_ROUTING_KEY_IDENTIFIER_LENGTH 4
@@ -980,26 +980,26 @@ dissect_sccp_cause_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree
switch (cause_type) {
case CAUSE_TYPE_RETURN:
- cause_string = val_to_str(cause, sccp_return_cause_values, "unknown");
+ cause_string = val_to_str_const(cause, sccp_return_cause_values, "unknown");
break;
case CAUSE_TYPE_REFUSAL:
- cause_string = val_to_str(cause, sccp_refusal_cause_values, "unknown");
+ cause_string = val_to_str_const(cause, sccp_refusal_cause_values, "unknown");
break;
case CAUSE_TYPE_RELEASE:
- cause_string = val_to_str(cause, sccp_release_cause_values, "unknown");
+ cause_string = val_to_str_const(cause, sccp_release_cause_values, "unknown");
break;
case CAUSE_TYPE_RESET:
- cause_string = val_to_str(cause, sccp_reset_cause_values, "unknown");
+ cause_string = val_to_str_const(cause, sccp_reset_cause_values, "unknown");
break;
case CAUSE_TYPE_ERROR:
- cause_string = val_to_str(cause, sccp_error_cause_values, "unknown");
+ cause_string = val_to_str_const(cause, sccp_error_cause_values, "unknown");
break;
default:
cause_string = "unknown";
}
proto_item_append_text(pi, " (%s)", cause_string);
- proto_item_append_text(parameter_item, " (%s: %s)", val_to_str(cause_type, cause_type_values, "unknown"), cause_string);
+ proto_item_append_text(parameter_item, " (%s: %s)", val_to_str_const(cause_type, cause_type_values, "unknown"), cause_string);
}
#define SEQUENCE_NUMBER_REC_SEQ_LENGTH 1
@@ -1382,12 +1382,12 @@ dissect_global_title_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tr
even_signal = tvb_get_guint8(parameter_tvb, offset) & GT_EVEN_SIGNAL_MASK;
even_signal >>= GT_EVEN_SIGNAL_SHIFT;
- g_strlcat(gt_digits, val_to_str(odd_signal, sccp_address_signal_values,
+ g_strlcat(gt_digits, val_to_str_const(odd_signal, sccp_address_signal_values,
"Unknown"), GT_MAX_SIGNALS+1);
/* If the last signal is NOT filler */
if (offset != (GLOBAL_TITLE_OFFSET + global_title_length - 1) || even_length == TRUE)
- g_strlcat(gt_digits, val_to_str(even_signal, sccp_address_signal_values,
+ g_strlcat(gt_digits, val_to_str_const(even_signal, sccp_address_signal_values,
"Unknown"), GT_MAX_SIGNALS+1);
offset += GT_SIGNAL_LENGTH;
@@ -1595,7 +1595,7 @@ dissect_v8_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *tr
if (tree) {
/* create proto_tree stuff */
- parameter_item = proto_tree_add_text(tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb), "%s", val_to_str(tag, v8_parameter_tag_values, "Unknown parameter"));
+ parameter_item = proto_tree_add_text(tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb), "%s", val_to_str_const(tag, v8_parameter_tag_values, "Unknown parameter"));
parameter_tree = proto_item_add_subtree(parameter_item, ett_sua_parameter);
/* add tag and length to the sua tree */
diff --git a/epan/dissectors/packet-synphasor.c b/epan/dissectors/packet-synphasor.c
index 3eb2e6592a..9e23426391 100644
--- a/epan/dissectors/packet-synphasor.c
+++ b/epan/dissectors/packet-synphasor.c
@@ -515,7 +515,7 @@ static void dissect_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (check_col(pinfo->cinfo, COL_INFO)) {
col_clear(pinfo->cinfo, COL_INFO); /* clear out stuff in the info column */
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str(frame_type, typenames, "invalid packet type"));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str_const(frame_type, typenames, "invalid packet type"));
}
/* CFG-2 and DATA frames need special treatment during the first run:
@@ -570,8 +570,8 @@ static void dissect_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvbuff_t *sub_tvb;
temp_item = proto_tree_add_item(tree, proto_synphasor, tvb, 0, -1, ENC_NA);
- proto_item_append_text(temp_item, ", %s", val_to_str(frame_type, typenames,
- ", invalid packet type"));
+ proto_item_append_text(temp_item, ", %s", val_to_str_const(frame_type, typenames,
+ ", invalid packet type"));
/* synphasor_tree is where from now on all new elements for this protocol get added */
synphasor_tree = proto_item_add_subtree(temp_item, ett_synphasor);
@@ -866,7 +866,7 @@ static int dissect_command_frame(tvbuff_t *tvb,
/* CMD */
proto_tree_add_item(command_tree, hf_command, tvb, 0, 2, ENC_BIG_ENDIAN);
if (check_col(pinfo->cinfo, COL_INFO)) {
- const char *s = val_to_str(tvb_get_ntohs(tvb, 0), command_names, "invalid command");
+ const char *s = val_to_str_const(tvb_get_ntohs(tvb, 0), command_names, "invalid command");
col_append_str(pinfo->cinfo, COL_INFO, ", ");
col_append_str(pinfo->cinfo, COL_INFO, s);
}
diff --git a/epan/dissectors/packet-syslog.c b/epan/dissectors/packet-syslog.c
index b19e63aef0..30798cc3b8 100644
--- a/epan/dissectors/packet-syslog.c
+++ b/epan/dissectors/packet-syslog.c
@@ -265,8 +265,8 @@ dissect_syslog(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (mtp3_tvb == NULL && check_col(pinfo->cinfo, COL_INFO)) {
if (pri >= 0) {
col_add_fstr(pinfo->cinfo, COL_INFO, "%s.%s: %s",
- val_to_str(fac, short_fac, "UNKNOWN"),
- val_to_str(lev, short_lev, "UNKNOWN"), msg_str);
+ val_to_str_const(fac, short_fac, "UNKNOWN"),
+ val_to_str_const(lev, short_lev, "UNKNOWN"), msg_str);
} else {
col_add_str(pinfo->cinfo, COL_INFO, msg_str);
}
@@ -276,8 +276,8 @@ dissect_syslog(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (pri >= 0) {
ti = proto_tree_add_protocol_format(tree, proto_syslog, tvb, 0, -1,
"Syslog message: %s.%s: %s",
- val_to_str(fac, short_fac, "UNKNOWN"),
- val_to_str(lev, short_lev, "UNKNOWN"), msg_str);
+ val_to_str_const(fac, short_fac, "UNKNOWN"),
+ val_to_str_const(lev, short_lev, "UNKNOWN"), msg_str);
} else {
ti = proto_tree_add_protocol_format(tree, proto_syslog, tvb, 0, -1,
"Syslog message: (unknown): %s", msg_str);
diff --git a/epan/dissectors/packet-t30.c b/epan/dissectors/packet-t30.c
index b640848867..eb72967bec 100644
--- a/epan/dissectors/packet-t30.c
+++ b/epan/dissectors/packet-t30.c
@@ -991,7 +991,7 @@ dissect_t30_hdlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_append_fstr(pinfo->cinfo, COL_INFO,
" %s - %s",
val_to_str_const(octet & 0x7F, t30_facsimile_control_field_vals_short, "<unknown>"),
- val_to_str(octet & 0x7F, t30_facsimile_control_field_vals, "<unknown>") );
+ val_to_str_const(octet & 0x7F, t30_facsimile_control_field_vals, "<unknown>") );
/*
TODO: VS Code Analysis makes a good point - several of these commands can't get detected while
the m.s.b. is masked off! (e.g. T30_FC_DTC is 0x81). I couldn't readily work out from the T.30
diff --git a/epan/dissectors/packet-tacacs.c b/epan/dissectors/packet-tacacs.c
index 560ea5d5e5..99d2c52ac6 100644
--- a/epan/dissectors/packet-tacacs.c
+++ b/epan/dissectors/packet-tacacs.c
@@ -399,14 +399,14 @@ proto_tree_add_tacplus_common_fields( tvbuff_t *tvb, proto_tree *tree, int offs
val=tvb_get_guint8(tvb,offset);
proto_tree_add_text( tree, tvb, offset, 1,
"Authentication type: %s",
- val_to_str( val, tacplus_authen_type_vals, "Unknown Packet" ) );
+ val_to_str_const( val, tacplus_authen_type_vals, "Unknown Packet" ) );
offset++;
/* service */
val=tvb_get_guint8(tvb,offset);
proto_tree_add_text( tree, tvb, offset, 1,
"Service: %s",
- val_to_str( val, tacplus_authen_service_vals, "Unknown Packet" ) );
+ val_to_str_const( val, tacplus_authen_service_vals, "Unknown Packet" ) );
offset++;
/* user_len && user */
@@ -539,7 +539,7 @@ dissect_tacplus_body_authen_req( tvbuff_t* tvb, proto_tree *tree )
proto_tree_add_text( tree, tvb,
AUTHEN_S_ACTION_OFF, 1,
"Action: %s",
- val_to_str( val, tacplus_authen_action_vals, "Unknown Packet" ) );
+ val_to_str_const( val, tacplus_authen_action_vals, "Unknown Packet" ) );
var_off=proto_tree_add_tacplus_common_fields( tvb, tree , AUTHEN_S_PRIV_LVL_OFF, AUTHEN_S_VARDATA_OFF );
@@ -594,7 +594,7 @@ dissect_tacplus_body_authen_rep( tvbuff_t *tvb, proto_tree *tree )
val=tvb_get_guint8( tvb, AUTHEN_R_STATUS_OFF );
proto_tree_add_text(tree, tvb,
AUTHEN_R_STATUS_OFF, 1, "Status: 0x%01x (%s)", val,
- val_to_str( val, tacplus_reply_status_vals, "Unknown Packet" ) );
+ val_to_str_const( val, tacplus_reply_status_vals, "Unknown Packet" ) );
val=tvb_get_guint8( tvb, AUTHEN_R_FLAGS_OFF );
proto_tree_add_text(tree, tvb,
@@ -627,7 +627,7 @@ dissect_tacplus_body_author_req( tvbuff_t* tvb, proto_tree *tree )
val=tvb_get_guint8( tvb, AUTHOR_Q_AUTH_METH_OFF ) ;
proto_tree_add_text( tree, tvb, AUTHOR_Q_AUTH_METH_OFF, 1,
- "Auth Method: %s", val_to_str( val, tacplus_authen_method, "Unknown Authen Method" ) );
+ "Auth Method: %s", val_to_str_const( val, tacplus_authen_method, "Unknown Authen Method" ) );
val=tvb_get_guint8( tvb, AUTHOR_Q_ARGC_OFF );
var_off=proto_tree_add_tacplus_common_fields( tvb, tree ,
@@ -650,7 +650,7 @@ dissect_tacplus_body_author_rep( tvbuff_t* tvb, proto_tree *tree )
proto_tree_add_text( tree, tvb, AUTHOR_R_STATUS_OFF , 1,
"Auth Status: 0x%01x (%s)", val,
- val_to_str( val, tacplus_author_status, "Unknown Authorization Status" ));
+ val_to_str_const( val, tacplus_author_status, "Unknown Authorization Status" ));
val=tvb_get_ntohs( tvb, AUTHOR_R_SRV_MSG_LEN_OFF );
offset+=val;
@@ -695,7 +695,7 @@ dissect_tacplus_body_acct_req( tvbuff_t* tvb, proto_tree *tree )
val=tvb_get_guint8( tvb, ACCT_Q_METHOD_OFF );
proto_tree_add_text( tree, tvb, ACCT_Q_METHOD_OFF, 1,
"Authen Method: 0x%01x (%s)",
- val, val_to_str( val, tacplus_authen_method, "Unknown Authen Method" ) );
+ val, val_to_str_const( val, tacplus_authen_method, "Unknown Authen Method" ) );
val=tvb_get_guint8( tvb, ACCT_Q_ARG_CNT_OFF );
@@ -723,7 +723,7 @@ dissect_tacplus_body_acct_rep( tvbuff_t* tvb, proto_tree *tree )
/* Status */
val=tvb_get_guint8( tvb, ACCT_R_STATUS_OFF );
proto_tree_add_text( tree, tvb, ACCT_R_STATUS_OFF, 1, "Status: 0x%02x (%s)", val,
- val_to_str( val, tacplus_acct_status, "Bogus status..") );
+ val_to_str_const( val, tacplus_acct_status, "Bogus status..") );
/* Server Message */
val=tvb_get_ntohs( tvb, ACCT_R_SRV_MSG_LEN_OFF );
diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c
index b0b5a96d0a..98b91b270f 100644
--- a/epan/dissectors/packet-tcp.c
+++ b/epan/dissectors/packet-tcp.c
@@ -3295,7 +3295,7 @@ dissect_tcpopt_rvbd_probe(const ip_tcp_opt *optp _U_, tvbuff_t *tvb, int offset,
pitem = proto_tree_add_boolean_format_value(
opt_tree, hf_tcp_option_rvbd_probe, tvb, offset, optlen, 1,
- "%s", val_to_str(type, rvbd_probe_type_vs, "Probe Unknown"));
+ "%s", val_to_str_const(type, rvbd_probe_type_vs, "Probe Unknown"));
if (type >= PROBE_TYPE_MAX)
return;
diff --git a/epan/dissectors/packet-tds.c b/epan/dissectors/packet-tds.c
index 2ee8b47a50..a26eb5932c 100644
--- a/epan/dissectors/packet-tds.c
+++ b/epan/dissectors/packet-tds.c
@@ -1034,7 +1034,7 @@ dissect_tds_query5_packet(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tre
token_item = proto_tree_add_text(query_tree, tvb, pos, token_sz,
"Token 0x%02x %s", token,
- val_to_str(token, token_names, "Unknown Token Type"));
+ val_to_str_const(token, token_names, "Unknown Token Type"));
token_tree = proto_item_add_subtree(token_item, ett_tds_token);
/*
@@ -1139,18 +1139,18 @@ dissect_tds7_login(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
len = tvb_get_letohs(tvb, offset + i*4 + 2);
proto_tree_add_text(length_tree, tvb, offset + i*4, 2,
"%s offset: %u",
- val_to_str(i, login_field_names, "Unknown"),
+ val_to_str_const(i, login_field_names, "Unknown"),
offset2);
proto_tree_add_text(length_tree, tvb, offset + i*4 + 2, 2,
"%s length: %u",
- val_to_str(i, login_field_names, "Unknown"),
+ val_to_str_const(i, login_field_names, "Unknown"),
len);
if (len != 0) {
if( i != 2) {
/* tds 7 is always unicode */
len *= 2;
val = tvb_get_ephemeral_unicode_string(tvb, offset2, len, ENC_LITTLE_ENDIAN);
- proto_tree_add_text(login_tree, tvb, offset2, len, "%s: %s", val_to_str(i, login_field_names, "Unknown"), val);
+ proto_tree_add_text(login_tree, tvb, offset2, len, "%s: %s", val_to_str_const(i, login_field_names, "Unknown"), val);
} else {
/* This field is the password. We retrieve it from the packet
* as a non-unicode string and then perform two operations on it
@@ -1173,7 +1173,7 @@ dissect_tds7_login(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
val2[k] = '\0'; /* Null terminate our new string */
- proto_tree_add_text(login_tree, tvb, offset2, len, "%s: %s", val_to_str(i, login_field_names, "Unknown"), val2);
+ proto_tree_add_text(login_tree, tvb, offset2, len, "%s: %s", val_to_str_const(i, login_field_names, "Unknown"), val2);
}
}
}
@@ -1441,7 +1441,7 @@ dissect_tds_env_chg(tvbuff_t *tvb, guint offset, guint token_sz,
env_type = tvb_get_guint8(tvb, offset);
proto_tree_add_text(tree, tvb, offset, 1, "Type: %u (%s)", env_type,
- val_to_str(env_type, env_chg_names, "Unknown"));
+ val_to_str_const(env_type, env_chg_names, "Unknown"));
new_len = tvb_get_guint8(tvb, offset+1);
old_len_offset = offset + new_len + 2;
@@ -2196,7 +2196,7 @@ dissect_tds_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
token_item = proto_tree_add_text(tree, tvb, pos, token_sz,
"Token 0x%02x %s", token,
- val_to_str(token, token_names, "Unknown Token Type"));
+ val_to_str_const(token, token_names, "Unknown Token Type"));
token_tree = proto_item_add_subtree(token_item, ett_tds_token);
/*
diff --git a/epan/dissectors/packet-tipc.c b/epan/dissectors/packet-tipc.c
index 3c1219678b..ea0438be7d 100644
--- a/epan/dissectors/packet-tipc.c
+++ b/epan/dissectors/packet-tipc.c
@@ -665,13 +665,13 @@ tipc_v2_set_info_col(tvbuff_t *tvb, packet_info *pinfo, guint8 user, guint8 msg_
case TIPCv2_DATA_NORMAL:
case TIPCv2_DATA_HIGH:
case TIPCv2_DATA_NON_REJECTABLE:
- col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str(msg_type, tipcv2_data_msg_type_defines, "unknown"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str_const(msg_type, tipcv2_data_msg_type_defines, "unknown"));
/* Display Error != 0 in Info Column */
dword = tvb_get_ntohl(tvb, 4);
error = (dword>>25) & 0xf;
if (error > 0)
- col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str(error, tipcv2_error_code_short_strings, "unknown"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str_const(error, tipcv2_error_code_short_strings, "unknown"));
if (hdr_size > 8) {
/* Port Name Type: 32 bits */
portNameType = tvb_get_ntohl(tvb, 32);
@@ -689,34 +689,34 @@ tipc_v2_set_info_col(tvbuff_t *tvb, packet_info *pinfo, guint8 user, guint8 msg_
}
break;
case TIPCv2_BCAST_PROTOCOL:
- col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str(msg_type, tipcv2_bcast_mtype_strings, "unknown"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str_const(msg_type, tipcv2_bcast_mtype_strings, "unknown"));
break;
case TIPCv2_MSG_BUNDLER:
/* No message types */
break;
case TIPCv2_LINK_PROTOCOL:
- col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str(msg_type, tipcv2_link_mtype_strings, "unknown"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str_const(msg_type, tipcv2_link_mtype_strings, "unknown"));
break;
case TIPCv2_CONN_MANAGER:
dword = tvb_get_ntohl(tvb, 4);
/* Display Error != 0 in Info Column */
error = (dword>>25) & 0xf;
if (error > 0)
- col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str(error, tipcv2_error_code_short_strings, "unknown"));
- col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str(msg_type, tipcv2_connmgr_mtype_strings, "unknown"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str_const(error, tipcv2_error_code_short_strings, "unknown"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str_const(msg_type, tipcv2_connmgr_mtype_strings, "unknown"));
break;
case TIPCv2_ROUTE_DISTRIBUTOR:
/* determine if it is TIPC v1.6 or v1.7 */
/*dword = tvb_get_ntohl(tvb, 36); */
/*item_size = (dword >> 24) & 0xff;*/
if ((handle_v2_as & V2_AS_1_6) || ((handle_v2_as & V2_AS_ALL) == 0)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str(msg_type, tipcv2_route_mtype_strings_1_6, "unknown"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str_const(msg_type, tipcv2_route_mtype_strings_1_6, "unknown"));
} else {
- col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str(msg_type, tipcv2_route_mtype_strings_1_7, "unknown"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str_const(msg_type, tipcv2_route_mtype_strings_1_7, "unknown"));
}
break;
case TIPCv2_CHANGEOVER_PROTOCOL:
- col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str(msg_type, tipcv2_changeover_mtype_strings, "unknown"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str_const(msg_type, tipcv2_changeover_mtype_strings, "unknown"));
break;
case TIPCv2_NAME_DISTRIBUTOR:
portNameType = tvb_get_ntohl(tvb, 40);
@@ -725,18 +725,18 @@ tipc_v2_set_info_col(tvbuff_t *tvb, packet_info *pinfo, guint8 user, guint8 msg_
if (portNameInstLow == portNameInstHigh) {
col_append_fstr(pinfo->cinfo, COL_INFO, " %s type:%d inst:%d",
- val_to_str(msg_type, tipcv2_naming_mtype_strings, "unknown"), portNameType, portNameInstLow);
+ val_to_str_const(msg_type, tipcv2_naming_mtype_strings, "unknown"), portNameType, portNameInstLow);
} else {
/* sequence */
col_append_fstr(pinfo->cinfo, COL_INFO, " %s type:%d seq:%d-%d",
- val_to_str(msg_type, tipcv2_naming_mtype_strings, "unknown"), portNameType, portNameInstLow, portNameInstHigh);
+ val_to_str_const(msg_type, tipcv2_naming_mtype_strings, "unknown"), portNameType, portNameInstLow, portNameInstHigh);
}
break;
case TIPCv2_MSG_FRAGMENTER:
- col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str(msg_type, tipcv2_fragmenter_mtype_strings, "unknown"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str_const(msg_type, tipcv2_fragmenter_mtype_strings, "unknown"));
break;
case TIPCv2_NEIGHBOUR_DISCOVERY:
- col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str(msg_type, tipcv2_neighbour_mtype_strings, "unknown"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str_const(msg_type, tipcv2_neighbour_mtype_strings, "unknown"));
break;
default:
break;
@@ -758,25 +758,25 @@ tipc_v1_set_col_msgtype(packet_info *pinfo, guint8 user, guint8 msg_type)
* src and dest address will be found at different location depending on User ad hdr_size
*/
datatype_hdr = TRUE;
- col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", val_to_str(msg_type, tipc_data_msg_type_values, "unknown"), msg_type);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", val_to_str_const(msg_type, tipc_data_msg_type_values, "unknown"), msg_type);
break;
case TIPC_NAME_DISTRIBUTOR:
- col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", val_to_str(msg_type, tipc_name_dist_msg_type_values, "unknown"), msg_type);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", val_to_str_const(msg_type, tipc_name_dist_msg_type_values, "unknown"), msg_type);
break;
case TIPC_CONNECTION_MANAGER:
- col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", val_to_str(msg_type, tipc_cm_msg_type_values, "unknown"), msg_type);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", val_to_str_const(msg_type, tipc_cm_msg_type_values, "unknown"), msg_type);
break;
case TIPC_ROUTING_MANAGER:
- col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", val_to_str(msg_type, tipc_routing_mgr_msg_type_values, "unknown"), msg_type);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", val_to_str_const(msg_type, tipc_routing_mgr_msg_type_values, "unknown"), msg_type);
break;
case TIPC_LINK_PROTOCOL:
- col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", val_to_str(msg_type, tipc_link_prot_msg_type_values, "unknown"), msg_type);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", val_to_str_const(msg_type, tipc_link_prot_msg_type_values, "unknown"), msg_type);
break;
case TIPC_CHANGEOVER_PROTOCOL:
- col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", val_to_str(msg_type, tipc_cng_prot_msg_type_values, "unknown"), msg_type);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", val_to_str_const(msg_type, tipc_cng_prot_msg_type_values, "unknown"), msg_type);
break;
case TIPC_SEGMENTATION_MANAGER:
- col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", val_to_str(msg_type, tipc_sm_msg_type_values, "unknown"), msg_type);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", val_to_str_const(msg_type, tipc_sm_msg_type_values, "unknown"), msg_type);
break;
case TIPC_MSG_BUNDLER:
break;
@@ -952,7 +952,7 @@ dissect_tipc_v2_internal_msg(tvbuff_t *tipc_tvb, proto_tree *tipc_tree, packet_i
msg_in_bundle_user = (dword >> 25) & 0xf;
proto_tree_add_text(top_tree, tipc_tvb, offset, msg_in_bundle_size, "Message %u of %u in Bundle (%s)",
- msg_no, message_count, val_to_str(msg_in_bundle_user, tipcv2_user_short_str_vals, "unknown"));
+ msg_no, message_count, val_to_str_const(msg_in_bundle_user, tipcv2_user_short_str_vals, "unknown"));
data_tvb = tvb_new_subset(tipc_tvb, offset, msg_in_bundle_size, msg_in_bundle_size);
/* the info column shall not be deleted by the
@@ -1903,7 +1903,7 @@ dissect_tipc_int_prot_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tipc_tr
case 0: /* DUPLICATE_MSG */
case 1: /* ORIGINAL_MSG */
proto_tree_add_text(tipc_tree, tvb, offset, -1, "TIPC_CHANGEOVER_PROTOCOL %s (%u)",
- val_to_str(msg_type, tipc_cng_prot_msg_type_values, "unknown"), msg_type);
+ val_to_str_const(msg_type, tipc_cng_prot_msg_type_values, "unknown"), msg_type);
data_tvb = tvb_new_subset_remaining(tvb, offset);
col_set_fence(pinfo->cinfo, COL_INFO);
dissect_tipc(data_tvb, pinfo, tipc_tree);
@@ -2048,7 +2048,7 @@ dissect_tipc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case 0:
case TIPCv1:
msg_type = tvb_get_guint8(tipc_tvb, offset + 20)>>4;
- col_append_fstr(pinfo->cinfo, COL_INFO, " %s(%u) ", val_to_str(user, tipc_user_values, "unknown"), user);
+ col_append_fstr(pinfo->cinfo, COL_INFO, " %s(%u) ", val_to_str_const(user, tipc_user_values, "unknown"), user);
/* Set msg type in info col and find out if its a data hdr or not */
datatype_hdr = tipc_v1_set_col_msgtype(pinfo, user, msg_type);
if (datatype_hdr) {
@@ -2075,7 +2075,7 @@ dissect_tipc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
case TIPCv2:
msg_type = tvb_get_guint8(tipc_tvb, offset + 4)>>5;
- col_append_fstr(pinfo->cinfo, COL_INFO, "%-12s", val_to_str(user, tipcv2_user_short_str_vals, "unknown"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%-12s", val_to_str_const(user, tipcv2_user_short_str_vals, "unknown"));
/* Set msg type in info col */
tipc_v2_set_info_col(tvb, pinfo, user, msg_type, hdr_size);
diff --git a/epan/dissectors/packet-tns.c b/epan/dissectors/packet-tns.c
index 9584b0f2e1..5586b51ce7 100644
--- a/epan/dissectors/packet-tns.c
+++ b/epan/dissectors/packet-tns.c
@@ -936,7 +936,7 @@ dissect_tns_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if ( check_col(pinfo->cinfo, COL_INFO))
{
col_append_fstr(pinfo->cinfo, COL_INFO, ", %s (%u)",
- val_to_str(type, tns_type_vals, "Unknown"), type);
+ val_to_str_const(type, tns_type_vals, "Unknown"), type);
}
if ( tree )
diff --git a/epan/dissectors/packet-tpncp.c b/epan/dissectors/packet-tpncp.c
index 0dfc51843a..8bbe430f1a 100644
--- a/epan/dissectors/packet-tpncp.c
+++ b/epan/dissectors/packet-tpncp.c
@@ -276,12 +276,12 @@ static void dissect_tpncp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
if (pinfo->srcport == UDP_PORT_TPNCP_TRUNKPACK) {
col_add_fstr(pinfo->cinfo, COL_INFO,
"EvID=%s(%d), SeqNo=%d, ChID=%d, Len=%d, Ver=%d",
- val_to_str(id, tpncp_events_id_vals, "Unknown"),
+ val_to_str_const(id, tpncp_events_id_vals, "Unknown"),
id, seq_number, cid, len, ver);
} else {
col_add_fstr(pinfo->cinfo, COL_INFO,
"CmdID=%s(%d), SeqNo=%d, Len=%d, Ver=%d",
- val_to_str(id, tpncp_commands_id_vals, "Unknown"),
+ val_to_str_const(id, tpncp_commands_id_vals, "Unknown"),
id, seq_number, len, ver);
}
}
@@ -301,7 +301,7 @@ static void dissect_tpncp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
proto_tree_add_int(tpncp_tree, hf_tpncp_cid, tvb, 12, 4, cid);
offset += 16;
if (tpncp_events_info_db[id].tpncp_data_field_size) {
- tpncp_header = ep_strdup_printf("TPNCP Event: %s (%d)", val_to_str(id, tpncp_events_id_vals, "Unknown"), id);
+ tpncp_header = ep_strdup_printf("TPNCP Event: %s (%d)", val_to_str_const(id, tpncp_events_id_vals, "Unknown"), id);
tpncp_item = proto_tree_add_text(tree, tvb, offset, -1, "%s", tpncp_header);
dissect_tpncp_event(id, tvb, tpncp_item, &offset);
}
@@ -312,7 +312,7 @@ static void dissect_tpncp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
proto_tree_add_uint(tpncp_tree, hf_tpncp_command_id, tvb, 8, 4, id);
offset += 12;
if (tpncp_commands_info_db[id].tpncp_data_field_size) {
- tpncp_header = ep_strdup_printf("TPNCP Command: %s (%d)", val_to_str(id, tpncp_commands_id_vals, "Unknown"), id);
+ tpncp_header = ep_strdup_printf("TPNCP Command: %s (%d)", val_to_str_const(id, tpncp_commands_id_vals, "Unknown"), id);
tpncp_item = proto_tree_add_text(tree, tvb, offset, -1, "%s", tpncp_header);
dissect_tpncp_command(id, tvb, tpncp_item, &offset);
}
diff --git a/epan/dissectors/packet-ua3g.c b/epan/dissectors/packet-ua3g.c
index df637a36e8..ac6ebcbae7 100644
--- a/epan/dissectors/packet-ua3g.c
+++ b/epan/dissectors/packet-ua3g.c
@@ -2630,7 +2630,7 @@ decode_beep(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo,
offset++;
length--;
proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "%s %d: %x",
- val_to_str(beep_number, str_duration, "Unknown"),
+ val_to_str_const(beep_number, str_duration, "Unknown"),
i, tvb_get_guint8(tvb, offset));
offset++;
length--;
diff --git a/epan/dissectors/packet-ucp.c b/epan/dissectors/packet-ucp.c
index bb5915d9c0..54639fe820 100644
--- a/epan/dissectors/packet-ucp.c
+++ b/epan/dissectors/packet-ucp.c
@@ -1832,7 +1832,7 @@ dissect_ucp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Make entries in Info column on summary display */
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, "%s (%s)",
- val_to_str(OT, vals_hdr_OT, "unknown operation"),
+ val_to_str_const(OT, vals_hdr_OT, "unknown operation"),
val_to_str(O_R, vals_hdr_O_R, "Unknown (%d)"));
if (result == UCP_INV_CHK)
col_append_str(pinfo->cinfo, COL_INFO, " [checksum invalid]");
diff --git a/epan/dissectors/packet-umts_mac.c b/epan/dissectors/packet-umts_mac.c
index 22c20a8b8e..106c3c9bae 100644
--- a/epan/dissectors/packet-umts_mac.c
+++ b/epan/dissectors/packet-umts_mac.c
@@ -287,7 +287,7 @@ static void dissect_mac_fdd_rach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
col_set_str(pinfo->cinfo, COL_PROTOCOL, "MAC");
col_add_str(pinfo->cinfo, COL_INFO,
- val_to_str(tctf, rach_fdd_tctf_vals, "Unknown TCTF"));
+ val_to_str_const(tctf, rach_fdd_tctf_vals, "Unknown TCTF"));
ti = proto_tree_add_item(tree, proto_umts_mac, tvb, 0, -1, ENC_NA);
rach_tree = proto_item_add_subtree(ti, ett_mac_rach);
@@ -379,7 +379,7 @@ static void dissect_mac_fdd_fach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
col_set_str(pinfo->cinfo, COL_PROTOCOL, "MAC");
col_add_str(pinfo->cinfo, COL_INFO,
- val_to_str(tctf, fach_fdd_tctf_vals, "Unknown TCTF"));
+ val_to_str_const(tctf, fach_fdd_tctf_vals, "Unknown TCTF"));
ti = proto_tree_add_item(tree, proto_umts_mac, tvb, 0, -1, ENC_NA);
fach_tree = proto_item_add_subtree(ti, ett_mac_fach);
diff --git a/epan/dissectors/packet-v52.c b/epan/dissectors/packet-v52.c
index 5e3e659fc9..bb87cf48fe 100644
--- a/epan/dissectors/packet-v52.c
+++ b/epan/dissectors/packet-v52.c
@@ -707,7 +707,7 @@ dissect_pstn_sequence_number(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
proto_tree_add_item(info_tree, hf_v52_pstn_sequence_number, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
col_append_fstr(pinfo->cinfo, COL_INFO, " | SN: %u", pstn_sequence_number_tmp);
@@ -740,11 +740,11 @@ dissect_cadenced_ring(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
cadenced_ring_tmp = tvb_get_guint8(info_tvb, info_offset+2)-0x80;
proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
proto_tree_add_item(info_tree, hf_v52_cadenced_ring, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
col_append_str(pinfo->cinfo, COL_INFO, " | ");
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
col_append_fstr(pinfo->cinfo, COL_INFO, ": %u", cadenced_ring_tmp);
@@ -776,7 +776,7 @@ dissect_pulsed_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
if (info_tree != NULL) {
proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
proto_tree_add_item(info_tree, hf_v52_pulse_type, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN);
if (data_length > 3) {
@@ -790,10 +790,10 @@ dissect_pulsed_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
}
col_append_str(pinfo->cinfo, COL_INFO, " | ");
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
col_append_str(pinfo->cinfo, COL_INFO, ": ");
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset+2), pulse_type_values, "Unknown element"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2), pulse_type_values, "Unknown element"));
}
}
@@ -824,14 +824,14 @@ dissect_steady_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
if (info_tree != NULL) {
proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
proto_tree_add_item(info_tree, hf_v52_steady_signal, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN);
col_append_str(pinfo->cinfo, COL_INFO, " | ");
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
col_append_str(pinfo->cinfo, COL_INFO, ": ");
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset+2)-0x80, steady_signal_values, "Unknown element"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, steady_signal_values, "Unknown element"));
}
}
@@ -861,13 +861,13 @@ dissect_digit_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of
if (info_tree != NULL) {
proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
buffer = tvb_get_guint8(info_tvb, info_offset+2)>>6;
buffer = buffer&0x01;
proto_tree_add_uint_format(info_tree, hf_v52_digit_ack, info_tvb, info_offset+2, 1, buffer,
- "Digit ack request indication: %s",val_to_str(buffer,digit_ack_values,"unknown"));
+ "Digit ack request indication: %s",val_to_str_const(buffer,digit_ack_values,"unknown"));
buffer = tvb_get_guint8(info_tvb, info_offset+2)>>4;
buffer = buffer&0x03;
@@ -876,7 +876,7 @@ dissect_digit_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of
proto_tree_add_item(info_tree, hf_v52_digit_info, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
col_append_str(pinfo->cinfo, COL_INFO, " | ");
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
col_append_fstr(pinfo->cinfo, COL_INFO, ": %u", buffer);
@@ -910,7 +910,7 @@ dissect_recognition_time(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in
if (info_tree != NULL) {
proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
buffer = tvb_get_guint8(info_tvb, info_offset+2)&0x7f;
/*Signal = Coding of pulse type*/
@@ -923,7 +923,7 @@ dissect_recognition_time(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in
proto_tree_add_item(info_tree, hf_v52_duration_type, info_tvb, info_offset+3, 1, ENC_BIG_ENDIAN);
col_append_str(pinfo->cinfo, COL_INFO, " | ");
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
}
}
@@ -953,7 +953,7 @@ dissect_enable_auto_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
if (info_tree != NULL) {
proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
buffer = tvb_get_guint8(info_tvb, info_offset+2)&0x7f;
/*Signal*/
@@ -979,7 +979,7 @@ dissect_enable_auto_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
}
col_append_str(pinfo->cinfo, COL_INFO, " | ");
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
}
}
@@ -1009,7 +1009,7 @@ dissect_disable_auto_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in
if (info_tree != NULL) {
proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
buffer = tvb_get_guint8(info_tvb, info_offset+2)&0x7f;
@@ -1019,7 +1019,7 @@ dissect_disable_auto_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in
proto_tree_add_item(info_tree, hf_v52_steady_signal, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN);
col_append_str(pinfo->cinfo, COL_INFO, " | ");
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
}
}
@@ -1048,18 +1048,18 @@ dissect_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
if (info_tree != NULL) {
proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"), info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"), info_element);
proto_tree_add_item(info_tree, hf_v52_cause_type, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN);
if(tvb_length_remaining(info_tvb, info_offset+3))
proto_tree_add_uint_format(info_tree, hf_v52_msg_type, info_tvb, info_offset+3, 1, tvb_get_guint8(info_tvb, info_offset+3),
- "Diagnostic: %s",val_to_str(tvb_get_guint8(info_tvb, info_offset+3), msg_type_values,"unknown"));
+ "Diagnostic: %s",val_to_str_const(tvb_get_guint8(info_tvb, info_offset+3), msg_type_values,"unknown"));
col_append_str(pinfo->cinfo, COL_INFO, " | ");
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
col_append_str(pinfo->cinfo, COL_INFO, ": ");
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset+2)-0x80, cause_type_values, "Unknown element"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, cause_type_values, "Unknown element"));
}
}
@@ -1088,11 +1088,11 @@ dissect_resource_unavailable(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
if (info_tree != NULL) {
proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
proto_tree_add_item(info_tree, hf_v52_res_unavailable, info_tvb, info_offset+2, info_element_length, ENC_ASCII|ENC_NA);
col_append_str(pinfo->cinfo, COL_INFO, " | ");
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
}
}
@@ -1119,11 +1119,11 @@ dissect_pulse_notification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
if (info_tree != NULL) {
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
proto_tree_add_item(info_tree, hf_v52_pulse_notification, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
col_append_str(pinfo->cinfo, COL_INFO, " | ");
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
}
}
@@ -1150,11 +1150,11 @@ dissect_line_information(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in
}
if (info_tree != NULL) {
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
proto_tree_add_item(info_tree, hf_v52_line_info, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
col_append_str(pinfo->cinfo, COL_INFO, " | ");
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
}
}
@@ -1181,11 +1181,11 @@ dissect_state(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
}
if (info_tree != NULL) {
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
proto_tree_add_item(info_tree, hf_v52_state, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
col_append_str(pinfo->cinfo, COL_INFO, " | ");
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
}
}
@@ -1212,11 +1212,11 @@ dissect_auto_sig_sequence(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, i
}
if (info_tree != NULL) {
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
proto_tree_add_item(info_tree, hf_v52_auto_signalling_sequence, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
col_append_str(pinfo->cinfo, COL_INFO, " | ");
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
}
}
@@ -1243,11 +1243,11 @@ dissect_sequence_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, i
}
if (info_tree != NULL) {
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
proto_tree_add_item(info_tree, hf_v52_sequence_response, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
col_append_str(pinfo->cinfo, COL_INFO, " | ");
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
}
}
@@ -1276,13 +1276,13 @@ dissect_control_function_element(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
if (info_tree != NULL) {
proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
proto_tree_add_item(info_tree, hf_v52_control_function_element, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
if (message_type_tmp == 0x11) {}
else {
col_append_str(pinfo->cinfo, COL_INFO, " | ");
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset+2)-0x80, control_function_element_values, "Unknown element"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, control_function_element_values, "Unknown element"));
}
}
}
@@ -1312,13 +1312,13 @@ dissect_control_function_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (info_tree != NULL) {
proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
proto_tree_add_item(info_tree, hf_v52_control_function_id, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
if (message_type_tmp == 0x13) {}
else {
col_append_str(pinfo->cinfo, COL_INFO, " | ");
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset+2)-0x80, control_function_id_values_short, "Unknown layer3 element"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, control_function_id_values_short, "Unknown layer3 element"));
}
}
}
@@ -1349,7 +1349,7 @@ dissect_variant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
if (info_tree != NULL) {
proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
proto_tree_add_item(info_tree, hf_v52_variant, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
variantValue = tvb_get_guint8(info_tvb, info_offset+2)-0x80;
@@ -1383,7 +1383,7 @@ dissect_interface_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of
if (info_tree != NULL) {
proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
proto_tree_add_item(info_tree, hf_v52_if_up_id, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_if_id, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_if_low_id, info_tvb, info_offset+4, info_element_length, ENC_BIG_ENDIAN);
@@ -1421,11 +1421,11 @@ dissect_sequence_number(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
hf_v52_sequence_number_tmp = tvb_get_guint8(info_tvb, info_offset+2)-0x80;
proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
proto_tree_add_item(info_tree, hf_v52_sequence_number, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
col_append_str(pinfo->cinfo, COL_INFO, " | ");
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset), info_element_values_short, "Unknown element"));
col_append_fstr(pinfo->cinfo, COL_INFO, ": %u", hf_v52_sequence_number_tmp);
@@ -1460,7 +1460,7 @@ dissect_physical_c_channel_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
if (info_tree != NULL) {
proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
proto_tree_add_item(info_tree, hf_v52_v5_link_id, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_v5_time_slot, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN);
@@ -1496,11 +1496,11 @@ dissect_pp_rejection_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (info_tree != NULL) {
proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
proto_tree_add_item(info_tree, hf_v52_rejection_cause, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
col_append_str(pinfo->cinfo, COL_INFO, " | ");
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset+2)-0x80, rejection_cause_values, "Unknown element"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, rejection_cause_values, "Unknown element"));
}
}
@@ -1529,13 +1529,13 @@ dissect_protocol_error(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
if (info_tree != NULL) {
proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
proto_tree_add_item(info_tree, hf_v52_error_cause, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_diagnostic_msg, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_diagnostic_element, info_tvb, info_offset+4, info_element_length, ENC_BIG_ENDIAN);
col_append_str(pinfo->cinfo, COL_INFO, " | ");
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset+2)-0x80, error_cause_values, "Unknown element"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, error_cause_values, "Unknown element"));
}
}
@@ -1563,11 +1563,11 @@ dissect_performance_grading(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
if (info_tree != NULL) {
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
proto_tree_add_item(info_tree, hf_v52_performance_grading, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
col_append_str(pinfo->cinfo, COL_INFO, " | ");
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset)-0xe0, performance_grading_values, "Unknown element"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset)-0xe0, performance_grading_values, "Unknown element"));
}
}
@@ -1595,11 +1595,11 @@ dissect_cp_rejection_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
if (info_tree != NULL) {
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
proto_tree_add_item(info_tree, hf_v52_cp_rejection_cause, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
col_append_str(pinfo->cinfo, COL_INFO, " | ");
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset)-0xe0, cp_rejection_cause_values, "Unknown element"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset)-0xe0, cp_rejection_cause_values, "Unknown element"));
}
}
@@ -1631,7 +1631,7 @@ dissect_user_port_identification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
if (info_tree != NULL) {
proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
buffer = tvb_get_guint8(info_tvb, info_offset+2)&0x01;
@@ -1680,7 +1680,7 @@ dissect_isdn_port_time_slot_identification(tvbuff_t *tvb, packet_info *pinfo, pr
if (info_tree != NULL) {
proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
proto_tree_add_item(info_tree, hf_v52_isdn_user_port_ts_num, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
isdn_user_port_ts_num_tmp = (tvb_get_guint8(info_tvb, info_offset+2)) - 128;
@@ -1716,7 +1716,7 @@ dissect_v5_time_slot_identification(tvbuff_t *tvb, packet_info *pinfo, proto_tre
if (info_tree != NULL) {
proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
proto_tree_add_item(info_tree, hf_v52_v5_link_id, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_override, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_v5_time_slot, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN);
@@ -1761,7 +1761,7 @@ dissect_multi_slot_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
if (info_tree != NULL) {
proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
proto_tree_add_item(info_tree, hf_v52_v5_link_id, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
col_append_fstr(pinfo->cinfo, COL_INFO, " | V5MSlink ID:%u",tvb_get_guint8(info_tvb, info_offset+2));
@@ -1810,11 +1810,11 @@ dissect_bcc_rejct_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
if (info_tree != NULL) {
proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
proto_tree_add_item(info_tree, hf_v52_reject_cause_type, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
col_append_str(pinfo->cinfo, COL_INFO, " | ");
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset+2)-0x80, reject_cause_type_values, "Unknown element"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, reject_cause_type_values, "Unknown element"));
}
}
@@ -1843,11 +1843,11 @@ dissect_bcc_protocol_error_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
if (info_tree != NULL) {
proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
proto_tree_add_item(info_tree, hf_v52_bcc_protocol_error_cause, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
col_append_str(pinfo->cinfo, COL_INFO, " | ");
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset+2)-0x80, bcc_protocol_error_cause_type_values, "Unknown element"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, bcc_protocol_error_cause_type_values, "Unknown element"));
if(tvb_length_remaining(info_tvb, info_offset+3))
proto_tree_add_item(info_tree, hf_v52_diagnostic_message, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN);
@@ -1881,16 +1881,16 @@ dissect_connection_incomplete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
if (info_tree != NULL) {
proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
proto_tree_add_item(info_tree, hf_v52_connection_incomplete_reason, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
col_append_str(pinfo->cinfo, COL_INFO, " | ");
if ((tvb_get_guint8(info_tvb, info_offset+2) < 0x80)) {
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset+2), connection_incomplete_reason_values, "Unknown element"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2), connection_incomplete_reason_values, "Unknown element"));
}
else {
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset+2)-0x80, connection_incomplete_reason_values, "Unknown element"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, connection_incomplete_reason_values, "Unknown element"));
}
}
@@ -1921,13 +1921,13 @@ dissect_link_control_function(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
if (info_tree != NULL) {
proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
- proto_item_append_text(ti_info, " %s (0x%x)",val_to_str(info_element, info_element_values, "unknown info element"),info_element);
+ proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
proto_tree_add_item(info_tree, hf_v52_link_control_function, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN);
if (message_type_tmp == 0x31) {}
else {
col_append_str(pinfo->cinfo, COL_INFO, " | ");
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(info_tvb, info_offset+2)-0x80, link_control_function_values, "Unknown element"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, link_control_function_values, "Unknown element"));
}
}
}
@@ -2235,7 +2235,7 @@ dissect_v52_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_append_str(pinfo->cinfo, COL_INFO, " | ");
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(tvb_get_guint8(tvb, MSG_TYPE_OFFSET), msg_type_values_short, "Unknown msg type"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(tvb, MSG_TYPE_OFFSET), msg_type_values_short, "Unknown msg type"));
dissect_v52_info(tvb, pinfo, v52_tree);
}
diff --git a/epan/dissectors/packet-v5ua.c b/epan/dissectors/packet-v5ua.c
index 3f3c7b35b2..35a0c6ed60 100644
--- a/epan/dissectors/packet-v5ua.c
+++ b/epan/dissectors/packet-v5ua.c
@@ -270,8 +270,8 @@ tei = tvb_get_ntohs(parameter_tvb, offset-DLCI_TEI_LENGTH)>>1;
}
else if (efa > 8175 && efa <= 8180){
proto_tree_add_uint_format(parameter_tree, hf_efa, parameter_tvb, offset, EFA_LENGTH, efa,
- "Envelope function address: %s (%u)", val_to_str(efa, efa_values, "unknown EFA"),tvb_get_ntohs(parameter_tvb, offset));
- proto_item_append_text(parameter_item, " (SAPI:%u TEI:%u EFA:%s (%u))",sapi,tei,val_to_str(efa, efa_values, "unknown EFA-value"),efa);
+ "Envelope function address: %s (%u)", val_to_str_const(efa, efa_values, "unknown EFA"),tvb_get_ntohs(parameter_tvb, offset));
+ proto_item_append_text(parameter_item, " (SAPI:%u TEI:%u EFA:%s (%u))",sapi,tei,val_to_str_const(efa, efa_values, "unknown EFA-value"),efa);
}
else if(efa >= 8181){
proto_tree_add_uint_format(parameter_tree, hf_efa, parameter_tvb, offset, EFA_LENGTH, efa,
@@ -308,8 +308,8 @@ tei = tvb_get_ntohs(parameter_tvb, offset-DLCI_TEI_LENGTH)>>1;
else if (efa > 8175 && efa <= 8180){
proto_tree_add_uint_format(parameter_tree, hf_efa, parameter_tvb, offset, EFA_LENGTH, efa,
- "Envelope function address: %s (%u)", val_to_str(efa, efa_values, "unknown EFA"),tvb_get_ntohs(parameter_tvb, offset));
- proto_item_append_text(parameter_item, " (SAPI:%u TEI:%u EFA:%s (%u))",sapi,tei,val_to_str(efa, efa_values, "unknown EFA-value"),efa);
+ "Envelope function address: %s (%u)", val_to_str_const(efa, efa_values, "unknown EFA"),tvb_get_ntohs(parameter_tvb, offset));
+ proto_item_append_text(parameter_item, " (SAPI:%u TEI:%u EFA:%s (%u))",sapi,tei,val_to_str_const(efa, efa_values, "unknown EFA-value"),efa);
}
else if(efa >= 8181){
@@ -401,7 +401,7 @@ dissect_error_code_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree
{
proto_tree_add_item(parameter_tree, hf_error_code, parameter_tvb, MGMT_ERROR_CODE_OFFSET, MGMT_ERROR_CODE_LENGTH, ENC_BIG_ENDIAN);
proto_item_append_text(parameter_item, " (%s)",
- val_to_str(tvb_get_ntohl(parameter_tvb, MGMT_ERROR_CODE_OFFSET), error_code_values, "Unknown error code"));
+ val_to_str_const(tvb_get_ntohl(parameter_tvb, MGMT_ERROR_CODE_OFFSET), error_code_values, "Unknown error code"));
}
static void
@@ -460,10 +460,10 @@ dissect_status_type_identification_parameter(tvbuff_t *parameter_tvb, proto_tree
proto_tree_add_item(parameter_tree, hf_status_type, parameter_tvb, NTFY_STATUS_TYPE_OFFSET, NTFY_STATUS_TYPE_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_uint_format(parameter_tree, hf_status_id, parameter_tvb, NTFY_STATUS_IDENT_OFFSET, NTFY_STATUS_IDENT_LENGTH,
status_id, "Status identification: %u (%s)", status_id,
- val_to_str(status_type * 256 * 256 + status_id, status_type_id_values, "unknown"));
+ val_to_str_const(status_type * 256 * 256 + status_id, status_type_id_values, "unknown"));
proto_item_append_text(parameter_item, " (%s)",
- val_to_str(status_type * 256 * 256 + status_id, status_type_id_values, "Unknown status information"));
+ val_to_str_const(status_type * 256 * 256 + status_id, status_type_id_values, "Unknown status information"));
}
/*----------------------Notify (RFC)-------------------------------------------*/
@@ -486,7 +486,7 @@ dissect_tei_status_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree
{
proto_tree_add_item(parameter_tree, hf_tei_status, parameter_tvb, TEI_STATUS_OFFSET, TEI_STATUS_LENGTH, ENC_BIG_ENDIAN);
proto_item_append_text(parameter_item, " (%s)",
- val_to_str(tvb_get_ntohl(parameter_tvb, TEI_STATUS_OFFSET), tei_status_values, "Unknown TEI status"));
+ val_to_str_const(tvb_get_ntohl(parameter_tvb, TEI_STATUS_OFFSET), tei_status_values, "Unknown TEI status"));
}
/*----------------------TEI Status (RFC)---------------------------------------*/
@@ -509,7 +509,7 @@ dissect_draft_tei_status_parameter(tvbuff_t *parameter_tvb, proto_tree *paramete
if(tvb_length_remaining(parameter_tvb, offset) > 0 ){
proto_tree_add_item(parameter_tree, hf_tei_draft_status, parameter_tvb, offset, TEI_STATUS_LENGTH, ENC_BIG_ENDIAN);
proto_item_append_text(parameter_item, " (%s)",
- val_to_str(tvb_get_ntohl(parameter_tvb, offset), tei_draft_status_values, "Unknown TEI Status"));
+ val_to_str_const(tvb_get_ntohl(parameter_tvb, offset), tei_draft_status_values, "Unknown TEI Status"));
}
}
/*----------------------TEI Status (Draft)-------------------------------------*/
@@ -552,7 +552,7 @@ static void
dissect_asp_reason_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
{
proto_tree_add_item(parameter_tree, hf_asp_reason, parameter_tvb, ASP_REASON_OFFSET, ASP_REASON_LENGTH, ENC_BIG_ENDIAN);
- proto_item_append_text(parameter_item, " (%s)", val_to_str(tvb_get_ntohl(parameter_tvb, ASP_REASON_OFFSET), asp_reason_values, "Unknown ASP down reason"));
+ proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, ASP_REASON_OFFSET), asp_reason_values, "Unknown ASP down reason"));
}
@@ -593,7 +593,7 @@ dissect_traffic_mode_type_parameter(tvbuff_t *parameter_tvb, proto_tree *paramet
{
proto_tree_add_item(parameter_tree, hf_traffic_mode_type, parameter_tvb, TRAFFIC_MODE_TYPE_OFFSET, TRAFFIC_MODE_TYPE_LENGTH, ENC_BIG_ENDIAN);
proto_item_append_text(parameter_item, " (%s)",
- val_to_str(tvb_get_ntohl(parameter_tvb, TRAFFIC_MODE_TYPE_OFFSET), traffic_mode_type_values, "Unknown traffic mode type"));
+ val_to_str_const(tvb_get_ntohl(parameter_tvb, TRAFFIC_MODE_TYPE_OFFSET), traffic_mode_type_values, "Unknown traffic mode type"));
}
#define INT_RANGE_START_OFFSET PARAMETER_VALUE_OFFSET
@@ -713,7 +713,7 @@ dissect_release_reason_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_
proto_tree_add_item(parameter_tree, hf_release_reason, parameter_tvb, offset, RELEASE_REASON_LENGTH, ENC_BIG_ENDIAN);
if(iua_version != DRAFT)
proto_item_append_text(parameter_item, " (%s)",
- val_to_str(tvb_get_ntohl(parameter_tvb, offset), release_reason_values, "Unknown release reason"));
+ val_to_str_const(tvb_get_ntohl(parameter_tvb, offset), release_reason_values, "Unknown release reason"));
}
/*----------------------Release Indication,Request (Draft,RFC)-----------------*/
@@ -742,7 +742,7 @@ dissect_link_status_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tre
{
proto_tree_add_item(parameter_tree, hf_link_status, parameter_tvb, LINK_STATUS_OFFSET, LINK_STATUS_LENGTH, ENC_BIG_ENDIAN);
proto_item_append_text(parameter_item, " (%s)",
- val_to_str(tvb_get_ntohl(parameter_tvb, LINK_STATUS_OFFSET),link_status_values, "Unknown Link status"));
+ val_to_str_const(tvb_get_ntohl(parameter_tvb, LINK_STATUS_OFFSET),link_status_values, "Unknown Link status"));
link_status_operational = tvb_get_ntohl(parameter_tvb, LINK_STATUS_OFFSET);
}
@@ -772,8 +772,8 @@ dissect_sa_bit_status_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_t
proto_tree_add_item(parameter_tree, hf_sa_bit_id, parameter_tvb, SA_BIT_ID_OFFSET, SA_BIT_ID_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_item(parameter_tree, hf_sa_bit_value, parameter_tvb, SA_BIT_VALUE_OFFSET, SA_BIT_VALUE_LENGTH, ENC_BIG_ENDIAN);
proto_item_append_text(parameter_item, " (%s %s)",
- val_to_str(tvb_get_ntohs(parameter_tvb, SA_BIT_ID_OFFSET), sa_bit_values, "unknown"),
- val_to_str(tvb_get_ntohs(parameter_tvb, SA_BIT_VALUE_OFFSET), sa_bit_values, "unknown Bit"));
+ val_to_str_const(tvb_get_ntohs(parameter_tvb, SA_BIT_ID_OFFSET), sa_bit_values, "unknown"),
+ val_to_str_const(tvb_get_ntohs(parameter_tvb, SA_BIT_VALUE_OFFSET), sa_bit_values, "unknown Bit"));
sa_bit_id = tvb_get_ntohs(parameter_tvb, SA_BIT_VALUE_OFFSET);
}
@@ -795,7 +795,7 @@ dissect_error_indication_parameter(tvbuff_t *parameter_tvb, proto_tree *paramete
{
proto_tree_add_item(parameter_tree, hf_error_reason, parameter_tvb, ERROR_REASON_OFFSET, ERROR_REASON_LENGTH, ENC_BIG_ENDIAN);
proto_item_append_text(parameter_item, " (%s)",
- val_to_str(tvb_get_ntohl(parameter_tvb, ERROR_REASON_OFFSET), error_reason_values, "unknown"));
+ val_to_str_const(tvb_get_ntohl(parameter_tvb, ERROR_REASON_OFFSET), error_reason_values, "unknown"));
}
/*----------------------Error Indication (RFC)---------------------------------*/
@@ -926,7 +926,7 @@ dissect_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *v5ua_
switch(iua_version){
case RFC:
parameter_item = proto_tree_add_text(v5ua_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb), "%s",
- val_to_str(tag, parameter_tag_values, "Unknown parameter"));
+ val_to_str_const(tag, parameter_tag_values, "Unknown parameter"));
parameter_tree = proto_item_add_subtree(parameter_item, ett_v5ua_parameter);
/* add tag to the v5ua tree */
proto_tree_add_item(parameter_tree, hf_parameter_tag, parameter_tvb, PARAMETER_TAG_OFFSET, PARAMETER_TAG_LENGTH, ENC_BIG_ENDIAN);
@@ -934,7 +934,7 @@ dissect_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *v5ua_
case DRAFT:
default:
parameter_item = proto_tree_add_text(v5ua_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb), "%s",
- val_to_str(tag, parameter_tag_draft_values, "Unknown parameter"));
+ val_to_str_const(tag, parameter_tag_draft_values, "Unknown parameter"));
parameter_tree = proto_item_add_subtree(parameter_item, ett_v5ua_parameter);
/* add tag to the v5ua tree */
@@ -1328,7 +1328,7 @@ dissect_common_header(tvbuff_t *common_header_tvb, packet_info *pinfo, proto_tre
message_type = tvb_get_guint8(common_header_tvb, COMMON_HEADER_MSG_TYPE_OFFSET);
/* Add message type into info column */
- col_add_str(pinfo->cinfo, COL_INFO, val_to_str(message_class * 256 + message_type, msg_class_type_values_short, "UNKNOWN"));
+ col_add_str(pinfo->cinfo, COL_INFO, val_to_str_const(message_class * 256 + message_type, msg_class_type_values_short, "UNKNOWN"));
if (v5ua_tree) {
@@ -1344,11 +1344,11 @@ dissect_common_header(tvbuff_t *common_header_tvb, packet_info *pinfo, proto_tre
proto_tree_add_uint_format(common_header_tree, hf_msg_type,
common_header_tvb, COMMON_HEADER_MSG_TYPE_OFFSET, COMMON_HEADER_MSG_TYPE_LENGTH,
message_type, "Message type: %s ( %u )",
- val_to_str(message_class * 256 + message_type, msg_class_type_values, "reserved"), message_type);
+ val_to_str_const(message_class * 256 + message_type, msg_class_type_values, "reserved"), message_type);
proto_tree_add_item(common_header_tree, hf_msg_length, common_header_tvb, COMMON_HEADER_MSG_LENGTH_OFFSET, COMMON_HEADER_MSG_LENGTH_LENGTH, ENC_BIG_ENDIAN);
/* Add message type to the Common Msg-Header line */
- proto_item_append_text(common_header_item, " (%s)",val_to_str(message_class * 256 + message_type, msg_class_type_values, "Unknown Msg-Type"));
+ proto_item_append_text(common_header_item, " (%s)",val_to_str_const(message_class * 256 + message_type, msg_class_type_values, "Unknown Msg-Type"));
messageclassCopy = message_class;
}
diff --git a/epan/dissectors/packet-vines.c b/epan/dissectors/packet-vines.c
index ad3f08f8d7..4548f23757 100644
--- a/epan/dissectors/packet-vines.c
+++ b/epan/dissectors/packet-vines.c
@@ -322,7 +322,7 @@ dissect_vines_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_text(vines_llc_tree, tvb, 0, 1,
"Packet Type: %s (0x%02x)",
- val_to_str(ptype, vines_llc_ptype_vals,
+ val_to_str_const(ptype, vines_llc_ptype_vals,
"Unknown"),
ptype);
}
@@ -406,7 +406,7 @@ dissect_vines_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "%s (0x%02x)",
- val_to_str(viph.vip_proto, proto_vals,
+ val_to_str_const(viph.vip_proto, proto_vals,
"Unknown VIP protocol"),
viph.vip_proto);
}
@@ -704,7 +704,7 @@ dissect_vines_ipc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_text(vipc_tree, tvb, offset, 1,
"Packet type: 0x%02x (%s)",
viph.vipc_pkttype,
- val_to_str(viph.vipc_pkttype, pkttype_vals,
+ val_to_str_const(viph.vipc_pkttype, pkttype_vals,
"Unknown"));
}
offset += 1;
@@ -769,7 +769,7 @@ dissect_vines_ipc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (viph.vipc_pkttype == PKTTYPE_ERR) {
proto_tree_add_text(vipc_tree, tvb, offset, 2,
"Error: %s (%u)",
- val_to_str(viph.vipc_err_len,
+ val_to_str_const(viph.vipc_err_len,
vipc_err_vals,
"Unknown"),
viph.vipc_err_len);
@@ -869,7 +869,7 @@ dissect_vines_spp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_text(vspp_tree, tvb, offset + 4, 1,
"Packet type: 0x%02x (%s)",
viph.vspp_pkttype,
- val_to_str(viph.vspp_pkttype, pkttype_vals,
+ val_to_str_const(viph.vspp_pkttype, pkttype_vals,
"Unknown"));
ti = proto_tree_add_text(vspp_tree, tvb, offset + 5, 1,
"Control: 0x%02x", viph.vspp_control);
@@ -991,7 +991,7 @@ dissect_vines_arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
proto_tree_add_text(vines_arp_tree, tvb, 0, 1,
"Version: %s (0x%02x)",
- val_to_str(version, vines_version_vals,
+ val_to_str_const(version, vines_version_vals,
"Unknown"),
version);
}
@@ -1009,7 +1009,7 @@ dissect_vines_arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
proto_tree_add_text(vines_arp_tree, tvb, 1, 1,
"Packet Type: %s (0x%02x)",
- val_to_str(packet_type,
+ val_to_str_const(packet_type,
vines_arp_packet_type_vals,
"Unknown"),
packet_type);
@@ -1051,7 +1051,7 @@ dissect_vines_arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
proto_tree_add_text(vines_arp_tree, tvb, 0, 2,
"Packet Type: %s (0x%04x)",
- val_to_str(packet_type,
+ val_to_str_const(packet_type,
vines_arp_packet_type_vals,
"Unknown"),
packet_type);
@@ -1178,7 +1178,7 @@ dissect_vines_rtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
proto_tree_add_text(vines_rtp_tree, tvb, offset, 1,
"Operation Type: %s (0x%02x)",
- val_to_str(operation_type,
+ val_to_str_const(operation_type,
vines_rtp_operation_type_vals,
"Unknown"),
operation_type);
@@ -1186,7 +1186,7 @@ dissect_vines_rtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
node_type = tvb_get_guint8(tvb, offset);
proto_tree_add_text(vines_rtp_tree, tvb, offset, 1,
"Node Type: %s (0x%02x)",
- val_to_str(node_type,
+ val_to_str_const(node_type,
vines_rtp_node_type_vals,
"Unknown"),
node_type);
@@ -1194,7 +1194,7 @@ dissect_vines_rtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
controller_type = tvb_get_guint8(tvb, offset);
proto_tree_add_text(vines_rtp_tree, tvb, offset, 1,
"Controller Type: %s (0x%02x)",
- val_to_str(controller_type,
+ val_to_str_const(controller_type,
vines_rtp_controller_type_vals,
"Unknown"),
controller_type);
@@ -1258,7 +1258,7 @@ dissect_vines_rtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
version = tvb_get_ntohs(tvb, offset);
proto_tree_add_text(vines_rtp_tree, tvb, offset, 2,
"Version: %s (0x%04x)",
- val_to_str(version, vines_version_vals,
+ val_to_str_const(version, vines_version_vals,
"Unknown"),
version);
}
@@ -1272,7 +1272,7 @@ dissect_vines_rtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
proto_tree_add_text(vines_rtp_tree, tvb, offset, 1,
"Operation Type: %s (0x%02x)",
- val_to_str(operation_type,
+ val_to_str_const(operation_type,
vines_rtp_operation_type_vals,
"Unknown"),
operation_type);
@@ -1280,7 +1280,7 @@ dissect_vines_rtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
node_type = tvb_get_guint8(tvb, offset);
proto_tree_add_text(vines_rtp_tree, tvb, offset, 1,
"Node Type: %s (0x%02x)",
- val_to_str(node_type,
+ val_to_str_const(node_type,
vines_rtp_node_type_vals,
"Unknown"),
node_type);
@@ -1326,7 +1326,7 @@ dissect_vines_rtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_text(vines_rtp_tree, tvb,
offset, 1,
"Information Type: %s (0x%02x)",
- val_to_str(info_type,
+ val_to_str_const(info_type,
vines_rtp_info_type_vals,
"Unknown"),
info_type);
@@ -1449,7 +1449,7 @@ dissect_vines_rtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_text(vines_rtp_tree, tvb,
offset, 1,
"Destination Node Type: %s (0x%02x)",
- val_to_str(node_type,
+ val_to_str_const(node_type,
vines_rtp_node_type_vals,
"Unknown"),
node_type);
@@ -1477,7 +1477,7 @@ dissect_vines_rtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_text(vines_rtp_tree, tvb,
offset, 1,
"Preferred Gateway Node Type: %s (0x%02x)",
- val_to_str(node_type,
+ val_to_str_const(node_type,
vines_rtp_node_type_vals,
"Unknown"),
node_type);
@@ -1578,7 +1578,7 @@ srtp_show_machine_info(proto_tree *tree, tvbuff_t *tvb, int offset, const char *
node_type = tvb_get_guint8(tvb, offset);
proto_tree_add_text(tree, tvb, offset, 1,
"%s Node Type: %s (0x%02x)", tag,
- val_to_str(node_type, vines_rtp_node_type_vals, "Unknown"),
+ val_to_str_const(node_type, vines_rtp_node_type_vals, "Unknown"),
node_type);
offset += 1;
rtp_show_machine_type(tree, tvb, offset, tag);
@@ -1586,7 +1586,7 @@ srtp_show_machine_info(proto_tree *tree, tvbuff_t *tvb, int offset, const char *
controller_type = tvb_get_guint8(tvb, offset);
proto_tree_add_text(tree, tvb, offset, 1,
"%s Controller Type: %s (0x%02x)", tag,
- val_to_str(controller_type, vines_rtp_controller_type_vals, "Unknown"),
+ val_to_str_const(controller_type, vines_rtp_controller_type_vals, "Unknown"),
controller_type);
offset += 1;
return offset;
@@ -1679,7 +1679,7 @@ dissect_vines_icp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
proto_tree_add_text(vines_icp_tree, tvb, offset, 2,
"Packet Type: %s (0x%04x)",
- val_to_str(packet_type,
+ val_to_str_const(packet_type,
vines_icp_packet_type_vals,
"Unknown"),
packet_type);
@@ -1698,7 +1698,7 @@ dissect_vines_icp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
proto_tree_add_text(vines_icp_tree, tvb, offset, 2,
"Exception Code: %s (%u)",
- val_to_str(exception_code,
+ val_to_str_const(exception_code,
vipc_err_vals,
"Unknown"),
exception_code);
diff --git a/epan/dissectors/packet-vrrp.c b/epan/dissectors/packet-vrrp.c
index c0953b6643..18910647d0 100644
--- a/epan/dissectors/packet-vrrp.c
+++ b/epan/dissectors/packet-vrrp.c
@@ -120,7 +120,7 @@ dissect_vrrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvb, offset, 1, ver_type,
"Version %u, Packet type %u (%s)",
hi_nibble(ver_type), lo_nibble(ver_type),
- val_to_str(lo_nibble(ver_type), vrrp_type_vals, "Unknown"));
+ val_to_str_const(lo_nibble(ver_type), vrrp_type_vals, "Unknown"));
ver_type_tree = proto_item_add_subtree(tv, ett_vrrp_ver_type);
proto_tree_add_uint(ver_type_tree, hf_vrrp_version, tvb,
offset, 1, ver_type);
@@ -134,7 +134,7 @@ dissect_vrrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
priority = tvb_get_guint8(tvb, offset);
proto_tree_add_uint_format(vrrp_tree, hf_vrrp_prio, tvb, offset, 1, priority, "Priority: %u (%s)",
priority,
- val_to_str(priority, vrrp_prio_vals, "Non-default backup priority"));
+ val_to_str_const(priority, vrrp_prio_vals, "Non-default backup priority"));
offset++;
addr_count = tvb_get_guint8(tvb, offset);
diff --git a/epan/dissectors/packet-vuze-dht.c b/epan/dissectors/packet-vuze-dht.c
index 6d8a80c316..04db99fb63 100644
--- a/epan/dissectors/packet-vuze-dht.c
+++ b/epan/dissectors/packet-vuze-dht.c
@@ -337,7 +337,7 @@ dissect_vuze_dht_contact(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in
/* the decoded length is ip length+5, see the format above */
ti = proto_tree_add_none_format( tree, hf_vuze_dht_contact, tvb, offset, tvb_get_guint8(tvb,offset+2)+5,
"%s contact, version %d",
- val_to_str( tvb_get_guint8(tvb, offset), vuze_dht_contact_type_vals, "Unknown"),
+ val_to_str_const( tvb_get_guint8(tvb, offset), vuze_dht_contact_type_vals, "Unknown"),
tvb_get_guint8(tvb, offset+1) );
sub_tree = proto_item_add_subtree(ti, ett_vuze_dht_contact);
@@ -615,7 +615,7 @@ dissect_vuze_dht_request_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
proto_tree_add_item(tree, hf_vuze_dht_action, tvb, offset, TL_INT, ENC_BIG_ENDIAN);
*action = tvb_get_ntohl(tvb, offset);
- col_append_fstr(pinfo->cinfo, COL_INFO, " Action: %s", val_to_str( *action, vuze_dht_action_type_vals, "Unknown") );
+ col_append_fstr(pinfo->cinfo, COL_INFO, " Action: %s", val_to_str_const( *action, vuze_dht_action_type_vals, "Unknown") );
offset += TL_INT;
proto_tree_add_item(tree, hf_vuze_dht_transaction_id, tvb, offset, TL_INT, ENC_BIG_ENDIAN);
@@ -668,7 +668,7 @@ dissect_vuze_dht_reply_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
{
proto_tree_add_item(tree, hf_vuze_dht_action, tvb, offset, TL_INT, ENC_BIG_ENDIAN);
*action = tvb_get_ntohl(tvb, offset);
- col_append_fstr(pinfo->cinfo, COL_INFO, " Action: %s", val_to_str( *action, vuze_dht_action_type_vals, "Unknown") );
+ col_append_fstr(pinfo->cinfo, COL_INFO, " Action: %s", val_to_str_const( *action, vuze_dht_action_type_vals, "Unknown") );
offset += TL_INT;
proto_tree_add_item(tree, hf_vuze_dht_transaction_id, tvb, offset, TL_INT, ENC_BIG_ENDIAN);
@@ -950,7 +950,7 @@ dissect_vuze_dht_reply_error(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
proto_tree_add_item(tree, hf_vuze_dht_error_type, tvb, offset, TL_INT, ENC_BIG_ENDIAN);
error_type = tvb_get_ntohl( tvb, offset );
- col_append_fstr(pinfo->cinfo, COL_INFO, " Error: %s", val_to_str( error_type, vuze_dht_error_type_vals, "Unknown") );
+ col_append_fstr(pinfo->cinfo, COL_INFO, " Error: %s", val_to_str_const( error_type, vuze_dht_error_type_vals, "Unknown") );
offset += TL_INT;
switch(error_type)
diff --git a/epan/dissectors/packet-wcp.c b/epan/dissectors/packet-wcp.c
index 5aaf2b0a74..81a40b9b3f 100644
--- a/epan/dissectors/packet-wcp.c
+++ b/epan/dissectors/packet-wcp.c
@@ -319,10 +319,10 @@ static void dissect_wcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
/*XXX should test seq to be sure it the last + 1 !! */
if (check_col(pinfo->cinfo, COL_INFO)){
- col_add_str(pinfo->cinfo, COL_INFO, val_to_str(cmd, cmd_string, "Unknown"));
+ col_add_str(pinfo->cinfo, COL_INFO, val_to_str_const(cmd, cmd_string, "Unknown"));
if ( cmd == 0xf)
col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
- val_to_str(ext_cmd, ext_cmd_string, "Unknown"));
+ val_to_str_const(ext_cmd, ext_cmd_string, "Unknown"));
}
if (tree) {
diff --git a/epan/dissectors/packet-windows-common.c b/epan/dissectors/packet-windows-common.c
index 21e6580498..5dcc2a4981 100644
--- a/epan/dissectors/packet-windows-common.c
+++ b/epan/dissectors/packet-windows-common.c
@@ -1647,7 +1647,7 @@ dissect_nt_sid(tvbuff_t *tvb, int offset, proto_tree *parent_tree,
} else if (i==5) {
rid = sa_field;
rid_offset = offset;
- mapped_rid = val_to_str(rid, wkwn_S_1_5_21_rids, "Domain RID");
+ mapped_rid = val_to_str_const(rid, wkwn_S_1_5_21_rids, "Domain RID");
ep_strbuf_append_printf(label_str, "-%s", mapped_rid);
} else {
diff --git a/epan/dissectors/packet-wlccp.c b/epan/dissectors/packet-wlccp.c
index 7e27c0dfc8..441c49ea2d 100644
--- a/epan/dissectors/packet-wlccp.c
+++ b/epan/dissectors/packet-wlccp.c
@@ -726,8 +726,8 @@ dissect_wlccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %-27s SubType: %s",
- val_to_str(base_message_type, wlccp_msg_type_vs_0, "Unknown"),
- val_to_str(message_sub_type, wlccp_subtype_vs, "Unknown")
+ val_to_str_const(base_message_type, wlccp_msg_type_vs_0, "Unknown"),
+ val_to_str_const(message_sub_type, wlccp_subtype_vs, "Unknown")
);
break;
@@ -737,8 +737,8 @@ dissect_wlccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %-27s SubType: %s",
- val_to_str(base_message_type, wlccp_msg_type_vs_1, "Unknown"),
- val_to_str(message_sub_type, wlccp_subtype_vs, "Unknown")
+ val_to_str_const(base_message_type, wlccp_msg_type_vs_1, "Unknown"),
+ val_to_str_const(message_sub_type, wlccp_subtype_vs, "Unknown")
);
break;
} /* case WLCCP_SAP_SEC */
@@ -746,8 +746,8 @@ dissect_wlccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case WLCCP_SAP_RRM:
{
col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %-27s SubType: %s",
- val_to_str(base_message_type, wlccp_msg_type_vs_2, "Unknown"),
- val_to_str(message_sub_type, wlccp_subtype_vs, "Unknown")
+ val_to_str_const(base_message_type, wlccp_msg_type_vs_2, "Unknown"),
+ val_to_str_const(message_sub_type, wlccp_subtype_vs, "Unknown")
);
break;
@@ -756,8 +756,8 @@ dissect_wlccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case WLCCP_SAP_QOS:
{
col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %-27s SubType: %s",
- val_to_str(base_message_type, wlccp_msg_type_vs_3, "Unknown"),
- val_to_str(message_sub_type, wlccp_subtype_vs, "Unknown")
+ val_to_str_const(base_message_type, wlccp_msg_type_vs_3, "Unknown"),
+ val_to_str_const(message_sub_type, wlccp_subtype_vs, "Unknown")
);
break;
} /* case WLCCP_SAP_QOS */
@@ -765,8 +765,8 @@ dissect_wlccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case WLCCP_SAP_NM:
{
col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %-27s SubType: %s",
- val_to_str(base_message_type, wlccp_msg_type_vs_4, "Unknown"),
- val_to_str(message_sub_type, wlccp_subtype_vs, "Unknown")
+ val_to_str_const(base_message_type, wlccp_msg_type_vs_4, "Unknown"),
+ val_to_str_const(message_sub_type, wlccp_subtype_vs, "Unknown")
);
break;
@@ -775,8 +775,8 @@ dissect_wlccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case WLCCP_SAP_MIP:
{
col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %-27s SubType: %s",
- val_to_str(base_message_type, wlccp_msg_type_vs_5, "Unknown"),
- val_to_str(message_sub_type, wlccp_subtype_vs, "Unknown")
+ val_to_str_const(base_message_type, wlccp_msg_type_vs_5, "Unknown"),
+ val_to_str_const(message_sub_type, wlccp_subtype_vs, "Unknown")
);
break;
} /* case WLCCP_SAP_MIP */
@@ -785,7 +785,7 @@ dissect_wlccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %-27s SubType: %s",
"Unknown",
- val_to_str(message_sub_type, wlccp_subtype_vs, "Unknown")
+ val_to_str_const(message_sub_type, wlccp_subtype_vs, "Unknown")
);
break;
} /* default for switch sap */
diff --git a/epan/dissectors/packet-wtp.c b/epan/dissectors/packet-wtp.c
index 27c62e68e7..68bc8395f3 100644
--- a/epan/dissectors/packet-wtp.c
+++ b/epan/dissectors/packet-wtp.c
@@ -507,7 +507,7 @@ dissect_wtp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
", PDU: Invoke (%u)"
", Transaction Class: %s (%u)",
INVOKE,
- val_to_str(clsTransaction, vals_transaction_classes, "Undefined"),
+ val_to_str_const(clsTransaction, vals_transaction_classes, "Undefined"),
clsTransaction);
break;
@@ -544,7 +544,7 @@ dissect_wtp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
", Reason: %s (%u)",
ABORT,
PROVIDER,
- val_to_str(reason, vals_abort_reason_provider, "Undefined"),
+ val_to_str_const(reason, vals_abort_reason_provider, "Undefined"),
reason);
}
else if (abortType == USER)
diff --git a/epan/dissectors/packet-x11.c b/epan/dissectors/packet-x11.c
index b39917b7b2..500c4bf7d5 100644
--- a/epan/dissectors/packet-x11.c
+++ b/epan/dissectors/packet-x11.c
@@ -1188,7 +1188,7 @@ static const value_string zero_is_none_vals[] = {
opcode = VALUE8(tvb, *offsetp); \
proto_tree_add_uint_format(t, hf_x11_opcode, tvb, *offsetp, \
1, opcode, "opcode: %u (%s)", opcode, \
- val_to_str(opcode, state->opcode_vals, "Unknown")); \
+ val_to_str_const(opcode, state->opcode_vals, "Unknown")); \
*offsetp += 1; \
}
diff --git a/epan/dissectors/packet-xmcp.c b/epan/dissectors/packet-xmcp.c
index 2ad1abe4b1..adaa9cc6bd 100644
--- a/epan/dissectors/packet-xmcp.c
+++ b/epan/dissectors/packet-xmcp.c
@@ -469,13 +469,13 @@ decode_xmcp_attr_value (proto_tree *attr_tree, guint16 attr_type,
it = proto_tree_add_uint_format(attr_tree, xmcp_attr_error_code, tvb,
(offset+2), 2, error_code,
"Error Code: %d (%s)", error_code,
- val_to_str(error_code, error_codes,
- "Unknown"));
+ val_to_str_const(error_code, error_codes,
+ "Unknown"));
PROTO_ITEM_SET_GENERATED(it);
proto_item_append_text(attr_tree, ": %d", error_code);
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", error %d (%s)", error_code,
- val_to_str(error_code, error_codes, "Unknown"));
+ val_to_str_const(error_code, error_codes, "Unknown"));
}
/*
@@ -492,8 +492,8 @@ decode_xmcp_attr_value (proto_tree *attr_tree, guint16 attr_type,
case 500: /* Responder Error */
expert_add_info_format(pinfo, it, PI_RESPONSE_CODE, PI_WARN,
"Unusual error code (%u, %s)", error_code,
- val_to_str(error_code, error_codes,
- "Unknown"));
+ val_to_str_const(error_code, error_codes,
+ "Unknown"));
break;
default:
break;
@@ -683,8 +683,8 @@ decode_xmcp_attr_value (proto_tree *attr_tree, guint16 attr_type,
(offset+3), 1, ENC_BIG_ENDIAN);
xmcp_service_protocol = tvb_get_guint8(tvb, (offset+3));
proto_item_append_text(attr_tree, ": %u (%s)", xmcp_service_protocol,
- val_to_str_ext(xmcp_service_protocol,
- &ipproto_val_ext, "Unknown"));
+ val_to_str_ext_const(xmcp_service_protocol,
+ &ipproto_val_ext, "Unknown"));
/* If we now know both port and protocol number, fill in the port name */
if (xmcp_service_port != -1 && xmcp_it_service_port != NULL) {
add_xmcp_port_name();
@@ -1027,8 +1027,8 @@ dissect_xmcp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
(XMCP_ATTR_HDR_LEN +
get_xmcp_attr_padded_len(attr_length)),
"%s, length %u",
- val_to_str(attr_type, attributes,
- "Unknown"),
+ val_to_str_const(attr_type, attributes,
+ "Unknown"),
attr_length);
/* Add subtree for this TLV */
@@ -1075,13 +1075,13 @@ dissect_xmcp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (xmcp_msg_type_method == XMCP_METHOD_REGISTER) {
expert_add_info_format(pinfo, xmcp_tree, PI_SEQUENCE, PI_CHAT,
"New session - Register %s",
- val_to_str(xmcp_msg_type_class, classes, ""));
+ val_to_str_const(xmcp_msg_type_class, classes, ""));
} else if (xmcp_msg_type_method == XMCP_METHOD_UNREGISTER ||
xmcp_msg_type_method == XMCP_METHOD_REG_REVOKE) {
expert_add_info_format(pinfo, xmcp_tree, PI_SEQUENCE, PI_CHAT,
"Session termination - %s %s",
- val_to_str(xmcp_msg_type_method, methods, ""),
- val_to_str(xmcp_msg_type_class, classes, ""));
+ val_to_str_const(xmcp_msg_type_method, methods, ""),
+ val_to_str_const(xmcp_msg_type_class, classes, ""));
}
}
}
diff --git a/epan/dissectors/packet-zbee-aps.c b/epan/dissectors/packet-zbee-aps.c
index 11f7f3f5cc..45174ec22d 100644
--- a/epan/dissectors/packet-zbee-aps.c
+++ b/epan/dissectors/packet-zbee-aps.c
@@ -617,16 +617,16 @@ dissect_zbee_aps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Display the frame type to the proto root and info column. */
if (tree) {
- proto_item_append_text(proto_root, " %s", val_to_str(packet.type, zbee_aps_frame_types, "Unknown Type"));
+ proto_item_append_text(proto_root, " %s", val_to_str_const(packet.type, zbee_aps_frame_types, "Unknown Type"));
}
col_clear(pinfo->cinfo, COL_INFO);
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(packet.type, zbee_aps_frame_types, "Unknown Frame Type"));
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(packet.type, zbee_aps_frame_types, "Unknown Frame Type"));
/* Display the FCF */
if (tree) {
/* Create the subtree */
ti = proto_tree_add_text(aps_tree, tvb, offset, 1, "Frame Control Field: %s (0x%02x)",
- val_to_str(packet.type, zbee_aps_frame_types, "Unknown"), fcf);
+ val_to_str_const(packet.type, zbee_aps_frame_types, "Unknown"), fcf);
field_tree = proto_item_add_subtree(ti, ett_zbee_aps_fcf);
/* Add the frame type and delivery mode. */
@@ -980,7 +980,7 @@ static void dissect_zbee_aps_cmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
/* Create a subtree for the APS Command frame, and add the command ID to it. */
if(tree){
- cmd_root = proto_tree_add_text(tree, tvb, offset, tvb_length(tvb), "Command Frame: %s", val_to_str(cmd_id, zbee_aps_cmd_names, "Unknown"));
+ cmd_root = proto_tree_add_text(tree, tvb, offset, tvb_length(tvb), "Command Frame: %s", val_to_str_const(cmd_id, zbee_aps_cmd_names, "Unknown"));
cmd_tree = proto_item_add_subtree(cmd_root, ett_zbee_aps_cmd);
/* Add the command ID. */
diff --git a/epan/dissectors/packet-zbee-nwk.c b/epan/dissectors/packet-zbee-nwk.c
index f3d4975e4f..647c05b2dd 100644
--- a/epan/dissectors/packet-zbee-nwk.c
+++ b/epan/dissectors/packet-zbee-nwk.c
@@ -405,7 +405,7 @@ dissect_zbee_nwk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
/* Create a subtree for the FCF. */
ti = proto_tree_add_text(nwk_tree, tvb, offset, 2, "Frame Control Field: %s (0x%04x)",
- val_to_str(packet.type, zbee_nwk_frame_types, "Unknown"), fcf);
+ val_to_str_const(packet.type, zbee_nwk_frame_types, "Unknown"), fcf);
field_tree = proto_item_add_subtree(ti, ett_zbee_nwk_fcf);
proto_tree_add_uint(field_tree, hf_zbee_nwk_frame_type, tvb, offset, 1,
fcf & ZBEE_NWK_FCF_FRAME_TYPE);
@@ -434,7 +434,7 @@ dissect_zbee_nwk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Add the frame type to the info column and protocol root. */
if (tree) {
- proto_item_append_text(proto_root, " %s", val_to_str(packet.type, zbee_nwk_frame_types, "Unknown Type"));
+ proto_item_append_text(proto_root, " %s", val_to_str_const(packet.type, zbee_nwk_frame_types, "Unknown Type"));
}
col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(packet.type, zbee_nwk_frame_types, "Reserved Frame Type"));
@@ -729,7 +729,7 @@ static void dissect_zbee_nwk_cmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
/* Create a subtree for this command. */
if (tree) {
cmd_root = proto_tree_add_text(tree, tvb, offset, tvb_length(tvb), "Command Frame: %s",
- val_to_str(cmd_id, zbee_nwk_cmd_names, "Unknown"));
+ val_to_str_const(cmd_id, zbee_nwk_cmd_names, "Unknown"));
cmd_tree = proto_item_add_subtree(cmd_root, ett_zbee_nwk_cmd);
/* Add the command ID. */
@@ -1030,7 +1030,7 @@ dissect_zbee_nwk_status(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gui
offset += 2;
/* Update the info column. */
- col_append_fstr(pinfo->cinfo, COL_INFO, ", 0x%04x: %s", addr, val_to_str(status_code, zbee_nwk_status_codes, "Unknown Status Code"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", 0x%04x: %s", addr, val_to_str_const(status_code, zbee_nwk_status_codes, "Unknown Status Code"));
/* Done */
return offset;
@@ -1209,7 +1209,7 @@ dissect_zbee_nwk_rejoin_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
col_append_fstr(pinfo->cinfo, COL_INFO, ", Address: 0x%04x", packet->src);
}
else {
- col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", val_to_str(status, zbee_nwk_rejoin_codes, "Unknown Rejoin Response"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", val_to_str_const(status, zbee_nwk_rejoin_codes, "Unknown Rejoin Response"));
}
/* Done */
@@ -1318,7 +1318,7 @@ dissect_zbee_nwk_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gui
}
/* Update the info column. */
- col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", val_to_str(report_type, zbee_nwk_report_types, "Unknown Report Type"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", val_to_str_const(report_type, zbee_nwk_report_types, "Unknown Report Type"));
/* Done */
return offset;
@@ -1384,7 +1384,7 @@ dissect_zbee_nwk_update(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gui
}
/* Update the info column. */
- col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", val_to_str(update_type, zbee_nwk_update_types, "Unknown Update Type"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", val_to_str_const(update_type, zbee_nwk_update_types, "Unknown Update Type"));
/* Done */
return offset;
diff --git a/epan/dissectors/packet-zbee-zdp.c b/epan/dissectors/packet-zbee-zdp.c
index f766be4e88..b6d12b81a3 100644
--- a/epan/dissectors/packet-zbee-zdp.c
+++ b/epan/dissectors/packet-zbee-zdp.c
@@ -404,7 +404,7 @@ static const value_string zbee_zdp_status_names[] = {
const gchar *
zdp_status_name(guint8 status)
{
- return val_to_str(status, zbee_zdp_status_names, "Reserved");
+ return val_to_str_const(status, zbee_zdp_status_names, "Reserved");
} /* zdp_status_name */
/*FUNCTION:------------------------------------------------------
@@ -1116,7 +1116,7 @@ dissect_zbee_zdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Update info. */
if (tree) {
- proto_item_append_text(zdp_tree, ", %s", val_to_str(cluster, zbee_zdp_cluster_names, "Unknown Cluster"));
+ proto_item_append_text(zdp_tree, ", %s", val_to_str_const(cluster, zbee_zdp_cluster_names, "Unknown Cluster"));
}
if (check_col(pinfo->cinfo, COL_INFO)) {
col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(cluster, zbee_zdp_cluster_names, "Unknown Cluster"));