diff options
author | Anders Broman <anders.broman@ericsson.com> | 2007-05-13 20:58:29 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2007-05-13 20:58:29 +0000 |
commit | c01f3829742dacd6d94dc50be54537661bad0581 (patch) | |
tree | eb3da0d69d5bc62ca587ebd999b6beacd693f168 /asn1/dap | |
parent | b80cb43018aa49bac3e24cabca009ca0471cd579 (diff) |
Second step in introducing asn context to BER dissectors just like in PER.
svn path=/trunk/; revision=21753
Diffstat (limited to 'asn1/dap')
-rw-r--r-- | asn1/dap/dap.cnf | 34 | ||||
-rw-r--r-- | asn1/dap/packet-dap-template.c | 8 |
2 files changed, 23 insertions, 19 deletions
diff --git a/asn1/dap/dap.cnf b/asn1/dap/dap.cnf index fcfa9523aa..65b2f3418e 100644 --- a/asn1/dap/dap.cnf +++ b/asn1/dap/dap.cnf @@ -138,14 +138,14 @@ TokenData/time utctime guint32 len; /* check and see if this is an empty set */ - dissect_ber_length(pinfo, tree, tvb, offset+1, &len, NULL); + dissect_ber_length(actx->pinfo, tree, tvb, offset+1, &len, NULL); if(len == 0) { /* its an empty set - i.e anonymous (assuming version is DEFAULTed) */ proto_tree_add_text(tree, tvb, offset, -1,"Anonymous"); - if(check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, " anonymous"); + if(check_col(actx->pinfo->cinfo, COL_INFO)) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " anonymous"); } /* do the default thing */ @@ -156,8 +156,8 @@ TokenData/time utctime %(DEFAULT_BODY)s - if(check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, " %%s", x509if_get_last_dn()); + if(check_col(actx->pinfo->cinfo, COL_INFO)) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", x509if_get_last_dn()); #.FN_PARS OCTET_STRING VAL_PTR=&out_tvb @@ -196,8 +196,8 @@ TokenData/time utctime %(DEFAULT_BODY)s - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " %%s", val_to_str(problem, dap_SecurityProblem_vals, "SecurityProblem(%%d)")); + if (check_col(actx->pinfo->cinfo, COL_INFO)) { + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", val_to_str(problem, dap_SecurityProblem_vals, "SecurityProblem(%%d)")); } #.FN_PARS ServiceProblem @@ -208,8 +208,8 @@ TokenData/time utctime %(DEFAULT_BODY)s - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " %%s", val_to_str(problem, dap_ServiceProblem_vals, "ServiceProblem(%%d)")); + if (check_col(actx->pinfo->cinfo, COL_INFO)) { + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", val_to_str(problem, dap_ServiceProblem_vals, "ServiceProblem(%%d)")); } #.FN_PARS UpdateProblem @@ -220,8 +220,8 @@ TokenData/time utctime %(DEFAULT_BODY)s - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " %%s", val_to_str(problem, dap_UpdateProblem_vals, "UpdateProblem(%%d)")); + if (check_col(actx->pinfo->cinfo, COL_INFO)) { + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", val_to_str(problem, dap_UpdateProblem_vals, "UpdateProblem(%%d)")); } #.FN_PARS LimitProblem @@ -232,8 +232,8 @@ TokenData/time utctime %(DEFAULT_BODY)s - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " %%s", val_to_str(problem, dap_LimitProblem_vals, "LimitProblem(%%d)")); + if (check_col(actx->pinfo->cinfo, COL_INFO)) { + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", val_to_str(problem, dap_LimitProblem_vals, "LimitProblem(%%d)")); } #.FN_PARS T_subset @@ -244,8 +244,8 @@ TokenData/time utctime %(DEFAULT_BODY)s - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " %%s", val_to_str(subset, dap_T_subset_vals, "Subset(%%d)")); + if (check_col(actx->pinfo->cinfo, COL_INFO)) { + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", val_to_str(subset, dap_T_subset_vals, "Subset(%%d)")); } @@ -254,9 +254,9 @@ TokenData/time utctime %(DEFAULT_BODY)s - if(check_col(pinfo->cinfo, COL_INFO)) { + if(check_col(actx->pinfo->cinfo, COL_INFO)) { dn = x509if_get_last_dn(); - col_append_fstr(pinfo->cinfo, COL_INFO, " %%s", (dn && *dn) ? dn : "(root)"); + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", (dn && *dn) ? dn : "(root)"); } #.FN_BODY T_subordinates_item diff --git a/asn1/dap/packet-dap-template.c b/asn1/dap/packet-dap-template.c index 4bc4a31d3b..9ed91fff51 100644 --- a/asn1/dap/packet-dap-template.c +++ b/asn1/dap/packet-dap-template.c @@ -32,6 +32,7 @@ #include <epan/prefs.h> #include <epan/conversation.h> #include <epan/oid_resolv.h> +#include <epan/asn1.h> #include <stdio.h> #include <string.h> @@ -85,8 +86,11 @@ dissect_dap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) int old_offset; proto_item *item=NULL; proto_tree *tree=NULL; - int (*dap_dissector)(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) = NULL; + int (*dap_dissector)(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_) = NULL; char *dap_op_name; + asn1_ctx_t asn1_ctx; + + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); /* do we have operation information from the ROS dissector? */ if( !pinfo->private_data ){ @@ -258,7 +262,7 @@ dissect_dap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) while (tvb_reported_length_remaining(tvb, offset) > 0){ old_offset=offset; - offset=(*dap_dissector)(FALSE, tvb, offset, pinfo , tree, -1); + offset=(*dap_dissector)(FALSE, tvb, offset, &asn1_ctx, tree, -1); if(offset == old_offset){ proto_tree_add_text(tree, tvb, offset, -1,"Internal error, zero-byte DAP PDU"); offset = tvb_length(tvb); |