summaryrefslogtreecommitdiff
path: root/asn1/h248
diff options
context:
space:
mode:
authorAndersBroman <anders.broman@ericsson.com>2014-05-05 17:37:12 +0200
committerAnders Broman <a.broman58@gmail.com>2014-05-05 15:51:18 +0000
commit09a9c86473645e33383df65c8b6986a542ba4e2d (patch)
tree24bd49db02d3a37e254b0e0e643417d84c2c94b6 /asn1/h248
parent326202f016ca1ca158b7ca8bcfa79187eafb9d0f (diff)
downloadwireshark-09a9c86473645e33383df65c8b6986a542ba4e2d.tar.gz
Add the possibillity to add a string to the termination id.
Change-Id: I3b48b28273a8c1a1558045d2a4ab5104160840de Reviewed-on: https://code.wireshark.org/review/1510 Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'asn1/h248')
-rw-r--r--asn1/h248/h248.cnf23
-rw-r--r--asn1/h248/packet-h248-template.h5
2 files changed, 23 insertions, 5 deletions
diff --git a/asn1/h248/h248.cnf b/asn1/h248/h248.cnf
index ee1afdb022..5c1ade583b 100644
--- a/asn1/h248/h248.cnf
+++ b/asn1/h248/h248.cnf
@@ -330,23 +330,36 @@ AuditReplyV1/auditResult audit_result
#.FN_BODY TerminationID/id
tvbuff_t* new_tvb;
+ h248_term_info_t term_info;
+
+ term_info.wild_card = wild_card;
+ term_info.str = NULL;
+
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, &new_tvb);
if (new_tvb) {
curr_info.term->len = tvb_length(new_tvb);
curr_info.term->type = 0; /* unknown */
+ if (h248_term_handle) {
+ call_dissector_with_data(h248_term_handle, new_tvb, actx->pinfo, tree, &term_info);
+ wild_card = 0xFF;
+ }
+
if (curr_info.term->len) {
curr_info.term->buffer = (guint8 *)tvb_memdup(wmem_packet_scope(),new_tvb,0,curr_info.term->len);
- curr_info.term->str = bytes_to_ep_str(curr_info.term->buffer,curr_info.term->len);
+ if(term_info.str){
+ curr_info.term->str = wmem_strdup_printf(wmem_packet_scope(), "%s %s",
+ bytestring_to_str(wmem_packet_scope(),curr_info.term->buffer,curr_info.term->len, 0),
+ term_info.str);
+ }else{
+ curr_info.term->str = bytestring_to_str(wmem_packet_scope(),curr_info.term->buffer,curr_info.term->len, 0);
+ }
}
+
curr_info.term = gcp_cmd_add_term(curr_info.msg, curr_info.trx, curr_info.cmd, curr_info.term, wild_term, keep_persistent_data);
- if (h248_term_handle) {
- call_dissector_with_data(h248_term_handle, new_tvb, actx->pinfo, tree, &wild_card);
- wild_card = 0xFF;
- }
} else {
curr_info.term->len = 0;
curr_info.term->buffer = (guint8*)wmem_strdup(wmem_packet_scope(), "");
diff --git a/asn1/h248/packet-h248-template.h b/asn1/h248/packet-h248-template.h
index c87ed51ab9..1783bf27c9 100644
--- a/asn1/h248/packet-h248-template.h
+++ b/asn1/h248/packet-h248-template.h
@@ -112,6 +112,11 @@ struct _h248_curr_info_t {
const h248_pkg_param_t* par;
};
+typedef struct h248_term_info {
+ guint8 wild_card;
+ gchar *str;
+} h248_term_info_t;
+
WS_DLL_PUBLIC
void h248_register_package(h248_package_t* pkg, pkg_reg_action reg_action);