aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorAndersBroman <anders.broman@ericsson.com>2014-04-04 15:49:35 +0200
committerAnders Broman <a.broman58@gmail.com>2014-04-04 14:37:02 +0000
commitb40b65529832ed7715bed4b7155104c6a2470a8d (patch)
tree0632608c722ea1770fb0053632949755f3a53409 /epan
parent196677514c9a06958139d42c9f4c61c30768ff3c (diff)
Change tvb_get_string() -> tvb_get_string_enc and ENC_ASCII -> ENC_UTF_8
Change-Id: I07ecca5612ae9fa2b053a62c69014612c5125d5e Reviewed-on: https://code.wireshark.org/review/962 Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-classicstun.c6
-rw-r--r--epan/dissectors/packet-exported_pdu.c4
-rw-r--r--epan/dissectors/packet-msrp.c30
-rw-r--r--epan/dissectors/packet-stun.c29
-rw-r--r--epan/dissectors/packet-sua.c4
5 files changed, 36 insertions, 37 deletions
diff --git a/epan/dissectors/packet-classicstun.c b/epan/dissectors/packet-classicstun.c
index a1d711114c..4ed9e6ecb8 100644
--- a/epan/dissectors/packet-classicstun.c
+++ b/epan/dissectors/packet-classicstun.c
@@ -449,7 +449,7 @@ dissect_classicstun(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
proto_tree_add_item(att_tree, classicstun_att_error_number, tvb, offset+3, 1, ENC_BIG_ENDIAN);
if (att_length < 5)
break;
- proto_tree_add_item(att_tree, classicstun_att_error_reason, tvb, offset+4, (att_length-4), ENC_ASCII|ENC_NA);
+ proto_tree_add_item(att_tree, classicstun_att_error_reason, tvb, offset+4, (att_length-4), ENC_UTF_8|ENC_NA);
break;
case LIFETIME:
@@ -482,7 +482,7 @@ dissect_classicstun(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
break;
case SERVER:
- proto_tree_add_item(att_tree, classicstun_att_server_string, tvb, offset, att_length, ENC_ASCII|ENC_NA);
+ proto_tree_add_item(att_tree, classicstun_att_server_string, tvb, offset, att_length, ENC_UTF_8|ENC_NA);
break;
case XOR_MAPPED_ADDRESS:
@@ -532,7 +532,7 @@ dissect_classicstun(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
break;
case CONNECTION_REQUEST_BINDING:
- proto_tree_add_item(att_tree, classicstun_att_connection_request_binding, tvb, offset, att_length, ENC_ASCII|ENC_NA);
+ proto_tree_add_item(att_tree, classicstun_att_connection_request_binding, tvb, offset, att_length, ENC_UTF_8|ENC_NA);
break;
default:
diff --git a/epan/dissectors/packet-exported_pdu.c b/epan/dissectors/packet-exported_pdu.c
index 6ee842a839..ed9e30917c 100644
--- a/epan/dissectors/packet-exported_pdu.c
+++ b/epan/dissectors/packet-exported_pdu.c
@@ -124,8 +124,8 @@ dissect_exported_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
switch(tag) {
case EXP_PDU_TAG_PROTO_NAME:
next_proto_type = EXPORTED_PDU_NEXT_PROTO_STR;
- proto_name = tvb_get_string(wmem_packet_scope(), tvb, offset, tag_len);
- proto_tree_add_item(tag_tree, hf_exported_pdu_prot_name, tvb, offset, tag_len, ENC_ASCII|ENC_NA);
+ proto_name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, tag_len, ENC_UTF_8|ENC_NA);
+ proto_tree_add_item(tag_tree, hf_exported_pdu_prot_name, tvb, offset, tag_len, ENC_UTF_8|ENC_NA);
break;
case EXP_PDU_TAG_IPV4_SRC:
proto_tree_add_item(tag_tree, hf_exported_pdu_ipv4_src, tvb, offset, 4, ENC_BIG_ENDIAN);
diff --git a/epan/dissectors/packet-msrp.c b/epan/dissectors/packet-msrp.c
index 00d0a5cd83..7596f7e365 100644
--- a/epan/dissectors/packet-msrp.c
+++ b/epan/dissectors/packet-msrp.c
@@ -565,17 +565,17 @@ dissect_msrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
msrp_tree = proto_item_add_subtree(ti, ett_msrp);
if (is_msrp_response){
- th = proto_tree_add_item(msrp_tree,hf_msrp_response_line,tvb,0,linelen,ENC_ASCII|ENC_NA);
+ th = proto_tree_add_item(msrp_tree,hf_msrp_response_line,tvb,0,linelen,ENC_UTF_8|ENC_NA);
reqresp_tree = proto_item_add_subtree(th, ett_msrp_reqresp);
- proto_tree_add_item(reqresp_tree,hf_msrp_transactionID,tvb,token_2_start,token_2_len,ENC_ASCII|ENC_NA);
+ proto_tree_add_item(reqresp_tree,hf_msrp_transactionID,tvb,token_2_start,token_2_len,ENC_UTF_8|ENC_NA);
proto_tree_add_uint(reqresp_tree,hf_msrp_status_code,tvb,token_3_start,token_3_len,
- atoi(tvb_get_string(wmem_packet_scope(), tvb, token_3_start, token_3_len)));
+ atoi(tvb_get_string_enc(wmem_packet_scope(), tvb, token_3_start, token_3_len)));
}else{
- th = proto_tree_add_item(msrp_tree,hf_msrp_request_line,tvb,0,linelen,ENC_ASCII|ENC_NA);
+ th = proto_tree_add_item(msrp_tree,hf_msrp_request_line,tvb,0,linelen,ENC_UTF_8|ENC_NA);
reqresp_tree = proto_item_add_subtree(th, ett_msrp_reqresp);
- proto_tree_add_item(reqresp_tree,hf_msrp_transactionID,tvb,token_2_start,token_2_len,ENC_ASCII|ENC_NA);
- proto_tree_add_item(reqresp_tree,hf_msrp_method,tvb,token_3_start,token_3_len,ENC_ASCII|ENC_NA);
+ proto_tree_add_item(reqresp_tree,hf_msrp_transactionID,tvb,token_2_start,token_2_len,ENC_UTF_8|ENC_NA);
+ proto_tree_add_item(reqresp_tree,hf_msrp_method,tvb,token_3_start,token_3_len,ENC_UTF_8|ENC_NA);
}
/* Conversation setup info */
@@ -633,8 +633,8 @@ dissect_msrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
* Fetch the value.
*/
value_len = line_end_offset - value_offset;
- value = tvb_get_string(wmem_packet_scope(), tvb, value_offset,
- value_len);
+ value = tvb_get_string_enc(wmem_packet_scope(), tvb, value_offset,
+ value_len, ENC_UTF_8|ENC_NA);
/*
* Add it to the protocol tree,
@@ -662,11 +662,11 @@ dissect_msrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
parameter_offset++;
content_type_len = semi_colon_offset - value_offset;
content_type_parameter_str_len = line_end_offset - parameter_offset;
- content_type_parameter_str = tvb_get_string(wmem_packet_scope(), tvb,
- parameter_offset, content_type_parameter_str_len);
+ content_type_parameter_str = tvb_get_string_enc(wmem_packet_scope(), tvb,
+ parameter_offset, content_type_parameter_str_len, ENC_UTF_8|ENC_NA);
}
media_type_str_lower_case = ascii_strdown_inplace(
- (gchar *)tvb_get_string(wmem_packet_scope(), tvb, value_offset, content_type_len));
+ (gchar *)tvb_get_string_enc(wmem_packet_scope(), tvb, value_offset, content_type_len, ENC_UTF_8|ENC_NA));
break;
default:
@@ -687,7 +687,7 @@ dissect_msrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
/* Create new tree & tvb for data */
next_tvb = tvb_new_subset_remaining(tvb, next_offset);
ti = proto_tree_add_item(msrp_tree, hf_msrp_data, tvb,
- next_offset, -1, ENC_ASCII|ENC_NA);
+ next_offset, -1, ENC_UTF_8|ENC_NA);
msrp_data_tree = proto_item_add_subtree(ti, ett_msrp_data);
/* give the content type parameters to sub dissectors */
@@ -719,12 +719,12 @@ dissect_msrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
/* End line */
- ti = proto_tree_add_item(msrp_tree,hf_msrp_end_line,tvb,end_line_offset,end_line_len,ENC_ASCII|ENC_NA);
+ ti = proto_tree_add_item(msrp_tree,hf_msrp_end_line,tvb,end_line_offset,end_line_len,ENC_UTF_8|ENC_NA);
msrp_end_tree = proto_item_add_subtree(ti, ett_msrp_end_line);
- proto_tree_add_item(msrp_end_tree,hf_msrp_transactionID,tvb,end_line_offset + 7,token_2_len,ENC_ASCII|ENC_NA);
+ proto_tree_add_item(msrp_end_tree,hf_msrp_transactionID,tvb,end_line_offset + 7,token_2_len,ENC_UTF_8|ENC_NA);
/* continuation-flag */
- proto_tree_add_item(msrp_end_tree,hf_msrp_cnt_flg,tvb,end_line_offset+end_line_len-1,1,ENC_ASCII|ENC_NA);
+ proto_tree_add_item(msrp_end_tree,hf_msrp_cnt_flg,tvb,end_line_offset+end_line_len-1,1,ENC_UTF_8|ENC_NA);
if (global_msrp_raw_text){
ti = proto_tree_add_text(tree, tvb, 0, -1,"Message Session Relay Protocol(as raw text)");
diff --git a/epan/dissectors/packet-stun.c b/epan/dissectors/packet-stun.c
index bf1bb63be0..8036be77b0 100644
--- a/epan/dissectors/packet-stun.c
+++ b/epan/dissectors/packet-stun.c
@@ -700,8 +700,8 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole
/* Deprecated STUN RFC3489 attributes */
case PASSWORD:
- proto_tree_add_item(att_tree, stun_att_password, tvb, offset, att_length, ENC_ASCII|ENC_NA);
- proto_item_append_text(att_tree, " (Deprecated): %s", tvb_get_string(wmem_packet_scope(), tvb, offset, att_length));
+ proto_tree_add_item(att_tree, stun_att_password, tvb, offset, att_length, ENC_UTF_8|ENC_NA);
+ proto_item_append_text(att_tree, " (Deprecated): %s", tvb_get_string_enc(wmem_packet_scope(), tvb, offset, att_length, ENC_UTF_8|ENC_NA));
if (att_length % 4 != 0)
proto_tree_add_uint(att_tree, stun_att_padding,
tvb, offset+att_length, 4-(att_length % 4), 4-(att_length % 4));
@@ -751,13 +751,12 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole
break;
case USERNAME:
- proto_tree_add_item(att_tree, stun_att_username, tvb, offset, att_length, ENC_ASCII|ENC_NA);
- proto_item_append_text(att_tree, ": %s", tvb_get_string(wmem_packet_scope(), tvb, offset, att_length));
+ proto_tree_add_item(att_tree, stun_att_username, tvb, offset, att_length, ENC_UTF_8|ENC_NA);
+ proto_item_append_text(att_tree, ": %s", tvb_get_string_enc(wmem_packet_scope(), tvb, offset, att_length, ENC_UTF_8|ENC_NA));
col_append_fstr(
pinfo->cinfo, COL_INFO,
" user: %s",
- tvb_get_string(wmem_packet_scope(), tvb,offset, att_length)
- );
+ tvb_get_string_enc(wmem_packet_scope(), tvb, offset, att_length, ENC_UTF_8|ENC_NA));
if (att_length % 4 != 0)
proto_tree_add_uint(att_tree, stun_att_padding,
tvb, offset+att_length, 4-(att_length % 4), 4-(att_length % 4));
@@ -796,13 +795,13 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole
}
if (att_length < 5)
break;
- proto_tree_add_item(att_tree, stun_att_error_reason, tvb, offset+4, att_length-4, ENC_ASCII|ENC_NA);
+ proto_tree_add_item(att_tree, stun_att_error_reason, tvb, offset+4, att_length-4, ENC_UTF_8|ENC_NA);
- proto_item_append_text(att_tree, ": %s", tvb_get_string(wmem_packet_scope(), tvb, offset+4, att_length-4));
+ proto_item_append_text(att_tree, ": %s", tvb_get_string_enc(wmem_packet_scope(), tvb, offset+4, att_length-4, ENC_UTF_8|ENC_NA));
col_append_fstr(
pinfo->cinfo, COL_INFO,
" %s",
- tvb_get_string(wmem_packet_scope(), tvb, offset+4, att_length-4)
+ tvb_get_string_enc(wmem_packet_scope(), tvb, offset+4, att_length-4, ENC_UTF_8|ENC_NA)
);
@@ -818,20 +817,20 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole
break;
case REALM:
- proto_tree_add_item(att_tree, stun_att_realm, tvb, offset, att_length, ENC_ASCII|ENC_NA);
- proto_item_append_text(att_tree, ": %s", tvb_get_string(wmem_packet_scope(), tvb, offset, att_length));
+ proto_tree_add_item(att_tree, stun_att_realm, tvb, offset, att_length, ENC_UTF_8|ENC_NA);
+ proto_item_append_text(att_tree, ": %s", tvb_get_string_enc(wmem_packet_scope(), tvb, offset, att_length, ENC_UTF_8|ENC_NA));
col_append_fstr(
pinfo->cinfo, COL_INFO,
" realm: %s",
- tvb_get_string(wmem_packet_scope(), tvb,offset, att_length)
+ tvb_get_string_enc(wmem_packet_scope(), tvb,offset, att_length, ENC_UTF_8|ENC_NA)
);
if (att_length % 4 != 0)
proto_tree_add_uint(att_tree, stun_att_padding, tvb, offset+att_length, 4-(att_length % 4), 4-(att_length % 4));
break;
case NONCE:
- proto_tree_add_item(att_tree, stun_att_nonce, tvb, offset, att_length, ENC_ASCII|ENC_NA);
- proto_item_append_text(att_tree, ": %s", tvb_get_string(wmem_packet_scope(), tvb, offset, att_length));
+ proto_tree_add_item(att_tree, stun_att_nonce, tvb, offset, att_length, ENC_UTF_8|ENC_NA);
+ proto_item_append_text(att_tree, ": %s", tvb_get_string_enc(wmem_packet_scope(), tvb, offset, att_length, ENC_UTF_8|ENC_NA));
col_append_str(
pinfo->cinfo, COL_INFO,
" with nonce"
@@ -951,7 +950,7 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole
break;
case SOFTWARE:
- proto_tree_add_item(att_tree, stun_att_software, tvb, offset, att_length, ENC_ASCII|ENC_NA);
+ proto_tree_add_item(att_tree, stun_att_software, tvb, offset, att_length, ENC_UTF_8|ENC_NA);
if (att_length % 4 != 0)
proto_tree_add_uint(att_tree, stun_att_padding, tvb, offset+att_length, 4-(att_length % 4), 4-(att_length % 4));
break;
diff --git a/epan/dissectors/packet-sua.c b/epan/dissectors/packet-sua.c
index 4f15f3f336..09aacfb624 100644
--- a/epan/dissectors/packet-sua.c
+++ b/epan/dissectors/packet-sua.c
@@ -597,9 +597,9 @@ dissect_info_string_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto
return;
}
- proto_tree_add_item(parameter_tree, hf_sua_info_string, parameter_tvb, INFO_STRING_OFFSET, info_string_length, ENC_ASCII|ENC_NA);
+ proto_tree_add_item(parameter_tree, hf_sua_info_string, parameter_tvb, INFO_STRING_OFFSET, info_string_length, ENC_UTF_8|ENC_NA);
proto_item_append_text(parameter_item, " (%.*s)", info_string_length,
- tvb_get_string(wmem_packet_scope(), parameter_tvb, INFO_STRING_OFFSET, info_string_length));
+ tvb_get_string_enc(wmem_packet_scope(), parameter_tvb, INFO_STRING_OFFSET, info_string_length, ENC_UTF_8|ENC_NA));
}
#define ROUTING_CONTEXT_LENGTH 4