diff options
author | gal <gal@f5534014-38df-0310-8fa8-9805f1628bb7> | 2007-11-14 20:57:55 +0000 |
---|---|---|
committer | gal <gal@f5534014-38df-0310-8fa8-9805f1628bb7> | 2007-11-14 20:57:55 +0000 |
commit | cadc8fc51e7faa484f173ce4bfd5567da7eea2a7 (patch) | |
tree | 069b599b07be4d54a01a76014398f1293eb163d6 /asn1/rtse | |
parent | 19f1a145127fa0c0b8e8097330c0f08027bb46b0 (diff) |
Changed to use the the packet-ber EXTERNAL decoding (into the ASN1 context).
Uses the ber_callback mechanism to call the rtse oid callbacks, rather than the default ber oid callback list.
A couple of fixes to packet-ber.c to mark [in]direct references as present and call the ber_callback if it has been specified.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@23450 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'asn1/rtse')
-rw-r--r-- | asn1/rtse/packet-rtse-template.c | 20 | ||||
-rw-r--r-- | asn1/rtse/rtse.asn | 18 | ||||
-rw-r--r-- | asn1/rtse/rtse.cnf | 23 |
3 files changed, 19 insertions, 42 deletions
diff --git a/asn1/rtse/packet-rtse-template.c b/asn1/rtse/packet-rtse-template.c index 773994647b..e0242f9b18 100644 --- a/asn1/rtse/packet-rtse-template.c +++ b/asn1/rtse/packet-rtse-template.c @@ -52,7 +52,6 @@ int proto_rtse = -1; static struct SESSION_DATA_STRUCTURE* session = NULL; -static char* object_identifier_id; static gboolean open_request=FALSE; /* indirect_reference, used to pick up the signalling so we know what kind of data is transferred in SES_DATA_TRANSFER_PDUs */ @@ -160,6 +159,23 @@ call_rtse_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info * return offset; } +static int +call_rtse_external_type_callback(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_) +{ + const char *oid = NULL; + + if (actx->external.indirect_ref_present) { + oid = (const char *)find_oid_by_pres_ctx_id(actx->pinfo, actx->external.indirect_reference); + } else if (actx->external.direct_ref_present) { + oid = actx->external.direct_reference; + } + + if (oid) + offset = call_rtse_oid_callback(oid, tvb, offset, actx->pinfo, top_tree ? top_tree : tree); + + return offset; +} + #include "packet-rtse-fn.c" /* @@ -254,7 +270,7 @@ dissect_rtse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) if (next_tvb) { /* ROS won't do this for us */ session->ros_op = (ROS_OP_INVOKE | ROS_OP_ARGUMENT); - offset=dissect_rtse_EXTERNALt(FALSE, next_tvb, 0, &asn1_ctx, tree, -1); + offset=dissect_ber_external_type(FALSE, tree, next_tvb, 0, &asn1_ctx, -1, call_rtse_external_type_callback); } else { offset = tvb_length (tvb); } diff --git a/asn1/rtse/rtse.asn b/asn1/rtse/rtse.asn index e481f358ee..dce9ca1af9 100644 --- a/asn1/rtse/rtse.asn +++ b/asn1/rtse/rtse.asn @@ -136,24 +136,6 @@ AbortReason ::= INTEGER { userError(6), -- user-abort solely in normal mode transferCompleted(7) -- activity can't be discarded--} --- I can't use the ACSE External as it dispatches out of the --- ber_callbacks and I want to dispatch out of the rtse_callbacks - --- Workaround for bug in asn2wrs in the .cnf file --- to handle the lack of support for tagged assignments. --- remove that workaround once asn2wrs learns how to handle --- tagged assignments. -EXTERNALt ::= [UNIVERSAL 8] IMPLICIT SEQUENCE - { - direct-reference OBJECT IDENTIFIER OPTIONAL, - indirect-reference INTEGER OPTIONAL, - data-value-descriptor ObjectDescriptor OPTIONAL, - encoding CHOICE - {single-ASN1-type [0] ANY, - octet-aligned [1] IMPLICIT OCTET STRING, - arbitrary [2] IMPLICIT BIT STRING} - } - END -- Generated by Asnp, the ASN.1 pretty-printer of France Telecom R&D diff --git a/asn1/rtse/rtse.cnf b/asn1/rtse/rtse.cnf index d47ab6556d..67d3ec9d58 100644 --- a/asn1/rtse/rtse.cnf +++ b/asn1/rtse/rtse.cnf @@ -3,7 +3,6 @@ RTORQapdu RTOACapdu RTORJapdu RTABapdu -EXTERNALt #.FN_BODY RTORJapdu/userDataRJ char *oid = NULL; @@ -89,29 +88,9 @@ EXTERNALt if(session) session->ros_op = (ROS_OP_INVOKE | ROS_OP_ARGUMENT); - offset = dissect_rtse_EXTERNALt(FALSE, next_tvb, 0, actx, tree, -1); - + offset = dissect_ber_external_type(FALSE, tree, next_tvb, 0, actx, -1, call_rtse_external_type_callback); } -#.FN_BODY EXTERNALt/_untag/indirect-reference - char *oid; - - offset = dissect_ber_integer(FALSE, actx, tree, tvb, offset, - hf_rtse_indirect_reference, - &indir_ref); - - /* look up the indirect reference */ - if((oid = find_oid_by_pres_ctx_id(actx->pinfo, indir_ref)) != NULL) { - object_identifier_id = ep_strdup_printf("%%s", oid); - } else if (object_identifier_id) { - *object_identifier_id = '\0'; - } - - -#.FN_BODY EXTERNALt/_untag/encoding/single-ASN1-type - if (object_identifier_id) - offset=call_rtse_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, top_tree); - #.FN_BODY RTORQapdu/applicationProtocol |