aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-alcap.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2014-07-31 12:39:40 -0400
committerMichael Mann <mmann78@netscape.net>2014-08-03 16:29:16 +0000
commit3fa5625ea074908d5617111a7edfcf6d95e6108a (patch)
tree05c5b6f0995c239b28a05ae3f61f3fdf9ff40583 /epan/dissectors/packet-alcap.c
parent7a7a72e15508d5927ced7189e50d17a16a016dad (diff)
Eliminate proto_tree_add_text from some dissectors.
Change-Id: Ib6024307e85d6c23decf40e9759f549c19ffe136 Reviewed-on: https://code.wireshark.org/review/3318 Petri-Dish: Michael Mann <mmann78@netscape.net> Petri-Dish: Evan Huus <eapache@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-alcap.c')
-rw-r--r--epan/dissectors/packet-alcap.c38
1 files changed, 6 insertions, 32 deletions
diff --git a/epan/dissectors/packet-alcap.c b/epan/dissectors/packet-alcap.c
index 0b37169ebb..0beaa34f2c 100644
--- a/epan/dissectors/packet-alcap.c
+++ b/epan/dissectors/packet-alcap.c
@@ -779,7 +779,7 @@ static const gchar* dissect_fields_ssim(packet_info* pinfo _U_, tvbuff_t *tvb, p
return NULL;
}
-static const gchar* dissect_fields_ssisa(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+static const gchar* dissect_fields_ssisa(packet_info* pinfo, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
/*
* Q.2630.1 -> 7.3.11 Service specific information (SAR-assured)
*
@@ -797,7 +797,7 @@ static const gchar* dissect_fields_ssisa(packet_info* pinfo _U_, tvbuff_t *tvb,
proto_tree_add_item(tree,hf_alcap_ssisa_max_sscop_uu_fw,tvb,offset+10,2,ENC_BIG_ENDIAN);
proto_tree_add_item(tree,hf_alcap_ssisa_max_sscop_uu_bw,tvb,offset+12,2,ENC_BIG_ENDIAN);
- proto_tree_add_text(tree,tvb,offset,14,"Not yet decoded: Q.2630.1 7.4.8");
+ proto_tree_add_expert_format(tree,pinfo,&ei_alcap_undecoded,tvb,offset,14,"Not yet decoded: Q.2630.1 7.4.8");
return NULL;
}
@@ -816,7 +816,7 @@ static const gchar* dissect_fields_ssisu(packet_info* pinfo _U_, tvbuff_t *tvb,
proto_tree_add_item(tree,hf_alcap_ssisu_max_sssar_fw,tvb,offset,3,ENC_BIG_ENDIAN);
proto_tree_add_item(tree,hf_alcap_ssisu_max_sssar_bw,tvb,offset+3,3,ENC_BIG_ENDIAN);
proto_tree_add_item(tree,hf_alcap_ssisu_ted,tvb,offset+6,1,ENC_BIG_ENDIAN);
- proto_tree_add_text(tree,tvb,offset,7,"Not yet decoded: Q.2630.1 7.4.9");
+ proto_tree_add_expert_format(tree,pinfo,&ei_alcap_undecoded,tvb,offset,7,"Not yet decoded: Q.2630.1 7.4.9");
return NULL;
}
@@ -1247,33 +1247,10 @@ static alcap_param_info_t param_infos[] = {
#define GET_PARAM_INFO(id) ( array_length(param_infos) <= id ? &(param_infos[0]) : &(param_infos[id]) )
-typedef struct _alcap_msg_type_info_t {
- const gchar* abbr;
- int severity; /* XXX - not used */
-} alcap_msg_type_info_t;
-
-static const alcap_msg_type_info_t msg_types[] = {
- { "Unknown Message ", PI_ERROR },
- { "BLC ", PI_NOTE },
- { "BLO ", PI_NOTE },
- { "CFN ", PI_WARN },
- { "ECF ", PI_CHAT },
- { "ERQ ", PI_CHAT },
- { "RLC ", PI_CHAT },
- { "REL ", PI_CHAT },
- { "RSC ", PI_NOTE },
- { "RES ", PI_NOTE },
- { "UBC ", PI_NOTE },
- { "UBL ", PI_NOTE },
- { "MOA ", PI_CHAT },
- { "MOR ", PI_CHAT },
- { "MOD ", PI_CHAT },
-};
-
static void alcap_leg_tree(proto_tree* tree, tvbuff_t* tvb, packet_info *pinfo, const alcap_leg_info_t* leg) {
- proto_item* pi = proto_tree_add_text(tree,tvb,0,0,"[ALCAP Leg Info]");
+ proto_item* pi;
- tree = proto_item_add_subtree(pi,ett_leg);
+ tree = proto_tree_add_subtree(tree,tvb,0,0,ett_leg,NULL,"[ALCAP Leg Info]");
if (leg->dsaid) {
pi = proto_tree_add_uint(tree,hf_alcap_leg_dsaid,tvb,0,0,leg->dsaid);
@@ -1352,7 +1329,6 @@ static void dissect_alcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
int offset;
proto_item* pi;
proto_tree* compat_tree;
- const alcap_msg_type_info_t* msg_type;
col_set_str(pinfo->cinfo, COL_PROTOCOL, alcap_proto_name_short);
@@ -1367,11 +1343,9 @@ static void dissect_alcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
msg_info->dsaid = tvb_get_ntohl(tvb, 0);
msg_info->msg_type = tvb_get_guint8(tvb, 4);
- msg_type = GET_MSG_TYPE(msg_info->msg_type);
-
expert_add_info(pinfo, pi, &ei_alcap_response);
- col_set_str(pinfo->cinfo, COL_INFO, msg_type->abbr);
+ col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(msg_info->msg_type, msg_type_strings, "Unknown Message"));
pi = proto_tree_add_item(alcap_tree,hf_alcap_compat,tvb,5,1,ENC_NA);
compat_tree = proto_item_add_subtree(pi,ett_compat);