diff options
author | etxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7> | 2007-05-13 20:58:29 +0000 |
---|---|---|
committer | etxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7> | 2007-05-13 20:58:29 +0000 |
commit | 2904c6115933cfab7bc881b269680fb73ab59a54 (patch) | |
tree | eb3da0d69d5bc62ca587ebd999b6beacd693f168 /asn1 | |
parent | 449bb111a734d5bef2f890102e2d0a6ff2f1b9da (diff) |
Second step in introducing asn context to BER dissectors just like in PER.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@21753 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'asn1')
94 files changed, 1656 insertions, 1698 deletions
diff --git a/asn1/MAP_Dialogue/MAP_DialoguePDU.cnf b/asn1/MAP_Dialogue/MAP_DialoguePDU.cnf index 74b6adad20..70e0f28d91 100644 --- a/asn1/MAP_Dialogue/MAP_DialoguePDU.cnf +++ b/asn1/MAP_Dialogue/MAP_DialoguePDU.cnf @@ -13,6 +13,7 @@ MAP-ST-DataTypes gsm_map #.EXPORTS #.PDU +MAP-DialoguePDU #.NO_EMIT diff --git a/asn1/MAP_Dialogue/packet-MAP-DialoguePDU-template.c b/asn1/MAP_Dialogue/packet-MAP-DialoguePDU-template.c index 067f182a9e..835de236b0 100644 --- a/asn1/MAP_Dialogue/packet-MAP-DialoguePDU-template.c +++ b/asn1/MAP_Dialogue/packet-MAP-DialoguePDU-template.c @@ -29,6 +29,7 @@ #include <glib.h> #include <epan/packet.h> #include <epan/conversation.h> +#include <epan/asn1.h> #include <stdio.h> #include <string.h> @@ -49,11 +50,6 @@ int proto_MAP_DialoguePDU = -1; #include "packet-MAP_DialoguePDU-fn.c" -static void -dissect_MAP_Dialogue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) -{ - dissect_MAP_DialoguePDU_MAP_DialoguePDU(FALSE, tvb, 0, pinfo, parent_tree, -1); -} /*--- proto_register_MAP_DialoguePDU -------------------------------------------*/ void proto_register_MAP_DialoguePDU(void) { @@ -70,7 +66,7 @@ void proto_register_MAP_DialoguePDU(void) { /* Register protocol */ proto_MAP_DialoguePDU = proto_register_protocol(PNAME, PSNAME, PFNAME); - register_dissector("MAP_DialoguePDU", dissect_MAP_Dialogue, proto_MAP_DialoguePDU); + register_dissector("MAP_DialoguePDU", dissect_MAP_DialoguePDU_PDU, proto_MAP_DialoguePDU); /* Register fields and subtrees */ proto_register_field_array(proto_MAP_DialoguePDU, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); @@ -80,7 +76,7 @@ void proto_register_MAP_DialoguePDU(void) { /*--- proto_reg_handoff_MAP_DialoguePDU ---------------------------------------*/ void proto_reg_handoff_MAP_DialoguePDU(void) { - register_ber_oid_dissector("0.4.0.0.1.1.1.1", dissect_MAP_Dialogue, proto_MAP_DialoguePDU, + register_ber_oid_dissector("0.4.0.0.1.1.1.1", dissect_MAP_DialoguePDU_PDU, proto_MAP_DialoguePDU, "itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) abstractSyntax(1) map-DialoguePDU(1) version1(1)"); } diff --git a/asn1/acp133/packet-acp133-template.c b/asn1/acp133/packet-acp133-template.c index 241c5877c9..57c270b470 100644 --- a/asn1/acp133/packet-acp133-template.c +++ b/asn1/acp133/packet-acp133-template.c @@ -31,6 +31,7 @@ #include <epan/packet.h> #include <epan/conversation.h> #include <epan/oid_resolv.h> +#include <epan/asn1.h> #include <stdio.h> #include <string.h> diff --git a/asn1/acse/acse.cnf b/asn1/acse/acse.cnf index ad7242c607..231e4067aa 100644 --- a/asn1/acse/acse.cnf +++ b/asn1/acse/acse.cnf @@ -48,45 +48,45 @@ ACRQ-apdu/aSO-context-name aCRQ_aSO_context_name * time being just remove this tag manually inside the EXTERNAL * dissector. */ - offset = dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag); - offset = dissect_ber_length(pinfo, tree, tvb, offset, &len1, &ind_field); + offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &class, &pc, &tag); + offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_sequence(TRUE, pinfo, tree, tvb, offset, + offset = dissect_ber_sequence(TRUE, actx, tree, tvb, offset, EXTERNALt_sequence, hf_index, ett_acse_EXTERNALt); #.FN_PARS Authentication-value-other/other-mechanism-name FN_VARIANT = _str VAL_PTR = &object_identifier_id #.FN_BODY Authentication-value-other/other-mechanism-value - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, top_tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, top_tree); #.FN_BODY PDV-list/presentation-data-values/simple-ASN1-type /*XXX not implemented yet */ #.FN_BODY AARQ-apdu/aSO-context-name - offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset, + offset = dissect_ber_object_identifier_str(FALSE, actx->pinfo, tree, tvb, offset, hf_index, &object_identifier_id); #.FN_BODY AARE-apdu/aSO-context-name - offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset, + offset = dissect_ber_object_identifier_str(FALSE, actx->pinfo, tree, tvb, offset, hf_index, &object_identifier_id); #.FN_BODY ACRQ-apdu/aSO-context-name - offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset, + offset = dissect_ber_object_identifier_str(FALSE, actx->pinfo, tree, tvb, offset, hf_index, &object_identifier_id); #.FN_BODY ACRP-apdu/aSO-context-name - offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset, + offset = dissect_ber_object_identifier_str(FALSE, actx->pinfo, tree, tvb, offset, hf_index, &object_identifier_id); #.FN_BODY EXTERNALt/indirect-reference char *oid; - offset = dissect_ber_integer(FALSE, pinfo, tree, tvb, offset, + offset = dissect_ber_integer(FALSE, actx->pinfo, tree, tvb, offset, hf_acse_indirect_reference, &indir_ref); /* look up the indirect reference */ - if((oid = find_oid_by_pres_ctx_id(pinfo, indir_ref)) != NULL) { + if((oid = find_oid_by_pres_ctx_id(actx->pinfo, indir_ref)) != NULL) { object_identifier_id = ep_strdup(oid); } @@ -97,7 +97,7 @@ ACRQ-apdu/aSO-context-name aCRQ_aSO_context_name FN_VARIANT = _str VAL_PTR = &object_identifier_id #.FN_BODY EXTERNALt/encoding/single-ASN1-type - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, top_tree ? top_tree : tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, top_tree ? top_tree : tree); #.FN_PARS Release-request-reason VAL_PTR=&reason @@ -107,8 +107,8 @@ ACRQ-apdu/aSO-context-name aCRQ_aSO_context_name %(DEFAULT_BODY)s - if((reason != -1) && check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, "Release-Request (%%s)", val_to_str(reason, acse_Release_request_reason_vals, "reason(%%d)")); + if((reason != -1) && check_col(actx->pinfo->cinfo, COL_INFO)) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, "Release-Request (%%s)", val_to_str(reason, acse_Release_request_reason_vals, "reason(%%d)")); #.FN_PARS Release-response-reason @@ -119,8 +119,8 @@ ACRQ-apdu/aSO-context-name aCRQ_aSO_context_name %(DEFAULT_BODY)s - if((reason != -1) && check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, "Release-Response (%%s)", val_to_str(reason, acse_Release_request_reason_vals, "reason(%%d)")); + if((reason != -1) && check_col(actx->pinfo->cinfo, COL_INFO)) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, "Release-Response (%%s)", val_to_str(reason, acse_Release_request_reason_vals, "reason(%%d)")); #.FIELD_ATTR diff --git a/asn1/acse/packet-acse-template.c b/asn1/acse/packet-acse-template.c index f22adf9d1e..55df3ab10b 100644 --- a/asn1/acse/packet-acse-template.c +++ b/asn1/acse/packet-acse-template.c @@ -155,6 +155,8 @@ dissect_acse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) proto_item *item=NULL; proto_tree *tree=NULL; char *oid; + asn1_ctx_t asn1_ctx; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); /* first, try to check length */ @@ -230,7 +232,7 @@ dissect_acse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) /* postpone it before dissector will have more information */ while (tvb_reported_length_remaining(tvb, offset) > 0){ int old_offset=offset; - offset = dissect_acse_ACSE_apdu(FALSE, tvb, offset, pinfo, tree, -1); + offset = dissect_acse_ACSE_apdu(FALSE, tvb, offset, &asn1_ctx, tree, -1); if(offset == old_offset ){ proto_tree_add_text(tree, tvb, offset, -1,"Malformed packet"); offset = tvb_length(tvb); diff --git a/asn1/ansi_map/ansi_map.cnf b/asn1/ansi_map/ansi_map.cnf index f07c41b465..c4c3c265dd 100644 --- a/asn1/ansi_map/ansi_map.cnf +++ b/asn1/ansi_map/ansi_map.cnf @@ -25,25 +25,25 @@ OriginationRequestRes OperationCode = OperationCode&0x00ff; ansi_map_is_invoke = TRUE; - if (check_col(pinfo->cinfo, COL_INFO)){ - col_set_str(pinfo->cinfo, COL_INFO, val_to_str(OperationCode, ansi_map_opr_code_strings, "Unknown ANSI-MAP PDU (%u)")); + if (check_col(actx->pinfo->cinfo, COL_INFO)){ + col_set_str(actx->pinfo->cinfo, COL_INFO, val_to_str(OperationCode, ansi_map_opr_code_strings, "Unknown ANSI-MAP PDU (%u)")); } /* No Data */ if(tvb_length_remaining(tvb, offset)<=0){ - update_saved_invokedata(pinfo, tree, tvb); + update_saved_invokedata(actx->pinfo, tree, tvb); return offset; } - offset = dissect_invokeData(pinfo, tree, tvb, offset); - update_saved_invokedata(pinfo, tree, tvb); + offset = dissect_invokeData(tree, tvb, offset, actx); + update_saved_invokedata(actx->pinfo, tree, tvb); #.FN_BODY ReturnParameters struct amsi_map_invokedata_t *ansi_map_saved_invokedata; struct tcap_private_t *p_private_tcap; proto_item *item; - address* src = &(pinfo->src); - address* dst = &(pinfo->dst); + address* src = &(actx->pinfo->src); + address* dst = &(actx->pinfo->dst); guint8 *src_str; guint8 *dst_str; char *buf; @@ -53,8 +53,8 @@ OriginationRequestRes dst_str = address_to_str(dst); /* Data from the TCAP dissector */ - if (pinfo->private_data != NULL){ - p_private_tcap=pinfo->private_data; + if (actx->pinfo->private_data != NULL){ + p_private_tcap=actx->pinfo->private_data; /* The hash string needs to contain src and dest to distiguish differnt flows */ src_str = address_to_str(src); dst_str = address_to_str(dst); @@ -73,9 +73,9 @@ OriginationRequestRes }else{ OperationCode = OperationCode & 0x00ff; } - if (check_col(pinfo->cinfo, COL_INFO)){ - col_clear(pinfo->cinfo, COL_INFO); - col_add_fstr(pinfo->cinfo, COL_INFO,"%s Response", val_to_str(OperationCode, ansi_map_opr_code_strings, "Unknown ANSI-MAP PDU (%u)")); + if (check_col(actx->pinfo->cinfo, COL_INFO)){ + col_clear(actx->pinfo->cinfo, COL_INFO); + col_add_fstr(actx->pinfo->cinfo, COL_INFO,"%s Response", val_to_str(OperationCode, ansi_map_opr_code_strings, "Unknown ANSI-MAP PDU (%u)")); } /* No Data */ if(tvb_length_remaining(tvb, offset)<=0){ @@ -86,7 +86,7 @@ OriginationRequestRes PROTO_ITEM_SET_GENERATED(item); ansi_map_is_invoke = FALSE; - offset = dissect_returnData(pinfo, tree, tvb, offset); + offset = dissect_returnData(tree, tvb, offset, actx); #.FN_BODY ErrorParameters @@ -101,21 +101,21 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_min_type(parameter_tvb,pinfo,tree); + dissect_ansi_map_min_type(parameter_tvb,actx->pinfo,tree); } #.FN_BODY DigitsType VAL_PTR = ¶meter_tvb tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_digits_type(parameter_tvb,pinfo,tree); + dissect_ansi_map_digits_type(parameter_tvb,actx->pinfo,tree); } #.FN_BODY Subaddress VAL_PTR = ¶meter_tvb tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_subaddress(parameter_tvb,pinfo,tree); + dissect_ansi_map_subaddress(parameter_tvb,actx->pinfo,tree); } # 6.5.2.3 AlertCode @@ -123,7 +123,7 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_alertcode(parameter_tvb,pinfo,tree); + dissect_ansi_map_alertcode(parameter_tvb,actx->pinfo,tree); } # 6.5.2.5 AnnouncementCode @@ -131,7 +131,7 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_announcementcode(parameter_tvb,pinfo,tree); + dissect_ansi_map_announcementcode(parameter_tvb,actx->pinfo,tree); } # 6.5.2.14 AuthorizationPeriod @@ -139,7 +139,7 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_authorizationperiod(parameter_tvb,pinfo,tree); + dissect_ansi_map_authorizationperiod(parameter_tvb,actx->pinfo,tree); } @@ -148,7 +148,7 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_billingid(parameter_tvb,pinfo,tree); + dissect_ansi_map_billingid(parameter_tvb,actx->pinfo,tree); } # 6.5.2.20 CallingFeaturesIndicator @@ -156,21 +156,21 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_callingfeaturesindicator(parameter_tvb,pinfo,tree); + dissect_ansi_map_callingfeaturesindicator(parameter_tvb,actx->pinfo,tree); } # 6.5.2.29 CDMACallMode #.FN_BODY CDMACallMode VAL_PTR = ¶meter_tvb tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_cdmacallmode(parameter_tvb,pinfo,tree); + dissect_ansi_map_cdmacallmode(parameter_tvb,actx->pinfo,tree); } # 6.5.2.30 CDMAChannelData #.FN_BODY CDMAChannelData VAL_PTR = ¶meter_tvb tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_cdmachanneldata(parameter_tvb,pinfo,tree); + dissect_ansi_map_cdmachanneldata(parameter_tvb,actx->pinfo,tree); } # 6.5.2.41 CDMAStationClassMark @@ -178,7 +178,7 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_cdmastationclassmark(parameter_tvb,pinfo,tree); + dissect_ansi_map_cdmastationclassmark(parameter_tvb,actx->pinfo,tree); } # 6.5.2.47 ChannelData @@ -186,7 +186,7 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_channeldata(parameter_tvb,pinfo,tree); + dissect_ansi_map_channeldata(parameter_tvb,actx->pinfo,tree); } # 6.5.2.50 ConfidentialityModes @@ -194,14 +194,14 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_confidentialitymodes(parameter_tvb,pinfo,tree); + dissect_ansi_map_confidentialitymodes(parameter_tvb,actx->pinfo,tree); } # 6.5.2.51 ControlChannelData #.FN_BODY ControlChannelData VAL_PTR = ¶meter_tvb tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_controlchanneldata(parameter_tvb,pinfo,tree); + dissect_ansi_map_controlchanneldata(parameter_tvb,actx->pinfo,tree); } # 6.5.2.53 DeniedAuthorizationPeriod @@ -209,7 +209,7 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_deniedauthorizationperiod(parameter_tvb,pinfo,tree); + dissect_ansi_map_deniedauthorizationperiod(parameter_tvb,actx->pinfo,tree); } # 6.5.2.64 ExtendedMSCID @@ -217,7 +217,7 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_extendedmscid(parameter_tvb,pinfo,tree); + dissect_ansi_map_extendedmscid(parameter_tvb,actx->pinfo,tree); } # 6.5.2.65 ExtendedSystemMyTypeCode @@ -225,14 +225,14 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_extendedsystemmytypecode(parameter_tvb,pinfo,tree); + dissect_ansi_map_extendedsystemmytypecode(parameter_tvb, actx->pinfo, tree, actx); } #6.5.2.71 HandoffState #.FN_BODY HandoffState VAL_PTR = ¶meter_tvb tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_handoffstate(parameter_tvb,pinfo,tree); + dissect_ansi_map_handoffstate(parameter_tvb,actx->pinfo,tree); } # 6.5.2.72 InterMSCCircuitID @@ -240,7 +240,7 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_intermsccircuitid(parameter_tvb,pinfo,tree); + dissect_ansi_map_intermsccircuitid(parameter_tvb,actx->pinfo,tree); } # 6.5.2.78 MessageWaitingNotificationCount @@ -248,7 +248,7 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_messagewaitingnotificationcount(parameter_tvb,pinfo,tree); + dissect_ansi_map_messagewaitingnotificationcount(parameter_tvb,actx->pinfo,tree); } # 6.5.2.79 MessageWaitingNotificationType @@ -256,7 +256,7 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_messagewaitingnotificationtype(parameter_tvb,pinfo,tree); + dissect_ansi_map_messagewaitingnotificationtype(parameter_tvb,actx->pinfo,tree); } @@ -265,7 +265,7 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_mscid(parameter_tvb,pinfo,tree); + dissect_ansi_map_mscid(parameter_tvb,actx->pinfo,tree); } # 6.5.2.84 MSLocation @@ -273,7 +273,7 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_mscid(parameter_tvb,pinfo,tree); + dissect_ansi_map_mscid(parameter_tvb,actx->pinfo,tree); } # 6.5.2.85 NAMPSCallMode @@ -281,7 +281,7 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_nampscallmode(parameter_tvb,pinfo,tree); + dissect_ansi_map_nampscallmode(parameter_tvb,actx->pinfo,tree); } # 6.5.2.86 NAMPSChannelData @@ -289,7 +289,7 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_nampschanneldata(parameter_tvb,pinfo,tree); + dissect_ansi_map_nampschanneldata(parameter_tvb,actx->pinfo,tree); } # 6.5.2.88 OneTimeFeatureIndicator @@ -297,7 +297,7 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_onetimefeatureindicator(parameter_tvb,pinfo,tree); + dissect_ansi_map_onetimefeatureindicator(parameter_tvb,actx->pinfo,tree); } # 6.5.2.90 OriginationTriggers @@ -305,7 +305,7 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_originationtriggers(parameter_tvb,pinfo,tree); + dissect_ansi_map_originationtriggers(parameter_tvb,actx->pinfo,tree); } # 6.5.2.91 PACAIndicator @@ -313,7 +313,7 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_pacaindicator(parameter_tvb,pinfo,tree); + dissect_ansi_map_pacaindicator(parameter_tvb,actx->pinfo,tree); } # 6.5.2.93 PC_SSN @@ -321,7 +321,7 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_pc_ssn(parameter_tvb,pinfo,tree); + dissect_ansi_map_pc_ssn(parameter_tvb,actx->pinfo,tree); } # 6.5.2.94 PilotBillingID @@ -330,7 +330,7 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_pilotbillingid(parameter_tvb,pinfo,tree); + dissect_ansi_map_pilotbillingid(parameter_tvb,actx->pinfo,tree); } # 6.5.2.124 @@ -371,7 +371,7 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_sms_originationrestrictions(parameter_tvb,pinfo,tree); + dissect_ansi_map_sms_originationrestrictions(parameter_tvb,actx->pinfo,tree); } # 6.5.2.137 @@ -407,7 +407,7 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_systemcapabilities(parameter_tvb,pinfo,tree); + dissect_ansi_map_systemcapabilities(parameter_tvb,actx->pinfo,tree); } @@ -416,7 +416,7 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_terminationtriggers(parameter_tvb,pinfo,tree); + dissect_ansi_map_terminationtriggers(parameter_tvb,actx->pinfo,tree); } # 6.5.2.160 TransactionCapability @@ -424,7 +424,7 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_transactioncapability(parameter_tvb,pinfo,tree); + dissect_ansi_map_transactioncapability(parameter_tvb,actx->pinfo,tree); } # 6.5.2.f (TSB76) CDMAServiceOption N.S0010-0 v 1.0 @@ -432,7 +432,7 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_cdmaserviceoption(parameter_tvb,pinfo,tree); + dissect_ansi_map_cdmaserviceoption(parameter_tvb,actx->pinfo,tree); } # 6.5.2.aj SecondInterMSCCircuitID @@ -443,7 +443,7 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_callingpartyname(parameter_tvb,pinfo,tree); + dissect_ansi_map_callingpartyname(parameter_tvb,actx->pinfo,tree); } # 6.5.2.df TriggerCapability @@ -451,7 +451,7 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_triggercapability(parameter_tvb,pinfo,tree); + dissect_ansi_map_triggercapability(parameter_tvb,actx->pinfo,tree); } # 6.5.2.dj WINOperationsCapability @@ -459,7 +459,7 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_winoperationscapability(parameter_tvb,pinfo,tree); + dissect_ansi_map_winoperationscapability(parameter_tvb,actx->pinfo,tree); } # 6.5.2.ek ControlNetworkID @@ -467,7 +467,7 @@ OriginationRequestRes tvbuff_t *parameter_tvb = NULL; %(DEFAULT_BODY)s if (parameter_tvb){ - dissect_ansi_map_controlnetworkid(parameter_tvb,pinfo,tree); + dissect_ansi_map_controlnetworkid(parameter_tvb,actx->pinfo,tree); } #6.5.2.gm CDMA2000HandoffInvokeIOSData @@ -480,7 +480,7 @@ OriginationRequestRes if (parameter_tvb){ item = get_ber_last_created_item(); subtree = proto_item_add_subtree(item, ett_CDMA2000HandoffInvokeIOSData); - dissect_cdma2000_a1_elements(parameter_tvb, pinfo, subtree, + dissect_cdma2000_a1_elements(parameter_tvb, actx->pinfo, subtree, 0, tvb_length_remaining(parameter_tvb,0)); } #6.5.2.gn CDMA2000HandoffResponseIOSData @@ -493,7 +493,7 @@ OriginationRequestRes if (parameter_tvb){ item = get_ber_last_created_item(); subtree = proto_item_add_subtree(item, ett_CDMA2000HandoffResponseIOSData); - dissect_cdma2000_a1_elements(parameter_tvb, pinfo, subtree, + dissect_cdma2000_a1_elements(parameter_tvb, actx->pinfo, subtree, 0, tvb_length_remaining(parameter_tvb,0)); } #6.5.2.wB ServiceIndicator N.S0011-0 v 1.0 diff --git a/asn1/ansi_map/packet-ansi_map-template.c b/asn1/ansi_map/packet-ansi_map-template.c index f164eefe09..ceeea4b830 100644 --- a/asn1/ansi_map/packet-ansi_map-template.c +++ b/asn1/ansi_map/packet-ansi_map-template.c @@ -94,14 +94,15 @@ #include <epan/conversation.h> #include <epan/tap.h> #include <epan/emem.h> +#include <epan/asn1.h> #include <stdio.h> #include <string.h> +#include "packet-ber.h" #include "packet-ansi_map.h" #include "packet-ansi_a.h" #include "packet-gsm_map.h" -#include "packet-ber.h" #include "packet-tcap.h" #define PNAME "ANSI Mobile Application Part" @@ -553,9 +554,9 @@ const value_string ansi_map_opr_code_strings[] = { { 0, NULL }, }; -static int dissect_invokeData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset); -static int dissect_returnData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset); -static int dissect_ansi_map_SystemMyTypeCode(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_); +static int dissect_invokeData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx); +static int dissect_returnData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx); +static int dissect_ansi_map_SystemMyTypeCode(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_); typedef struct dgt_set_t { @@ -1662,7 +1663,7 @@ dissect_ansi_map_extendedmscid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree } /* 6.5.2.65 ExtendedSystemMyTypeCode */ static void -dissect_ansi_map_extendedsystemmytypecode(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_){ +dissect_ansi_map_extendedsystemmytypecode(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_, asn1_ctx_t *actx){ int offset = 0; proto_item *item; @@ -1673,7 +1674,7 @@ dissect_ansi_map_extendedsystemmytypecode(tvbuff_t *tvb, packet_info *pinfo _U_, /* Type (octet 1) */ proto_tree_add_item(subtree, hf_ansi_map_msc_type, tvb, offset, 1, FALSE); offset++; - offset = dissect_ansi_map_SystemMyTypeCode(TRUE, tvb, offset, pinfo, subtree, hf_ansi_map_systemMyTypeCode); + offset = dissect_ansi_map_SystemMyTypeCode(TRUE, tvb, offset, actx, subtree, hf_ansi_map_systemMyTypeCode); } @@ -3526,60 +3527,60 @@ static const value_string ansi_map_VoicePrivacyReport_vals[] = { #include "packet-ansi_map-fn.c" -static int dissect_invokeData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { +static int dissect_invokeData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx) { switch(OperationCode){ case 1: /*Handoff Measurement Request*/ - offset = dissect_ansi_map_HandoffMeasurementRequest(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_handoffMeasurementRequest); + offset = dissect_ansi_map_HandoffMeasurementRequest(TRUE, tvb, offset, actx, tree, hf_ansi_map_handoffMeasurementRequest); break; case 2: /*Facilities Directive*/ - offset = dissect_ansi_map_FacilitiesDirective(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_facilitiesDirective); + offset = dissect_ansi_map_FacilitiesDirective(TRUE, tvb, offset, actx, tree, hf_ansi_map_facilitiesDirective); break; case 3: /*Mobile On Channel*/ proto_tree_add_text(tree, tvb, offset, -1, "Unknown invokeData blob"); break; case 4: /*Handoff Back*/ - offset = dissect_ansi_map_HandoffBack(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_handoffBack); + offset = dissect_ansi_map_HandoffBack(TRUE, tvb, offset, actx, tree, hf_ansi_map_handoffBack); break; case 5: /*Facilities Release*/ - offset = dissect_ansi_map_FacilitiesRelease(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_facilitiesRelease); + offset = dissect_ansi_map_FacilitiesRelease(TRUE, tvb, offset, actx, tree, hf_ansi_map_facilitiesRelease); break; case 6: /*Qualification Request*/ - offset = dissect_ansi_map_QualificationRequest(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_qualificationRequest); + offset = dissect_ansi_map_QualificationRequest(TRUE, tvb, offset, actx, tree, hf_ansi_map_qualificationRequest); break; case 7: /*Qualification Directive*/ - offset = dissect_ansi_map_QualificationDirective(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_qualificationDirective); + offset = dissect_ansi_map_QualificationDirective(TRUE, tvb, offset, actx, tree, hf_ansi_map_qualificationDirective); break; case 8: /*Blocking*/ - offset = dissect_ansi_map_Blocking(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_blocking); + offset = dissect_ansi_map_Blocking(TRUE, tvb, offset, actx, tree, hf_ansi_map_blocking); break; case 9: /*Unblocking*/ - offset = dissect_ansi_map_Unblocking(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_unblocking); + offset = dissect_ansi_map_Unblocking(TRUE, tvb, offset, actx, tree, hf_ansi_map_unblocking); break; case 10: /*Reset Circuit*/ - offset = dissect_ansi_map_ResetCircuit(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_resetCircuit); + offset = dissect_ansi_map_ResetCircuit(TRUE, tvb, offset, actx, tree, hf_ansi_map_resetCircuit); break; case 11: /*Trunk Test*/ - offset = dissect_ansi_map_TrunkTest(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_trunkTest); + offset = dissect_ansi_map_TrunkTest(TRUE, tvb, offset, actx, tree, hf_ansi_map_trunkTest); break; case 12: /*Trunk Test Disconnect*/ - offset = dissect_ansi_map_TrunkTestDisconnect(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_trunkTestDisconnect); + offset = dissect_ansi_map_TrunkTestDisconnect(TRUE, tvb, offset, actx, tree, hf_ansi_map_trunkTestDisconnect); break; case 13: /*Registration Notification*/ - offset = dissect_ansi_map_RegistrationNotification(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_registrationNotification); + offset = dissect_ansi_map_RegistrationNotification(TRUE, tvb, offset, actx, tree, hf_ansi_map_registrationNotification); break; case 14: /*Registration Cancellation*/ - offset = dissect_ansi_map_RegistrationCancellation(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_registrationCancellation); + offset = dissect_ansi_map_RegistrationCancellation(TRUE, tvb, offset, actx, tree, hf_ansi_map_registrationCancellation); break; case 15: /*Location Request*/ - offset = dissect_ansi_map_LocationRequest(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_locationRequest); + offset = dissect_ansi_map_LocationRequest(TRUE, tvb, offset, actx, tree, hf_ansi_map_locationRequest); break; case 16: /*Routing Request*/ - offset = dissect_ansi_map_RoutingRequest(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_routingRequest); + offset = dissect_ansi_map_RoutingRequest(TRUE, tvb, offset, actx, tree, hf_ansi_map_routingRequest); break; case 17: /*Feature Request*/ - offset = dissect_ansi_map_FeatureRequest(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_featureRequest); + offset = dissect_ansi_map_FeatureRequest(TRUE, tvb, offset, actx, tree, hf_ansi_map_featureRequest); break; case 18: /*Reserved 18 (Service Profile Request, IS-41-C)*/ proto_tree_add_text(tree, tvb, offset, -1, "Unknown invokeData blob(18 (Service Profile Request, IS-41-C)"); @@ -3588,118 +3589,118 @@ static int dissect_invokeData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tv proto_tree_add_text(tree, tvb, offset, -1, "Unknown invokeData blob(19 Service Profile Directive, IS-41-C)"); break; case 20: /*Unreliable Roamer Data Directive*/ - offset = dissect_ansi_map_UnreliableRoamerDataDirective(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_unreliableRoamerDataDirective); + offset = dissect_ansi_map_UnreliableRoamerDataDirective(TRUE, tvb, offset, actx, tree, hf_ansi_map_unreliableRoamerDataDirective); break; case 21: /*Reserved 21 (Call Data Request, IS-41-C)*/ proto_tree_add_text(tree, tvb, offset, -1, "Unknown invokeData blob(Reserved 21 (Call Data Request, IS-41-C)"); break; case 22: /*MS Inactive*/ - offset = dissect_ansi_map_MSInactive(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_mSInactive); + offset = dissect_ansi_map_MSInactive(TRUE, tvb, offset, actx, tree, hf_ansi_map_mSInactive); break; case 23: /*Transfer To Number Request*/ - offset = dissect_ansi_map_TransferToNumberRequest(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_transferToNumberRequest); + offset = dissect_ansi_map_TransferToNumberRequest(TRUE, tvb, offset, actx, tree, hf_ansi_map_transferToNumberRequest); break; case 24: /*Redirection Request*/ - offset = dissect_ansi_map_RedirectionRequest(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_redirectionRequest); + offset = dissect_ansi_map_RedirectionRequest(TRUE, tvb, offset, actx, tree, hf_ansi_map_redirectionRequest); break; case 25: /*Handoff To Third*/ - offset = dissect_ansi_map_HandoffToThird(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_handoffToThird); + offset = dissect_ansi_map_HandoffToThird(TRUE, tvb, offset, actx, tree, hf_ansi_map_handoffToThird); break; case 26: /*Flash Request*/ - offset = dissect_ansi_map_FlashRequest(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_flashRequest); + offset = dissect_ansi_map_FlashRequest(TRUE, tvb, offset, actx, tree, hf_ansi_map_flashRequest); break; case 27: /*Authentication Directive*/ - offset = dissect_ansi_map_AuthenticationDirective(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_authenticationDirective); + offset = dissect_ansi_map_AuthenticationDirective(TRUE, tvb, offset, actx, tree, hf_ansi_map_authenticationDirective); break; case 28: /*Authentication Request*/ - offset = dissect_ansi_map_AuthenticationRequest(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_authenticationRequest); + offset = dissect_ansi_map_AuthenticationRequest(TRUE, tvb, offset, actx, tree, hf_ansi_map_authenticationRequest); break; case 29: /*Base Station Challenge*/ - offset = dissect_ansi_map_BaseStationChallenge(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_baseStationChallenge); + offset = dissect_ansi_map_BaseStationChallenge(TRUE, tvb, offset, actx, tree, hf_ansi_map_baseStationChallenge); break; case 30: /*Authentication Failure Report*/ - offset = dissect_ansi_map_AuthenticationFailureReport(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_authenticationFailureReport); + offset = dissect_ansi_map_AuthenticationFailureReport(TRUE, tvb, offset, actx, tree, hf_ansi_map_authenticationFailureReport); break; case 31: /*Count Request*/ - offset = dissect_ansi_map_CountRequest(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_countRequest); + offset = dissect_ansi_map_CountRequest(TRUE, tvb, offset, actx, tree, hf_ansi_map_countRequest); break; case 32: /*Inter System Page*/ - offset = dissect_ansi_map_InterSystemPage(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_interSystemPage); + offset = dissect_ansi_map_InterSystemPage(TRUE, tvb, offset, actx, tree, hf_ansi_map_interSystemPage); break; case 33: /*Unsolicited Response*/ - offset = dissect_ansi_map_UnsolicitedResponse(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_unsolicitedResponse); + offset = dissect_ansi_map_UnsolicitedResponse(TRUE, tvb, offset, actx, tree, hf_ansi_map_unsolicitedResponse); break; case 34: /*Bulk Deregistration*/ - offset = dissect_ansi_map_BulkDeregistration(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_bulkDeregistration); + offset = dissect_ansi_map_BulkDeregistration(TRUE, tvb, offset, actx, tree, hf_ansi_map_bulkDeregistration); break; case 35: /*Handoff Measurement Request 2*/ - offset = dissect_ansi_map_HandoffMeasurementRequest2(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_handoffMeasurementRequest2); + offset = dissect_ansi_map_HandoffMeasurementRequest2(TRUE, tvb, offset, actx, tree, hf_ansi_map_handoffMeasurementRequest2); break; case 36: /*Facilities Directive 2*/ - offset = dissect_ansi_map_FacilitiesDirective2(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_facilitiesDirective2); + offset = dissect_ansi_map_FacilitiesDirective2(TRUE, tvb, offset, actx, tree, hf_ansi_map_facilitiesDirective2); break; case 37: /*Handoff Back 2*/ - offset = dissect_ansi_map_HandoffBack2(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_handoffBack2); + offset = dissect_ansi_map_HandoffBack2(TRUE, tvb, offset, actx, tree, hf_ansi_map_handoffBack2); break; case 38: /*Handoff To Third 2*/ - offset = dissect_ansi_map_HandoffToThird2(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_handoffToThird2); + offset = dissect_ansi_map_HandoffToThird2(TRUE, tvb, offset, actx, tree, hf_ansi_map_handoffToThird2); break; case 39: /*Authentication Directive Forward*/ - offset = dissect_ansi_map_AuthenticationDirectiveForward(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_authenticationDirectiveForward); + offset = dissect_ansi_map_AuthenticationDirectiveForward(TRUE, tvb, offset, actx, tree, hf_ansi_map_authenticationDirectiveForward); break; case 40: /*Authentication Status Report*/ - offset = dissect_ansi_map_AuthenticationStatusReport(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_authenticationStatusReport); + offset = dissect_ansi_map_AuthenticationStatusReport(TRUE, tvb, offset, actx, tree, hf_ansi_map_authenticationStatusReport); break; case 41: /*Reserved 41*/ proto_tree_add_text(tree, tvb, offset, -1, "Reserved 41, Unknown invokeData blob"); break; case 42: /*Information Directive*/ - offset = dissect_ansi_map_InformationDirective(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_informationDirective); + offset = dissect_ansi_map_InformationDirective(TRUE, tvb, offset, actx, tree, hf_ansi_map_informationDirective); break; case 43: /*Information Forward*/ - offset = dissect_ansi_map_InformationForward(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_informationForward); + offset = dissect_ansi_map_InformationForward(TRUE, tvb, offset, actx, tree, hf_ansi_map_informationForward); break; case 44: /*Inter System Answer*/ - offset = dissect_ansi_map_InterSystemAnswer(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_interSystemAnswer); + offset = dissect_ansi_map_InterSystemAnswer(TRUE, tvb, offset, actx, tree, hf_ansi_map_interSystemAnswer); break; case 45: /*Inter System Page 2*/ - offset = dissect_ansi_map_InterSystemPage2(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_interSystemPage2); + offset = dissect_ansi_map_InterSystemPage2(TRUE, tvb, offset, actx, tree, hf_ansi_map_interSystemPage2); break; case 46: /*Inter System Setup*/ - offset = dissect_ansi_map_InterSystemSetup(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_interSystemSetup); + offset = dissect_ansi_map_InterSystemSetup(TRUE, tvb, offset, actx, tree, hf_ansi_map_interSystemSetup); break; case 47: /*OriginationRequest*/ - offset = dissect_ansi_map_OriginationRequest(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_originationRequest); + offset = dissect_ansi_map_OriginationRequest(TRUE, tvb, offset, actx, tree, hf_ansi_map_originationRequest); break; case 48: /*Random Variable Request*/ - offset = dissect_ansi_map_RandomVariableRequest(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_randomVariableRequest); + offset = dissect_ansi_map_RandomVariableRequest(TRUE, tvb, offset, actx, tree, hf_ansi_map_randomVariableRequest); break; case 49: /*Redirection Directive*/ - offset = dissect_ansi_map_RedirectionDirective(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_redirectionDirective); + offset = dissect_ansi_map_RedirectionDirective(TRUE, tvb, offset, actx, tree, hf_ansi_map_redirectionDirective); break; case 50: /*Remote User Interaction Directive*/ - offset = dissect_ansi_map_RemoteUserInteractionDirective(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_remoteUserInteractionDirective); + offset = dissect_ansi_map_RemoteUserInteractionDirective(TRUE, tvb, offset, actx, tree, hf_ansi_map_remoteUserInteractionDirective); break; case 51: /*SMS Delivery Backward*/ - offset = dissect_ansi_map_SMSDeliveryBackward(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_sMSDeliveryBackward); + offset = dissect_ansi_map_SMSDeliveryBackward(TRUE, tvb, offset, actx, tree, hf_ansi_map_sMSDeliveryBackward); break; case 52: /*SMS Delivery Forward*/ - offset = dissect_ansi_map_SMSDeliveryForward(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_sMSDeliveryForward); + offset = dissect_ansi_map_SMSDeliveryForward(TRUE, tvb, offset, actx, tree, hf_ansi_map_sMSDeliveryForward); break; case 53: /*SMS Delivery Point to Point*/ - offset = dissect_ansi_map_SMSDeliveryPointToPoint(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_sMSDeliveryPointToPoint); + offset = dissect_ansi_map_SMSDeliveryPointToPoint(TRUE, tvb, offset, actx, tree, hf_ansi_map_sMSDeliveryPointToPoint); break; case 54: /*SMS Notification*/ - offset = dissect_ansi_map_SMSNotification(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_sMSNotification); + offset = dissect_ansi_map_SMSNotification(TRUE, tvb, offset, actx, tree, hf_ansi_map_sMSNotification); break; case 55: /*SMS Request*/ - offset = dissect_ansi_map_SMSRequest(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_sMSRequest); + offset = dissect_ansi_map_SMSRequest(TRUE, tvb, offset, actx, tree, hf_ansi_map_sMSRequest); break; /* End N.S0005*/ /* N.S0010-0 v 1.0 */ /* N.S0011-0 v 1.0 */ case 56: /*OTASP Request 6.4.2.CC*/ - offset = dissect_ansi_map_OTASPRequest(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_oTASPRequest); + offset = dissect_ansi_map_OTASPRequest(TRUE, tvb, offset, actx, tree, hf_ansi_map_oTASPRequest); break; /*End N.S0011-0 v 1.0 */ case 57: /*Information Backward*/ @@ -3707,64 +3708,64 @@ static int dissect_invokeData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tv break; /* N.S0008-0 v 1.0 */ case 58: /*Change Facilities*/ - offset = dissect_ansi_map_ChangeFacilities(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_changeFacilities); + offset = dissect_ansi_map_ChangeFacilities(TRUE, tvb, offset, actx, tree, hf_ansi_map_changeFacilities); break; case 59: /*Change Service*/ - offset = dissect_ansi_map_ChangeService(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_changeService); + offset = dissect_ansi_map_ChangeService(TRUE, tvb, offset, actx, tree, hf_ansi_map_changeService); break; /* End N.S0008-0 v 1.0 */ case 60: /*Parameter Request*/ - offset = dissect_ansi_map_ParameterRequest(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_parameterRequest); + offset = dissect_ansi_map_ParameterRequest(TRUE, tvb, offset, actx, tree, hf_ansi_map_parameterRequest); break; case 61: /*TMSI Directive*/ - offset = dissect_ansi_map_TMSIDirective(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_tMSIDirective); + offset = dissect_ansi_map_TMSIDirective(TRUE, tvb, offset, actx, tree, hf_ansi_map_tMSIDirective); break; /*End N.S0010-0 v 1.0 */ case 62: /*Reserved 62*/ proto_tree_add_text(tree, tvb, offset, -1, "Unknown invokeData blob(Reserved 62)"); break; case 63: /*Service Request N.S0012-0 v 1.0*/ - offset = dissect_ansi_map_ServiceRequest(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_serviceRequest); + offset = dissect_ansi_map_ServiceRequest(TRUE, tvb, offset, actx, tree, hf_ansi_map_serviceRequest); break; /* N.S0013 */ case 64: /*Analyzed Information Request*/ - offset = dissect_ansi_map_AnalyzedInformation(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_analyzedInformation); + offset = dissect_ansi_map_AnalyzedInformation(TRUE, tvb, offset, actx, tree, hf_ansi_map_analyzedInformation); break; case 65: /*Connection Failure Report*/ - offset = dissect_ansi_map_ConnectionFailureReport(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_connectionFailureReport); + offset = dissect_ansi_map_ConnectionFailureReport(TRUE, tvb, offset, actx, tree, hf_ansi_map_connectionFailureReport); break; case 66: /*Connect Resource*/ - offset = dissect_ansi_map_ConnectResource(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_connectResource); + offset = dissect_ansi_map_ConnectResource(TRUE, tvb, offset, actx, tree, hf_ansi_map_connectResource); break; case 67: /*Disconnect Resource*/ /* No data */ break; case 68: /*Facility Selected and Available*/ - offset = dissect_ansi_map_FacilitySelectedAndAvailable(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_facilitySelectedAndAvailable); + offset = dissect_ansi_map_FacilitySelectedAndAvailable(TRUE, tvb, offset, actx, tree, hf_ansi_map_facilitySelectedAndAvailable); break; case 69: /*Instruction Request*/ /* No data */ break; case 70: /*Modify*/ - offset = dissect_ansi_map_Modify(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_modify); + offset = dissect_ansi_map_Modify(TRUE, tvb, offset, actx, tree, hf_ansi_map_modify); break; case 71: /*Reset Timer*/ /*No Data*/ break; case 72: /*Search*/ - offset = dissect_ansi_map_Search(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_search); + offset = dissect_ansi_map_Search(TRUE, tvb, offset, actx, tree, hf_ansi_map_search); break; case 73: /*Seize Resource*/ - offset = dissect_ansi_map_SeizeResource(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_seizeResource); + offset = dissect_ansi_map_SeizeResource(TRUE, tvb, offset, actx, tree, hf_ansi_map_seizeResource); break; case 74: /*SRF Directive*/ - offset = dissect_ansi_map_SRFDirective(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_sRFDirective); + offset = dissect_ansi_map_SRFDirective(TRUE, tvb, offset, actx, tree, hf_ansi_map_sRFDirective); break; case 75: /*T Busy*/ - offset = dissect_ansi_map_TBusy(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_tBusy); + offset = dissect_ansi_map_TBusy(TRUE, tvb, offset, actx, tree, hf_ansi_map_tBusy); break; case 76: /*T NoAnswer*/ - offset = dissect_ansi_map_TNoAnswer(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_tNoAnswer); + offset = dissect_ansi_map_TNoAnswer(TRUE, tvb, offset, actx, tree, hf_ansi_map_tNoAnswer); break; /*END N.S0013 */ case 77: /*Release*/ @@ -3775,47 +3776,47 @@ static int dissect_invokeData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tv break; /* N.S0024*/ case 79: /*Message Directive*/ - offset = dissect_ansi_map_MessageDirective(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_messageDirective); + offset = dissect_ansi_map_MessageDirective(TRUE, tvb, offset, actx, tree, hf_ansi_map_messageDirective); break; /*END N.S0024*/ /* N.S0018 PN-4287*/ case 80: /*Bulk Disconnection*/ - offset = dissect_ansi_map_BulkDisconnection(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_bulkDisconnection); + offset = dissect_ansi_map_BulkDisconnection(TRUE, tvb, offset, actx, tree, hf_ansi_map_bulkDisconnection); break; case 81: /*Call Control Directive*/ - offset = dissect_ansi_map_CallControlDirective(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_callControlDirective); + offset = dissect_ansi_map_CallControlDirective(TRUE, tvb, offset, actx, tree, hf_ansi_map_callControlDirective); break; case 82: /*O Answer*/ - offset = dissect_ansi_map_OAnswer(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_oAnswer); + offset = dissect_ansi_map_OAnswer(TRUE, tvb, offset, actx, tree, hf_ansi_map_oAnswer); break; case 83: /*O Disconnect*/ - offset = dissect_ansi_map_ODisconnect(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_oDisconnect); + offset = dissect_ansi_map_ODisconnect(TRUE, tvb, offset, actx, tree, hf_ansi_map_oDisconnect); break; case 84: /*Call Recovery Report*/ - offset = dissect_ansi_map_CallRecoveryReport(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_callRecoveryReport); + offset = dissect_ansi_map_CallRecoveryReport(TRUE, tvb, offset, actx, tree, hf_ansi_map_callRecoveryReport); break; case 85: /*T Answer*/ - offset = dissect_ansi_map_TAnswer(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_tAnswer); + offset = dissect_ansi_map_TAnswer(TRUE, tvb, offset, actx, tree, hf_ansi_map_tAnswer); break; case 86: /*T Disconnect*/ - offset = dissect_ansi_map_TDisconnect(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_tDisconnect); + offset = dissect_ansi_map_TDisconnect(TRUE, tvb, offset, actx, tree, hf_ansi_map_tDisconnect); break; case 87: /*Unreliable Call Data*/ - offset = dissect_ansi_map_UnreliableCallData(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_unreliableCallData); + offset = dissect_ansi_map_UnreliableCallData(TRUE, tvb, offset, actx, tree, hf_ansi_map_unreliableCallData); break; /* N.S0018 PN-4287*/ /*N.S0004 */ case 88: /*O CalledPartyBusy*/ - offset = dissect_ansi_map_OCalledPartyBusy(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_oCalledPartyBusy); + offset = dissect_ansi_map_OCalledPartyBusy(TRUE, tvb, offset, actx, tree, hf_ansi_map_oCalledPartyBusy); break; case 89: /*O NoAnswer*/ - offset = dissect_ansi_map_ONoAnswer(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_oNoAnswer); + offset = dissect_ansi_map_ONoAnswer(TRUE, tvb, offset, actx, tree, hf_ansi_map_oNoAnswer); break; case 90: /*Position Request*/ - offset = dissect_ansi_map_PositionRequest(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_positionRequest); + offset = dissect_ansi_map_PositionRequest(TRUE, tvb, offset, actx, tree, hf_ansi_map_positionRequest); break; case 91: /*Position Request Forward*/ - offset = dissect_ansi_map_PositionRequestForward(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_positionRequestForward); + offset = dissect_ansi_map_PositionRequestForward(TRUE, tvb, offset, actx, tree, hf_ansi_map_positionRequestForward); break; /*END N.S0004 */ case 92: /*Call Termination Report*/ @@ -3835,18 +3836,18 @@ static int dissect_invokeData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tv break; /* 3GPP2 N.S0023-0 */ case 97: /*ACG Directive*/ - offset = dissect_ansi_map_ACGDirective(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_aCGDirective); + offset = dissect_ansi_map_ACGDirective(TRUE, tvb, offset, actx, tree, hf_ansi_map_aCGDirective); break; /* END 3GPP2 N.S0023-0 */ case 98: /*Roamer Database Verification Request*/ - offset = dissect_ansi_map_RoamerDatabaseVerificationRequest(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_roamerDatabaseVerificationRequest); + offset = dissect_ansi_map_RoamerDatabaseVerificationRequest(TRUE, tvb, offset, actx, tree, hf_ansi_map_roamerDatabaseVerificationRequest); break; /* N.S0029 */ case 99: /*Add Service*/ - offset = dissect_ansi_map_AddService(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_addService); + offset = dissect_ansi_map_AddService(TRUE, tvb, offset, actx, tree, hf_ansi_map_addService); break; case 100: /*Drop Service*/ - offset = dissect_ansi_map_DropService(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_dropService); + offset = dissect_ansi_map_DropService(TRUE, tvb, offset, actx, tree, hf_ansi_map_dropService); break; /*End N.S0029 */ default: @@ -3858,191 +3859,191 @@ static int dissect_invokeData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tv } -static int dissect_returnData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { +static int dissect_returnData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx) { switch(OperationCode){ case 1: /*Handoff Measurement Request*/ - offset = dissect_ansi_map_HandoffMeasurementRequestRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_handoffMeasurementRequestRes); + offset = dissect_ansi_map_HandoffMeasurementRequestRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_handoffMeasurementRequestRes); break; case 2: /*Facilities Directive*/ - offset = dissect_ansi_map_FacilitiesDirectiveRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_facilitiesDirectiveRes); + offset = dissect_ansi_map_FacilitiesDirectiveRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_facilitiesDirectiveRes); break; case 4: /*Handoff Back*/ - offset = dissect_ansi_map_HandoffBackRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_handoffBackRes); + offset = dissect_ansi_map_HandoffBackRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_handoffBackRes); break; case 5: /*Facilities Release*/ - offset = dissect_ansi_map_FacilitiesReleaseRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_facilitiesReleaseRes); + offset = dissect_ansi_map_FacilitiesReleaseRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_facilitiesReleaseRes); break; case 6: /*Qualification Request*/ - offset = dissect_ansi_map_QualificationRequestRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_qualificationRequestRes); + offset = dissect_ansi_map_QualificationRequestRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_qualificationRequestRes); break; case 10: /*Reset Circuit*/ - offset = dissect_ansi_map_ResetCircuitRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_resetCircuitRes); + offset = dissect_ansi_map_ResetCircuitRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_resetCircuitRes); break; case 13: /*Registration Notification*/ - offset = dissect_ansi_map_RegistrationNotificationRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_registrationNotificationRes); + offset = dissect_ansi_map_RegistrationNotificationRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_registrationNotificationRes); break; case 14: /*Registration Cancellation*/ - offset = dissect_ansi_map_RegistrationCancellationRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_registrationCancellationRes); + offset = dissect_ansi_map_RegistrationCancellationRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_registrationCancellationRes); break; case 15: /*Location Request*/ - offset = dissect_ansi_map_LocationRequestRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_locationRequestRes); + offset = dissect_ansi_map_LocationRequestRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_locationRequestRes); break; case 16: /*Routing Request*/ - offset = dissect_ansi_map_RoutingRequestRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_routingRequestRes); + offset = dissect_ansi_map_RoutingRequestRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_routingRequestRes); break; case 17: /*Feature Request*/ - offset = dissect_ansi_map_FeatureRequestRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_featureRequestRes); + offset = dissect_ansi_map_FeatureRequestRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_featureRequestRes); break; case 23: /*Transfer To Number Request*/ - offset = dissect_ansi_map_TransferToNumberRequestRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_transferToNumberRequestRes); + offset = dissect_ansi_map_TransferToNumberRequestRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_transferToNumberRequestRes); break; case 25: /*Handoff To Third*/ - offset = dissect_ansi_map_HandoffToThirdRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_handoffToThirdRes); + offset = dissect_ansi_map_HandoffToThirdRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_handoffToThirdRes); break; case 27: /*Authentication Directive*/ - offset = dissect_ansi_map_AuthenticationDirectiveRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_authenticationDirectiveRes); + offset = dissect_ansi_map_AuthenticationDirectiveRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_authenticationDirectiveRes); break; case 28: /*Authentication Request*/ - offset = dissect_ansi_map_AuthenticationRequestRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_authenticationRequestRes); + offset = dissect_ansi_map_AuthenticationRequestRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_authenticationRequestRes); break; case 30: /*Authentication Failure Report*/ - offset = dissect_ansi_map_AuthenticationFailureReportRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_authenticationFailureReportRes); + offset = dissect_ansi_map_AuthenticationFailureReportRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_authenticationFailureReportRes); break; case 31: /*Count Request*/ - offset = dissect_ansi_map_CountRequestRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_countRequestRes); + offset = dissect_ansi_map_CountRequestRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_countRequestRes); break; case 32: /*Inter System Page*/ - offset = dissect_ansi_map_InterSystemPageRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_interSystemPageRes); + offset = dissect_ansi_map_InterSystemPageRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_interSystemPageRes); break; case 33: /*Unsolicited Response*/ - offset = dissect_ansi_map_UnsolicitedResponseRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_unsolicitedResponseRes); + offset = dissect_ansi_map_UnsolicitedResponseRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_unsolicitedResponseRes); break; case 35: /*Handoff Measurement Request 2*/ - offset = dissect_ansi_map_HandoffMeasurementRequest2Res(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_handoffMeasurementRequest2Res); + offset = dissect_ansi_map_HandoffMeasurementRequest2Res(TRUE, tvb, offset, actx, tree, hf_ansi_map_handoffMeasurementRequest2Res); break; case 36: /*Facilities Directive 2*/ - offset = dissect_ansi_map_FacilitiesDirective2Res(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_facilitiesDirective2Res); + offset = dissect_ansi_map_FacilitiesDirective2Res(TRUE, tvb, offset, actx, tree, hf_ansi_map_facilitiesDirective2Res); break; case 37: /*Handoff Back 2*/ - offset = dissect_ansi_map_HandoffBack2Res(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_handoffBack2Res); + offset = dissect_ansi_map_HandoffBack2Res(TRUE, tvb, offset, actx, tree, hf_ansi_map_handoffBack2Res); break; case 38: /*Handoff To Third 2*/ - offset = dissect_ansi_map_HandoffToThird2Res(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_handoffToThird2Res); + offset = dissect_ansi_map_HandoffToThird2Res(TRUE, tvb, offset, actx, tree, hf_ansi_map_handoffToThird2Res); break; case 39: /*Authentication Directive Forward*/ - offset = dissect_ansi_map_AuthenticationDirectiveForwardRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_authenticationDirectiveForwardRes); + offset = dissect_ansi_map_AuthenticationDirectiveForwardRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_authenticationDirectiveForwardRes); break; case 40: /*Authentication Status Report*/ - offset = dissect_ansi_map_AuthenticationStatusReportRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_authenticationStatusReportRes); + offset = dissect_ansi_map_AuthenticationStatusReportRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_authenticationStatusReportRes); break; /*Reserved 41*/ case 43: /*Information Forward*/ - offset = dissect_ansi_map_InformationForwardRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_informationForwardRes); + offset = dissect_ansi_map_InformationForwardRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_informationForwardRes); break; case 45: /*Inter System Page 2*/ - offset = dissect_ansi_map_InterSystemPage2Res(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_interSystemPage2Res); + offset = dissect_ansi_map_InterSystemPage2Res(TRUE, tvb, offset, actx, tree, hf_ansi_map_interSystemPage2Res); break; case 46: /*Inter System Setup*/ - offset = dissect_ansi_map_InterSystemSetupRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_interSystemSetupRes); + offset = dissect_ansi_map_InterSystemSetupRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_interSystemSetupRes); break; case 47: /*OriginationRequest*/ - offset = dissect_ansi_map_OriginationRequestRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_originationRequestRes); + offset = dissect_ansi_map_OriginationRequestRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_originationRequestRes); break; case 48: /*Random Variable Request*/ - offset = dissect_ansi_map_RandomVariableRequestRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_randomVariableRequestRes); + offset = dissect_ansi_map_RandomVariableRequestRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_randomVariableRequestRes); break; case 50: /*Remote User Interaction Directive*/ - offset = dissect_ansi_map_RemoteUserInteractionDirectiveRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_remoteUserInteractionDirectiveRes); + offset = dissect_ansi_map_RemoteUserInteractionDirectiveRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_remoteUserInteractionDirectiveRes); break; case 51: /*SMS Delivery Backward*/ - offset = dissect_ansi_map_SMSDeliveryBackwardRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_sMSDeliveryBackwardRes); + offset = dissect_ansi_map_SMSDeliveryBackwardRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_sMSDeliveryBackwardRes); break; case 52: /*SMS Delivery Forward*/ - offset = dissect_ansi_map_SMSDeliveryForwardRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_sMSDeliveryForwardRes); + offset = dissect_ansi_map_SMSDeliveryForwardRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_sMSDeliveryForwardRes); break; case 53: /*SMS Delivery Point to Point*/ - offset = dissect_ansi_map_SMSDeliveryPointToPointRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_sMSDeliveryPointToPointRes); + offset = dissect_ansi_map_SMSDeliveryPointToPointRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_sMSDeliveryPointToPointRes); break; case 54: /*SMS Notification*/ - offset = dissect_ansi_map_SMSNotificationRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_sMSNotificationRes); + offset = dissect_ansi_map_SMSNotificationRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_sMSNotificationRes); break; case 55: /*SMS Request*/ - offset = dissect_ansi_map_SMSRequestRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_sMSRequestRes); + offset = dissect_ansi_map_SMSRequestRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_sMSRequestRes); break; /* N.S0008-0 v 1.0 */ case 56: /*OTASP Request 6.4.2.CC*/ - offset = dissect_ansi_map_OTASPRequestRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_oTASPRequestRes); + offset = dissect_ansi_map_OTASPRequestRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_oTASPRequestRes); break; case 58: /*Change Facilities*/ - offset = dissect_ansi_map_ChangeFacilitiesRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_changeFacilitiesRes); + offset = dissect_ansi_map_ChangeFacilitiesRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_changeFacilitiesRes); break; case 59: /*Change Service*/ - offset = dissect_ansi_map_ChangeServiceRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_changeServiceRes); + offset = dissect_ansi_map_ChangeServiceRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_changeServiceRes); break; case 60: /*Parameter Request*/ - offset = dissect_ansi_map_ParameterRequestRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_parameterRequestRes); + offset = dissect_ansi_map_ParameterRequestRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_parameterRequestRes); break; case 61: /*TMSI Directive*/ - offset = dissect_ansi_map_TMSIDirectiveRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_tMSIDirectiveRes); + offset = dissect_ansi_map_TMSIDirectiveRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_tMSIDirectiveRes); break; case 63: /*Service Request*/ - offset = dissect_ansi_map_ServiceRequestRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_serviceRequestRes); + offset = dissect_ansi_map_ServiceRequestRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_serviceRequestRes); break; /* N.S0013 */ case 64: /*Analyzed Information Request*/ - offset = dissect_ansi_map_AnalyzedInformationRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_analyzedInformationRes); + offset = dissect_ansi_map_AnalyzedInformationRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_analyzedInformationRes); break; case 68: /*Facility Selected and Available*/ - offset = dissect_ansi_map_FacilitySelectedAndAvailableRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_facilitySelectedAndAvailableRes); + offset = dissect_ansi_map_FacilitySelectedAndAvailableRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_facilitySelectedAndAvailableRes); break; case 70: /*Modify*/ - offset = dissect_ansi_map_ModifyRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_modifyRes); + offset = dissect_ansi_map_ModifyRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_modifyRes); break; case 72: /*Search*/ - offset = dissect_ansi_map_SearchRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_searchRes);; + offset = dissect_ansi_map_SearchRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_searchRes);; break; case 73: /*Seize Resource*/ - offset = dissect_ansi_map_SeizeResourceRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_seizeResourceRes); + offset = dissect_ansi_map_SeizeResourceRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_seizeResourceRes); break; case 74: /*SRF Directive*/ - offset = dissect_ansi_map_SRFDirectiveRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_sRFDirectiveRes); + offset = dissect_ansi_map_SRFDirectiveRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_sRFDirectiveRes); break; case 75: /*T Busy*/ - offset = dissect_ansi_map_TBusyRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_tBusyRes); + offset = dissect_ansi_map_TBusyRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_tBusyRes); break; case 76: /*T NoAnswer*/ - offset = dissect_ansi_map_TNoAnswerRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_tNoAnswerRes); + offset = dissect_ansi_map_TNoAnswerRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_tNoAnswerRes); break; case 81: /*Call Control Directive*/ - offset = dissect_ansi_map_CallControlDirectiveRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_callControlDirectiveRes); + offset = dissect_ansi_map_CallControlDirectiveRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_callControlDirectiveRes); break; case 83: /*O Disconnect*/ - offset = dissect_ansi_map_ODisconnectRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_oDisconnectRes); + offset = dissect_ansi_map_ODisconnectRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_oDisconnectRes); break; case 86: /*T Disconnect*/ - offset = dissect_ansi_map_TDisconnectRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_tDisconnectRes); + offset = dissect_ansi_map_TDisconnectRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_tDisconnectRes); break; case 88: /*O CalledPartyBusy*/ - offset = dissect_ansi_map_OCalledPartyBusyRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_oCalledPartyBusyRes); + offset = dissect_ansi_map_OCalledPartyBusyRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_oCalledPartyBusyRes); break; case 89: /*O NoAnswer*/ - offset = dissect_ansi_map_ONoAnswerRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_oNoAnswerRes); + offset = dissect_ansi_map_ONoAnswerRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_oNoAnswerRes); break; case 90: /*Position Request*/ - offset = dissect_ansi_map_PositionRequestRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_positionRequestRes); + offset = dissect_ansi_map_PositionRequestRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_positionRequestRes); break; case 91: /*Position Request Forward*/ - offset = dissect_ansi_map_PositionRequestForwardRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_positionRequestForwardRes); + offset = dissect_ansi_map_PositionRequestForwardRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_positionRequestForwardRes); break; case 98: /*Roamer Database Verification Request*/ - offset = dissect_ansi_map_RoamerDatabaseVerificationRequestRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_roamerDatabaseVerificationRequestRes); + offset = dissect_ansi_map_RoamerDatabaseVerificationRequestRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_roamerDatabaseVerificationRequestRes); break; case 99: /*Add Service*/ - offset = dissect_ansi_map_AddServiceRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_addServiceRes); + offset = dissect_ansi_map_AddServiceRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_addServiceRes); break; case 100: /*Drop Service*/ - offset = dissect_ansi_map_DropServiceRes(TRUE, tvb, offset, pinfo, tree, hf_ansi_map_dropServiceRes); + offset = dissect_ansi_map_DropServiceRes(TRUE, tvb, offset, actx, tree, hf_ansi_map_dropServiceRes); break; /*End N.S0029 */ @@ -4061,6 +4062,8 @@ dissect_ansi_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_item *ansi_map_item; proto_tree *ansi_map_tree = NULL; int offset = 0; + asn1_ctx_t asn1_ctx; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); SMS_BearerData_tvb = NULL; g_pinfo = pinfo; @@ -4081,7 +4084,7 @@ dissect_ansi_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) ansi_map_is_invoke = FALSE; is683_ota = FALSE; is801_pld = FALSE; - dissect_ansi_map_ComponentPDU(FALSE, tvb, offset, pinfo, ansi_map_tree, -1); + dissect_ansi_map_ComponentPDU(FALSE, tvb, offset, &asn1_ctx, ansi_map_tree, -1); } diff --git a/asn1/camel/camel.cnf b/asn1/camel/camel.cnf index 8de2aacae9..0d783ab878 100644 --- a/asn1/camel/camel.cnf +++ b/asn1/camel/camel.cnf @@ -24,15 +24,15 @@ MAP-CH-DataTypes gsm_map Component #---------------------------------------------------------------------------------------- #.FN_BODY InvokeParameter - offset = dissect_invokeData(pinfo, tree, tvb, offset); + offset = dissect_invokeData(tree, tvb, offset, actx); #---------------------------------------------------------------------------------------- #.FN_BODY ReturnResultParameter - offset = dissect_returnResultData(pinfo, tree, tvb, offset); + offset = dissect_returnResultData(tree, tvb, offset, actx); #---------------------------------------------------------------------------------------- #.FN_BODY ReturnErrorParameter - offset = dissect_returnErrorData(pinfo, tree, tvb, offset); + offset = dissect_returnErrorData(tree, tvb, offset, actx); #---------------------------------------------------------------------------------------- #.FN_PARS CAMELOperationLocalvalue @@ -42,11 +42,11 @@ Component #.FN_BODY CAMELOperationLocalvalue %(DEFAULT_BODY)s - if (check_col(pinfo->cinfo, COL_INFO)){ - col_append_fstr(pinfo->cinfo, COL_INFO, + if (check_col(actx->pinfo->cinfo, COL_INFO)){ + col_append_fstr(actx->pinfo->cinfo, COL_INFO, val_to_str(opcode, camel_opr_code_strings, "Unknown CAMEL (%%u)")); - col_append_str(pinfo->cinfo, COL_INFO, " "); - col_set_fence(pinfo->cinfo, COL_INFO); + col_append_str(actx->pinfo->cinfo, COL_INFO, " "); + col_set_fence(actx->pinfo->cinfo, COL_INFO); } gp_camelsrt_info->opcode=opcode; @@ -123,7 +123,7 @@ tvbuff_t *parameter_tvb; %(DEFAULT_BODY)s if (!parameter_tvb) return offset; - dissect_camel_CAMEL_CallResult(implicit_tag, parameter_tvb, 0, pinfo, tree, -1); + dissect_camel_CAMEL_CallResult(implicit_tag, parameter_tvb, 0, actx, tree, -1); #.END @@ -475,14 +475,13 @@ tvbuff_t *parameter_tvb; subtree = proto_item_add_subtree(item, ett_camel_pdptypenumber); if (tvb_reported_length_remaining(tvb,start_offset) == 7){ - dissect_gsm_map_CellGlobalIdOrServiceAreaIdFixedLength(TRUE, tvb, start_offset, pinfo, subtree, hf_camel_cellGlobalIdOrServiceAreaIdFixedLength); + dissect_gsm_map_CellGlobalIdOrServiceAreaIdFixedLength(TRUE, tvb, start_offset, actx, subtree, hf_camel_cellGlobalIdOrServiceAreaIdFixedLength); }else{ - dissect_gsm_map_LAIFixedLength(TRUE, tvb, start_offset, pinfo, subtree, hf_camel_locationAreaId); + dissect_gsm_map_LAIFixedLength(TRUE, tvb, start_offset, actx, subtree, hf_camel_locationAreaId); } #.END #---------------------------------------------------------------------------------------- -#---------------------------------------------------------------------------------------- #.TYPE_ATTR CallingPartysCategory TYPE = FT_UINT16 DISPLAY = BASE_DEC STRINGS = VALS(isup_calling_partys_category_value) diff --git a/asn1/camel/packet-camel-template.c b/asn1/camel/packet-camel-template.c index 3d6b3a5e75..8bc71cb842 100644 --- a/asn1/camel/packet-camel-template.c +++ b/asn1/camel/packet-camel-template.c @@ -43,6 +43,7 @@ #include <epan/conversation.h> #include <epan/oid_resolv.h> #include <epan/tap.h> +#include <epan/asn1.h> #include "epan/expert.h" #include <stdio.h> @@ -103,9 +104,9 @@ int hf_camelsrt_DeltaTime80=-1; static struct camelsrt_info_t * gp_camelsrt_info; /* Forward declarations */ -static int dissect_invokeData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset); -static int dissect_returnResultData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset); -static int dissect_returnErrorData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset); +static int dissect_invokeData(proto_tree *tree, tvbuff_t *tvb, int offset,asn1_ctx_t *actx); +static int dissect_returnResultData(proto_tree *tree, tvbuff_t *tvb, int offset,asn1_ctx_t *actx); +static int dissect_returnErrorData(proto_tree *tree, tvbuff_t *tvb, int offset,asn1_ctx_t *actx); #include "packet-camel-hf.c" @@ -358,7 +359,7 @@ dissect_RP_cause_ie(tvbuff_t *tvb, guint32 offset, _U_ guint len, } -static int dissect_invokeData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { +static int dissect_invokeData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx) { proto_item *cause; gint8 bug_class; gboolean bug_pc, bug_ind_field; @@ -367,196 +368,196 @@ static int dissect_invokeData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tv switch(opcode){ case 0: /*InitialDP*/ - offset=dissect_camel_InitialDPArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_InitialDPArg(FALSE, tvb, offset, actx, tree, -1); break; case 16: /*AssistRequestInstructions*/ - offset=dissect_camel_AssistRequestInstructionsArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_AssistRequestInstructionsArg(FALSE, tvb, offset, actx, tree, -1); break; case 17: /*EstablishTemporaryConnection*/ - offset=dissect_camel_EstablishTemporaryConnectionArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_EstablishTemporaryConnectionArg(FALSE, tvb, offset, actx, tree, -1); break; case 18: /*DisconnectForwardConnections*/ proto_tree_add_text(tree, tvb, offset, -1, "Disconnect Forward Connection"); break; case 19: /*ConnectToResource*/ - offset=dissect_camel_ConnectToResourceArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_ConnectToResourceArg(FALSE, tvb, offset, actx, tree, -1); break; case 20: /*Connect*/ - offset=dissect_camel_ConnectArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_ConnectArg(FALSE, tvb, offset, actx, tree, -1); break; case 22: /*releaseCall*/ - offset=dissect_camel_ReleaseCallArg(FALSE, tvb, offset, pinfo, tree, hf_camel_cause); + offset=dissect_camel_ReleaseCallArg(FALSE, tvb, offset, actx, tree, hf_camel_cause); break; case 23: /*RequestReportBCSMEvent*/ - offset=dissect_camel_RequestReportBCSMEventArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_RequestReportBCSMEventArg(FALSE, tvb, offset, actx, tree, -1); break; case 24: /*EventReportBCSM*/ - offset=dissect_camel_EventReportBCSMArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_EventReportBCSMArg(FALSE, tvb, offset, actx, tree, -1); break; case 27: /*CollectInformation*/ - offset=dissect_camel_CollectInformationArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_CollectInformationArg(FALSE, tvb, offset, actx, tree, -1); break; case 31: /*Continue*/ /* Continue: no arguments - do nothing */ break; case 32: /*initiateCallAttempt*/ - offset=dissect_camel_InitiateCallAttemptArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_InitiateCallAttemptArg(FALSE, tvb, offset, actx, tree, -1); break; case 33: /*ResetTimer*/ - offset=dissect_camel_ResetTimerArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_ResetTimerArg(FALSE, tvb, offset, actx, tree, -1); break; case 34: /*FurnishChargingInformation*/ - /* offset=dissect_camel_FurnishChargingInformationArg(TRUE, tvb, offset, pinfo, tree, -1); */ + /* offset=dissect_camel_FurnishChargingInformationArg(TRUE, tvb, offset, tree, -1); */ offset = get_ber_identifier(tvb, offset, &bug_class, &bug_pc, &bug_tag); offset = get_ber_length(tree, tvb, offset, &bug_len1, &bug_ind_field); - offset=dissect_camel_CAMEL_FCIBillingChargingCharacteristics(TRUE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_CAMEL_FCIBillingChargingCharacteristics(TRUE, tvb, offset, actx, tree, -1); break; case 35: /*ApplyCharging*/ - offset=dissect_camel_ApplyChargingArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_ApplyChargingArg(FALSE, tvb, offset, actx, tree, -1); break; case 36: /*ApplyChargingReport*/ - /* offset=dissect_camel_ApplyChargingReportArg(TRUE, tvb, offset, pinfo, tree, -1); */ + /* offset=dissect_camel_ApplyChargingReportArg(TRUE, tvb, offset, tree, -1); */ offset = get_ber_identifier(tvb, offset, &bug_class, &bug_pc, &bug_tag); offset = get_ber_length(tree, tvb, offset, &bug_len1, &bug_ind_field); - offset=dissect_camel_CAMEL_CallResult(TRUE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_CAMEL_CallResult(TRUE, tvb, offset, actx, tree, -1); break; case 41: /*CallGap*/ - offset=dissect_camel_CallGapArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_CallGapArg(FALSE, tvb, offset, actx, tree, -1); break; case 44: /*CallInformationReport*/ - offset=dissect_camel_CallInformationReportArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_CallInformationReportArg(FALSE, tvb, offset, actx, tree, -1); break; case 45: /*CallInformationRequest*/ - offset=dissect_camel_CallInformationRequestArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_CallInformationRequestArg(FALSE, tvb, offset, actx, tree, -1); break; case 46: /*SendChargingInformation*/ - offset=dissect_camel_SendChargingInformationArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_SendChargingInformationArg(FALSE, tvb, offset, actx, tree, -1); break; case 47: /*PlayAnnouncement*/ - offset=dissect_camel_PlayAnnouncementArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_PlayAnnouncementArg(FALSE, tvb, offset, actx, tree, -1); break; case 48: /*PromptAndCollectUserInformation*/ - offset=dissect_camel_PromptAndCollectUserInformationArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_PromptAndCollectUserInformationArg(FALSE, tvb, offset, actx, tree, -1); break; case 49: /*SpecializedResourceReport*/ - offset=dissect_camel_SpecializedResourceReportArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_SpecializedResourceReportArg(FALSE, tvb, offset, actx, tree, -1); break; case 53: /*Cancel*/ - offset=dissect_camel_CancelArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_CancelArg(FALSE, tvb, offset, actx, tree, -1); break; case 56: /*ContinueWithArgument*/ - offset=dissect_camel_ContinueWithArgumentArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_ContinueWithArgumentArg(FALSE, tvb, offset, actx, tree, -1); break; case 60: /*InitialDPSMS*/ - offset=dissect_camel_InitialDPSMSArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_InitialDPSMSArg(FALSE, tvb, offset, actx, tree, -1); break; case 61: /*FurnishChargingInformationSMS*/ - /* offset=dissect_camel_FurnishChargingInformationSMSArg(FALSE, tvb, offset, pinfo, tree, -1); */ + /* offset=dissect_camel_FurnishChargingInformationSMSArg(FALSE, tvb, offset, tree, -1); */ offset = get_ber_identifier(tvb, offset, &bug_class, &bug_pc, &bug_tag); offset = get_ber_length(tree, tvb, offset, &bug_len1, &bug_ind_field); - offset=dissect_camel_CAMEL_FCISMSBillingChargingCharacteristics(TRUE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_CAMEL_FCISMSBillingChargingCharacteristics(TRUE, tvb, offset, actx, tree, -1); break; case 62: /*ConnectSMS*/ - offset=dissect_camel_ConnectSMSArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_ConnectSMSArg(FALSE, tvb, offset, actx, tree, -1); break; case 63: /*RequestReportSMSEvent*/ - offset=dissect_camel_RequestReportSMSEventArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_RequestReportSMSEventArg(FALSE, tvb, offset, actx, tree, -1); break; case 64: /*EventReportSMS*/ - offset=dissect_camel_EventReportSMSArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_EventReportSMSArg(FALSE, tvb, offset, actx, tree, -1); break; case 65: /*ContinueSMS*/ /* ContinueSMS: no arguments - do nothing */ break; case 66: /*ReleaseSMS*/ - offset=dissect_camel_ReleaseSMSArg(FALSE, tvb, offset, pinfo, tree, hf_camel_RP_Cause); + offset=dissect_camel_ReleaseSMSArg(FALSE, tvb, offset, actx, tree, hf_camel_RP_Cause); break; case 67: /*ResetTimerSMS*/ - offset=dissect_camel_ResetTimerSMSArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_ResetTimerSMSArg(FALSE, tvb, offset, actx, tree, -1); break; case 71: /*ApplyChargingGPRS*/ - offset=dissect_camel_ApplyChargingGPRSArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_ApplyChargingGPRSArg(FALSE, tvb, offset, actx, tree, -1); break; case 72: /*ApplyChargingReportGPRS*/ - offset=dissect_camel_ApplyChargingReportGPRSArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_ApplyChargingReportGPRSArg(FALSE, tvb, offset, actx, tree, -1); break; case 73: /*CancelGPRS*/ - offset=dissect_camel_CancelGPRSArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_CancelGPRSArg(FALSE, tvb, offset, actx, tree, -1); break; case 74: /*ConnectGPRS*/ - offset=dissect_camel_ConnectGPRSArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_ConnectGPRSArg(FALSE, tvb, offset, actx, tree, -1); break; case 75: /*ContinueGPRS*/ - offset=dissect_camel_ContinueGPRSArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_ContinueGPRSArg(FALSE, tvb, offset, actx, tree, -1); break; case 76: /*EntityReleasedGPRS*/ - offset=dissect_camel_EntityReleasedGPRSArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_EntityReleasedGPRSArg(FALSE, tvb, offset, actx, tree, -1); break; case 77: /*FurnishChargingInformationGPRS*/ - /* offset=dissect_camel_FurnishChargingInformationGPRSArg(FALSE, tvb, offset, pinfo, tree, -1); */ + /* offset=dissect_camel_FurnishChargingInformationGPRSArg(FALSE, tvb, offset, tree, -1); */ offset = get_ber_identifier(tvb, offset, &bug_class, &bug_pc, &bug_tag); offset = get_ber_length(tree, tvb, offset, &bug_len1, &bug_ind_field); - offset=dissect_camel_CAMEL_FCIGPRSBillingChargingCharacteristics(TRUE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_CAMEL_FCIGPRSBillingChargingCharacteristics(TRUE, tvb, offset, actx, tree, -1); break; case 78: /*InitialDPGPRS*/ - offset=dissect_camel_InitialDPGPRSArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_InitialDPGPRSArg(FALSE, tvb, offset, actx, tree, -1); break; case 79: /*ReleaseGPRS*/ - offset=dissect_camel_ReleaseGPRSArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_ReleaseGPRSArg(FALSE, tvb, offset, actx, tree, -1); break; case 80: /*EventReportGPRS*/ - offset=dissect_camel_EventReportGPRSArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_EventReportGPRSArg(FALSE, tvb, offset, actx, tree, -1); break; case 81: /*RequestReportGPRSEvent*/ - offset=dissect_camel_RequestReportGPRSEventArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_RequestReportGPRSEventArg(FALSE, tvb, offset, actx, tree, -1); break; case 82: /*ResetTimerGPRS*/ - offset=dissect_camel_ResetTimerGPRSArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_ResetTimerGPRSArg(FALSE, tvb, offset, actx, tree, -1); break; case 83: /*SendChargingInformationGPRS*/ - offset=dissect_camel_SendChargingInformationGPRSArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_SendChargingInformationGPRSArg(FALSE, tvb, offset, actx, tree, -1); break; case 86: /*DFCWithArgument*/ - offset= dissect_camel_DisconnectForwardConnectionWithArgumentArg(FALSE, tvb, offset, pinfo, tree, -1); + offset= dissect_camel_DisconnectForwardConnectionWithArgumentArg(FALSE, tvb, offset, actx, tree, -1); break; case 88: /*ContinueWithArgument*/ /* XXX Same as opcode 56 ??? */ - offset= dissect_camel_ContinueWithArgumentArg(FALSE, tvb, offset, pinfo, tree, -1); + offset= dissect_camel_ContinueWithArgumentArg(FALSE, tvb, offset, actx, tree, -1); break; case 90: /*DisconnectLeg*/ - offset= dissect_camel_DisconnectLegArg(FALSE, tvb, offset, pinfo, tree, -1); + offset= dissect_camel_DisconnectLegArg(FALSE, tvb, offset, actx, tree, -1); break; case 93: /*MoveLeg*/ - offset= dissect_camel_MoveLegArg(FALSE, tvb, offset, pinfo, tree, -1); + offset= dissect_camel_MoveLegArg(FALSE, tvb, offset, actx, tree, -1); break; case 95: /*SplitLeg*/ - offset= dissect_camel_SplitLegArg(FALSE, tvb, offset, pinfo, tree, -1); + offset= dissect_camel_SplitLegArg(FALSE, tvb, offset, actx, tree, -1); break; case 96: /*EntityReleased*/ - offset= dissect_camel_EntityReleasedArg(FALSE, tvb, offset, pinfo, tree, -1); + offset= dissect_camel_EntityReleasedArg(FALSE, tvb, offset, actx, tree, -1); break; case 97: /*PlayTone*/ - offset= dissect_camel_PlayToneArg(FALSE, tvb, offset, pinfo, tree, -1); + offset= dissect_camel_PlayToneArg(FALSE, tvb, offset, actx, tree, -1); break; default: cause=proto_tree_add_text(tree, tvb, offset, -1, "Unknown invokeData blob"); proto_item_set_expert_flags(cause, PI_MALFORMED, PI_WARN); - expert_add_info_format(pinfo, cause, PI_MALFORMED, PI_WARN, "Unknown invokeData %d",opcode); + expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "Unknown invokeData %d",opcode); /* todo call the asn.1 dissector */ } return offset; } -static int dissect_returnResultData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { +static int dissect_returnResultData(proto_tree *tree, tvbuff_t *tvb, int offset,asn1_ctx_t *actx) { proto_item *cause; switch(opcode){ case 32: /*initiateCallAttempt*/ - offset=dissect_camel_InitiateCallAttemptRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_InitiateCallAttemptRes(FALSE, tvb, offset, actx, tree, -1); break; case 48: /*PromptAndCollectUserInformation*/ - offset=dissect_camel_ReceivedInformationArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_ReceivedInformationArg(FALSE, tvb, offset, actx, tree, -1); break; case 55: /*ActivityTest*/ /* ActivityTest: no arguments - do nothing */ @@ -567,31 +568,31 @@ static int dissect_returnResultData(packet_info *pinfo, proto_tree *tree, tvbuff default: cause=proto_tree_add_text(tree, tvb, offset, -1, "Unknown returnResultData blob"); proto_item_set_expert_flags(cause, PI_MALFORMED, PI_WARN); - expert_add_info_format(pinfo, cause, PI_MALFORMED, PI_WARN, "Unknown returnResultData %d",opcode); + expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "Unknown returnResultData %d",opcode); } return offset; } -static int dissect_returnErrorData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { +static int dissect_returnErrorData(proto_tree *tree, tvbuff_t *tvb, int offset,asn1_ctx_t *actx) { proto_item *cause; switch(errorCode) { case 1: /*CancelFailed*/ - offset=dissect_camel_CancelFailedPARAM(TRUE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_CancelFailedPARAM(TRUE, tvb, offset, actx, tree, -1); break; case 10: /*RequestedInfoError*/ - offset=dissect_camel_RequestedInfoErrorPARAM(TRUE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_RequestedInfoErrorPARAM(TRUE, tvb, offset, actx, tree, -1); break; case 11: /*SystemFailure*/ - offset=dissect_camel_SystemFailurePARAM(TRUE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_SystemFailurePARAM(TRUE, tvb, offset, actx, tree, -1); break; case 12: /*TaskRefused*/ - offset=dissect_camel_TaskRefusedPARAM(TRUE, tvb, offset, pinfo, tree, -1); + offset=dissect_camel_TaskRefusedPARAM(TRUE, tvb, offset, actx, tree, -1); break; default: cause=proto_tree_add_text(tree, tvb, offset, -1, "Unknown returnErrorData blob"); proto_item_set_expert_flags(cause, PI_MALFORMED, PI_WARN); - expert_add_info_format(pinfo, cause, PI_MALFORMED, PI_WARN, "Unknown returnErrorData %d",errorCode); + expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "Unknown returnErrorData %d",errorCode); } return offset; } @@ -604,6 +605,9 @@ static void dissect_camelext_CAPGPRSReferenceNumber(tvbuff_t *tvb, packet_info * proto_tree *tree=NULL; proto_item *camel_item=NULL; proto_tree *camel_tree=NULL; + asn1_ctx_t asn1_ctx; + + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); if (check_col(pinfo->cinfo, COL_PROTOCOL)) { @@ -620,19 +624,19 @@ static void dissect_camelext_CAPGPRSReferenceNumber(tvbuff_t *tvb, packet_info * item = proto_tree_add_text(camel_tree, tvb, 0, -1, "GPRS Reference Number"); tree = proto_item_add_subtree(item, ett_camel_CAPGPRSReferenceNumber); } - dissect_camel_CAPGPRSReferenceNumber(FALSE, tvb, 0, pinfo, tree, -1); + dissect_camel_CAPGPRSReferenceNumber(FALSE, tvb, 0, &asn1_ctx, tree, -1); } static int -dissect_camel_camelPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { +dissect_camel_camelPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_,proto_tree *tree, int hf_index) { char *version_ptr; struct tcap_private_t * p_private_tcap; opcode = 0; application_context_version = 0; - if (pinfo->private_data != NULL){ - p_private_tcap=pinfo->private_data; + if (actx->pinfo->private_data != NULL){ + p_private_tcap=actx->pinfo->private_data; if (p_private_tcap->acv==TRUE ){ version_ptr = strrchr(p_private_tcap->oid,'.'); @@ -642,6 +646,7 @@ dissect_camel_camelPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, pac gp_camelsrt_info->tcap_context=p_private_tcap->context; if (p_private_tcap->context) gp_camelsrt_info->tcap_session_id + = ( (struct tcaphash_context_t *) (p_private_tcap->context))->session_id; } @@ -649,13 +654,13 @@ dissect_camel_camelPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, pac /* Get the length and add 2 */ camel_pdu_size = tvb_get_guint8(tvb, offset+1)+2; - if (check_col(pinfo->cinfo, COL_INFO)){ + if (check_col(actx->pinfo->cinfo, COL_INFO)){ /* Populate the info column with PDU type*/ - col_set_str(pinfo->cinfo, COL_INFO, val_to_str(camel_pdu_type, camel_Component_vals, "Unknown Camel (%u)")); - col_append_fstr(pinfo->cinfo, COL_INFO, " "); + col_set_str(actx->pinfo->cinfo, COL_INFO, val_to_str(camel_pdu_type, camel_Component_vals, "Unknown Camel (%u)")); + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " "); } - offset = dissect_camel_Component(FALSE, tvb, 0, pinfo, tree, hf_index); + offset = dissect_camel_Component(FALSE, tvb, 0, actx, tree, hf_index); return offset; } @@ -667,6 +672,8 @@ dissect_camel(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) proto_tree *tree=NULL; proto_item *stat_item=NULL; proto_tree *stat_tree=NULL; + asn1_ctx_t asn1_ctx; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); if (check_col(pinfo->cinfo, COL_PROTOCOL)) { col_set_str(pinfo->cinfo, COL_PROTOCOL, "Camel"); @@ -680,7 +687,7 @@ dissect_camel(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) /* camelsrt reset counter, and initialise global pointer to store service response time related data */ gp_camelsrt_info=camelsrt_razinfo(); - dissect_camel_camelPDU(FALSE, tvb, 0, pinfo, tree, -1); + dissect_camel_camelPDU(FALSE, tvb, 0, &asn1_ctx , tree, -1); /* If a Tcap context is associated to this transaction */ if (gcamel_HandleSRT && diff --git a/asn1/cdt/cdt.cnf b/asn1/cdt/cdt.cnf index 332a9e9a03..aeb7abe2a0 100644 --- a/asn1/cdt/cdt.cnf +++ b/asn1/cdt/cdt.cnf @@ -20,8 +20,8 @@ CompressedData B "1.3.26.0.4406.0.4.2" "cdt" val_to_str (value, cdt_AlgorithmID_ShortForm_vals, "unknown")); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, "%%s ", + if (check_col (actx->pinfo->cinfo, COL_INFO)) + col_append_fstr (actx->pinfo->cinfo, COL_INFO, "%%s ", val_to_str (value, cdt_AlgorithmID_ShortForm_vals, "unknown")); @@ -36,8 +36,8 @@ CompressedData B "1.3.26.0.4406.0.4.2" "cdt" val_to_str (value, cdt_ContentType_ShortForm_vals, "unknown")); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, "%%s ", + if (check_col (actx->pinfo->cinfo, COL_INFO)) + col_append_fstr (actx->pinfo->cinfo, COL_INFO, "%%s ", val_to_str (value, cdt_ContentType_ShortForm_vals, "unknown")); @@ -57,8 +57,8 @@ CompressedData B "1.3.26.0.4406.0.4.2" "cdt" proto_item_append_text (cdt_item, ", %%s", name); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, "%%s ", name); + if (check_col (actx->pinfo->cinfo, COL_INFO)) + col_append_fstr (actx->pinfo->cinfo, COL_INFO, "%%s ", name); } #.FN_PARS CompressedContent @@ -73,10 +73,10 @@ CompressedData B "1.3.26.0.4406.0.4.2" "cdt" if (compr_tvb == NULL) { tf = proto_tree_add_text (top_tree, tvb, save_offset, -1, "[Error: Unable to get compressed content]"); - expert_add_info_format (pinfo, tf, PI_UNDECODED, PI_ERROR, + expert_add_info_format (actx->pinfo, tf, PI_UNDECODED, PI_ERROR, "Unable to get compressed content"); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, + if (check_col (actx->pinfo->cinfo, COL_INFO)) + col_append_fstr (actx->pinfo->cinfo, COL_INFO, "[Error: Unable to get compressed content]"); return offset; } @@ -86,17 +86,17 @@ CompressedData B "1.3.26.0.4406.0.4.2" "cdt" if (next_tvb == NULL) { tf = proto_tree_add_text (top_tree, tvb, save_offset, -1, "[Error: Unable to uncompress content]"); - expert_add_info_format (pinfo, tf, PI_UNDECODED, PI_ERROR, + expert_add_info_format (actx->pinfo, tf, PI_UNDECODED, PI_ERROR, "Unable to uncompress content"); - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, + if (check_col (actx->pinfo->cinfo, COL_INFO)) + col_append_fstr (actx->pinfo->cinfo, COL_INFO, "[Error: Unable to uncompress content]"); return offset; } tvb_set_child_real_data_tvbuff (tvb, next_tvb); - add_new_data_source (pinfo, next_tvb, "Uncompressed Content"); + add_new_data_source (actx->pinfo, next_tvb, "Uncompressed Content"); - dissect_x411_mts_apdu (next_tvb, pinfo, top_tree); + dissect_x411_mts_apdu (next_tvb, actx->pinfo, top_tree); #.END diff --git a/asn1/cdt/packet-cdt-template.c b/asn1/cdt/packet-cdt-template.c index 4a048aba4e..718c8e7b7f 100644 --- a/asn1/cdt/packet-cdt-template.c +++ b/asn1/cdt/packet-cdt-template.c @@ -34,6 +34,7 @@ #include <epan/packet.h> #include <epan/oid_resolv.h> #include <epan/expert.h> +#include <epan/asn1.h> #include "packet-ber.h" #include "packet-x411.h" diff --git a/asn1/cmip/cmip.cnf b/asn1/cmip/cmip.cnf index ffb6f95991..5b17c93c4a 100644 --- a/asn1/cmip/cmip.cnf +++ b/asn1/cmip/cmip.cnf @@ -15,6 +15,13 @@ ObjectClass Attribute RDNSequence +#.REGISTER +OperationalState B "2.9.3.2.7.35" "smi2AttributeID(7)operationalState(35)" +Destination B "2.9.3.2.7.55" "smi2AttributeID(7)destination(55)" +DiscriminatorConstruct B "2.9.3.2.7.56" "smi2AttributeID(7)discriminatorConstruct(56)" +NameBinding B "2.9.3.2.7.63" "smi2AttributeID(7)nameBinding(63)" +ObjectClass B "2.9.3.2.7.65" "smi2AttributeID(7)objectClass(65)" + #.NO_EMIT #.PDU @@ -24,14 +31,14 @@ RDNSequence #.FIELD_RENAME #.FN_HDR CMIPAbortInfo - if(check_col(pinfo->cinfo, COL_INFO)){ - col_append_fstr(pinfo->cinfo, COL_INFO, "CMIP-A-ABORT"); + if(check_col(actx->pinfo->cinfo, COL_INFO)){ + col_append_fstr(actx->pinfo->cinfo, COL_INFO, "CMIP-A-ABORT"); } #.END #.FN_HDR CMIPUserInfo - if(check_col(pinfo->cinfo, COL_INFO)){ - col_append_fstr(pinfo->cinfo, COL_INFO, "CMIP-A-ASSOCIATE"); + if(check_col(actx->pinfo->cinfo, COL_INFO)){ + col_append_fstr(actx->pinfo->cinfo, COL_INFO, "CMIP-A-ASSOCIATE"); } #.END @@ -39,43 +46,43 @@ RDNSequence guint32 value; %(DEFAULT_BODY)s - if(check_col(pinfo->cinfo, COL_INFO)){ - col_append_fstr(pinfo->cinfo, COL_INFO, " AbortSource:%%s", val_to_str(value, cmip_CMIPAbortSource_vals, " Unknown AbortSource:%%d")); + if(check_col(actx->pinfo->cinfo, COL_INFO)){ + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " AbortSource:%%s", val_to_str(value, cmip_CMIPAbortSource_vals, " Unknown AbortSource:%%d")); } #.END #.FN_BODY Opcode VAL_PTR = &opcode %(DEFAULT_BODY)s - if(check_col(pinfo->cinfo, COL_INFO)){ - col_prepend_fstr(pinfo->cinfo, COL_INFO, "%%s", val_to_str(opcode, cmip_Opcode_vals, " Unknown Opcode:%%d")); + if(check_col(actx->pinfo->cinfo, COL_INFO)){ + col_prepend_fstr(actx->pinfo->cinfo, COL_INFO, "%%s", val_to_str(opcode, cmip_Opcode_vals, " Unknown Opcode:%%d")); } #.END #.FN_HDR Invoke opcode_type=OPCODE_INVOKE; - if(check_col(pinfo->cinfo, COL_INFO)){ - col_prepend_fstr(pinfo->cinfo, COL_INFO, "Invoke "); + if(check_col(actx->pinfo->cinfo, COL_INFO)){ + col_prepend_fstr(actx->pinfo->cinfo, COL_INFO, "Invoke "); } #.END #.FN_HDR ReturnResult opcode_type=OPCODE_RETURN_RESULT; - if(check_col(pinfo->cinfo, COL_INFO)){ - col_prepend_fstr(pinfo->cinfo, COL_INFO, "ReturnResult "); + if(check_col(actx->pinfo->cinfo, COL_INFO)){ + col_prepend_fstr(actx->pinfo->cinfo, COL_INFO, "ReturnResult "); } #.END #.FN_HDR ReturnError opcode_type=OPCODE_RETURN_ERROR; - if(check_col(pinfo->cinfo, COL_INFO)){ - col_prepend_fstr(pinfo->cinfo, COL_INFO, "ReturnError "); + if(check_col(actx->pinfo->cinfo, COL_INFO)){ + col_prepend_fstr(actx->pinfo->cinfo, COL_INFO, "ReturnError "); } #.END #.FN_HDR Reject opcode_type=OPCODE_REJECT; - if(check_col(pinfo->cinfo, COL_INFO)){ - col_prepend_fstr(pinfo->cinfo, COL_INFO, "Reject "); + if(check_col(actx->pinfo->cinfo, COL_INFO)){ + col_prepend_fstr(actx->pinfo->cinfo, COL_INFO, "Reject "); } #.END @@ -85,55 +92,55 @@ RDNSequence #.FN_BODY AttributeId/localForm attributeform = ATTRIBUTE_LOCAL_FORM; - offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_cmip_localForm, NULL); + offset = dissect_ber_integer(implicit_tag, actx->pinfo, tree, tvb, offset, hf_cmip_localForm, NULL); #.FN_BODY Attribute/value /*XXX handle local form here */ if(attributeform==ATTRIBUTE_GLOBAL_FORM){ - offset=call_ber_oid_callback(attribute_identifier_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(attribute_identifier_id, tvb, offset, actx->pinfo, tree); } #.FN_PARS AttributeValueAssertion/id FN_VARIANT = _str VAL_PTR = &attributevalueassertion_id #.FN_BODY AttributeValueAssertion/value - offset=call_ber_oid_callback(attributevalueassertion_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(attributevalueassertion_id, tvb, offset, actx->pinfo, tree); #.FN_BODY Argument switch(opcode_type){ case OPCODE_INVOKE: switch(opcode){ case 0: /* M-eventreport */ - offset = dissect_cmip_EventReportArgument(FALSE, tvb, offset, pinfo, tree, -1); + offset = dissect_cmip_EventReportArgument(FALSE, tvb, offset, actx, tree, -1); break; case 1: /* M-eventreport-confirmed */ - offset = dissect_cmip_EventReportArgument(FALSE, tvb, offset, pinfo, tree, -1); + offset = dissect_cmip_EventReportArgument(FALSE, tvb, offset, actx, tree, -1); break; case 2: /* M-linkedreply */ - offset = dissect_cmip_LinkedReplyArgument(FALSE, tvb, offset, pinfo, tree, -1); + offset = dissect_cmip_LinkedReplyArgument(FALSE, tvb, offset, actx, tree, -1); break; case 3: /* M-get */ - offset = dissect_cmip_GetArgument(FALSE, tvb, offset, pinfo, tree, -1); + offset = dissect_cmip_GetArgument(FALSE, tvb, offset,actx, tree, -1); break; case 4: /* M-set */ - offset = dissect_cmip_SetArgument(FALSE, tvb, offset, pinfo, tree, -1); + offset = dissect_cmip_SetArgument(FALSE, tvb, offset,actx, tree, -1); break; case 5: /* M-set-confirmed */ - offset = dissect_cmip_SetArgument(FALSE, tvb, offset, pinfo, tree, -1); + offset = dissect_cmip_SetArgument(FALSE, tvb, offset,actx, tree, -1); break; case 6: /* M-action*/ - offset = dissect_cmip_ActionArgument(FALSE, tvb, offset, pinfo, tree, -1); + offset = dissect_cmip_ActionArgument(FALSE, tvb, offset, actx, tree, -1); break; case 7: /* M-action-confirmed*/ - offset = dissect_cmip_ActionArgument(FALSE, tvb, offset, pinfo, tree, -1); + offset = dissect_cmip_ActionArgument(FALSE, tvb, offset, actx, tree, -1); break; case 8: /* M-create*/ - offset = dissect_cmip_CreateArgument(FALSE, tvb, offset, pinfo, tree, -1); + offset = dissect_cmip_CreateArgument(FALSE, tvb, offset, actx, tree, -1); break; case 9: /* M-delete*/ - offset = dissect_cmip_DeleteArgument(FALSE, tvb, offset, pinfo, tree, -1); + offset = dissect_cmip_DeleteArgument(FALSE, tvb, offset, actx, tree, -1); break; case 10: /* M-cancelget */ - offset = dissect_cmip_InvokeIDType(FALSE, tvb, offset, pinfo, tree, -1); + offset = dissect_cmip_InvokeIDType(FALSE, tvb, offset, actx, tree, -1); break; } break; @@ -142,28 +149,28 @@ RDNSequence case 0: /* M-eventreport*/ break; /* No return data */ case 1: /* M-eventreport-confirmed */ - offset = dissect_cmip_EventReportResult(FALSE, tvb, offset, pinfo, tree, -1); + offset = dissect_cmip_EventReportResult(FALSE, tvb, offset, actx, tree, -1); break; case 2: /* M-linkedreply*/ break; /* No return data */ case 3: /* M-get */ - offset = dissect_cmip_GetResult(FALSE, tvb, offset, pinfo, tree, -1); + offset = dissect_cmip_GetResult(FALSE, tvb, offset, actx, tree, -1); break; case 4: /* M-set */ break; /* No return data */ case 5: /* M-set-confirmed*/ - offset = dissect_cmip_SetResult(FALSE, tvb, offset, pinfo, tree, -1); + offset = dissect_cmip_SetResult(FALSE, tvb, offset, actx, tree, -1); break; case 6: /* M-action*/ break; /* No return data */ case 7: /* M-action-confirmed*/ - offset = dissect_cmip_ActionResult(FALSE, tvb, offset, pinfo, tree, -1); + offset = dissect_cmip_ActionResult(FALSE, tvb, offset, actx, tree, -1); break; case 8: /* M-create*/ - offset = dissect_cmip_CreateResult(FALSE, tvb, offset, pinfo, tree, -1); + offset = dissect_cmip_CreateResult(FALSE, tvb, offset, actx, tree, -1); break; case 9: /* M-delete*/ - offset = dissect_cmip_DeleteResult(FALSE, tvb, offset, pinfo, tree, -1); + offset = dissect_cmip_DeleteResult(FALSE, tvb, offset, actx, tree, -1); break; case 10: /* M-cancelget */ break; /* doe this one return any data? */ @@ -184,43 +191,43 @@ RDNSequence FN_VARIANT = _str HF_INDEX = hf_cmip_actionType_OID VAL_PTR = &object_identifier_id #.FN_BODY ActionInfo/actionInfoArg - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.FN_PARS ActionReply/actionType FN_VARIANT = _str HF_INDEX = hf_cmip_actionType_OID VAL_PTR = &object_identifier_id #.FN_BODY ActionReply/actionReplyInfo - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.FN_PARS EventReportArgument/eventType FN_VARIANT = _str HF_INDEX = hf_cmip_eventType_OID VAL_PTR = &object_identifier_id #.FN_BODY EventReportArgument/eventInfo - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.FN_PARS EventReply/eventType FN_VARIANT = _str HF_INDEX = hf_cmip_eventType_OID VAL_PTR = &object_identifier_id #.FN_BODY EventReply/eventReplyInfo - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.FN_PARS ModificationItem/attributeId FN_VARIANT = _str HF_INDEX = hf_cmip_attributeId_OID VAL_PTR = &object_identifier_id #.FN_BODY ModificationItem/attributeValue - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.FN_PARS SpecificErrorInfo/errorId FN_VARIANT = _str HF_INDEX = hf_cmip_errorId_OID VAL_PTR = &object_identifier_id #.FN_BODY SpecificErrorInfo/errorInfo - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.FN_PARS AttributeError/attributeId FN_VARIANT = _str HF_INDEX = hf_cmip_attributeId_OID VAL_PTR = &object_identifier_id #.FN_BODY AttributeError/attributeValue - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.FN_PARS ErrorInfo/actionType FN_VARIANT = _str HF_INDEX = hf_cmip_actionType_OID VAL_PTR = &object_identifier_id @@ -235,7 +242,7 @@ RDNSequence FN_VARIANT = _str HF_INDEX = hf_cmip_eventType_OID VAL_PTR = &object_identifier_id #.FN_BODY InvalidArgumentValueEventValue/eventInfo - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.END diff --git a/asn1/cmip/packet-cmip-template.c b/asn1/cmip/packet-cmip-template.c index cd85d95891..6f0b0af0eb 100644 --- a/asn1/cmip/packet-cmip-template.c +++ b/asn1/cmip/packet-cmip-template.c @@ -31,6 +31,7 @@ #include <epan/packet.h> #include <epan/conversation.h> #include <epan/oid_resolv.h> +#include <epan/asn1.h> #include <stdio.h> #include <string.h> @@ -90,45 +91,6 @@ static const char *objectclass_identifier_id; #include "packet-cmip-fn.c" -static void -dissect_cmip_attribute_35(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) -{ - - dissect_cmip_OperationalState(FALSE, tvb, 0, pinfo, parent_tree, hf_OperationalState); - -} - -static void -dissect_cmip_attribute_55(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) -{ - - dissect_cmip_Destination(FALSE, tvb, 0, pinfo, parent_tree,hf_Destination); - -} - -static void -dissect_cmip_attribute_56(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) -{ - - dissect_cmip_DiscriminatorConstruct(FALSE, tvb, 0, pinfo, parent_tree, hf_DiscriminatorConstruct); - -} - -static void -dissect_cmip_attribute_63(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) -{ - - dissect_cmip_NameBinding(FALSE, tvb, 0, pinfo, parent_tree, hf_NameBinding); - -} - -static void -dissect_cmip_attribute_65(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) -{ - - dissect_cmip_ObjectClass(FALSE, tvb, 0, pinfo, parent_tree, hf_ObjectClass); - -} /* XXX this one should be broken out later and moved into the conformance file */ @@ -138,6 +100,8 @@ dissect_cmip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) static struct SESSION_DATA_STRUCTURE* session = NULL; proto_item *item = NULL; proto_tree *tree = NULL; + asn1_ctx_t asn1_ctx; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); /* do we have spdu type from the session dissector? */ @@ -173,13 +137,13 @@ dissect_cmip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) case SES_DISCONNECT: case SES_FINISH: case SES_REFUSE: - dissect_cmip_CMIPUserInfo(FALSE,tvb,0,pinfo,tree,-1); + dissect_cmip_CMIPUserInfo(FALSE,tvb,0,&asn1_ctx,tree,-1); break; case SES_ABORT: - dissect_cmip_CMIPAbortInfo(FALSE,tvb,0,pinfo,tree,-1); + dissect_cmip_CMIPAbortInfo(FALSE,tvb,0,&asn1_ctx,tree,-1); break; case SES_DATA_TRANSFER: - dissect_cmip_ROS(FALSE,tvb,0,pinfo,tree,-1); + dissect_cmip_ROS(FALSE,tvb,0,&asn1_ctx,tree,-1); break; default: ; @@ -251,14 +215,10 @@ void proto_register_cmip(void) { void proto_reg_handoff_cmip(void) { register_ber_oid_dissector("2.9.0.0.2", dissect_cmip, proto_cmip, "cmip"); register_ber_oid_dissector("2.9.1.1.4", dissect_cmip, proto_cmip, "joint-iso-itu-t(2) ms(9) cmip(1) cmip-pci(1) abstractSyntax(4)"); - register_ber_oid_dissector("2.9.3.2.7.35", dissect_cmip_attribute_35, proto_cmip, "smi2AttributeID (7) operationalState(35)"); - register_ber_oid_dissector("2.9.3.2.7.55", dissect_cmip_attribute_55, proto_cmip, "smi2AttributeID (7) destination(55)"); - register_ber_oid_dissector("2.9.3.2.7.56", dissect_cmip_attribute_56, proto_cmip, "smi2AttributeID (7) discriminatorConstruct(56)"); - register_ber_oid_dissector("2.9.3.2.7.63", dissect_cmip_attribute_63, proto_cmip, "smi2AttributeID (7) nameBinding(63)"); - register_ber_oid_dissector("2.9.3.2.7.65", dissect_cmip_attribute_65, proto_cmip, "smi2AttributeID (7) objectClass(65)"); add_oid_str_name("2.9.3.2.3.4","eventForwardingDiscriminator(4)"); add_oid_str_name("2.9.1.1.4","joint-iso-itu-t(2) ms(9) cmip(1) cmip-pci(1) abstractSyntax(4)"); +#include "packet-cmip-dis-tab.c" } diff --git a/asn1/cms/cms.cnf b/asn1/cms/cms.cnf index 95049ccc6f..d6d36a16a9 100644 --- a/asn1/cms/cms.cnf +++ b/asn1/cms/cms.cnf @@ -25,20 +25,20 @@ SignatureValue UnsignedAttributes #.REGISTER -ContentInfo B "1.2.840.113549.1.9.16.1.6" "id-ct-contentInfo" -#OctetString B "1.2.840.113549.1.7.1" "id-data" see x509sat.cnf -SignedData B "1.2.840.113549.1.7.2" "id-signedData" -EnvelopedData B "1.2.840.113549.1.7.3" "id-envelopedData" -DigestedData B "1.2.840.113549.1.7.5" "id-digestedData" -EncryptedData B "1.2.840.113549.1.7.6" "id-encryptedData" -AuthenticatedData B "1.2.840.113549.1.9.16.1.2" "id-ct-authenticatedData" +ContentInfo B "1.2.840.113549.1.9.16.1.6" "id-ct-contentInfo" +#OctetString B "1.2.840.113549.1.7.1" "id-data" see x509sat.cnf +SignedData B "1.2.840.113549.1.7.2" "id-signedData" +EnvelopedData B "1.2.840.113549.1.7.3" "id-envelopedData" +DigestedData B "1.2.840.113549.1.7.5" "id-digestedData" +EncryptedData B "1.2.840.113549.1.7.6" "id-encryptedData" +AuthenticatedData B "1.2.840.113549.1.9.16.1.2" "id-ct-authenticatedData" -ContentType B "1.2.840.113549.1.9.3" "id-contentType" -MessageDigest B "1.2.840.113549.1.9.4" "id-messageDigest" -SigningTime B "1.2.840.113549.1.9.5" "id-signingTime" -Countersignature B "1.2.840.113549.1.9.6" "id-counterSignature" +ContentType B "1.2.840.113549.1.9.3" "id-contentType" +MessageDigest B "1.2.840.113549.1.9.4" "id-messageDigest" +SigningTime B "1.2.840.113549.1.9.5" "id-signingTime" +Countersignature B "1.2.840.113549.1.9.6" "id-counterSignature" -ContentInfo B "2.6.1.4.18" "id-et-pkcs7" +ContentInfo B "2.6.1.4.18" "id-et-pkcs7" IssuerAndSerialNumber B "1.3.6.1.4.1.311.16.4" "ms-oe-encryption-key-preference" SMIMECapabilities B "1.2.840.113549.1.9.15" "id-smime-capabilities" @@ -80,7 +80,7 @@ EncryptedContentInfo/contentType encryptedContentType } #.FN_BODY ContentInfo/content - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.FN_BODY EncapsulatedContentInfo/eContent @@ -92,11 +92,11 @@ EncryptedContentInfo/contentType encryptedContentType int content_offset; /* XXX Do we care about printing out the octet string? */ - offset = dissect_cms_OCTET_STRING(FALSE, tvb, offset, pinfo, NULL, hf_cms_eContent); + offset = dissect_cms_OCTET_STRING(FALSE, tvb, offset, actx, NULL, hf_cms_eContent); pdu_offset = get_ber_identifier(tvb, pdu_offset, &class, &pc, &tag); content_offset = pdu_offset = get_ber_length(tree, tvb, pdu_offset, &len, &ind); - pdu_offset = call_ber_oid_callback(object_identifier_id, tvb, pdu_offset, pinfo, top_tree ? top_tree : tree); + pdu_offset = call_ber_oid_callback(object_identifier_id, tvb, pdu_offset, actx->pinfo, top_tree ? top_tree : tree); /* save the content for checking the message digest */ content_tvb = tvb_new_subset(tvb, content_offset, len, -1); @@ -105,7 +105,7 @@ EncryptedContentInfo/contentType encryptedContentType FN_VARIANT = _str HF_INDEX = hf_cms_ci_contentType VAL_PTR = &object_identifier_id #.FN_BODY OtherKeyAttribute/keyAttr - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.FN_PARS Attribute/attrType @@ -123,7 +123,7 @@ EncryptedContentInfo/contentType encryptedContentType #.FN_BODY AttributeValue - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.FN_BODY MessageDigest proto_item *pi; @@ -156,7 +156,7 @@ EncryptedContentInfo/contentType encryptedContentType #.FN_BODY T_parameters - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.FN_PARS RC2ParameterVersion diff --git a/asn1/cms/packet-cms-template.c b/asn1/cms/packet-cms-template.c index 315ee5d732..ba9436c49d 100644 --- a/asn1/cms/packet-cms-template.c +++ b/asn1/cms/packet-cms-template.c @@ -31,6 +31,7 @@ #include <epan/packet.h> #include <epan/conversation.h> #include <epan/oid_resolv.h> +#include <epan/asn1.h> #include <stdio.h> #include <string.h> @@ -55,7 +56,7 @@ static int hf_cms_ci_contentType = -1; /* Initialize the subtree pointers */ #include "packet-cms-ett.c" -static int dissect_cms_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) ; /* XXX kill a compiler warning until asn2wrs stops generating these silly wrappers */ +static int dissect_cms_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_) ; /* XXX kill a compiler warning until asn2wrs stops generating these silly wrappers */ static const char *object_identifier_id; 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); diff --git a/asn1/disp/disp.cnf b/asn1/disp/disp.cnf index 058d99a911..a135dc5820 100644 --- a/asn1/disp/disp.cnf +++ b/asn1/disp/disp.cnf @@ -40,8 +40,8 @@ ModificationParameter B "dop.modify.roleb.2.5.19.1" "shadow-modify-roleb" %(DEFAULT_BODY)s - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " %%s", val_to_str(update, disp_T_standard_vals, "standard(%%d")); + if (check_col(actx->pinfo->cinfo, COL_INFO)) { + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", val_to_str(update, disp_T_standard_vals, "standard(%%d")); } #.FN_PARS RefreshInformation @@ -52,8 +52,8 @@ ModificationParameter B "dop.modify.roleb.2.5.19.1" "shadow-modify-roleb" %(DEFAULT_BODY)s - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " %%s", val_to_str(update, disp_RefreshInformation_vals, "unknown(%%d)")); + if (check_col(actx->pinfo->cinfo, COL_INFO)) { + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", val_to_str(update, disp_RefreshInformation_vals, "unknown(%%d)")); } #.FN_PARS StandardUpdate @@ -64,8 +64,8 @@ ModificationParameter B "dop.modify.roleb.2.5.19.1" "shadow-modify-roleb" %(DEFAULT_BODY)s - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " %%s", val_to_str(update, disp_StandardUpdate_vals, "unknown(%%d)")); + if (check_col(actx->pinfo->cinfo, COL_INFO)) { + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", val_to_str(update, disp_StandardUpdate_vals, "unknown(%%d)")); } #.FN_PARS CoordinateShadowUpdateResult @@ -76,8 +76,8 @@ ModificationParameter B "dop.modify.roleb.2.5.19.1" "shadow-modify-roleb" %(DEFAULT_BODY)s - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " %%s", val_to_str(update, disp_CoordinateShadowUpdateResult_vals, "unknown(%%d)")); + if (check_col(actx->pinfo->cinfo, COL_INFO)) { + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", val_to_str(update, disp_CoordinateShadowUpdateResult_vals, "unknown(%%d)")); } #.FN_PARS RequestShadowUpdateResult @@ -88,8 +88,8 @@ ModificationParameter B "dop.modify.roleb.2.5.19.1" "shadow-modify-roleb" %(DEFAULT_BODY)s - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " %%s", val_to_str(update, disp_RequestShadowUpdateResult_vals, "unknown(%%d)")); + if (check_col(actx->pinfo->cinfo, COL_INFO)) { + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", val_to_str(update, disp_RequestShadowUpdateResult_vals, "unknown(%%d)")); } #.FN_PARS UpdateShadowResult @@ -100,8 +100,8 @@ ModificationParameter B "dop.modify.roleb.2.5.19.1" "shadow-modify-roleb" %(DEFAULT_BODY)s - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " %%s", val_to_str(update, disp_UpdateShadowResult_vals, "unknown(%%d)")); + if (check_col(actx->pinfo->cinfo, COL_INFO)) { + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", val_to_str(update, disp_UpdateShadowResult_vals, "unknown(%%d)")); } #.FN_PARS ShadowProblem @@ -112,6 +112,6 @@ ModificationParameter B "dop.modify.roleb.2.5.19.1" "shadow-modify-roleb" %(DEFAULT_BODY)s - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " %%s", val_to_str(problem, disp_ShadowProblem_vals, "ShadowProblem(%%d)")); + if (check_col(actx->pinfo->cinfo, COL_INFO)) { + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", val_to_str(problem, disp_ShadowProblem_vals, "ShadowProblem(%%d)")); } diff --git a/asn1/disp/packet-disp-template.c b/asn1/disp/packet-disp-template.c index 300bfba385..97b7465c5d 100644 --- a/asn1/disp/packet-disp-template.c +++ b/asn1/disp/packet-disp-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> @@ -87,8 +88,11 @@ dissect_disp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) int old_offset; proto_item *item=NULL; proto_tree *tree=NULL; - int (*disp_dissector)(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) = NULL; + int (*disp_dissector)(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_) = NULL; char *disp_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 ){ @@ -184,7 +188,7 @@ dissect_disp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) while (tvb_reported_length_remaining(tvb, offset) > 0){ old_offset=offset; - offset=(*disp_dissector)(FALSE, tvb, offset, pinfo , tree, -1); + offset=(*disp_dissector)(FALSE, tvb, offset, &asn1_ctx, tree, -1); if(offset == old_offset){ proto_tree_add_text(tree, tvb, offset, -1,"Internal error, zero-byte DISP PDU"); offset = tvb_length(tvb); diff --git a/asn1/dop/dop.cnf b/asn1/dop/dop.cnf index 19f10a0784..0bb4dc7ebf 100644 --- a/asn1/dop/dop.cnf +++ b/asn1/dop/dop.cnf @@ -95,74 +95,74 @@ ACIItem B "2.5.24.6" "id-aca-subentryACI" %(DEFAULT_BODY)s - if(check_col(pinfo->cinfo, COL_INFO)) { + if(check_col(actx->pinfo->cinfo, COL_INFO)) { name = get_oid_str_name(binding_type); - col_append_fstr(pinfo->cinfo, COL_INFO, " %%s", name ? name : binding_type); + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", name ? name : binding_type); } #.FN_BODY EstablishSymmetric - offset = call_dop_oid_callback("dop.establish.symmetric", tvb, offset, pinfo, tree, "symmetric"); + offset = call_dop_oid_callback("dop.establish.symmetric", tvb, offset, actx->pinfo, tree, "symmetric"); #.FN_BODY EstablishRoleAInitiates - offset = call_dop_oid_callback("dop.establish.rolea", tvb, offset, pinfo, tree, "roleA"); + offset = call_dop_oid_callback("dop.establish.rolea", tvb, offset, actx->pinfo, tree, "roleA"); #.FN_BODY EstablishRoleBInitiates - offset = call_dop_oid_callback("dop.establish.roleb", tvb, offset, pinfo, tree, "roleB"); + offset = call_dop_oid_callback("dop.establish.roleb", tvb, offset, actx->pinfo, tree, "roleB"); #.FN_BODY ModifySymmetric - offset = call_dop_oid_callback("dop.modify.symmetric", tvb, offset, pinfo, tree, "symmetric"); + offset = call_dop_oid_callback("dop.modify.symmetric", tvb, offset, actx->pinfo, tree, "symmetric"); #.FN_BODY ModifyRoleAInitiates - offset = call_dop_oid_callback("dop.modify.rolea", tvb, offset, pinfo, tree, "roleA"); + offset = call_dop_oid_callback("dop.modify.rolea", tvb, offset, actx->pinfo, tree, "roleA"); #.FN_BODY ModifyRoleBInitiates - offset = call_dop_oid_callback("dop.modify.roleb", tvb, offset, pinfo, tree, "roleB"); + offset = call_dop_oid_callback("dop.modify.roleb", tvb, offset, actx->pinfo, tree, "roleB"); #.FN_BODY TerminateSymmetric - offset = call_dop_oid_callback("dop.terminate.symmetric", tvb, offset, pinfo, tree, "symmetric"); + offset = call_dop_oid_callback("dop.terminate.symmetric", tvb, offset, actx->pinfo, tree, "symmetric"); #.FN_BODY TerminateRoleAInitiates - offset = call_dop_oid_callback("dop.terminate.rolea", tvb, offset, pinfo, tree, "roleA"); + offset = call_dop_oid_callback("dop.terminate.rolea", tvb, offset, actx->pinfo, tree, "roleA"); #.FN_BODY TerminateRoleBInitiates - offset = call_dop_oid_callback("dop.terminate.roleb", tvb, offset, pinfo, tree, "roleB"); + offset = call_dop_oid_callback("dop.terminate.roleb", tvb, offset, actx->pinfo, tree, "roleB"); #.FN_BODY T_agreement - offset = call_dop_oid_callback("dop.agreement", tvb, offset, pinfo, tree, NULL); + offset = call_dop_oid_callback("dop.agreement", tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY T_symmetric - offset = call_dop_oid_callback("dop.establish.symmetric", tvb, offset, pinfo, tree, "symmetric"); + offset = call_dop_oid_callback("dop.establish.symmetric", tvb, offset, actx->pinfo, tree, "symmetric"); #.FN_BODY T_roleA_replies - offset = call_dop_oid_callback("dop.establish.rolea", tvb, offset, pinfo, tree, "roleA"); + offset = call_dop_oid_callback("dop.establish.rolea", tvb, offset, actx->pinfo, tree, "roleA"); #.FN_BODY T_roleB_replies - offset = call_dop_oid_callback("dop.establish.roleb", tvb, offset, pinfo, tree, "roleB"); + offset = call_dop_oid_callback("dop.establish.roleb", tvb, offset, actx->pinfo, tree, "roleB"); #.FN_BODY T_agreementProposal - offset = call_dop_oid_callback("dop.agreement", tvb, offset, pinfo, tree, NULL); + offset = call_dop_oid_callback("dop.agreement", tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY ResultNewAgreement - offset = call_dop_oid_callback("dop.agreement", tvb, offset, pinfo, tree, NULL); + offset = call_dop_oid_callback("dop.agreement", tvb, offset, actx->pinfo, tree, NULL); #.FN_BODY ArgumentNewAgreement - offset = call_dop_oid_callback("dop.agreement", tvb, offset, pinfo, tree, NULL); + offset = call_dop_oid_callback("dop.agreement", tvb, offset, actx->pinfo, tree, NULL); #.FN_PARS INTEGER @@ -173,11 +173,11 @@ ACIItem B "2.5.24.6" "id-aca-subentryACI" %(DEFAULT_BODY)s - if (check_col(pinfo->cinfo, COL_INFO)) { + if (check_col(actx->pinfo->cinfo, COL_INFO)) { if(hf_index == hf_dop_identifier) { - col_append_fstr(pinfo->cinfo, COL_INFO, " id=%%d", value); + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " id=%%d", value); } else if (hf_index == hf_dop_version) { - col_append_fstr(pinfo->cinfo, COL_INFO, ",%%d", value); + col_append_fstr(actx->pinfo->cinfo, COL_INFO, ",%%d", value); } } diff --git a/asn1/dop/packet-dop-template.c b/asn1/dop/packet-dop-template.c index 801ee49a39..c6b56b5fd3 100644 --- a/asn1/dop/packet-dop-template.c +++ b/asn1/dop/packet-dop-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> @@ -99,8 +100,11 @@ dissect_dop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) int old_offset; proto_item *item=NULL; proto_tree *tree=NULL; - int (*dop_dissector)(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) = NULL; + int (*dop_dissector)(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_) = NULL; char *dop_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 ){ @@ -198,7 +202,7 @@ dissect_dop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) while (tvb_reported_length_remaining(tvb, offset) > 0){ old_offset=offset; - offset=(*dop_dissector)(FALSE, tvb, offset, pinfo , tree, -1); + offset=(*dop_dissector)(FALSE, tvb, offset, &asn1_ctx, tree, -1); if(offset == old_offset){ proto_tree_add_text(tree, tvb, offset, -1,"Internal error, zero-byte DOP PDU"); offset = tvb_length(tvb); diff --git a/asn1/dsp/packet-dsp-template.c b/asn1/dsp/packet-dsp-template.c index fb449d735c..56d2f358cb 100644 --- a/asn1/dsp/packet-dsp-template.c +++ b/asn1/dsp/packet-dsp-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> @@ -81,8 +82,11 @@ dissect_dsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) int old_offset; proto_item *item=NULL; proto_tree *tree=NULL; - int (*dsp_dissector)(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) = NULL; + int (*dsp_dissector)(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_) = NULL; char *dsp_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_dsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) while (tvb_reported_length_remaining(tvb, offset) > 0){ old_offset=offset; - offset=(*dsp_dissector)(FALSE, tvb, offset, pinfo , tree, -1); + offset=(*dsp_dissector)(FALSE, tvb, offset, &asn1_ctx, tree, -1); if(offset == old_offset){ proto_tree_add_text(tree, tvb, offset, -1,"Internal error, zero-byte DSP PDU"); offset = tvb_length(tvb); diff --git a/asn1/ess/ess.cnf b/asn1/ess/ess.cnf index 03e7ea579e..cea949b29e 100644 --- a/asn1/ess/ess.cnf +++ b/asn1/ess/ess.cnf @@ -39,7 +39,7 @@ EnumeratedTag B "2.16.840.1.101.2.1.8.3.4" "id-enumeratedRestrictiveAttribu FN_VARIANT = _str HF_INDEX = hf_ess_SecurityCategory_type_OID VAL_PTR = &object_identifier_id #.FN_BODY SecurityCategory/value - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.END diff --git a/asn1/ess/packet-ess-template.c b/asn1/ess/packet-ess-template.c index 4fe269da24..12a20057df 100644 --- a/asn1/ess/packet-ess-template.c +++ b/asn1/ess/packet-ess-template.c @@ -29,6 +29,7 @@ #include <glib.h> #include <epan/packet.h> +#include <epan/asn1.h> #include <stdio.h> #include <string.h> diff --git a/asn1/ftam/ftam.cnf b/asn1/ftam/ftam.cnf index 37330bbd9f..49b7d1c26c 100644 --- a/asn1/ftam/ftam.cnf +++ b/asn1/ftam/ftam.cnf @@ -68,16 +68,16 @@ Legal-Qualification-Attribute/actual-values actual_values9 FN_VARIANT = _str VAL_PTR = &object_identifier_id #.FN_BODY Contents-Type-Attribute/document-type/parameter - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.FN_BODY Extension-Attribute/extension-attribute - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.FN_PARS Attribute-Extensions-Pattern/_item/extension-set-attribute-Patterns/_item/extension-attribute-identifier FN_VARIANT = _str VAL_PTR = &object_identifier_id #.FN_BODY Attribute-Extensions-Pattern/_item/extension-set-attribute-Patterns/_item/extension-attribute-Pattern - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.FN_BODY AP-title /* XXX have no idea about this one */ @@ -98,7 +98,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } offset = dissect_ber_restricted_string(TRUE, 1, - pinfo, tree, tvb, offset, hf_index, + actx->pinfo, tree, tvb, offset, hf_index, NULL); #.FN_BODY Protocol-Version @@ -114,7 +114,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_bitstring(TRUE, pinfo, tree, tvb, offset, + offset = dissect_ber_bitstring(TRUE, actx->pinfo, tree, tvb, offset, Protocol_Version_bits, hf_index, ett_ftam_Protocol_Version, NULL); @@ -131,7 +131,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_bitstring(TRUE, pinfo, tree, tvb, offset, + offset = dissect_ber_bitstring(TRUE, actx->pinfo, tree, tvb, offset, Service_Class_bits, hf_index, ett_ftam_Service_Class, NULL); @@ -148,7 +148,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_bitstring(TRUE, pinfo, tree, tvb, offset, + offset = dissect_ber_bitstring(TRUE, actx->pinfo, tree, tvb, offset, Functional_Units_bits, hf_index, ett_ftam_Functional_Units, NULL); @@ -166,7 +166,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_bitstring(TRUE, pinfo, tree, tvb, offset, + offset = dissect_ber_bitstring(TRUE, actx->pinfo, tree, tvb, offset, Attribute_Groups_bits, hf_index, ett_ftam_Attribute_Groups, NULL); @@ -184,7 +184,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_integer(TRUE, pinfo, tree, tvb, offset, hf_index, + offset = dissect_ber_integer(TRUE, actx->pinfo, tree, tvb, offset, hf_index, NULL); #.FN_BODY Contents-Type-List @@ -200,7 +200,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_sequence_of(TRUE, pinfo, tree, tvb, offset, + offset = dissect_ber_sequence_of(TRUE, actx, tree, tvb, offset, Contents_Type_List_sequence_of, hf_index, ett_ftam_Contents_Type_List); @@ -217,7 +217,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_integer(TRUE, pinfo, tree, tvb, offset, hf_index, + offset = dissect_ber_integer(TRUE, actx->pinfo, tree, tvb, offset, hf_index, NULL); #.FN_BODY Request-Type @@ -233,7 +233,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_integer(TRUE, pinfo, tree, tvb, offset, hf_index, + offset = dissect_ber_integer(TRUE, actx->pinfo, tree, tvb, offset, hf_index, NULL); #.FN_BODY Abstract-Syntax-Name @@ -249,7 +249,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_object_identifier(TRUE, pinfo, tree, tvb, offset, hf_index, + offset = dissect_ber_object_identifier(TRUE, actx->pinfo, tree, tvb, offset, hf_index, NULL); @@ -266,7 +266,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_sequence(TRUE, pinfo, tree, tvb, offset, + offset = dissect_ber_sequence(TRUE, actx, tree, tvb, offset, Access_Context_sequence, hf_index, ett_ftam_Access_Context); #.FN_BODY Access-Passwords @@ -282,7 +282,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_sequence(TRUE, pinfo, tree, tvb, offset, + offset = dissect_ber_sequence(TRUE, actx, tree, tvb, offset, Access_Passwords_sequence, hf_index, ett_ftam_Access_Passwords); #.FN_BODY Access-Request @@ -298,7 +298,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_bitstring(TRUE, pinfo, tree, tvb, offset, + offset = dissect_ber_bitstring(TRUE, actx->pinfo, tree, tvb, offset, Access_Request_bits, hf_index, ett_ftam_Access_Request, NULL); #.FN_BODY Account @@ -315,7 +315,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } offset = dissect_ber_restricted_string(TRUE, 4, - pinfo, tree, tvb, offset, hf_index, + actx->pinfo, tree, tvb, offset, hf_index, NULL); #.FN_BODY Action-Result gint8 class; @@ -330,7 +330,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_integer(TRUE, pinfo, tree, tvb, offset, hf_index, + offset = dissect_ber_integer(TRUE, actx->pinfo, tree, tvb, offset, hf_index, NULL); @@ -347,7 +347,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_integer(TRUE, pinfo, tree, tvb, offset, hf_index, + offset = dissect_ber_integer(TRUE, actx->pinfo, tree, tvb, offset, hf_index, NULL); #.FN_BODY Change-Attributes @@ -363,7 +363,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_sequence(TRUE, pinfo, tree, tvb, offset, + offset = dissect_ber_sequence(TRUE, actx, tree, tvb, offset, Change_Attributes_sequence, hf_index, ett_ftam_Change_Attributes); @@ -380,7 +380,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_sequence_of(TRUE, pinfo, tree, tvb, offset, + offset = dissect_ber_sequence_of(TRUE, actx, tree, tvb, offset, Charging_sequence_of, hf_index, ett_ftam_Charging); @@ -397,7 +397,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_sequence(TRUE, pinfo, tree, tvb, offset, + offset = dissect_ber_sequence(TRUE, actx, tree, tvb, offset, Concurrency_Control_sequence, hf_index, ett_ftam_Concurrency_Control); @@ -414,7 +414,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_object_identifier(TRUE, pinfo, tree, tvb, offset, hf_index, + offset = dissect_ber_object_identifier(TRUE, actx->pinfo, tree, tvb, offset, hf_index, NULL); #.FN_BODY Create-Attributes @@ -430,7 +430,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_sequence(TRUE, pinfo, tree, tvb, offset, + offset = dissect_ber_sequence(TRUE, actx, tree, tvb, offset, Create_Attributes_sequence, hf_index, ett_ftam_Create_Attributes); #.FN_BODY Diagnostic @@ -446,7 +446,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_sequence_of(TRUE, pinfo, tree, tvb, offset, + offset = dissect_ber_sequence_of(TRUE, actx, tree, tvb, offset, Diagnostic_sequence_of, hf_index, ett_ftam_Diagnostic); @@ -465,7 +465,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_integer(TRUE, pinfo, tree, tvb, offset, hf_index, + offset = dissect_ber_integer(TRUE, actx->pinfo, tree, tvb, offset, hf_index, NULL); #.FN_BODY Read-Attributes @@ -481,7 +481,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_sequence(TRUE, pinfo, tree, tvb, offset, + offset = dissect_ber_sequence(TRUE, actx, tree, tvb, offset, Read_Attributes_sequence, hf_index, ett_ftam_Read_Attributes); #.FN_BODY Select-Attributes @@ -497,7 +497,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_sequence(TRUE, pinfo, tree, tvb, offset, + offset = dissect_ber_sequence(TRUE, actx, tree, tvb, offset, Select_Attributes_sequence, hf_index, ett_ftam_Select_Attributes); #.FN_BODY State-Result @@ -513,7 +513,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_integer(TRUE, pinfo, tree, tvb, offset, hf_index, + offset = dissect_ber_integer(TRUE, actx->pinfo, tree, tvb, offset, hf_index, NULL); #.FN_BODY User-Identity @@ -530,7 +530,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } offset = dissect_ber_restricted_string(TRUE, 22, - pinfo, tree, tvb, offset, hf_index, + actx->pinfo, tree, tvb, offset, hf_index, NULL); #.FN_BODY Scope gint8 class; @@ -545,7 +545,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_sequence_of(TRUE, pinfo, tree, tvb, offset, + offset = dissect_ber_sequence_of(TRUE, actx, tree, tvb, offset, Scope_sequence_of, hf_index, ett_ftam_Scope); #.FN_BODY Objects-Attributes-List @@ -561,7 +561,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_sequence_of(TRUE, pinfo, tree, tvb, offset, + offset = dissect_ber_sequence_of(TRUE, actx, tree, tvb, offset, Objects_Attributes_List_sequence_of, hf_index, ett_ftam_Objects_Attributes_List); @@ -578,7 +578,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_sequence_of(TRUE, pinfo, tree, tvb, offset, + offset = dissect_ber_sequence_of(TRUE, actx, tree, tvb, offset, Path_Access_Passwords_sequence_of, hf_index, ett_ftam_Path_Access_Passwords); #.FN_BODY Request-Operation-Result @@ -594,7 +594,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_integer(TRUE, pinfo, tree, tvb, offset, hf_index, + offset = dissect_ber_integer(TRUE, actx->pinfo, tree, tvb, offset, hf_index, NULL); #.FN_BODY Shared-ASE-Informatio @@ -610,7 +610,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_acse_EXTERNALt(TRUE, tvb, offset, pinfo, tree, hf_index); + offset = dissect_acse_EXTERNALt(TRUE, tvb, offset, actx->pinfo, tree, hf_index); #.FN_BODY Attribute-Value-Assertions gint8 class; @@ -625,7 +625,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ftam_OR_Set(TRUE, tvb, offset, pinfo, tree, hf_index); + offset = dissect_ftam_OR_Set(TRUE, tvb, offset, actx, tree, hf_index); #.FN_BODY Referent-Indicator gint8 class; @@ -640,7 +640,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_boolean(TRUE, pinfo, tree, tvb, offset, hf_index); + offset = dissect_ber_boolean(TRUE, actx->pinfo, tree, tvb, offset, hf_index); #.FN_BODY Password gint8 class; @@ -655,7 +655,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_choice(pinfo, tree, tvb, offset, + offset = dissect_ber_choice(actx, tree, tvb, offset, Password_choice, hf_index, ett_ftam_Password, NULL); @@ -672,7 +672,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_choice(pinfo, tree, tvb, offset, + offset = dissect_ber_choice(actx, tree, tvb, offset, FADU_Identity_choice, hf_index, ett_ftam_FADU_Identity, NULL); #.FN_BODY Operation-Result @@ -688,7 +688,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_choice(pinfo, tree, tvb, offset, + offset = dissect_ber_choice(actx, tree, tvb, offset, Operation_Result_choice, hf_index, ett_ftam_Operation_Result, NULL); #.FN_PARS FTAM-Regime-PDU VAL_PTR = &branch_taken @@ -699,8 +699,8 @@ Legal-Qualification-Attribute/actual-values actual_values9 %(DEFAULT_BODY)s if( (branch_taken!=-1) && ftam_FTAM_Regime_PDU_vals[branch_taken].strptr ){ - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " %%s:", ftam_FTAM_Regime_PDU_vals[branch_taken].strptr); + if (check_col(actx->pinfo->cinfo, COL_INFO)) { + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s:", ftam_FTAM_Regime_PDU_vals[branch_taken].strptr); } } @@ -713,8 +713,8 @@ Legal-Qualification-Attribute/actual-values actual_values9 %(DEFAULT_BODY)s if( (branch_taken!=-1) && ftam_File_PDU_vals[branch_taken].strptr ){ - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " %%s:", ftam_File_PDU_vals[branch_taken].strptr); + if (check_col(actx->pinfo->cinfo, COL_INFO)) { + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s:", ftam_File_PDU_vals[branch_taken].strptr); } } @@ -727,8 +727,8 @@ Legal-Qualification-Attribute/actual-values actual_values9 %(DEFAULT_BODY)s if( (branch_taken!=-1) && ftam_Bulk_Data_PDU_vals[branch_taken].strptr ){ - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " %%s:", ftam_Bulk_Data_PDU_vals[branch_taken].strptr); + if (check_col(actx->pinfo->cinfo, COL_INFO)) { + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s:", ftam_Bulk_Data_PDU_vals[branch_taken].strptr); } } @@ -741,7 +741,7 @@ Legal-Qualification-Attribute/actual-values actual_values9 %(DEFAULT_BODY)s if( (branch_taken!=-1) && ftam_FSM_PDU_vals[branch_taken].strptr ){ - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " %%s:", ftam_FSM_PDU_vals[branch_taken].strptr); + if (check_col(actx->pinfo->cinfo, COL_INFO)) { + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s:", ftam_FSM_PDU_vals[branch_taken].strptr); } } diff --git a/asn1/ftam/packet-ftam-template.c b/asn1/ftam/packet-ftam-template.c index 5a5fe32280..fe44af82dd 100644 --- a/asn1/ftam/packet-ftam-template.c +++ b/asn1/ftam/packet-ftam-template.c @@ -36,6 +36,7 @@ #include <epan/packet.h> #include <epan/conversation.h> #include <epan/oid_resolv.h> +#include <epan/asn1.h> #include <stdio.h> #include <string.h> @@ -53,7 +54,7 @@ int proto_ftam = -1; static const char *object_identifier_id; /* Declare the function to avoid a compiler warning */ -static int dissect_ftam_OR_Set(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_); +static int dissect_ftam_OR_Set(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_); #include "packet-ftam-hf.c" @@ -73,6 +74,9 @@ dissect_ftam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) int old_offset; proto_item *item=NULL; proto_tree *tree=NULL; + asn1_ctx_t asn1_ctx; + + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); if(parent_tree){ item = proto_tree_add_item(parent_tree, proto_ftam, tvb, 0, -1, FALSE); @@ -85,7 +89,7 @@ dissect_ftam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) while (tvb_reported_length_remaining(tvb, offset) > 0){ old_offset=offset; - offset=dissect_ftam_PDU(FALSE, tvb, offset, pinfo , tree, -1); + offset=dissect_ftam_PDU(FALSE, tvb, offset, &asn1_ctx, tree, -1); if(offset == old_offset){ proto_tree_add_text(tree, tvb, offset, -1,"Internal error, zero-byte FTAM PDU"); offset = tvb_length(tvb); diff --git a/asn1/ftbp/packet-ftbp-template.c b/asn1/ftbp/packet-ftbp-template.c index 68139d4ba4..1a83bbcdfb 100644 --- a/asn1/ftbp/packet-ftbp-template.c +++ b/asn1/ftbp/packet-ftbp-template.c @@ -30,6 +30,7 @@ #include <glib.h> #include <epan/packet.h> #include <epan/conversation.h> +#include <epan/asn1.h> #include <stdio.h> #include <string.h> diff --git a/asn1/gnm/packet-gnm-template.c b/asn1/gnm/packet-gnm-template.c index 96c231b3ea..e60ddfdfd1 100644 --- a/asn1/gnm/packet-gnm-template.c +++ b/asn1/gnm/packet-gnm-template.c @@ -34,11 +34,12 @@ #include <glib.h> #include <epan/packet.h> #include <epan/conversation.h> +#include <epan/asn1.h> #include <stdio.h> #include <string.h> -#include "packet-cmip.h" #include "packet-ber.h" +#include "packet-cmip.h" #include "packet-gnm.h" #define PNAME "ITU M.3100 Generic Network Information Model" @@ -61,8 +62,11 @@ static int hf_gnm_AdministrativeState = -1; static void dissect_gnm_attribute_ObjectInstance(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { + asn1_ctx_t asn1_ctx; + + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); - dissect_cmip_ObjectInstance(FALSE, tvb, 0, pinfo, parent_tree, -1); + dissect_cmip_ObjectInstance(FALSE, tvb, 0, &asn1_ctx, parent_tree, -1); } diff --git a/asn1/gsm_ss/gsm_ss.cnf b/asn1/gsm_ss/gsm_ss.cnf index c8017b1ce0..dfac655e25 100644 --- a/asn1/gsm_ss/gsm_ss.cnf +++ b/asn1/gsm_ss/gsm_ss.cnf @@ -21,7 +21,7 @@ tvbuff_t *parameter_tvb; char *digit_str; - offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, + offset = dissect_ber_octet_string(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, ¶meter_tvb); if (parameter_tvb) { digit_str = unpack_digits(parameter_tvb, 1); @@ -36,7 +36,7 @@ tvbuff_t *parameter_tvb; char *digit_str; - offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, + offset = dissect_ber_octet_string(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, ¶meter_tvb); if (parameter_tvb) { digit_str = unpack_digits(parameter_tvb, 1); diff --git a/asn1/gsm_ss/packet-gsm_ss-template.c b/asn1/gsm_ss/packet-gsm_ss-template.c index c4ee8a81ed..7b01e225a0 100644 --- a/asn1/gsm_ss/packet-gsm_ss-template.c +++ b/asn1/gsm_ss/packet-gsm_ss-template.c @@ -42,6 +42,7 @@ #include <epan/prefs.h> #include <epan/conversation.h> #include <epan/tap.h> +#include <epan/asn1.h> #include <stdio.h> #include <string.h> @@ -170,78 +171,78 @@ static int hf_gsm_ss_SS_Code = -1; int -gsm_ss_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,guint32 opcode, gint comp_type_tag) +gsm_ss_dissect(tvbuff_t *tvb, proto_tree *tree, int offset, asn1_ctx_t *actx, guint32 opcode, gint comp_type_tag) { switch (comp_type_tag){ case 1: /* invoke */ switch (opcode){ case 10: /* Register SS -- imports operations from MAP-SupplementaryServiceOperations*/ - offset=dissect_gsm_map_RegisterSS_Arg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_RegisterSS_Arg(FALSE, tvb, offset, actx, tree, -1); break; case 11: /* Erase SS -- imports operations from MAP-SupplementaryServiceOperations*/ - offset=dissect_gsm_map_SS_ForBS_Code(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SS_ForBS_Code(FALSE, tvb, offset, actx, tree, -1); break; case 12: /* Activate SS -- imports operations from MAP-SupplementaryServiceOperations*/ - offset=dissect_gsm_map_SS_ForBS_Code(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SS_ForBS_Code(FALSE, tvb, offset, actx, tree, -1); break; case 13: /*Deactivate SS -- imports operations from MAP-SupplementaryServiceOperations*/ - offset=dissect_gsm_map_SS_ForBS_Code(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SS_ForBS_Code(FALSE, tvb, offset, actx, tree, -1); break; case 14: /*Interrogate SS -- imports operations from MAP-SupplementaryServiceOperations*/ - offset=dissect_gsm_map_SS_ForBS_Code(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SS_ForBS_Code(FALSE, tvb, offset, actx, tree, -1); break; case 16: /*Notify SS */ - offset = dissect_notifySS(pinfo, tree, tvb, offset, NULL /* actx */); + offset = dissect_notifySS(tree, tvb, offset, actx); break; case 17: /*Register Password -- imports operations from MAP-SupplementaryServiceOperations*/ - offset=dissect_gsm_map_SS_Code(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SS_Code(FALSE, tvb, offset, actx, tree, -1); break; case 18: /*Get Password -- imports operations from MAP-SupplementaryServiceOperations*/ - offset=dissect_gsm_map_GetPasswordArg(FALSE, tvb, offset, pinfo, tree, hf_gsm_ss_getPassword); + offset=dissect_gsm_map_GetPasswordArg(FALSE, tvb, offset, actx, tree, hf_gsm_ss_getPassword); break; case 19: /*Process Unstructured SS Data */ - offset = dissect_processUnstructuredSS_Data(pinfo, tree, tvb, offset, NULL /* axtx */); + offset = dissect_processUnstructuredSS_Data(tree, tvb, offset, NULL /* axtx */); break; case 38: /*Forward Check SS Indication -- imports operation from MAP-MobileServiceOperations*/ break; case 59: /*Process Unstructured SS Request -- imports operations from MAP-SupplementaryServiceOperations*/ - offset=dissect_gsm_map_Ussd_Arg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_Ussd_Arg(FALSE, tvb, offset, actx, tree, -1); break; case 60: /*Unstructured SS Request -- imports operations from MAP-SupplementaryServiceOperations*/ - offset=dissect_gsm_map_Ussd_Arg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_Ussd_Arg(FALSE, tvb, offset, actx, tree, -1); break; case 61: /*Unstructured SS Notify -- imports operations from MAP-SupplementaryServiceOperations*/ - offset=dissect_gsm_map_Ussd_Arg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_Ussd_Arg(FALSE, tvb, offset, actx, tree, -1); break; case 77: /*Erase CC Entry -- imports operations from MAP-SupplementaryServiceOperations*/ - offset=dissect_gsm_map_EraseCC_EntryArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_EraseCC_EntryArg(FALSE, tvb, offset, actx, tree, -1); break; case 112: /*lcs-AreaEventCancellation */ - offset = dissect_lcs_AreaEventCancellation(pinfo, tree, tvb, offset,NULL /* axtx */); + offset = dissect_lcs_AreaEventCancellation(tree, tvb, offset,NULL /* axtx */); break; case 113: /*lcs-AreaEventReport */ - offset = dissect_lcs_AreaEventReport(pinfo, tree, tvb, offset,NULL /* axtx */); + offset = dissect_lcs_AreaEventReport(tree, tvb, offset,NULL /* axtx */); break; case 114: /*LCS-AreaEventRequest */ - offset = dissect_lcs_AreaEventRequest(pinfo, tree, tvb, offset,NULL /* axtx */); + offset = dissect_lcs_AreaEventRequest(tree, tvb, offset,NULL /* axtx */); break; case 115: /*LCS MOLR */ - offset = dissect_lcs_MOLR(pinfo, tree, tvb, offset,NULL /* axtx */); + offset = dissect_lcs_MOLR(tree, tvb, offset,NULL /* axtx */); break; case 116: /*LCS Location Notification */ - offset = dissect_lcs_LocationNotification(pinfo, tree, tvb,offset,NULL /* axtx */); + offset = dissect_lcs_LocationNotification(tree, tvb,offset,NULL /* axtx */); break; case 117: /*Call Deflection */ - offset = dissect_callDeflection(pinfo, tree, tvb,offset,NULL /* axtx */); + offset = dissect_callDeflection(tree, tvb,offset,NULL /* axtx */); break; case 118: /*User User Service */ - offset = dissect_gsm_ss_UserUserServiceArg(FALSE, tvb, offset, pinfo, tree, -1); + offset = dissect_gsm_ss_UserUserServiceArg(FALSE, tvb, offset, actx, tree, -1); break; case 119: /* Access Register CC Entry */ - offset = dissect_gsm_ss_AccessRegisterCCEntryArg(FALSE, tvb, offset, pinfo, tree, -1); + offset = dissect_gsm_ss_AccessRegisterCCEntryArg(FALSE, tvb, offset, actx, tree, -1); break; case 120: /*Forward CUG Info */ - offset = dissect_forwardCUG_Info(pinfo, tree, tvb,offset,NULL /* axtx */); + offset = dissect_forwardCUG_Info(tree, tvb,offset,NULL /* axtx */); break; case 121: /*Split MPTY */ break; @@ -252,7 +253,7 @@ gsm_ss_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,g case 124: /*Build MPTY */ break; case 125: /*Forward Charge Advice */ - dissect_forwardChargeAdvice(pinfo, tree, tvb,offset,NULL /* axtx */); + dissect_forwardChargeAdvice(tree, tvb,offset,NULL /* axtx */); break; case 126: /*Explicit CT */ break; @@ -263,44 +264,44 @@ gsm_ss_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,g case 2: /* returnResultLast */ switch (opcode){ case 10: /*registerSS*/ - offset=dissect_gsm_map_SS_Info(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SS_Info(FALSE, tvb, offset, actx, tree, -1); break; case 11: /*eraseSS*/ - offset=dissect_gsm_map_SS_Info(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SS_Info(FALSE, tvb, offset, actx, tree, -1); break; case 12: /*activateSS*/ - offset=dissect_gsm_map_SS_Info(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SS_Info(FALSE, tvb, offset, actx, tree, -1); break; case 13: /*deactivateSS*/ - offset=dissect_gsm_map_SS_Info(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SS_Info(FALSE, tvb, offset, actx, tree, -1); break; case 14: /*interrogateSS*/ - offset=dissect_gsm_map_InterrogateSS_Res(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_InterrogateSS_Res(FALSE, tvb, offset, actx, tree, -1); break; case 16: /*Notify SS */ break; case 17: /*Register Password -- imports operations from MAP-SupplementaryServiceOperations*/ - offset=dissect_gsm_map_NewPassword(FALSE, tvb, offset, pinfo, tree, hf_gsm_ss_SS_Code); + offset=dissect_gsm_map_NewPassword(FALSE, tvb, offset, actx, tree, hf_gsm_ss_SS_Code); break; case 18: /*Get Password -- imports operations from MAP-SupplementaryServiceOperations*/ - offset=dissect_gsm_map_CurrentPassword(FALSE, tvb, offset, pinfo, tree, hf_gsm_ss_currentPassword); + offset=dissect_gsm_map_CurrentPassword(FALSE, tvb, offset, actx, tree, hf_gsm_ss_currentPassword); break; case 19: /*Process Unstructured SS Data */ - offset=dissect_gsm_ss_SS_UserData(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_ss_SS_UserData(FALSE, tvb, offset, actx, tree, -1); break; case 38: /*Forward Check SS Indication -- imports operation from MAP-MobileServiceOperations*/ break; case 59: /*Process Unstructured SS Request -- imports operations from MAP-SupplementaryServiceOperations*/ - offset=dissect_gsm_map_Ussd_Res(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_Ussd_Res(FALSE, tvb, offset, actx, tree, -1); break; case 60: /*Unstructured SS Request -- imports operations from MAP-SupplementaryServiceOperations*/ - offset=dissect_gsm_map_Ussd_Res(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_Ussd_Res(FALSE, tvb, offset, actx, tree, -1); break; case 61: /*Unstructured SS Notify -- imports operations from MAP-SupplementaryServiceOperations*/ - offset=dissect_gsm_map_Ussd_Res(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_Ussd_Res(FALSE, tvb, offset, actx, tree, -1); break; case 77: /*Erase CC Entry -- imports operations from MAP-SupplementaryServiceOperations*/ - offset=dissect_gsm_map_EraseCC_EntryRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_EraseCC_EntryRes(FALSE, tvb, offset, actx, tree, -1); break; case 112: /*lcs-AreaEventCancellation */ break; @@ -309,17 +310,17 @@ gsm_ss_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,g case 114: /*LCS-AreaEventRequest */ break; case 115: /*LCS MOLR */ - offset=dissect_gsm_ss_LCS_MOLRRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_ss_LCS_MOLRRes(FALSE, tvb, offset, actx, tree, -1); break; case 116: /*LCS Location Notification */ - offset=dissect_gsm_ss_LocationNotificationRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_ss_LocationNotificationRes(FALSE, tvb, offset, actx, tree, -1); break; case 117: /*Call Deflection */ break; case 118: /*User User Service */ break; case 119: /* Access Register CC Entry */ - offset=dissect_gsm_map_RegisterCC_EntryRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_RegisterCC_EntryRes(FALSE, tvb, offset, actx, tree, -1); break; case 120: /*Forward CUG Info */ break; diff --git a/asn1/gsm_ss/packet-gsm_ss-template.h b/asn1/gsm_ss/packet-gsm_ss-template.h index d46bf8eedc..1071990958 100644 --- a/asn1/gsm_ss/packet-gsm_ss-template.h +++ b/asn1/gsm_ss/packet-gsm_ss-template.h @@ -33,7 +33,7 @@ #ifndef PACKET_GSM_SS_H #define PACKET_GSM_SS_H -int gsm_ss_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint32 opcode, gint comp_type_tag); +int gsm_ss_dissect(tvbuff_t *tvb, proto_tree *tree, int offset, asn1_ctx_t *actx, guint32 opcode, gint comp_type_tag); extern const value_string gsm_ss_opr_code_strings[]; extern const value_string gsm_ss_err_code_strings[]; diff --git a/asn1/gsmmap/gsmmap.cnf b/asn1/gsmmap/gsmmap.cnf index de30fea4dc..3ed8a05781 100644 --- a/asn1/gsmmap/gsmmap.cnf +++ b/asn1/gsmmap/gsmmap.cnf @@ -126,13 +126,13 @@ OPERATION/localValue operationLocalvalue Component #.FN_BODY InvokeParameter - offset = dissect_invokeData(pinfo, tree, tvb, offset); + offset = dissect_invokeData(tree, tvb, offset, actx); #.FN_BODY ReturnResultParameter - offset = dissect_returnResultData(pinfo, tree, tvb, offset); + offset = dissect_returnResultData(tree, tvb, offset, actx); #.FN_BODY ReturnErrorParameter - offset = dissect_returnErrorData(pinfo, tree, tvb, offset); + offset = dissect_returnErrorData(tree, tvb, offset, actx); #.FN_PARS GSMMAPOperationLocalvalue @@ -141,8 +141,8 @@ Component #.FN_BODY GSMMAPOperationLocalvalue %(DEFAULT_BODY)s - if (check_col(pinfo->cinfo, COL_INFO)){ - col_append_fstr(pinfo->cinfo, COL_INFO, gsm_map_opr_code(opcode)); + if (check_col(actx->pinfo->cinfo, COL_INFO)){ + col_append_fstr(actx->pinfo->cinfo, COL_INFO, gsm_map_opr_code(opcode)); } #.FN_PARS GSMMAPLocalErrorcode @@ -165,7 +165,7 @@ Component if (!tpdu_tvb) return offset; - dissector_try_port(sms_dissector_table, 0, tpdu_tvb, pinfo, top_tree); + dissector_try_port(sms_dissector_table, 0, tpdu_tvb, actx->pinfo, top_tree); #.END #---------------------------------------------------------------------------------------- #.FN_PARS IMSI @@ -211,7 +211,7 @@ Component digit_str = unpack_digits(parameter_tvb, 1); proto_tree_add_string(tree, hf_gsm_map_servicecentreaddress_digits, parameter_tvb, 1, -1, digit_str); - pinfo->p2p_dir = P2P_DIR_SENT; + actx->pinfo->p2p_dir = P2P_DIR_SENT; #.END #---------------------------------------------------------------------------------------- @@ -251,7 +251,7 @@ Component if ((na == 1) && (np==1))/*International Number & E164*/ dissect_e164_cc(parameter_tvb, subtree, 1, TRUE); - pinfo->p2p_dir = P2P_DIR_RECV; + actx->pinfo->p2p_dir = P2P_DIR_RECV; #.END @@ -387,7 +387,7 @@ Component length = tvb_get_guint8(parameter_tvb,1); if ( octet == 0) {/* DISCRIMINATION TS 48 006 */ next_tvb = tvb_new_subset(parameter_tvb, 2, -1, -1); - dissect_bssmap(next_tvb, pinfo, tree); + dissect_bssmap(next_tvb, actx->pinfo, tree); } break; /* ets-300102-1 (~Q.931 ) */ @@ -432,12 +432,12 @@ Component if ( octet == 0) {/* DISCRIMINATION TS 48 006 */ /* gsm-BSSMAP? */ next_tvb = tvb_new_subset(parameter_tvb, 2, -1, -1); - dissect_bssmap(next_tvb, pinfo, tree); + dissect_bssmap(next_tvb, actx->pinfo, tree); } break; /* ts3G-25413 */ case 2: - call_dissector(ranap_handle, parameter_tvb, pinfo, tree); + call_dissector(ranap_handle, parameter_tvb, actx->pinfo, tree); break; default: break; @@ -521,9 +521,9 @@ Component proto_tree_add_text(tree, tvb, offset, -1, "Extension Data"); if (obj_id){ - offset=call_ber_oid_callback(obj_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(obj_id, tvb, offset, actx->pinfo, tree); }else{ - call_dissector(data_handle, tvb, pinfo, tree); + call_dissector(data_handle, tvb, actx->pinfo, tree); offset = tvb_length_remaining(tvb,offset); } @@ -594,7 +594,7 @@ Component if (!parameter_tvb) return offset; - dissect_gsm_map_ext_qos_subscribed(tvb, pinfo, tree); + dissect_gsm_map_ext_qos_subscribed(tvb, actx->pinfo, tree); #.FN_PARS GSN-Address @@ -688,7 +688,7 @@ Component if (!parameter_tvb) return offset; - asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); + asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, actx->pinfo); dissect_ranap_Service_Handover(parameter_tvb, 0, &asn1_ctx, tree, hf_gsm_map_ranap_service_Handover); #.FN_BODY IntegrityProtectionInformation VAL_PTR = ¶meter_tvb @@ -700,7 +700,7 @@ Component if (!parameter_tvb) return offset; - asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); + asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, actx->pinfo); dissect_ranap_IntegrityProtectionInformation(parameter_tvb, 0, &asn1_ctx, tree, hf_gsm_mapIntegrityProtectionInformation); #.FN_BODY EncryptionInformation VAL_PTR = ¶meter_tvb @@ -712,7 +712,7 @@ Component if (!parameter_tvb) return offset; - asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); + asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, actx->pinfo); dissect_ranap_EncryptionInformation(parameter_tvb, 0, &asn1_ctx, tree, hf_gsm_mapEncryptionInformation); #---------------------------------------------------------------------------------------- diff --git a/asn1/gsmmap/packet-gsm_map-template.c b/asn1/gsmmap/packet-gsm_map-template.c index 71dbccea96..133b8ab6dc 100644 --- a/asn1/gsmmap/packet-gsm_map-template.c +++ b/asn1/gsmmap/packet-gsm_map-template.c @@ -126,7 +126,7 @@ static int hf_geo_loc_included_angle = -1; static int hf_gsm_map_ranap_service_Handover = -1; static int hf_gsm_mapIntegrityProtectionInformation = -1; static int hf_gsm_mapEncryptionInformation = -1; - +static int hf_gsm_map_PlmnContainer_PDU = -1; #include "packet-gsm_map-hf.c" /* Initialize the subtree pointers */ @@ -170,9 +170,9 @@ const char *obj_id = NULL; static int gsm_map_tap = -1; /* Forward declarations */ -static int dissect_invokeData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset); -static int dissect_returnResultData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset); -static int dissect_returnErrorData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset); +static int dissect_invokeData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx); +static int dissect_returnResultData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx); +static int dissect_returnErrorData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx); const gchar* gsm_map_opr_code(guint32 val); /* Value strings */ @@ -786,7 +786,7 @@ const gchar* gsm_map_opr_code(guint32 val) { typedef int (* dissect_function_t)( gboolean, tvbuff_t *, int , - packet_info *, + asn1_ctx_t *, proto_tree *, int); @@ -810,7 +810,7 @@ typedef int (* dissect_function_t)( gboolean, */ static int dissect_mc_message(tvbuff_t *tvb, int offset, - packet_info *pinfo _U_, + asn1_ctx_t *actx, proto_tree *tree, gboolean implicit_param _U_, dissect_function_t parameter, int hf_index_param _U_, gboolean implicit_seq _U_, dissect_function_t sequence, int hf_index_seq _U_, @@ -831,133 +831,133 @@ static int dissect_mc_message(tvbuff_t *tvb, offset = get_ber_identifier(tvb, offset, &bug_class, &bug_pc, &bug_tag); offset = get_ber_length(tree, tvb, offset, &bug_len, &bug_ind_field); if (sequence3 != NULL) { - offset= (sequence3) (implicit_seq3, tvb, offset, pinfo, tree, hf_index_seq3); + offset= (sequence3) (implicit_seq3, tvb, offset, actx, tree, hf_index_seq3); } else { cause=proto_tree_add_text(tree, tvb, offset, -1, "Unknown or not implemented [3] sequence, cannot decode"); proto_item_set_expert_flags(cause, PI_UNDECODED, PI_ERROR); - expert_add_info_format(pinfo, cause, PI_UNDECODED, PI_ERROR, "Unknown or not implemented [3] sequence"); + expert_add_info_format(actx->pinfo, cause, PI_UNDECODED, PI_ERROR, "Unknown or not implemented [3] sequence"); } } else if (octet == 0x30) { if (sequence != NULL) { - offset= (sequence) (implicit_seq, tvb, offset, pinfo, tree, hf_index_seq); + offset= (sequence) (implicit_seq, tvb, offset, actx, tree, hf_index_seq); } else { cause=proto_tree_add_text(tree, tvb, offset, -1, "Unknown or not implemented sequence"); proto_item_set_expert_flags(cause, PI_UNDECODED, PI_ERROR); - expert_add_info_format(pinfo, cause, PI_UNDECODED, PI_ERROR, "Unknown or not implemented sequence"); + expert_add_info_format(actx->pinfo, cause, PI_UNDECODED, PI_ERROR, "Unknown or not implemented sequence"); } } else { if (parameter != NULL) { - offset= (parameter) (implicit_param, tvb, offset, pinfo, tree, hf_index_param); + offset= (parameter) (implicit_param, tvb, offset, actx, tree, hf_index_param); } else { cause=proto_tree_add_text(tree, tvb, offset, -1, "Unknown or not implemented parameter"); proto_item_set_expert_flags(cause, PI_UNDECODED, PI_ERROR); - expert_add_info_format(pinfo, cause, PI_UNDECODED, PI_ERROR, "Unknown or not implemented parameter"); + expert_add_info_format(actx->pinfo, cause, PI_UNDECODED, PI_ERROR, "Unknown or not implemented parameter"); } } return offset; } -static int dissect_invokeData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { +static int dissect_invokeData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx) { proto_item *cause; switch(opcode){ case 2: /*updateLocation*/ - offset=dissect_gsm_map_UpdateLocationArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_UpdateLocationArg(FALSE, tvb, offset, actx, tree, -1); break; case 3: /*cancelLocation*/ - offset=dissect_mc_message(tvb, offset, pinfo, tree, + offset=dissect_mc_message(tvb, offset, actx, tree, FALSE, dissect_gsm_map_Identity, hf_gsm_map_identity, FALSE, dissect_gsm_map_CancelLocationArgV2, -1,/*undefined*/ TRUE , dissect_gsm_map_CancelLocationArg, -1); break; case 4: /*provideRoamingNumber*/ - offset=dissect_gsm_map_ProvideRoamingNumberArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_ProvideRoamingNumberArg(FALSE, tvb, offset, actx, tree, -1); break; case 5: /*noteSubscriberDataModified*/ - offset=dissect_gsm_map_NoteSubscriberDataModifiedArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_NoteSubscriberDataModifiedArg(FALSE, tvb, offset, actx, tree, -1); break; case 6: /*resumeCallHandling*/ - offset=dissect_gsm_map_ResumeCallHandlingArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_ResumeCallHandlingArg(FALSE, tvb, offset, actx, tree, -1); break; case 7: /*insertSubscriberData*/ - offset=dissect_gsm_map_InsertSubscriberDataArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_InsertSubscriberDataArg(FALSE, tvb, offset, actx, tree, -1); break; case 8: /*deleteSubscriberData*/ - offset=dissect_gsm_map_DeleteSubscriberDataArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_DeleteSubscriberDataArg(FALSE, tvb, offset, actx, tree, -1); break; /* TODO find out why this isn't in the ASN1 file */ /* reserved sendParameters (9) */ case 10: /*registerSS*/ - offset=dissect_gsm_map_RegisterSS_Arg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_RegisterSS_Arg(FALSE, tvb, offset, actx, tree, -1); break; case 11: /*eraseSS*/ - offset=dissect_gsm_map_SS_ForBS_Code(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SS_ForBS_Code(FALSE, tvb, offset, actx, tree, -1); break; case 12: /*activateSS*/ - offset=dissect_gsm_map_SS_ForBS_Code(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SS_ForBS_Code(FALSE, tvb, offset, actx, tree, -1); break; case 13: /*deactivateSS*/ - offset=dissect_gsm_map_SS_ForBS_Code(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SS_ForBS_Code(FALSE, tvb, offset, actx, tree, -1); break; case 14: /*interrogateSS*/ - offset=dissect_gsm_map_SS_ForBS_Code(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SS_ForBS_Code(FALSE, tvb, offset, actx, tree, -1); break; case 15: /*authenticationFailureReport*/ - offset=dissect_gsm_map_AuthenticationFailureReportArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_AuthenticationFailureReportArg(FALSE, tvb, offset, actx, tree, -1); break; /* undefined 16 */ case 17: /*registerPassword*/ - offset=dissect_gsm_map_SS_Code(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_ss_Code); + offset=dissect_gsm_map_SS_Code(FALSE, tvb, offset, actx, tree, hf_gsm_map_ss_Code); break; case 18: /*getPassword*/ - offset=dissect_gsm_map_GetPasswordArg(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_getPassword); + offset=dissect_gsm_map_GetPasswordArg(FALSE, tvb, offset, actx, tree, hf_gsm_map_getPassword); break; /* reserved processUnstructuredSS-Data (19) */ case 20: /*releaseResources*/ - offset=dissect_gsm_map_ReleaseResourcesArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_ReleaseResourcesArg(FALSE, tvb, offset, actx, tree, -1); break; case 21: /*mt-ForwardSM-VGCS*/ - offset=dissect_gsm_map_Mt_ForwardSM_VGCS_Arg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_Mt_ForwardSM_VGCS_Arg(FALSE, tvb, offset, actx, tree, -1); break; case 22: /*sendRoutingInfo*/ - offset=dissect_gsm_map_SendRoutingInfoArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SendRoutingInfoArg(FALSE, tvb, offset, actx, tree, -1); break; case 23: /*updateGprsLocation*/ - offset=dissect_gsm_map_UpdateGprsLocationArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_UpdateGprsLocationArg(FALSE, tvb, offset, actx, tree, -1); break; case 24: /*sendRoutingInfoForGprs*/ - offset=dissect_gsm_map_SendRoutingInfoForGprsArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SendRoutingInfoForGprsArg(FALSE, tvb, offset, actx, tree, -1); break; case 25: /*failureReport*/ - offset=dissect_gsm_map_FailureReportArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_FailureReportArg(FALSE, tvb, offset, actx, tree, -1); break; case 26: /*noteMsPresentForGprs*/ - offset=dissect_gsm_map_NoteMsPresentForGprsArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_NoteMsPresentForGprsArg(FALSE, tvb, offset, actx, tree, -1); break; /* undefined 27 */ /* reserved performHandover (28) */ case 29: /*sendEndSignal*/ - offset=dissect_mc_message(tvb, offset, pinfo, tree, + offset=dissect_mc_message(tvb, offset, actx, tree, FALSE, NULL, -1, FALSE, dissect_gsm_map_Bss_APDU, -1, TRUE , dissect_gsm_map_SendEndSignalArgV3, -1); break; /* reserved performSubsequentHandover (30) */ case 31: /*provideSIWFSNumber*/ - offset=dissect_gsm_map_ProvideSIWFSNumberArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_ProvideSIWFSNumberArg(FALSE, tvb, offset, actx, tree, -1); break; case 32: /*sIWFSSignallingModify*/ - offset=dissect_gsm_map_SIWFSSignallingModifyArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SIWFSSignallingModifyArg(FALSE, tvb, offset, actx, tree, -1); break; case 33: /*processAccessSignalling*/ - offset=dissect_mc_message(tvb, offset, pinfo, tree, + offset=dissect_mc_message(tvb, offset, actx, tree, FALSE, NULL, -1, FALSE, dissect_gsm_map_Bss_APDU, -1, TRUE , dissect_gsm_map_ProcessAccessSignallingArgV3, -1); break; case 34: /*forwardAccessSignalling*/ - offset=dissect_mc_message(tvb, offset, pinfo, tree, + offset=dissect_mc_message(tvb, offset, actx, tree, FALSE, NULL, -1, FALSE, dissect_gsm_map_Bss_APDU, -1, TRUE , dissect_gsm_map_ForwardAccessSignallingArgV3, -1); @@ -965,580 +965,580 @@ static int dissect_invokeData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tv /* reserved noteInternalHandover (35) */ /* undefined 36 */ case 37: /*reset*/ - offset=dissect_gsm_map_ResetArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_ResetArg(FALSE, tvb, offset, actx, tree, -1); break; case 38: /*forwardCheckSS-Indication*/ return offset; break; case 39: /*prepareGroupCall*/ - offset=dissect_gsm_map_PrepareGroupCallArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_PrepareGroupCallArg(FALSE, tvb, offset, actx, tree, -1); break; case 40: /*sendGroupCallEndSignal*/ - dissect_gsm_map_SendGroupCallEndSignalArg(FALSE, tvb, offset, pinfo, tree, -1); + dissect_gsm_map_SendGroupCallEndSignalArg(FALSE, tvb, offset, actx, tree, -1); break; case 41: /*processGroupCallSignalling*/ - dissect_gsm_map_ProcessGroupCallSignallingArg(FALSE, tvb, offset, pinfo, tree, -1); + dissect_gsm_map_ProcessGroupCallSignallingArg(FALSE, tvb, offset, actx, tree, -1); break; case 42: /*forwardGroupCallSignalling*/ - offset=dissect_gsm_map_ForwardGroupCallSignallingArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_ForwardGroupCallSignallingArg(FALSE, tvb, offset, actx, tree, -1); break; case 43: /*checkIMEI*/ - offset=dissect_mc_message(tvb, offset, pinfo, tree, + offset=dissect_mc_message(tvb, offset, actx, tree, FALSE, dissect_gsm_map_IMEI, hf_gsm_map_imei, FALSE, dissect_gsm_map_CheckIMEIArgV3, -1, TRUE , NULL, -1); /* no [3] SEQUENCE */ break; case 44: /*mt-forwardSM(v3) or ForwardSM(v1/v2)*/ if (application_context_version == 3) - offset=dissect_gsm_map_Mt_forwardSM_Arg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_Mt_forwardSM_Arg(FALSE, tvb, offset, actx, tree, -1); else { - offset=dissect_gsm_map_ForwardSM_Arg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_ForwardSM_Arg(FALSE, tvb, offset, actx, tree, -1); } break; case 45: /*sendRoutingInfoForSM*/ - offset=dissect_gsm_map_RoutingInfoForSMArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_RoutingInfoForSMArg(FALSE, tvb, offset, actx, tree, -1); break; case 46: /*mo-forwardSM(v3) or ForwardSM(v1/v2)*/ if (application_context_version == 3) - offset=dissect_gsm_map_Mo_forwardSM_Arg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_Mo_forwardSM_Arg(FALSE, tvb, offset, actx, tree, -1); else { - offset=dissect_gsm_map_ForwardSM_Arg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_ForwardSM_Arg(FALSE, tvb, offset, actx, tree, -1); } break; case 47: /*reportSM-DeliveryStatus*/ - offset=dissect_gsm_map_ReportSM_DeliveryStatusArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_ReportSM_DeliveryStatusArg(FALSE, tvb, offset, actx, tree, -1); break; /* reserved noteSubscriberPresent (48) */ /* reserved alertServiceCentreWithoutResult (49) */ case 50: /*activateTraceMode*/ - offset=dissect_gsm_map_ActivateTraceModeArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_ActivateTraceModeArg(FALSE, tvb, offset, actx, tree, -1); break; case 51: /*deactivateTraceMode*/ - offset=dissect_gsm_map_DeactivateTraceModeArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_DeactivateTraceModeArg(FALSE, tvb, offset, actx, tree, -1); break; /* reserved traceSubscriberActivity (52) */ /* undefined 53 */ /* reserved beginSubscriberActivity (54) */ case 55: /*sendIdentification*/ - offset=dissect_mc_message(tvb, offset, pinfo, tree, + offset=dissect_mc_message(tvb, offset, actx, tree, FALSE, dissect_gsm_map_TMSI, hf_gsm_map_tmsi, FALSE, dissect_gsm_map_SendIdentificationArg, -1, TRUE, NULL, -1); break; case 56: /*sendAuthenticationInfo*/ - offset=dissect_mc_message(tvb, offset, pinfo, tree, + offset=dissect_mc_message(tvb, offset, actx, tree, FALSE, dissect_gsm_map_IMSI, hf_gsm_map_imsi, FALSE, dissect_gsm_map_SendAuthenticationInfoArgV2, -1, TRUE, NULL, -1); break; case 57: /*restoreData*/ - offset=dissect_gsm_map_RestoreDataArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_RestoreDataArg(FALSE, tvb, offset, actx, tree, -1); break; case 58: /*sendIMSI*/ - offset = dissect_gsm_map_ISDN_AddressString(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_msisdn); + offset = dissect_gsm_map_ISDN_AddressString(FALSE, tvb, offset, actx, tree, hf_gsm_map_msisdn); break; case 59: /*processUnstructuredSS-Request*/ - offset=dissect_gsm_map_Ussd_Arg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_Ussd_Arg(FALSE, tvb, offset, actx, tree, -1); break; case 60: /*unstructuredSS-Request*/ - offset=dissect_gsm_map_Ussd_Arg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_Ussd_Arg(FALSE, tvb, offset, actx, tree, -1); break; case 61: /*unstructuredSS-Notify*/ - offset=dissect_gsm_map_Ussd_Arg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_Ussd_Arg(FALSE, tvb, offset, actx, tree, -1); break; case 62: /*AnyTimeSubscriptionInterrogation*/ - offset=dissect_gsm_map_AnyTimeSubscriptionInterrogationArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_AnyTimeSubscriptionInterrogationArg(FALSE, tvb, offset, actx, tree, -1); break; case 63: /*informServiceCentre*/ - offset=dissect_gsm_map_InformServiceCentreArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_InformServiceCentreArg(FALSE, tvb, offset, actx, tree, -1); break; case 64: /*alertServiceCentre*/ - offset=dissect_gsm_map_AlertServiceCentreArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_AlertServiceCentreArg(FALSE, tvb, offset, actx, tree, -1); break; case 65: /*AnyTimeModification*/ - offset=dissect_gsm_map_AnyTimeModificationArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_AnyTimeModificationArg(FALSE, tvb, offset, actx, tree, -1); break; case 66: /*readyForSM*/ - offset=dissect_gsm_map_ReadyForSM_Arg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_ReadyForSM_Arg(FALSE, tvb, offset, actx, tree, -1); break; case 67: /*purgeMS*/ - offset=dissect_mc_message(tvb, offset, pinfo, tree, + offset=dissect_mc_message(tvb, offset, actx, tree, FALSE, dissect_gsm_map_IMSI, hf_gsm_map_imsi, FALSE, dissect_gsm_map_PurgeMSArgV2, -1, /*undefined*/ TRUE , dissect_gsm_map_PurgeMSArg, -1); break; case 68: /*prepareHandover*/ - offset=dissect_mc_message(tvb, offset, pinfo, tree, + offset=dissect_mc_message(tvb, offset, actx, tree, FALSE, NULL, -1, FALSE, dissect_gsm_map_PrepareHO_Arg, -1, TRUE, dissect_gsm_map_PrepareHO_ArgV3, -1); break; case 69: /*prepareSubsequentHandover*/ - offset=dissect_mc_message(tvb, offset, pinfo, tree, + offset=dissect_mc_message(tvb, offset, actx, tree, FALSE, NULL, -1, FALSE, NULL, -1, TRUE, dissect_gsm_map_PrepareSubsequentHOArg, -1); break; case 70: /*provideSubscriberInfo*/ - offset=dissect_gsm_map_ProvideSubscriberInfoArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_ProvideSubscriberInfoArg(FALSE, tvb, offset, actx, tree, -1); break; case 71: /*anyTimeInterrogation*/ - offset=dissect_gsm_map_AnyTimeInterrogationArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_AnyTimeInterrogationArg(FALSE, tvb, offset, actx, tree, -1); break; case 72: /*ss-InvocationNotificatio*/ - offset=dissect_gsm_map_Ss_InvocationNotificationArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_Ss_InvocationNotificationArg(FALSE, tvb, offset, actx, tree, -1); break; case 73: /*setReportingState*/ - offset=dissect_gsm_map_SetReportingStateArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SetReportingStateArg(FALSE, tvb, offset, actx, tree, -1); break; case 74: /*statusReport*/ - offset=dissect_gsm_map_StatusReportArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_StatusReportArg(FALSE, tvb, offset, actx, tree, -1); break; case 75: /*remoteUserFree*/ - offset=dissect_gsm_map_RemoteUserFreeArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_RemoteUserFreeArg(FALSE, tvb, offset, actx, tree, -1); break; case 76: /*registerCC-Entry*/ - offset=dissect_gsm_map_RegisterCC_EntryArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_RegisterCC_EntryArg(FALSE, tvb, offset, actx, tree, -1); break; case 77: /*eraseCC-Entry*/ - offset=dissect_gsm_map_EraseCC_EntryArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_EraseCC_EntryArg(FALSE, tvb, offset, actx, tree, -1); break; case 78: /*secureTransportClass1*/ case 79: /*secureTransportClass1*/ case 80: /*secureTransportClass1*/ case 81: /*secureTransportClass1*/ - offset=dissect_gsm_map_SecureTransportArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SecureTransportArg(FALSE, tvb, offset, actx, tree, -1); break; /* undefined 82 */ case 83: /*provideSubscriberLocation*/ - offset=dissect_gsm_map_ProvideSubscriberLocation_Arg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_ProvideSubscriberLocation_Arg(FALSE, tvb, offset, actx, tree, -1); break; case 84: /*sendGroupCallInfo*/ - offset=dissect_gsm_map_SendGroupCallInfoArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SendGroupCallInfoArg(FALSE, tvb, offset, actx, tree, -1); break; case 85: /*sendRoutingInfoForLCS*/ - offset=dissect_gsm_map_RoutingInfoForLCS_Arg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_RoutingInfoForLCS_Arg(FALSE, tvb, offset, actx, tree, -1); break; case 86: /*subscriberLocationReport*/ - offset=dissect_gsm_map_SubscriberLocationReport_Arg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SubscriberLocationReport_Arg(FALSE, tvb, offset, actx, tree, -1); break; case 87: /*ist-Alert*/ - offset=dissect_gsm_map_IST_AlertArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_IST_AlertArg(FALSE, tvb, offset, actx, tree, -1); break; case 88: /*ist-Command*/ - offset=dissect_gsm_map_IST_CommandArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_IST_CommandArg(FALSE, tvb, offset, actx, tree, -1); break; case 89: /*noteMM-Event*/ - offset=dissect_gsm_map_NoteMM_EventArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_NoteMM_EventArg(FALSE, tvb, offset, actx, tree, -1); break; default: cause=proto_tree_add_text(tree, tvb, offset, -1, "Unknown invokeData blob"); proto_item_set_expert_flags(cause, PI_MALFORMED, PI_WARN); - expert_add_info_format(pinfo, cause, PI_MALFORMED, PI_WARN, "Unknown invokeData %d",opcode); + expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "Unknown invokeData %d",opcode); } return offset; } -static int dissect_returnResultData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { +static int dissect_returnResultData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx) { proto_item *cause; switch(opcode){ case 2: /*updateLocation*/ - offset=dissect_mc_message(tvb, offset, pinfo, tree, + offset=dissect_mc_message(tvb, offset, actx, tree, FALSE, dissect_gsm_map_IMSI, hf_gsm_map_imsi, FALSE, dissect_gsm_map_UpdateLocationRes, -1, TRUE , NULL, -1); break; case 3: /*cancelLocation*/ - offset=dissect_gsm_map_CancelLocationRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_CancelLocationRes(FALSE, tvb, offset, actx, tree, -1); break; case 4: /*provideRoamingNumber*/ - offset=dissect_gsm_map_ProvideRoamingNumberRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_ProvideRoamingNumberRes(FALSE, tvb, offset, actx, tree, -1); break; case 5: /*noteSubscriberDataModified*/ - offset=dissect_gsm_map_NoteSubscriberDataModifiedRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_NoteSubscriberDataModifiedRes(FALSE, tvb, offset, actx, tree, -1); break; case 6: /*resumeCallHandling*/ - offset=dissect_gsm_map_ResumeCallHandlingRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_ResumeCallHandlingRes(FALSE, tvb, offset, actx, tree, -1); break; case 7: /*insertSubscriberData*/ - offset=dissect_gsm_map_InsertSubscriberDataRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_InsertSubscriberDataRes(FALSE, tvb, offset, actx, tree, -1); break; case 8: /*deleteSubscriberData*/ - offset=dissect_gsm_map_DeleteSubscriberDataRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_DeleteSubscriberDataRes(FALSE, tvb, offset, actx, tree, -1); break; /* TODO find out why this isn't in the ASN1 file case 9: sendParameters - offset=dissect_gsm_map_DeleteSubscriberDataArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_DeleteSubscriberDataArg(FALSE, tvb, offset, actx, tree, -1); break; */ case 10: /*registerSS*/ - offset=dissect_gsm_map_SS_Info(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SS_Info(FALSE, tvb, offset, actx, tree, -1); break; case 11: /*eraseSS*/ - offset=dissect_gsm_map_SS_Info(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SS_Info(FALSE, tvb, offset, actx, tree, -1); break; case 12: /*activateSS*/ - offset=dissect_gsm_map_SS_Info(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SS_Info(FALSE, tvb, offset, actx, tree, -1); break; case 13: /*deactivateSS*/ - offset=dissect_gsm_map_SS_Info(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SS_Info(FALSE, tvb, offset, actx, tree, -1); break; case 14: /*interrogateSS*/ - offset=dissect_gsm_map_InterrogateSS_Res(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_InterrogateSS_Res(FALSE, tvb, offset, actx, tree, -1); break; case 15: /*authenticationFailureReport*/ - offset=dissect_gsm_map_AuthenticationFailureReportRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_AuthenticationFailureReportRes(FALSE, tvb, offset, actx, tree, -1); break; case 17: /*registerPassword*/ /* change hf_gsm_map_ss_Code to something with password */ - offset=dissect_gsm_map_NewPassword(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_ss_Code); + offset=dissect_gsm_map_NewPassword(FALSE, tvb, offset, actx, tree, hf_gsm_map_ss_Code); break; case 18: /*getPassword*/ - offset=dissect_gsm_map_CurrentPassword(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_currentPassword); + offset=dissect_gsm_map_CurrentPassword(FALSE, tvb, offset, actx, tree, hf_gsm_map_currentPassword); break; case 20: /*releaseResources*/ - offset=dissect_gsm_map_ReleaseResourcesRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_ReleaseResourcesRes(FALSE, tvb, offset, actx, tree, -1); break; case 21: /*mt-ForwardSM-VGCS*/ - offset=dissect_gsm_map_Mt_ForwardSM_VGCS_Res(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_Mt_ForwardSM_VGCS_Res(FALSE, tvb, offset, actx, tree, -1); break; case 22: /*sendRoutingInfo*/ - offset=dissect_mc_message(tvb, offset, pinfo, tree, + offset=dissect_mc_message(tvb, offset, actx, tree, FALSE, dissect_gsm_map_IMSI, hf_gsm_map_imsi, FALSE, NULL, -1, TRUE , dissect_gsm_map_SendRoutingInfoRes, -1); break; case 23: /*updateGprsLocation*/ - offset=dissect_gsm_map_UpdateGprsLocationRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_UpdateGprsLocationRes(FALSE, tvb, offset, actx, tree, -1); break; case 24: /*sendRoutingInfoForGprs*/ - offset=dissect_gsm_map_SendRoutingInfoForGprsRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SendRoutingInfoForGprsRes(FALSE, tvb, offset, actx, tree, -1); break; case 25: /*failureReport*/ - offset=dissect_gsm_map_FailureReportRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_FailureReportRes(FALSE, tvb, offset, actx, tree, -1); break; case 26: /*noteMsPresentForGprs*/ - offset=dissect_gsm_map_NoteMsPresentForGprsRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_NoteMsPresentForGprsRes(FALSE, tvb, offset, actx, tree, -1); break; case 29: /*sendEndSignal*/ /* Taken from MAP-MobileServiceOperations{ 0 identified-organization (4) etsi (0) mobileDomain * (0) gsm-Network (1) modules (3) map-MobileServiceOperations (5) version9 (9) } */ - offset=dissect_gsm_map_SendEndSignalRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SendEndSignalRes(FALSE, tvb, offset, actx, tree, -1); break; case 31: /*provideSIWFSNumber*/ - offset=dissect_gsm_map_ProvideSIWFSNumberRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_ProvideSIWFSNumberRes(FALSE, tvb, offset, actx, tree, -1); break; case 32: /*provideSIWFSSignallingModify*/ - offset=dissect_gsm_map_SIWFSSignallingModifyRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SIWFSSignallingModifyRes(FALSE, tvb, offset, actx, tree, -1); break; case 39: /*prepareGroupCall*/ - offset=dissect_gsm_map_PrepareGroupCallRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_PrepareGroupCallRes(FALSE, tvb, offset, actx, tree, -1); break; case 40: /*sendGroupCallEndSignal*/ - dissect_gsm_map_SendGroupCallEndSignalRes(FALSE, tvb, offset, pinfo, tree, -1); + dissect_gsm_map_SendGroupCallEndSignalRes(FALSE, tvb, offset, actx, tree, -1); break; case 43: /*checkIMEI*/ - offset=dissect_mc_message(tvb, offset, pinfo, tree, + offset=dissect_mc_message(tvb, offset, actx, tree, FALSE, dissect_gsm_map_EquipmentStatus, hf_gsm_map_equipmentStatus, FALSE, dissect_gsm_map_CheckIMEIRes, -1, TRUE, NULL, -1); break; case 44: /*mt-forwardSM*/ - offset=dissect_gsm_map_Mt_forwardSM_Res(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_Mt_forwardSM_Res(FALSE, tvb, offset, actx, tree, -1); break; case 45: /*sendRoutingInfoForSM*/ - offset=dissect_gsm_map_RoutingInfoForSM_Res(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_RoutingInfoForSM_Res(FALSE, tvb, offset, actx, tree, -1); break; case 46: /*mo-forwardSM*/ - offset=dissect_gsm_map_Mo_forwardSM_Res(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_Mo_forwardSM_Res(FALSE, tvb, offset, actx, tree, -1); break; case 47: /*reportSM-DeliveryStatus*/ - offset=dissect_gsm_map_ReportSM_DeliveryStatusRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_ReportSM_DeliveryStatusRes(FALSE, tvb, offset, actx, tree, -1); break; case 48: /*reportSM-DeliveryStatus*/ - offset=dissect_gsm_map_ReportSM_DeliveryStatusRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_ReportSM_DeliveryStatusRes(FALSE, tvb, offset, actx, tree, -1); break; case 50: /*activateTraceMode*/ - offset=dissect_gsm_map_ActivateTraceModeRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_ActivateTraceModeRes(FALSE, tvb, offset, actx, tree, -1); break; case 51: /*deactivateTraceMode*/ - offset=dissect_gsm_map_DeactivateTraceModeRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_DeactivateTraceModeRes(FALSE, tvb, offset, actx, tree, -1); break; case 55: /*sendIdentification */ - offset=dissect_mc_message(tvb, offset, pinfo, tree, + offset=dissect_mc_message(tvb, offset, actx, tree, FALSE, dissect_gsm_map_IMSI, hf_gsm_map_imsi, FALSE, dissect_gsm_map_SendIdentificationResV2, -1,/*undefined*/ TRUE, dissect_gsm_map_SendIdentificationRes, -1); break; case 56: /*sendAuthenticationInfo*/ - offset=dissect_mc_message(tvb, offset, pinfo, tree, + offset=dissect_mc_message(tvb, offset, actx, tree, FALSE, NULL, -1, FALSE, dissect_gsm_map_SendAuthenticationInfoRes, -1, TRUE , dissect_gsm_map_SendAuthenticationInfoResV3, -1); break; case 57: /*restoreData*/ - offset=dissect_gsm_map_RestoreDataRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_RestoreDataRes(FALSE, tvb, offset, actx, tree, -1); break; case 58: /*sendIMSI*/ - offset=dissect_gsm_map_IMSI(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_imsi); + offset=dissect_gsm_map_IMSI(FALSE, tvb, offset, actx, tree, hf_gsm_map_imsi); break; case 59: /*unstructuredSS-Request*/ - offset=dissect_gsm_map_Ussd_Res(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_Ussd_Res(FALSE, tvb, offset, actx, tree, -1); break; case 60: /*unstructuredSS-Request*/ - offset=dissect_gsm_map_Ussd_Res(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_Ussd_Res(FALSE, tvb, offset, actx, tree, -1); break; case 61: /*unstructuredSS-Notify*/ /* TRUE ? */ proto_tree_add_text(tree, tvb, offset, -1, "Unknown returnResultData blob"); break; case 62: /*AnyTimeSubscriptionInterrogation*/ - offset=dissect_gsm_map_AnyTimeSubscriptionInterrogationRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_AnyTimeSubscriptionInterrogationRes(FALSE, tvb, offset, actx, tree, -1); break; case 64: /*alertServiceCentre*/ /* TRUE */ break; case 65: /*AnyTimeModification*/ - offset=dissect_gsm_map_AnyTimeModificationRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_AnyTimeModificationRes(FALSE, tvb, offset, actx, tree, -1); break; case 66: /*readyForSM*/ - offset=dissect_gsm_map_ReadyForSM_Res(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_ReadyForSM_Res(FALSE, tvb, offset, actx, tree, -1); break; case 67: /*purgeMS*/ - offset=dissect_gsm_map_PurgeMSRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_PurgeMSRes(FALSE, tvb, offset, actx, tree, -1); break; case 68: /*prepareHandover*/ - offset=dissect_mc_message(tvb, offset, pinfo, tree, + offset=dissect_mc_message(tvb, offset, actx, tree, FALSE, NULL, -1, FALSE, dissect_gsm_map_PrepareHO_Res, -1, TRUE , dissect_gsm_map_PrepareHO_ResV3, -1); break; case 69: /*prepareSubsequentHandover*/ - offset=dissect_mc_message(tvb, offset, pinfo, tree, + offset=dissect_mc_message(tvb, offset, actx, tree, FALSE, NULL, -1, FALSE, NULL, -1, TRUE , dissect_gsm_map_PrepareSubsequentHOResV3, -1); break; case 70: /*provideSubscriberInfo*/ - offset=dissect_gsm_map_ProvideSubscriberInfoRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_ProvideSubscriberInfoRes(FALSE, tvb, offset, actx, tree, -1); break; case 71: /*anyTimeInterrogation*/ - offset=dissect_gsm_map_AnyTimeInterrogationRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_AnyTimeInterrogationRes(FALSE, tvb, offset, actx, tree, -1); break; case 72: /*ss-InvocationNotificatio*/ - offset=dissect_gsm_map_Ss_InvocationNotificationRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_Ss_InvocationNotificationRes(FALSE, tvb, offset, actx, tree, -1); break; case 73: /*setReportingState*/ - offset=dissect_gsm_map_SetReportingStateRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SetReportingStateRes(FALSE, tvb, offset, actx, tree, -1); break; case 74: /*statusReport*/ - offset=dissect_gsm_map_StatusReportRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_StatusReportRes(FALSE, tvb, offset, actx, tree, -1); break; case 75: /*remoteUserFree*/ - offset=dissect_gsm_map_RemoteUserFreeRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_RemoteUserFreeRes(FALSE, tvb, offset, actx, tree, -1); break; case 76: /*registerCC-Entry*/ - offset=dissect_gsm_map_RegisterCC_EntryRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_RegisterCC_EntryRes(FALSE, tvb, offset, actx, tree, -1); break; case 77: /*eraseCC-Entry*/ - offset=dissect_gsm_map_EraseCC_EntryRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_EraseCC_EntryRes(FALSE, tvb, offset, actx, tree, -1); break; case 78: /*secureTransportClass1*/ case 79: /*secureTransportClass2*/ case 80: /*secureTransportClass3*/ case 81: /*secureTransportClass4*/ - offset=dissect_gsm_map_SecureTransportRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SecureTransportRes(FALSE, tvb, offset, actx, tree, -1); break; case 83: /*provideSubscriberLocation*/ - offset=dissect_gsm_map_ProvideSubscriberLocation_Res(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_ProvideSubscriberLocation_Res(FALSE, tvb, offset, actx, tree, -1); break; case 84: /*sendGroupCallInfo*/ - offset=dissect_gsm_map_SendGroupCallInfoRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SendGroupCallInfoRes(FALSE, tvb, offset, actx, tree, -1); break; case 85: /*sendRoutingInfoForLCS*/ - offset=dissect_gsm_map_RoutingInfoForLCS_Res(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_RoutingInfoForLCS_Res(FALSE, tvb, offset, actx, tree, -1); break; case 86: /*subscriberLocationReport*/ - offset=dissect_gsm_map_SubscriberLocationReport_Res(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SubscriberLocationReport_Res(FALSE, tvb, offset, actx, tree, -1); break; case 87: /*ist-Alert*/ - offset=dissect_gsm_map_IST_AlertRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_IST_AlertRes(FALSE, tvb, offset, actx, tree, -1); break; case 88: /*ist-Command*/ - offset=dissect_gsm_map_IST_CommandRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_IST_CommandRes(FALSE, tvb, offset, actx, tree, -1); break; case 89: /*noteMM-Event*/ - offset=dissect_gsm_map_NoteMM_EventRes(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_NoteMM_EventRes(FALSE, tvb, offset, actx, tree, -1); break; default: cause=proto_tree_add_text(tree, tvb, offset, -1, "Unknown returnResultData blob"); proto_item_set_expert_flags(cause, PI_MALFORMED, PI_WARN); - expert_add_info_format(pinfo, cause, PI_MALFORMED, PI_WARN, "Unknown invokeData %d",opcode); + expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "Unknown invokeData %d",opcode); } return offset; } -static int dissect_returnErrorData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { +static int dissect_returnErrorData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx) { proto_item *cause; switch(errorCode){ case 1: /* UnknownSubscriberParam */ - offset=dissect_gsm_map_UnknownSubscriberParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_UnknownSubscriberParam(FALSE, tvb, offset, actx, tree, -1); break; case 4: /* SecureTransportErrorParam */ - offset=dissect_gsm_map_SecureTransportErrorParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SecureTransportErrorParam(FALSE, tvb, offset, actx, tree, -1); break; case 5: /* UnidentifiedSubParam */ - offset=dissect_gsm_map_UnidentifiedSubParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_UnidentifiedSubParam(FALSE, tvb, offset, actx, tree, -1); break; case 6: /* AbsentSubscriberSM-Param */ - offset=dissect_gsm_map_AbsentSubscriberSM_Param(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_AbsentSubscriberSM_Param(FALSE, tvb, offset, actx, tree, -1); break; case 8: /* RoamingNotAllowedParam */ - offset=dissect_gsm_map_RoamingNotAllowedParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_RoamingNotAllowedParam(FALSE, tvb, offset, actx, tree, -1); break; case 9: /* IllegalSubscriberParam */ - offset=dissect_gsm_map_IllegalSubscriberParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_IllegalSubscriberParam(FALSE, tvb, offset, actx, tree, -1); break; case 10: /* BearerServNotProvParam */ - offset=dissect_gsm_map_BearerServNotProvParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_BearerServNotProvParam(FALSE, tvb, offset, actx, tree, -1); break; case 11: /* TeleservNotProvParam */ - offset=dissect_gsm_map_TeleservNotProvParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_TeleservNotProvParam(FALSE, tvb, offset, actx, tree, -1); break; case 12: /* IllegalEquipmentParam */ - offset=dissect_gsm_map_IllegalEquipmentParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_IllegalEquipmentParam(FALSE, tvb, offset, actx, tree, -1); break; case 13: /* CallBarredParam */ - offset=dissect_gsm_map_CallBarredParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_CallBarredParam(FALSE, tvb, offset, actx, tree, -1); break; case 14: /* ForwardingViolationParam */ - offset=dissect_gsm_map_ForwardingViolationParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_ForwardingViolationParam(FALSE, tvb, offset, actx, tree, -1); break; case 15: /* CUG-RejectParam */ - offset=dissect_gsm_map_CUG_RejectParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_CUG_RejectParam(FALSE, tvb, offset, actx, tree, -1); break; case 16: /* IllegalSS-OperationParam */ - offset=dissect_gsm_map_IllegalSS_OperationParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_IllegalSS_OperationParam(FALSE, tvb, offset, actx, tree, -1); break; case 17: /* SS-ErrorStatus */ - offset=dissect_gsm_map_SS_Status(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SS_Status(FALSE, tvb, offset, actx, tree, -1); break; case 18: /* SS-NotAvailableParam */ - offset=dissect_gsm_map_SS_NotAvailableParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SS_NotAvailableParam(FALSE, tvb, offset, actx, tree, -1); break; case 19: /* SS-SubscriptionViolationParam */ - offset=dissect_gsm_map_SS_SubscriptionViolationParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SS_SubscriptionViolationParam(FALSE, tvb, offset, actx, tree, -1); break; case 20: /* SS-IncompatibilityCause */ - offset=dissect_gsm_map_SS_IncompatibilityCause(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SS_IncompatibilityCause(FALSE, tvb, offset, actx, tree, -1); break; case 21: /* FacilityNotSupParam */ - offset=dissect_gsm_map_FacilityNotSupParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_FacilityNotSupParam(FALSE, tvb, offset, actx, tree, -1); break; case 22: /* OngoingGroupCallParam */ - offset=dissect_gsm_map_OngoingGroupCallParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_OngoingGroupCallParam(FALSE, tvb, offset, actx, tree, -1); break; case 27: /* AbsentSubscriberParam */ - offset=dissect_gsm_map_AbsentSubscriberParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_AbsentSubscriberParam(FALSE, tvb, offset, actx, tree, -1); break; case 28: /* IncompatibleTerminalParam */ - offset=dissect_gsm_map_IncompatibleTerminalParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_IncompatibleTerminalParam(FALSE, tvb, offset, actx, tree, -1); break; case 29: /* ShortTermDenialParam */ - offset=dissect_gsm_map_ShortTermDenialParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_ShortTermDenialParam(FALSE, tvb, offset, actx, tree, -1); break; case 30: /* LongTermDenialParam */ - offset=dissect_gsm_map_LongTermDenialParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_LongTermDenialParam(FALSE, tvb, offset, actx, tree, -1); break; case 31: /* SubBusyForMT-SMS-Param */ - offset=dissect_gsm_map_SubBusyForMT_SMS_Param(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SubBusyForMT_SMS_Param(FALSE, tvb, offset, actx, tree, -1); break; case 32: /* SM-DeliveryFailureCause */ - offset=dissect_gsm_map_SM_DeliveryFailureCause(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SM_DeliveryFailureCause(FALSE, tvb, offset, actx, tree, -1); break; case 33: /* MessageWaitListFullParam */ - offset=dissect_gsm_map_MessageWaitListFullParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_MessageWaitListFullParam(FALSE, tvb, offset, actx, tree, -1); break; case 34: /* SystemFailureParam */ - offset=dissect_gsm_map_SystemFailureParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_SystemFailureParam(FALSE, tvb, offset, actx, tree, -1); break; case 35: /* DataMissingParam */ - offset=dissect_gsm_map_DataMissingParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_DataMissingParam(FALSE, tvb, offset, actx, tree, -1); break; case 36: /* UnexpectedDataParam */ - offset=dissect_gsm_map_UnexpectedDataParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_UnexpectedDataParam(FALSE, tvb, offset, actx, tree, -1); break; case 37: /* PW-RegistrationFailureCause */ - offset=dissect_gsm_map_PW_RegistrationFailureCause(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_PW_RegistrationFailureCause(FALSE, tvb, offset, actx, tree, -1); break; case 39: /* NoRoamingNbParam */ - offset=dissect_gsm_map_NoRoamingNbParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_NoRoamingNbParam(FALSE, tvb, offset, actx, tree, -1); break; case 40: /* TracingBufferFullParam */ - offset=dissect_gsm_map_TracingBufferFullParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_TracingBufferFullParam(FALSE, tvb, offset, actx, tree, -1); break; case 42: /* TargetCellOutsideGCA-Param */ - offset=dissect_gsm_map_TargetCellOutsideGCA_Param(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_TargetCellOutsideGCA_Param(FALSE, tvb, offset, actx, tree, -1); break; case 44: /* NumberChangedParam */ - offset=dissect_gsm_map_NumberChangedParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_NumberChangedParam(FALSE, tvb, offset, actx, tree, -1); break; case 45: /* BusySubscriberParam */ - offset=dissect_gsm_map_BusySubscriberParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_BusySubscriberParam(FALSE, tvb, offset, actx, tree, -1); break; case 46: /* NoSubscriberReplyParam */ - offset=dissect_gsm_map_NoSubscriberReplyParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_NoSubscriberReplyParam(FALSE, tvb, offset, actx, tree, -1); break; case 47: /* ForwardingFailedParam */ - offset=dissect_gsm_map_ForwardingFailedParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_ForwardingFailedParam(FALSE, tvb, offset, actx, tree, -1); break; case 48: /* OR-NotAllowedParam */ - offset=dissect_gsm_map_Or_NotAllowedParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_Or_NotAllowedParam(FALSE, tvb, offset, actx, tree, -1); break; case 49: /* ATI-NotAllowedParam */ - offset=dissect_gsm_map_ATI_NotAllowedParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_ATI_NotAllowedParam(FALSE, tvb, offset, actx, tree, -1); break; case 50: /* NoGroupCallNbParam */ - offset=dissect_gsm_map_NoGroupCallNbParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_NoGroupCallNbParam(FALSE, tvb, offset, actx, tree, -1); break; case 51: /* ResourceLimitationParam */ - offset=dissect_gsm_map_ResourceLimitationParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_ResourceLimitationParam(FALSE, tvb, offset, actx, tree, -1); break; case 52: /* UnauthorizedRequestingNetwork-Param */ - offset=dissect_gsm_map_UnauthorizedRequestingNetwork_Param(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_UnauthorizedRequestingNetwork_Param(FALSE, tvb, offset, actx, tree, -1); break; case 53: /* UnauthorizedLCSClient-Param */ - offset=dissect_gsm_map_UnauthorizedLCSClient_Param(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_UnauthorizedLCSClient_Param(FALSE, tvb, offset, actx, tree, -1); break; case 54: /* PositionMethodFailure-Param */ - offset=dissect_gsm_map_PositionMethodFailure_Param(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_PositionMethodFailure_Param(FALSE, tvb, offset, actx, tree, -1); break; case 58: /* UnknownOrUnreachableLCSClient-Param */ - offset=dissect_gsm_map_UnknownOrUnreachableLCSClient_Param(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_UnknownOrUnreachableLCSClient_Param(FALSE, tvb, offset, actx, tree, -1); break; case 59: /* MM-EventNotSupported-Param */ - offset=dissect_gsm_map_MM_EventNotSupported_Param(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_MM_EventNotSupported_Param(FALSE, tvb, offset, actx, tree, -1); break; case 60: /* ATSI-NotAllowedParam */ - offset=dissect_gsm_map_ATSI_NotAllowedParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_ATSI_NotAllowedParam(FALSE, tvb, offset, actx, tree, -1); break; case 61: /* ATM-NotAllowedParam */ - offset=dissect_gsm_map_ATM_NotAllowedParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_ATM_NotAllowedParam(FALSE, tvb, offset, actx, tree, -1); break; case 62: /* InformationNotAvailableParam */ - offset=dissect_gsm_map_InformationNotAvailableParam(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_gsm_map_InformationNotAvailableParam(FALSE, tvb, offset, actx, tree, -1); break; default: cause=proto_tree_add_text(tree, tvb, offset, -1, "Unknown returnErrorData blob"); proto_item_set_expert_flags(cause, PI_MALFORMED, PI_WARN); - expert_add_info_format(pinfo, cause, PI_MALFORMED, PI_WARN, "Unknown invokeData %d",errorCode); + expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "Unknown invokeData %d",errorCode); break; } return offset; @@ -1548,13 +1548,14 @@ static int dissect_returnErrorData(packet_info *pinfo, proto_tree *tree, tvbuff_ static void dissect_gsm_mapext_PlmnContainer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { proto_item *item=NULL; proto_tree *tree=NULL; - + asn1_ctx_t asn1_ctx; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); /* create display subtree for the protocol */ if(parent_tree){ item = proto_tree_add_text(parent_tree, tvb, 0, -1, "MAP Ext. Plmn Container"); tree = proto_item_add_subtree(item, ett_gsm_map_PlmnContainer); } - dissect_gsm_map_PlmnContainer(FALSE, tvb, 0, pinfo, tree, -1); + dissect_gsm_map_PlmnContainer(FALSE, tvb, 0, &asn1_ctx, tree, hf_gsm_map_PlmnContainer_PDU); } @@ -1562,15 +1563,15 @@ static guint8 gsmmap_pdu_type = 0; static guint8 gsm_map_pdu_size = 0; static int -dissect_gsm_map_GSMMAPPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo , proto_tree *tree, int hf_index _U_) { +dissect_gsm_map_GSMMAPPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_) { char *version_ptr; struct tcap_private_t * p_private_tcap; opcode = 0; application_context_version = 0; - if (pinfo->private_data != NULL){ - p_private_tcap=pinfo->private_data; + if (actx->pinfo->private_data != NULL){ + p_private_tcap=actx->pinfo->private_data; if (p_private_tcap->acv==TRUE ){ version_ptr = strrchr(p_private_tcap->oid,'.'); if (version_ptr) @@ -1582,11 +1583,11 @@ dissect_gsm_map_GSMMAPPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, /* Get the length and add 2 */ gsm_map_pdu_size = tvb_get_guint8(tvb, offset+1)+2; - if (check_col(pinfo->cinfo, COL_INFO)){ - col_set_str(pinfo->cinfo, COL_INFO, val_to_str(gsmmap_pdu_type, gsm_map_Component_vals, "Unknown GSM-MAP PDU (%u)")); - col_append_fstr(pinfo->cinfo, COL_INFO, " "); + if (check_col(actx->pinfo->cinfo, COL_INFO)){ + col_set_str(actx->pinfo->cinfo, COL_INFO, val_to_str(gsmmap_pdu_type, gsm_map_Component_vals, "Unknown GSM-MAP PDU (%u)")); + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " "); } - offset = dissect_gsm_map_Component(FALSE, tvb, 0, pinfo, tree, hf_gsm_map_Component_PDU); + offset = dissect_gsm_map_Component(FALSE, tvb, 0, actx, tree, hf_gsm_map_Component_PDU); return offset; /* offset = dissect_ber_choice(pinfo, tree, tvb, offset, @@ -1604,6 +1605,9 @@ dissect_gsm_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) /* Used for gsm_map TAP */ static gsm_map_tap_rec_t tap_rec; gint op_idx; + asn1_ctx_t asn1_ctx; + + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); if (check_col(pinfo->cinfo, COL_PROTOCOL)) @@ -1619,7 +1623,7 @@ dissect_gsm_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) tree = proto_item_add_subtree(item, ett_gsm_map); } - dissect_gsm_map_GSMMAPPDU(FALSE, tvb, 0, pinfo, tree, -1); + dissect_gsm_map_GSMMAPPDU(FALSE, tvb, 0, &asn1_ctx, tree, -1); match_strval_idx(opcode, gsm_map_opr_code_strings, &op_idx); tap_rec.invoke = FALSE; @@ -2274,6 +2278,10 @@ void proto_register_gsm_map(void) { { "EncryptionInformation", "gsm_map.ranap.EncryptionInformation", FT_NONE, BASE_NONE, NULL, 0, "gsm_map.ranap.EncryptionInformation", HFILL }}, + { &hf_gsm_map_PlmnContainer_PDU, + { "PlmnContainer", "gsm_map.PlmnContainer", + FT_NONE, BASE_NONE, NULL, 0, + "gsm_map.PlmnContainer", HFILL }}, #include "packet-gsm_map-hfarr.c" }; diff --git a/asn1/h248/h248.cnf b/asn1/h248/h248.cnf index f7eed44fa7..cab4f9c20c 100644 --- a/asn1/h248/h248.cnf +++ b/asn1/h248/h248.cnf @@ -77,12 +77,12 @@ IndAudStatisticsDescriptor/statName iAStatName #.FN_HDR Message - curr_info.msg = gcp_msg(pinfo,TVB_RAW_OFFSET(tvb),keep_persistent_data); + curr_info.msg = gcp_msg(actx->pinfo,TVB_RAW_OFFSET(tvb),keep_persistent_data); #.END #.FN_FTR Message - if (check_col(pinfo->cinfo, COL_INFO)) - col_set_str(pinfo->cinfo, COL_INFO, gcp_msg_to_str(curr_info.msg,keep_persistent_data)); + if (check_col(actx->pinfo->cinfo, COL_INFO)) + col_set_str(actx->pinfo->cinfo, COL_INFO, gcp_msg_to_str(curr_info.msg,keep_persistent_data)); if (keep_persistent_data) gcp_analyze_msg(h248_tree, h248_tvb, curr_info.msg, &h248_arrel); @@ -90,14 +90,14 @@ IndAudStatisticsDescriptor/statName iAStatName #.FN_BODY TransactionRequest/transactionId guint32 trx_id = 0; - offset = dissect_h248_trx_id(implicit_tag, pinfo, tree, tvb, offset, &trx_id); + offset = dissect_h248_trx_id(implicit_tag, actx->pinfo, tree, tvb, offset, &trx_id); curr_info.trx = gcp_trx(curr_info.msg, trx_id, GCP_TRX_REQUEST, keep_persistent_data); error_code = 0; #.END #.FN_BODY ActionRequest/contextId guint32 ctx_id = 0; - offset = dissect_h248_ctx_id(implicit_tag, pinfo, tree, tvb, offset, &ctx_id); + offset = dissect_h248_ctx_id(implicit_tag, actx->pinfo, tree, tvb, offset, &ctx_id); curr_info.ctx = gcp_ctx(curr_info.msg,curr_info.trx,ctx_id,keep_persistent_data); curr_info.cmd = NULL; curr_info.term = NULL; @@ -234,8 +234,8 @@ IndAudStatisticsDescriptor/statName iAStatName #.END #.FN_BODY ErrorDescriptor/errorCode - offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_h248_error_code, &error_code); - expert_add_info_format(pinfo, get_ber_last_created_item(), PI_RESPONSE_CODE, PI_WARN, "Errored Command"); + offset = dissect_ber_integer(implicit_tag, actx->pinfo, tree, tvb, offset, hf_h248_error_code, &error_code); + expert_add_info_format(actx->pinfo, get_ber_last_created_item(), PI_RESPONSE_CODE, PI_WARN, "Errored Command"); if (curr_info.cmd) { gcp_cmd_set_error(curr_info.cmd,error_code); @@ -253,7 +253,7 @@ IndAudStatisticsDescriptor/statName iAStatName #.FN_BODY WildcardField tvbuff_t* new_tvb; - offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, &new_tvb); + offset = dissect_ber_octet_string(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, &new_tvb); tree = proto_item_add_subtree(get_ber_last_created_item(),ett_wildcard); proto_tree_add_item(tree,hf_h248_term_wild_type,new_tvb,0,1,FALSE); proto_tree_add_item(tree,hf_h248_term_wild_level,new_tvb,0,1,FALSE); @@ -265,7 +265,7 @@ IndAudStatisticsDescriptor/statName iAStatName #.FN_BODY TerminationID/id tvbuff_t* new_tvb; - offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, &new_tvb); + offset = dissect_ber_octet_string(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, &new_tvb); if (new_tvb) { curr_info.term->len = tvb_length(new_tvb); @@ -279,7 +279,7 @@ IndAudStatisticsDescriptor/statName iAStatName 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(h248_term_handle, new_tvb, pinfo, tree); + call_dissector(h248_term_handle, new_tvb, actx->pinfo, tree); } } else { curr_info.term->len = 0; @@ -297,7 +297,7 @@ IndAudStatisticsDescriptor/statName iAStatName if (!parameter_tvb) return offset; - dissect_h248_ServiceChangeReasonStr(FALSE, parameter_tvb, 0, pinfo, tree, hf_h248_serviceChangeReasonStr); + dissect_h248_ServiceChangeReasonStr(FALSE, parameter_tvb, 0, actx, tree, hf_h248_serviceChangeReasonStr); #.TYPE_ATTR IP4Address/address TYPE = FT_IPv4 DISPLAY = BASE_NONE STRINGS = NULL diff --git a/asn1/h248/packet-h248-template.c b/asn1/h248/packet-h248-template.c index 077ace6568..8b2f3ae4f5 100644 --- a/asn1/h248/packet-h248-template.c +++ b/asn1/h248/packet-h248-template.c @@ -107,7 +107,7 @@ static dissector_handle_t h248_term_handle; static dissector_handle_t h248_tpkt_handle; /* Forward declarations */ -static int dissect_h248_ServiceChangeReasonStr(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); +static int dissect_h248_ServiceChangeReasonStr(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index); static const value_string package_name_vals[] = { { 0x0000, "Media stream properties H.248.1 Annex C" }, @@ -705,7 +705,7 @@ void h248_register_package(const h248_package_t* pkg) { static guint32 packageandid; -static int dissect_h248_PkgdName(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index) { +static int dissect_h248_PkgdName(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index) { tvbuff_t *new_tvb = NULL; proto_tree *package_tree=NULL; guint16 name_major, name_minor; @@ -714,7 +714,7 @@ static int dissect_h248_PkgdName(gboolean implicit_tag, tvbuff_t *tvb, int offse guint i; old_offset=offset; - offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, &new_tvb); + offset = dissect_ber_octet_string(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, &new_tvb); if (new_tvb) { /* this field is always 4 bytes so just read it into two integers */ @@ -763,7 +763,7 @@ static int dissect_h248_PkgdName(gboolean implicit_tag, tvbuff_t *tvb, int offse return offset; } -static int dissect_h248_EventName(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index) { +static int dissect_h248_EventName(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index) { tvbuff_t *new_tvb; proto_tree *package_tree=NULL; guint16 name_major, name_minor; @@ -773,7 +773,7 @@ static int dissect_h248_EventName(gboolean implicit_tag, tvbuff_t *tvb, int offs guint i; old_offset=offset; - offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, &new_tvb); + offset = dissect_ber_octet_string(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, &new_tvb); if (new_tvb) { /* this field is always 4 bytes so just read it into two integers */ @@ -840,7 +840,7 @@ static int dissect_h248_EventName(gboolean implicit_tag, tvbuff_t *tvb, int offs -static int dissect_h248_SignalName(gboolean implicit_tag , tvbuff_t *tvb, int offset, packet_info *pinfo , proto_tree *tree, int hf_index) { +static int dissect_h248_SignalName(gboolean implicit_tag , tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index) { tvbuff_t *new_tvb; proto_tree *package_tree=NULL; guint16 name_major, name_minor; @@ -850,7 +850,7 @@ static int dissect_h248_SignalName(gboolean implicit_tag , tvbuff_t *tvb, int of guint i; old_offset=offset; - offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, &new_tvb); + offset = dissect_ber_octet_string(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, &new_tvb); if (new_tvb) { /* this field is always 4 bytes so just read it into two integers */ @@ -914,7 +914,7 @@ static int dissect_h248_SignalName(gboolean implicit_tag , tvbuff_t *tvb, int of return offset; } -static int dissect_h248_PropertyID(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index _U_) { +static int dissect_h248_PropertyID(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) { gint8 class; gboolean pc, ind; @@ -928,8 +928,8 @@ static int dissect_h248_PropertyID(gboolean implicit_tag _U_, tvbuff_t *tvb, int const h248_pkg_param_t* prop; old_offset=offset; - offset=dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag); - offset=dissect_ber_length(pinfo, tree, tvb, offset, &len, &ind); + offset=dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &class, &pc, &tag); + offset=dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind); end_offset=offset+len; if( (class!=BER_CLASS_UNI) @@ -957,21 +957,21 @@ static int dissect_h248_PropertyID(gboolean implicit_tag _U_, tvbuff_t *tvb, int if (prop && prop->hfid ) { if (!prop->dissector) prop = &no_param; - prop->dissector(tree, next_tvb, pinfo, *(prop->hfid), &curr_info, prop->data); + prop->dissector(tree, next_tvb, actx->pinfo, *(prop->hfid), &curr_info, prop->data); } return end_offset; } -static int dissect_h248_SigParameterName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +static int dissect_h248_SigParameterName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) { tvbuff_t *next_tvb; guint32 param_id = 0xffffffff; const h248_pkg_param_t* sigpar; const gchar* strval; proto_item* pi; - offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, &next_tvb); + offset = dissect_ber_octet_string(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, &next_tvb); pi = get_ber_last_created_item(); switch(tvb_length(next_tvb)) { @@ -1004,7 +1004,7 @@ static int dissect_h248_SigParameterName(gboolean implicit_tag _U_, tvbuff_t *tv return offset; } -static int dissect_h248_SigParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +static int dissect_h248_SigParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) { tvbuff_t *next_tvb; int old_offset, end_offset; gint8 class; @@ -1013,8 +1013,8 @@ static int dissect_h248_SigParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb, guint32 len; old_offset=offset; - offset=dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag); - offset=dissect_ber_length(pinfo, tree, tvb, offset, &len, &ind); + offset=dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &class, &pc, &tag); + offset=dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind); end_offset=offset+len; if( (class!=BER_CLASS_UNI) @@ -1027,20 +1027,20 @@ static int dissect_h248_SigParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb, next_tvb = tvb_new_subset(tvb,offset,len,len); if ( curr_info.par && curr_info.par->dissector) { - curr_info.par->dissector(tree, next_tvb, pinfo, *(curr_info.par->hfid), &curr_info, curr_info.par->data); + curr_info.par->dissector(tree, next_tvb, actx->pinfo, *(curr_info.par->hfid), &curr_info, curr_info.par->data); } return end_offset; } -static int dissect_h248_EventParameterName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +static int dissect_h248_EventParameterName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) { tvbuff_t *next_tvb; guint32 param_id = 0xffffffff; const h248_pkg_param_t* evtpar; const gchar* strval; proto_item* pi; - offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, &next_tvb); + offset = dissect_ber_octet_string(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, &next_tvb); pi = get_ber_last_created_item(); if (next_tvb) { @@ -1079,7 +1079,7 @@ static int dissect_h248_EventParameterName(gboolean implicit_tag _U_, tvbuff_t * return offset; } -static int dissect_h248_EventParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +static int dissect_h248_EventParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) { tvbuff_t *next_tvb; int old_offset, end_offset; gint8 class; @@ -1088,8 +1088,8 @@ static int dissect_h248_EventParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb guint32 len; old_offset=offset; - offset=dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag); - offset=dissect_ber_length(pinfo, tree, tvb, offset, &len, &ind); + offset=dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &class, &pc, &tag); + offset=dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind); end_offset=offset+len; if( (class!=BER_CLASS_UNI) @@ -1102,20 +1102,20 @@ static int dissect_h248_EventParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb next_tvb = tvb_new_subset(tvb,offset,len,len); if ( curr_info.par && curr_info.par->dissector) { - curr_info.par->dissector(tree, next_tvb, pinfo, *(curr_info.par->hfid), &curr_info, curr_info.par->data); + curr_info.par->dissector(tree, next_tvb, actx->pinfo, *(curr_info.par->hfid), &curr_info, curr_info.par->data); } return end_offset; } -static int dissect_h248_MtpAddress(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index) { +static int dissect_h248_MtpAddress(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index) { tvbuff_t *new_tvb; proto_tree *mtp_tree=NULL; guint32 val; int i, len, old_offset; old_offset=offset; - offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, &new_tvb); + offset = dissect_ber_octet_string(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, &new_tvb); if (new_tvb) { /* this field is either 2 or 4 bytes so just read it into an integer */ @@ -1137,7 +1137,7 @@ static int dissect_h248_MtpAddress(gboolean implicit_tag, tvbuff_t *tvb, int off return offset; } -#define H248_TAP() do { if (keep_persistent_data && curr_info.cmd) tap_queue_packet(h248_tap, pinfo, curr_info.cmd); } while(0) +#define H248_TAP() do { if (keep_persistent_data && curr_info.cmd) tap_queue_packet(h248_tap, actx->pinfo, curr_info.cmd); } while(0) #include "packet-h248-fn.c" @@ -1149,10 +1149,12 @@ static void dissect_h248(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *h248_item; - + asn1_ctx_t asn1_ctx; h248_tree = NULL; h248_tvb = NULL; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); + curr_info.msg = NULL; curr_info.trx = NULL; curr_info.ctx = NULL; @@ -1190,7 +1192,7 @@ dissect_h248(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) h248_tree = proto_item_add_subtree(h248_item, ett_h248); } - dissect_h248_MegacoMessage(FALSE, tvb, 0, pinfo, h248_tree, -1); + dissect_h248_MegacoMessage(FALSE, tvb, 0, &asn1_ctx, h248_tree, -1); } diff --git a/asn1/inap/inap.asn b/asn1/inap/inap.asn index dd92e65338..a44d426854 100644 --- a/asn1/inap/inap.asn +++ b/asn1/inap/inap.asn @@ -2,6 +2,108 @@ IN-CS-1-Operations-appendix { ccitt recommendation q 1218 modules(0) cs-1-operat -- This module contains additional type definitions for IN CS-1 operations. DEFINITIONS IMPLICIT TAGS ::= BEGIN + +-- IMPORTED ROS stuff for Wireshark use +-- ROS def's +-- Module Remote-Operations-Apdus (H.450.1:02/1998) +--Remote-Operations-Apdus {itu-t recommendation h 450 1 version1(0) +-- remote-operations-apdus(11)} DEFINITIONS AUTOMATIC TAGS ::= +--BEGIN + +Component ::= CHOICE { + invoke [1] IMPLICIT Invoke, + returnResultLast [2] IMPLICIT ReturnResult, + returnError [3] IMPLICIT ReturnError, + reject [4] IMPLICIT Reject, +-- TCAP adds returnResultNotLast to allow for the segmentation of a result. + returnResultNotLast [7] IMPLICIT ReturnResult +} +Invoke ::= SEQUENCE { + invokeID InvokeIdType, + linkedID [0] IMPLICIT InvokeIdType OPTIONAL, + opCode OPERATION, + invokeparameter InvokeParameter OPTIONAL +} + +InvokeParameter ::= ANY + + +-- ANY is filled by the single ASN.1 data type following the keyword PARAMETER or the keyword ARGUMENT +-- in the type definition of a particular operation. + +ReturnResult ::= SEQUENCE { + invokeID InvokeIdType, + resultretres SEQUENCE { + opCode OPERATION, + returnparameter ReturnResultParameter OPTIONAL + } OPTIONAL + } + +ReturnResultParameter ::= ANY + +-- ANY is filled by the single ASN.1 data type following the keyword RESULT in the type definition +-- of a particular operation. + +ReturnError ::= SEQUENCE { + invokeID InvokeIdType, + errorCode ERROR, + parameter ReturnErrorParameter OPTIONAL } + +ReturnErrorParameter ::= ANY + +-- ANY is filled by the single ASN.1 data type following the keyword PARAMETER in the type definition +-- of a particular error. + +Reject ::= SEQUENCE { + invokeIDRej CHOICE { + derivable InvokeIdType, + not-derivable NULL }, + problem CHOICE { + generalProblem [0] IMPLICIT GeneralProblem, + invokeProblem [1] IMPLICIT InvokeProblem, + returnResultProblem [2] IMPLICIT ReturnResultProblem, + returnErrorProblem [3] IMPLICIT ReturnErrorProblem } } + +InvokeIdType ::= INTEGER (-128..127) + + +OPERATION ::= CHOICE { + localValue OperationLocalvalue, + globalValue OBJECT IDENTIFIER } + +LocalErrorcode ::= INAPLocalErrorcode +OperationLocalvalue ::= INAPOperationLocalvalue +INAPLocalErrorcode ::= INTEGER +INAPOperationLocalvalue ::= INTEGER +ERROR ::= CHOICE { + localValue LocalErrorcode, + globalValue OBJECT IDENTIFIER } + +-- PROBLEMS + +GeneralProblem ::= INTEGER { unrecognizedComponent (0), + mistypedComponent (1), + badlyStructuredComponent (2) } + +InvokeProblem ::= INTEGER { duplicateInvokeID (0), + unrecognizedOperation (1), + mistypedParameter (2), + resourceLimitation (3), + initiatingRelease (4), + unrecognizedLinkedID (5), + linkedResponseUnexpected (6), + unexpectedLinkedOperation (7) } + +ReturnResultProblem ::= INTEGER { unrecognizedInvokeID (0), + returnResultUnexpected (1), + mistypedParameter (2) } + +ReturnErrorProblem ::= INTEGER { unrecognizedInvokeID (0), + returnErrorUnexpected (1), + unrecognizedError (2), + unexpectedError (3), + mistypedParameter (4) } + -- TYPE DEFINITION FOR ADDITIONAL IN CS-1 OPERATIONS -- SCF-SSF operations -- SCF ? SSF @@ -1469,44 +1571,5 @@ TaskRefused ::= ENUMERATED { --unknownResource ERROR -- ::= localValue 18 --- additional pdus for reject - -InvokeIDType ::= INTEGER - -RejectPDU ::= SEQUENCE { - rinvokeID CHOICE { - invidtype InvokeIDType, - null NULL}, - rproblem CHOICE { - gp [0] IMPLICIT GeneralProblem, - ip [1] IMPLICIT InvokeProblem, - rrp [2] IMPLICIT ReturnResultProblem, - rep [3] IMPLICIT ReturnErrorProblem}} - -GeneralProblem ::= INTEGER { -- ROSE-provider detected - unrecognisedAPDU(0), - mistypedAPDU(1), - badlyStructuredAPDU(2)} -InvokeProblem ::= INTEGER { -- ROSE-user detected - duplicateInvocation(0), - unrecognisedOperation(1), - mistypedArgument(2), - resourceLimitation(3), - initiatorReleasing(4), - unrecognisedLinkedID(5), - linkedResponseUnexpected(6), - unexpectedChildOperation(7)} -ReturnResultProblem ::= INTEGER { -- ROSE-user detected - unrecognisedInvocation(0), - resultResponseUnexpected(1), - mistypedResult(2)} -ReturnErrorProblem ::= INTEGER { -- ROSE-user detected - unrecognisedInvocation(0), - errorResponseUnexpected(1), - unrecognisedError(2), - unexpectedError(3), - mistypedParameter(4)} - - END
\ No newline at end of file diff --git a/asn1/inap/inap.cnf b/asn1/inap/inap.cnf index 9ab9e66777..8051edbc63 100644 --- a/asn1/inap/inap.cnf +++ b/asn1/inap/inap.cnf @@ -9,7 +9,7 @@ #.PDU - +Component #.NO_EMIT @@ -69,6 +69,29 @@ CancelArg RequestCurrentStatusReportResultArg ReceivedInformationArg +#.FN_BODY InvokeParameter + offset = dissect_invokeData(tree, tvb, offset, actx); + +#.FN_BODY ReturnResultParameter + offset = dissect_returnResultData(tree, tvb, offset, actx); + +#.FN_BODY ReturnErrorParameter + offset = dissect_returnErrorData(tree, tvb, offset, actx); + +#.FN_BODY INAPLocalErrorcode VAL_PTR = &errorCode + offset = dissect_ber_integer(FALSE, actx->pinfo, tree, tvb, offset, hf_index, &errorCode); + + if (check_col(actx->pinfo->cinfo, COL_INFO)){ + col_set_str(actx->pinfo->cinfo, COL_INFO, val_to_str(errorCode, inap_error_code_strings, "Unknown Inap (%u)")); + } + +#.FN_BODY INAPOperationLocalvalue + offset = dissect_ber_integer(FALSE, actx->pinfo, tree, tvb, offset, hf_index, &opcode); + + if (check_col(actx->pinfo->cinfo, COL_INFO)){ + col_add_fstr(actx->pinfo->cinfo, COL_INFO, "%s ", val_to_str(opcode, inap_opr_code_strings, "Unknown Inap (%u)")); + } + #.FN_PARS CalledPartyNumber VAL_PTR = ¶meter_tvb diff --git a/asn1/inap/packet-inap-template.c b/asn1/inap/packet-inap-template.c index 88fa2766c8..4ecee8e813 100644 --- a/asn1/inap/packet-inap-template.c +++ b/asn1/inap/packet-inap-template.c @@ -33,6 +33,8 @@ #include <epan/packet.h> #include <epan/prefs.h> #include <epan/conversation.h> +#include "epan/expert.h" +#include <epan/asn1.h> #include <stdio.h> #include <string.h> @@ -50,18 +52,7 @@ /* Initialize the protocol and registered fields */ int proto_inap = -1; -static int hf_inap_invokeCmd = -1; /* Opcode */ -static int hf_inap_invokeid = -1; /* INTEGER */ -static int hf_inap_linkedid = -1; /* INTEGER */ -static int hf_inap_absent = -1; /* NULL */ -static int hf_inap_invokeId = -1; /* InvokeId */ -static int hf_inap_invoke = -1; /* InvokePDU */ -static int hf_inap_ReturnError = -1; /* InvokePDU */ -static int hf_inap_returnResult = -1; /* InvokePDU */ -static int hf_inap_returnResult_result = -1; -static int hf_inap_getPassword = -1; -static int hf_inap_currentPassword = -1; -static int hf_inap_genproblem = -1; + #include "packet-inap-hf.c" #define MAX_SSN 254 @@ -70,22 +61,15 @@ static range_t *ssn_range; static dissector_handle_t inap_handle; +/* Global variables */ +static guint32 opcode=0; +static guint32 errorCode; + /* Initialize the subtree pointers */ static gint ett_inap = -1; -static gint ett_inap_InvokeId = -1; -static gint ett_inap_InvokePDU = -1; -static gint ett_inap_ReturnErrorPDU = -1; -static gint ett_inap_ReturnResultPDU = -1; -static gint ett_inap_ReturnResult_result = -1; -static gint ett_inap_INAPPDU = -1; static gint ett_inapisup_parameter = -1; #include "packet-inap-ett.c" -static int dissect_invokeCmd(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_); - -#include "packet-inap-fn.c" - - const value_string inap_opr_code_strings[] = { {0,"InitialDP"}, @@ -173,34 +157,12 @@ const value_string inap_general_problem_strings[] = { {0, NULL} }; +/* Forvard declarations */ +static int dissect_invokeData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_); +static int dissect_returnResultData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_); +static int dissect_returnErrorData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx); - -static guint32 opcode=0; - -static int -dissect_inap_Opcode(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { - offset = dissect_ber_integer(FALSE, pinfo, tree, tvb, offset, hf_index, &opcode); - - if (check_col(pinfo->cinfo, COL_INFO)){ - col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(opcode, inap_opr_code_strings, "Unknown Inap (%u)")); - } - - return offset; -} - - - -static int -dissect_inap_errorCode(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { - offset = dissect_ber_integer(FALSE, pinfo, tree, tvb, offset, hf_index, &opcode); - - if (check_col(pinfo->cinfo, COL_INFO)){ - col_set_str(pinfo->cinfo, COL_INFO, val_to_str(opcode, inap_error_code_strings, "Unknown Inap (%u)")); - } - - return offset; -} - +#include "packet-inap-fn.c" /* TC-Invokable OPERATION ::= {activateServiceFiltering | activityTest | analysedInformation | @@ -221,156 +183,156 @@ TC-Invokable OPERATION ::= promptAndCollectUserInformation} */ -static int dissect_invokeData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_) { +static int dissect_invokeData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_) { switch(opcode){ case 0: /*InitialDP*/ - offset=dissect_inap_InitialDP(FALSE, tvb, offset, pinfo, tree, hf_inap_InitialDP_PDU); + offset=dissect_inap_InitialDP(FALSE, tvb, offset, actx, tree, hf_inap_InitialDP_PDU); break; case 1: /*1 OriginationAttemptAuthorized */ - offset=dissect_inap_OriginationAttemptAuthorizedArg(FALSE, tvb, offset, pinfo, tree, hf_inap_OriginationAttemptAuthorizedArg_PDU); + offset=dissect_inap_OriginationAttemptAuthorizedArg(FALSE, tvb, offset, actx, tree, hf_inap_OriginationAttemptAuthorizedArg_PDU); break; case 2: /*2 CollectedInformation */ - offset=dissect_inap_CollectedInformationArg(FALSE, tvb, offset, pinfo, tree, hf_inap_CollectedInformationArg_PDU); + offset=dissect_inap_CollectedInformationArg(FALSE, tvb, offset, actx, tree, hf_inap_CollectedInformationArg_PDU); break; case 3: /*3 AnalysedInformation */ - offset=dissect_inap_AnalysedInformationArg(FALSE, tvb, offset, pinfo, tree, hf_inap_AnalysedInformationArg_PDU); + offset=dissect_inap_AnalysedInformationArg(FALSE, tvb, offset, actx, tree, hf_inap_AnalysedInformationArg_PDU); break; case 4: /*4 RouteSelectFailure */ - offset=dissect_inap_RouteSelectFailureArg(FALSE, tvb, offset, pinfo, tree, hf_inap_RouteSelectFailureArg_PDU); + offset=dissect_inap_RouteSelectFailureArg(FALSE, tvb, offset, actx, tree, hf_inap_RouteSelectFailureArg_PDU); break; case 5: /*5 oCalledPartyBusy */ - offset=dissect_inap_OCalledPartyBusyArg(FALSE, tvb, offset, pinfo, tree, hf_inap_OCalledPartyBusyArg_PDU); + offset=dissect_inap_OCalledPartyBusyArg(FALSE, tvb, offset, actx, tree, hf_inap_OCalledPartyBusyArg_PDU); break; case 6: /*6 oNoAnswer */ - offset=dissect_inap_ONoAnswer(FALSE, tvb, offset, pinfo, tree, hf_inap_ONoAnswer_PDU); + offset=dissect_inap_ONoAnswer(FALSE, tvb, offset, actx, tree, hf_inap_ONoAnswer_PDU); break; case 7: /*7 oAnswer */ - offset=dissect_inap_OAnswerArg(FALSE, tvb, offset, pinfo, tree, hf_inap_OAnswerArg_PDU); + offset=dissect_inap_OAnswerArg(FALSE, tvb, offset, actx, tree, hf_inap_OAnswerArg_PDU); break; case 8: /*8 oDisconnect */ - offset=dissect_inap_ODisconnectArg(FALSE, tvb, offset, pinfo, tree, hf_inap_ODisconnectArg_PDU); + offset=dissect_inap_ODisconnectArg(FALSE, tvb, offset, actx, tree, hf_inap_ODisconnectArg_PDU); break; case 9: /*9 TermAttemptAuthorized */ - offset=dissect_inap_TermAttemptAuthorizedArg(FALSE, tvb, offset, pinfo, tree, hf_inap_TermAttemptAuthorizedArg_PDU); + offset=dissect_inap_TermAttemptAuthorizedArg(FALSE, tvb, offset, actx, tree, hf_inap_TermAttemptAuthorizedArg_PDU); break; case 10: /*10 tBusy */ - offset=dissect_inap_TBusyArg(FALSE, tvb, offset, pinfo, tree, hf_inap_TBusyArg_PDU); + offset=dissect_inap_TBusyArg(FALSE, tvb, offset, actx, tree, hf_inap_TBusyArg_PDU); break; case 11: /*11 tNoAnswer */ - offset=dissect_inap_TNoAnswerArg(FALSE, tvb, offset, pinfo, tree, hf_inap_TNoAnswerArg_PDU); + offset=dissect_inap_TNoAnswerArg(FALSE, tvb, offset, actx, tree, hf_inap_TNoAnswerArg_PDU); break; case 12: /*12 tAnswer */ - offset=dissect_inap_TAnswerArg(FALSE, tvb, offset, pinfo, tree, hf_inap_TAnswerArg_PDU); + offset=dissect_inap_TAnswerArg(FALSE, tvb, offset, actx, tree, hf_inap_TAnswerArg_PDU); break; case 13: /*13 tDisconnect */ - offset=dissect_inap_TDisconnectArg(FALSE, tvb, offset, pinfo, tree, hf_inap_TDisconnectArg_PDU); + offset=dissect_inap_TDisconnectArg(FALSE, tvb, offset, actx, tree, hf_inap_TDisconnectArg_PDU); break; case 14: /*14 oMidCall */ - offset=dissect_inap_MidCallArg(FALSE, tvb, offset, pinfo, tree, hf_inap_MidCallArg_PDU); + offset=dissect_inap_MidCallArg(FALSE, tvb, offset, actx, tree, hf_inap_MidCallArg_PDU); break; case 15: /*15 tMidCall */ - offset=dissect_inap_MidCallArg(FALSE, tvb, offset, pinfo, tree, hf_inap_MidCallArg_PDU); + offset=dissect_inap_MidCallArg(FALSE, tvb, offset, actx, tree, hf_inap_MidCallArg_PDU); break; case 16: /*AssistRequestInstructions*/ - offset=dissect_inap_AssistRequestInstructionsArg(FALSE, tvb, offset, pinfo, tree, hf_inap_AssistRequestInstructionsArg_PDU); + offset=dissect_inap_AssistRequestInstructionsArg(FALSE, tvb, offset, actx, tree, hf_inap_AssistRequestInstructionsArg_PDU); break; case 17: /*EstablishTemporaryConnection*/ - offset=dissect_inap_EstablishTemporaryConnectionArg(FALSE, tvb, offset, pinfo, tree, hf_inap_EstablishTemporaryConnectionArg_PDU); + offset=dissect_inap_EstablishTemporaryConnectionArg(FALSE, tvb, offset, actx, tree, hf_inap_EstablishTemporaryConnectionArg_PDU); break; case 18: /*DisconnectForwardConnections*/ proto_tree_add_text(tree, tvb, offset, -1, "Disconnect Forward Connection"); break; case 19: /*ConnectToResource*/ - offset=dissect_inap_ConnectToResourceArg(FALSE, tvb, offset, pinfo, tree, hf_inap_ConnectToResourceArg_PDU); + offset=dissect_inap_ConnectToResourceArg(FALSE, tvb, offset, actx, tree, hf_inap_ConnectToResourceArg_PDU); break; case 20: /*Connect*/ - offset=dissect_inap_ConnectArg(FALSE, tvb, offset, pinfo, tree,hf_inap_ConnectArg_PDU); + offset=dissect_inap_ConnectArg(FALSE, tvb, offset, actx, tree,hf_inap_ConnectArg_PDU); break; case 21: /* 21 HoldCallInNetwork */ - offset=dissect_inap_HoldCallInNetworkArg(FALSE, tvb, offset, pinfo, tree,hf_inap_HoldCallInNetworkArg_PDU); + offset=dissect_inap_HoldCallInNetworkArg(FALSE, tvb, offset, actx, tree,hf_inap_HoldCallInNetworkArg_PDU); break; case 22: /*ReleaseCall*/ - offset=dissect_inap_ReleaseCallArg(FALSE, tvb, offset, pinfo, tree,hf_inap_ReleaseCallArg_PDU); + offset=dissect_inap_ReleaseCallArg(FALSE, tvb, offset, actx, tree,hf_inap_ReleaseCallArg_PDU); break; case 23: /*InitialDP*/ - offset=dissect_inap_RequestReportBCSMEventArg(FALSE, tvb, offset, pinfo, tree, hf_inap_RequestReportBCSMEventArg_PDU); + offset=dissect_inap_RequestReportBCSMEventArg(FALSE, tvb, offset, actx, tree, hf_inap_RequestReportBCSMEventArg_PDU); break; case 24: /*EventReportBCSM*/ - offset=dissect_inap_EventReportBCSMArg(FALSE, tvb, offset, pinfo, tree, hf_inap_EventReportBCSMArg_PDU); + offset=dissect_inap_EventReportBCSMArg(FALSE, tvb, offset, actx, tree, hf_inap_EventReportBCSMArg_PDU); break; case 25: /*25, "RequestNotificationChargingEvent */ - offset=dissect_inap_RequestNotificationChargingEvent(FALSE, tvb, offset, pinfo, tree, hf_inap_RequestNotificationChargingEvent_PDU); + offset=dissect_inap_RequestNotificationChargingEvent(FALSE, tvb, offset, actx, tree, hf_inap_RequestNotificationChargingEvent_PDU); break; case 26: /*26, "EventNotificationCharging */ - offset=dissect_inap_EventNotificationChargingArg(FALSE, tvb, offset, pinfo, tree, hf_inap_EventNotificationChargingArg_PDU); + offset=dissect_inap_EventNotificationChargingArg(FALSE, tvb, offset, actx, tree, hf_inap_EventNotificationChargingArg_PDU); break; case 27: /*27, "CollectInformation */ - offset=dissect_inap_CollectInformationArg(FALSE, tvb, offset, pinfo, tree, hf_inap_CollectInformationArg_PDU); + offset=dissect_inap_CollectInformationArg(FALSE, tvb, offset, actx, tree, hf_inap_CollectInformationArg_PDU); break; case 28: /*28, "AnalyseInformation */ - offset=dissect_inap_AnalyseInformationArg(FALSE, tvb, offset, pinfo, tree, hf_inap_AnalyseInformationArg_PDU); + offset=dissect_inap_AnalyseInformationArg(FALSE, tvb, offset, actx, tree, hf_inap_AnalyseInformationArg_PDU); break; case 29: /*29, "SelectRoute */ - offset=dissect_inap_SelectRouteArg(FALSE, tvb, offset, pinfo, tree, hf_inap_SelectRouteArg_PDU); + offset=dissect_inap_SelectRouteArg(FALSE, tvb, offset, actx, tree, hf_inap_SelectRouteArg_PDU); break; case 30: /*30, "SelectFacility */ - offset=dissect_inap_SelectFacilityArg(FALSE, tvb, offset, pinfo, tree, hf_inap_SelectFacilityArg_PDU); + offset=dissect_inap_SelectFacilityArg(FALSE, tvb, offset, actx, tree, hf_inap_SelectFacilityArg_PDU); break; /*31, "Continue */ case 32: /*32, InitiateCallAttempt*/ - offset=dissect_inap_InitiateCallAttemptArg(FALSE, tvb, offset, pinfo, tree, hf_inap_InitiateCallAttemptArg_PDU); + offset=dissect_inap_InitiateCallAttemptArg(FALSE, tvb, offset, actx, tree, hf_inap_InitiateCallAttemptArg_PDU); break; case 33: /*ResetTimer*/ - offset=dissect_inap_ResetTimerArg(FALSE, tvb, offset, pinfo, tree, hf_inap_ResetTimerArg_PDU); + offset=dissect_inap_ResetTimerArg(FALSE, tvb, offset, actx, tree, hf_inap_ResetTimerArg_PDU); break; case 34: /*FurnishChargingInformation*/ - offset=dissect_inap_FurnishChargingInformationArg(FALSE, tvb, offset, pinfo, tree, hf_inap_FurnishChargingInformationArg_PDU); + offset=dissect_inap_FurnishChargingInformationArg(FALSE, tvb, offset, actx, tree, hf_inap_FurnishChargingInformationArg_PDU); break; case 35: /*35, ApplyCharging */ - offset=dissect_inap_ApplyChargingArg(FALSE, tvb, offset, pinfo, tree, hf_inap_ApplyChargingArg_PDU); + offset=dissect_inap_ApplyChargingArg(FALSE, tvb, offset, actx, tree, hf_inap_ApplyChargingArg_PDU); break; case 36: /*36, "ApplyChargingReport */ - offset=dissect_inap_ApplyChargingReportArg(FALSE, tvb, offset, pinfo, tree, hf_inap_ApplyChargingReportArg_PDU); + offset=dissect_inap_ApplyChargingReportArg(FALSE, tvb, offset, actx, tree, hf_inap_ApplyChargingReportArg_PDU); break; case 37: /*37, "RequestCurrentStatusReport */ - offset=dissect_inap_RequestCurrentStatusReportArg(FALSE, tvb, offset, pinfo, tree, hf_inap_RequestCurrentStatusReportArg_PDU); + offset=dissect_inap_RequestCurrentStatusReportArg(FALSE, tvb, offset, actx, tree, hf_inap_RequestCurrentStatusReportArg_PDU); break; case 38:/*38, "RequestEveryStatusChangeReport */ - offset=dissect_inap_RequestEveryStatusChangeReportArg(FALSE, tvb, offset, pinfo, tree, hf_inap_RequestEveryStatusChangeReportArg_PDU); + offset=dissect_inap_RequestEveryStatusChangeReportArg(FALSE, tvb, offset, actx, tree, hf_inap_RequestEveryStatusChangeReportArg_PDU); break; case 39:/*39, "RequestFirstStatusMatchReport */ - offset=dissect_inap_RequestFirstStatusMatchReportArg(FALSE, tvb, offset, pinfo, tree, hf_inap_RequestFirstStatusMatchReportArg_PDU); + offset=dissect_inap_RequestFirstStatusMatchReportArg(FALSE, tvb, offset, actx, tree, hf_inap_RequestFirstStatusMatchReportArg_PDU); break; case 40:/*40, "StatusReport */ - offset=dissect_inap_StatusReportArg(FALSE, tvb, offset, pinfo, tree, hf_inap_StatusReportArg_PDU); + offset=dissect_inap_StatusReportArg(FALSE, tvb, offset, actx, tree, hf_inap_StatusReportArg_PDU); break; case 41:/*41, "CallGap */ - offset=dissect_inap_CallGapArg(FALSE, tvb, offset, pinfo, tree, hf_inap_CallGapArg_PDU); + offset=dissect_inap_CallGapArg(FALSE, tvb, offset, actx, tree, hf_inap_CallGapArg_PDU); break; case 42:/*42, "ActivateServiceFiltering */ - offset=dissect_inap_ActivateServiceFilteringArg(FALSE, tvb, offset, pinfo, tree, hf_inap_ActivateServiceFilteringArg_PDU); + offset=dissect_inap_ActivateServiceFilteringArg(FALSE, tvb, offset, actx, tree, hf_inap_ActivateServiceFilteringArg_PDU); break; case 43:/*43, "ServiceFilteringResponse */ - offset=dissect_inap_ServiceFilteringResponseArg(FALSE, tvb, offset, pinfo, tree, hf_inap_ServiceFilteringResponseArg_PDU); + offset=dissect_inap_ServiceFilteringResponseArg(FALSE, tvb, offset, actx, tree, hf_inap_ServiceFilteringResponseArg_PDU); break; case 44: /*CallInformationReport*/ - offset=dissect_inap_CallInformationReportArg(FALSE, tvb, offset, pinfo, tree, hf_inap_CallInformationReportArg_PDU); + offset=dissect_inap_CallInformationReportArg(FALSE, tvb, offset, actx, tree, hf_inap_CallInformationReportArg_PDU); break; case 45: /*CallInformationRequest*/ - offset=dissect_inap_CallInformationRequestArg(FALSE, tvb, offset, pinfo, tree, hf_inap_CallInformationRequestArg_PDU); + offset=dissect_inap_CallInformationRequestArg(FALSE, tvb, offset, actx, tree, hf_inap_CallInformationRequestArg_PDU); break; case 47: /*PlayAnnouncement*/ - offset=dissect_inap_PlayAnnouncementArg(FALSE, tvb, offset, pinfo, tree, hf_inap_PlayAnnouncementArg_PDU); + offset=dissect_inap_PlayAnnouncementArg(FALSE, tvb, offset, actx, tree, hf_inap_PlayAnnouncementArg_PDU); break; case 48: /*PromptAndCollectUserInformation*/ - offset=dissect_inap_PromptAndCollectUserInformationArg(FALSE, tvb, offset, pinfo, tree, hf_inap_PromptAndCollectUserInformationArg_PDU); + offset=dissect_inap_PromptAndCollectUserInformationArg(FALSE, tvb, offset, actx, tree, hf_inap_PromptAndCollectUserInformationArg_PDU); break; case 49: /* 49 SpecializedResourceReport */ - offset=dissect_inap_SpecializedResourceReportArg(FALSE, tvb, offset, pinfo, tree, hf_inap_SpecializedResourceReportArg_PDU); + offset=dissect_inap_SpecializedResourceReportArg(FALSE, tvb, offset, actx, tree, hf_inap_SpecializedResourceReportArg_PDU); break; case 53: /*Cancel*/ - offset=dissect_inap_CancelArg(FALSE, tvb, offset, pinfo, tree, hf_inap_CancelArg_PDU); + offset=dissect_inap_CancelArg(FALSE, tvb, offset, actx, tree, hf_inap_CancelArg_PDU); break; /*55 ActivityTest*/ default: @@ -394,188 +356,43 @@ TC-Returnable OPERATION ::= promptAndCollectUserInformation - RESULT ReceivedInformationArg */ -static int dissect_returnResultData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_) { +static int dissect_returnResultData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_) { switch(opcode){ case 37: /*requestCurrentStatusReport*/ - offset=dissect_inap_RequestCurrentStatusReportResultArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_inap_RequestCurrentStatusReportResultArg(FALSE, tvb, offset, actx, tree, -1); break; case 48: /*PromptAndCollectUserInformation*/ - offset=dissect_inap_ReceivedInformationArg(FALSE, tvb, offset, pinfo, tree, -1); + offset=dissect_inap_ReceivedInformationArg(FALSE, tvb, offset, actx, tree, -1); break; default: proto_tree_add_text(tree, tvb, offset, -1, "Unknown returnResultData blob"); } return offset; } - -static int -dissect_invokeCmd(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_) { - return dissect_inap_Opcode(FALSE, tvb, offset, pinfo, tree, hf_inap_invokeCmd); -} - - -static int -dissect_errorCode(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_) { - return dissect_inap_errorCode(FALSE, tvb, offset, pinfo, tree, hf_inap_ReturnError); -} - -static int dissect_invokeid(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_) { - return dissect_ber_integer(FALSE, pinfo, tree, tvb, offset, hf_inap_invokeid, NULL); -} - - -static const value_string InvokeId_vals[] = { - { 0, "invokeid" }, - { 1, "absent" }, - { 0, NULL } -}; - -static int dissect_absent(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_) { - return dissect_inap_NULL(FALSE, tvb, offset, pinfo, tree, hf_inap_absent); -} - - -static const ber_choice_t InvokeId_choice[] = { - { 0, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_invokeid }, - { 1, BER_CLASS_UNI, BER_UNI_TAG_NULL, BER_FLAGS_NOOWNTAG, dissect_absent }, - { 0, 0, 0, 0, NULL } -}; - -static int -dissect_inap_InvokeId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { - offset = dissect_ber_choice(pinfo, tree, tvb, offset, - InvokeId_choice, hf_index, ett_inap_InvokeId, NULL); - - return offset; -} -static int dissect_invokeId(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_) { - return dissect_inap_InvokeId(FALSE, tvb, offset, pinfo, tree, hf_inap_invokeId); -} -static int dissect_linkedID_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_) { - return dissect_ber_integer(TRUE, pinfo, tree, tvb, offset, hf_inap_linkedid, NULL); -} - - -static const ber_sequence_t InvokePDU_sequence[] = { - { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_invokeId }, - { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_linkedID_impl }, - { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_invokeCmd }, - { BER_CLASS_UNI, -1/*depends on Cmd*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_invokeData }, - { 0, 0, 0, NULL } -}; - -static int -dissect_inap_InvokePDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { - offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, - InvokePDU_sequence, hf_index, ett_inap_InvokePDU); - - return offset; -} - - -static const ber_sequence_t returnErrorPDU_sequence[] = { - { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_invokeId }, - { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_errorCode }, - { 0, 0, 0, NULL } -}; - -static int -dissect_inap_returnErrorPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { - offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, - returnErrorPDU_sequence, hf_index, ett_inap_ReturnErrorPDU); - - return offset; -} - - -static int dissect_invoke_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_) { - return dissect_inap_InvokePDU(TRUE, tvb, offset, pinfo, tree, hf_inap_invoke); -} - -static int dissect_returnError_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_) { - return dissect_inap_returnErrorPDU(TRUE, tvb, offset, pinfo, tree, hf_inap_invoke); -} - -static const ber_sequence_t ReturnResult_result_sequence[] = { - { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_invokeCmd }, - { BER_CLASS_UNI, -1/*depends on Cmd*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_returnResultData }, - { 0, 0, 0, NULL } -}; -static int -dissect_returnResult_result(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_) { - offset = dissect_ber_sequence(FALSE, pinfo, tree, tvb, offset, - ReturnResult_result_sequence, hf_inap_returnResult_result, ett_inap_ReturnResult_result); - - return offset; -} - -static const ber_sequence_t ReturnResultPDU_sequence[] = { - { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_invokeId }, - { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_returnResult_result }, - { 0, 0, 0, NULL } -}; - -static int -dissect_inap_returnResultPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { - offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, - ReturnResultPDU_sequence, hf_index, ett_inap_ReturnResultPDU); - +/* From GSMMAP TODO find out if there is ERROR parameters */ +static int dissect_returnErrorData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx) { + proto_item *cause; + + switch(errorCode){ + default: + cause=proto_tree_add_text(tree, tvb, offset, -1, "Unknown returnErrorData blob"); + proto_item_set_expert_flags(cause, PI_MALFORMED, PI_WARN); + expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "Unknown invokeData %d",errorCode); + break; + } return offset; } -static int dissect_returnResult_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_) { - return dissect_inap_returnResultPDU(TRUE, tvb, offset, pinfo, tree, hf_inap_returnResult); -} - - -static int dissect_reject_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_) { - return dissect_inap_RejectPDU(TRUE, tvb, offset, pinfo, tree, -1); -} - -static const value_string INAPPDU_vals[] = { - { 1, "invoke" }, - { 2, "returnResult" }, - { 3, "returnError" }, - { 4, "reject" }, - { 0, NULL } -}; - -static const ber_choice_t INAPPDU_choice[] = { - { 1, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_invoke_impl }, - { 2, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_returnResult_impl }, - { 3, BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_returnError_impl }, - { 4, BER_CLASS_CON, 4, BER_FLAGS_IMPLTAG, dissect_reject_impl }, - { 0, 0, 0, 0, NULL } -}; static guint8 inap_pdu_type = 0; static guint8 inap_pdu_size = 0; -static int -dissect_inap_INAPPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { - - inap_pdu_type = tvb_get_guint8(tvb, offset)&0x0f; - /* Get the length and add 2 */ - inap_pdu_size = tvb_get_guint8(tvb, offset+1)+2; - - offset = dissect_ber_choice(pinfo, tree, tvb, offset, - INAPPDU_choice, hf_index, ett_inap_INAPPDU, NULL); -/* - if (check_col(pinfo->cinfo, COL_INFO)){ - col_prepend_fstr(pinfo->cinfo, COL_INFO, val_to_str(opcode, inap_opr_code_strings, "Unknown INAP (%u)")); - } -*/ - return offset; -} - - - static void dissect_inap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { proto_item *item=NULL; proto_tree *tree=NULL; - + int offset = 0; if (check_col(pinfo->cinfo, COL_PROTOCOL)) { @@ -587,8 +404,11 @@ dissect_inap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) item = proto_tree_add_item(parent_tree, proto_inap, tvb, 0, -1, FALSE); tree = proto_item_add_subtree(item, ett_inap); } - - dissect_inap_INAPPDU(FALSE, tvb, 0, pinfo, tree, -1); + inap_pdu_type = tvb_get_guint8(tvb, offset)&0x0f; + /* Get the length and add 2 */ + inap_pdu_size = tvb_get_guint8(tvb, offset+1)+2; + opcode = 0; + dissect_Component_PDU(tvb, pinfo, tree); } @@ -632,40 +452,8 @@ void proto_register_inap(void) { module_t *inap_module; /* List of fields */ static hf_register_info hf[] = { - { &hf_inap_invokeCmd, - { "invokeCmd", "inap.invokeCmd", - FT_UINT32, BASE_DEC, VALS(inap_opr_code_strings), 0, - "InvokePDU/invokeCmd", HFILL }}, - { &hf_inap_ReturnError, - { "ReturnError", "inap.ReturnError", - FT_UINT32, BASE_DEC, VALS(inap_error_code_strings), 0, - "InvokePDU/ReturnError", HFILL }}, - { &hf_inap_invokeid, - { "invokeid", "inap.invokeid", - FT_INT32, BASE_DEC, NULL, 0, - "InvokeId/invokeid", HFILL }}, - { &hf_inap_linkedid, - { "linkedid", "inap.linkedid", - FT_INT32, BASE_DEC, NULL, 0, - "LinkedId/linkedid", HFILL }}, - - { &hf_inap_absent, - { "absent", "inap.absent", - FT_NONE, BASE_NONE, NULL, 0, - "InvokeId/absent", HFILL }}, - { &hf_inap_invokeId, - { "invokeId", "inap.invokeId", - FT_UINT32, BASE_DEC, VALS(InvokeId_vals), 0, - "InvokePDU/invokeId", HFILL }}, - { &hf_inap_invoke, - { "invoke", "inap.invoke", - FT_NONE, BASE_NONE, NULL, 0, - "INAPPDU/invoke", HFILL }}, - { &hf_inap_returnResult, - { "returnResult", "inap.returnResult", - FT_NONE, BASE_NONE, NULL, 0, - "INAPPDU/returnResult", HFILL }}, - + + #include "packet-inap-hfarr.c" }; @@ -678,13 +466,7 @@ void proto_register_inap(void) { /* List of subtrees */ static gint *ett[] = { &ett_inap, - &ett_inap_InvokeId, - &ett_inap_InvokePDU, - &ett_inap_ReturnErrorPDU, - &ett_inap_ReturnResultPDU, - &ett_inap_ReturnResult_result, - &ett_inap_INAPPDU, - &ett_inapisup_parameter, + &ett_inapisup_parameter, #include "packet-inap-ettarr.c" }; diff --git a/asn1/ldap/ldap.cnf b/asn1/ldap/ldap.cnf index 41535a4230..4ea3c25f0c 100644 --- a/asn1/ldap/ldap.cnf +++ b/asn1/ldap/ldap.cnf @@ -75,14 +75,14 @@ ReplControlValue B "1.2.840.113556.1.4.841" "replControlValue" #.FN_HDR ProtocolOp ldap_call_response_t *lcrp; - ldap_conv_info_t *ldap_info = (ldap_conv_info_t *)pinfo->private_data; + ldap_conv_info_t *ldap_info = (ldap_conv_info_t *)actx->pinfo->private_data; do_protocolop = TRUE; #.FN_FTR ProtocolOp - lcrp=ldap_match_call_response(tvb, pinfo, tree, MessageID, ProtocolOp); + lcrp=ldap_match_call_response(tvb, actx->pinfo, tree, MessageID, ProtocolOp); if(lcrp){ - tap_queue_packet(ldap_tap, pinfo, lcrp); + tap_queue_packet(ldap_tap, actx->pinfo, lcrp); } /* XXX: the count will not work if the results span multiple TCP packets */ @@ -100,8 +100,8 @@ ReplControlValue B "1.2.840.113556.1.4.841" "replControlValue" case LDAP_RES_SEARCH_RESULT: - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, " [%d result%s]", + if (check_col(actx->pinfo->cinfo, COL_INFO)) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " [%d result%s]", ldap_info->num_results, ldap_info->num_results == 1 ? "" : "s"); proto_item_append_text(tree, " [%d result%s]", @@ -119,10 +119,10 @@ ldap_conv_info_t *ldap_info; %(DEFAULT_BODY)s - ldap_info = pinfo->private_data; + ldap_info = actx->pinfo->private_data; ldap_info->auth_type = LDAP_AUTH_SIMPLE; - pinfo->private_data = ldap_info; + actx->pinfo->private_data = ldap_info; #.FN_PARS Mechanism VAL_PTR = ¶meter_tvb #.FN_BODY Mechanism @@ -131,7 +131,7 @@ ldap_conv_info_t *ldap_info; tvbuff_t *parameter_tvb; char *mechanism = NULL; %(DEFAULT_BODY)s - ldap_info = pinfo->private_data; + ldap_info = actx->pinfo->private_data; ldap_info->auth_type = LDAP_AUTH_SASL; if (!parameter_tvb) @@ -161,7 +161,7 @@ char *mechanism = NULL; } ldap_info->auth_mech = mechanism; } - pinfo->private_data = ldap_info; + actx->pinfo->private_data = ldap_info; #.FN_PARS Credentials VAL_PTR = ¶meter_tvb #.FN_BODY Credentials @@ -173,21 +173,21 @@ ldap_conv_info_t *ldap_info; if (!parameter_tvb) return offset; - ldap_info = pinfo->private_data; + ldap_info = actx->pinfo->private_data; if (ldap_info->auth_mech != NULL && strcmp(ldap_info->auth_mech, "GSS-SPNEGO") == 0) { /* * This is a GSS-API token ancapsulated within GSS-SPNEGO. */ if (parameter_tvb && (tvb_length(parameter_tvb) > 0)) - call_dissector(spnego_handle, parameter_tvb, pinfo, tree); + call_dissector(spnego_handle, parameter_tvb, actx->pinfo, tree); } else if (ldap_info->auth_mech != NULL && strcmp(ldap_info->auth_mech, "GSSAPI") == 0) { /* * This is a raw GSS-API token. */ if (parameter_tvb && (tvb_length(parameter_tvb) > 0)) - call_dissector(gssapi_handle, parameter_tvb, pinfo, tree); + call_dissector(gssapi_handle, parameter_tvb, actx->pinfo, tree); } - pinfo->private_data = ldap_info; + actx->pinfo->private_data = ldap_info; #.FN_PARS ServerSaslCreds VAL_PTR = ¶meter_tvb #.FN_BODY ServerSaslCreds @@ -198,7 +198,7 @@ ldap_conv_info_t *ldap_info; %(DEFAULT_BODY)s if (!parameter_tvb) return offset; - ldap_info = pinfo->private_data; + ldap_info = actx->pinfo->private_data; switch (ldap_info->auth_type) { /* For Kerberos V4, dissect it as a ticket. */ @@ -231,25 +231,25 @@ ldap_conv_info_t *ldap_info; * assumption that we won't have more than 2^24 bytes of * encapsulated stuff. */ - ldap_info->first_auth_frame = pinfo->fd->num + 1; + ldap_info->first_auth_frame = actx->pinfo->fd->num + 1; if (ldap_info->auth_mech != NULL && strcmp(ldap_info->auth_mech, "GSS-SPNEGO") == 0) { /* * This is a GSS-API token. */ if(parameter_tvb && (tvb_length(parameter_tvb) > 0)) - call_dissector(spnego_handle, parameter_tvb, pinfo, tree); + call_dissector(spnego_handle, parameter_tvb, actx->pinfo, tree); } else if (ldap_info->auth_mech != NULL && strcmp(ldap_info->auth_mech, "GSSAPI") == 0) { /* * This is a GSS-API token. */ if(parameter_tvb && (tvb_length(parameter_tvb) > 0)) - call_dissector(gssapi_handle, parameter_tvb, pinfo, tree); + call_dissector(gssapi_handle, parameter_tvb, actx->pinfo, tree); } break; } - pinfo->private_data = ldap_info; + actx->pinfo->private_data = ldap_info; #.FN_PARS LDAPString VAL_PTR = ¶meter_tvb @@ -262,7 +262,7 @@ ldap_conv_info_t *ldap_info; if (parameter_tvb || (hf_index == hf_ldap_baseObject)) { - ldap_do_protocolop(pinfo); + ldap_do_protocolop(actx->pinfo); if(parameter_tvb) ldapstring = tvb_get_ephemeral_string(parameter_tvb, 0, tvb_length_remaining(parameter_tvb, 0)); @@ -271,8 +271,8 @@ ldap_conv_info_t *ldap_info; if(hf_index == hf_ldap_baseObject) { /* this is search - put it on the scanline */ - if(check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, "\"%%s\" ", ldapstring); + if(check_col(actx->pinfo->cinfo, COL_INFO)) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, "\"%%s\" ", ldapstring); if(ldm_tree) proto_item_append_text(ldm_tree, " \"%%s\"", ldapstring); @@ -284,14 +284,14 @@ ldap_conv_info_t *ldap_info; } } else if ((hf_index == hf_ldap_errorMessage) && result) { /* only show message if not success */ - if(check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, "(%%s) ", ldapstring); + if(check_col(actx->pinfo->cinfo, COL_INFO)) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, "(%%s) ", ldapstring); if(ldm_tree) proto_item_append_text(ldm_tree, " (%%s)", ldapstring); } else if (hf_index == hf_ldap_objectName) { - if(check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, "\"%%s\" ", ldapstring); + if(check_col(actx->pinfo->cinfo, COL_INFO)) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, "\"%%s\" ", ldapstring); if(ldm_tree) proto_item_append_text(ldm_tree, " \"%%s\"", ldapstring); @@ -343,12 +343,12 @@ ldap_conv_info_t *ldap_info; %(DEFAULT_BODY)s - ldap_do_protocolop(pinfo); + ldap_do_protocolop(actx->pinfo); valstr = val_to_str(scope, ldap_T_scope_vals, "Unknown scope(%%u)"); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, "%%s ", valstr); + if (check_col(actx->pinfo->cinfo, COL_INFO)) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, "%%s ", valstr); if(ldm_tree) proto_item_append_text(ldm_tree, " %%s", valstr); @@ -361,14 +361,14 @@ ldap_conv_info_t *ldap_info; %(DEFAULT_BODY)s - ldap_do_protocolop(pinfo); + ldap_do_protocolop(actx->pinfo); if(result) { valstr = val_to_str(result, ldap_T_resultCode_vals, "Unknown result(%%u)"); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, "%%s ", valstr); + if (check_col(actx->pinfo->cinfo, COL_INFO)) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, "%%s ", valstr); if(ldm_tree) proto_item_append_text(ldm_tree, " %%s", valstr); @@ -383,14 +383,14 @@ ldap_conv_info_t *ldap_info; %(DEFAULT_BODY)s - ldap_do_protocolop(pinfo); + ldap_do_protocolop(actx->pinfo); if(result) { valstr = val_to_str(result, ldap_BindResponse_resultCode_vals, "Unknown result(%%u)"); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, "%%s ", valstr); + if (check_col(actx->pinfo->cinfo, COL_INFO)) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, "%%s ", valstr); if(ldm_tree) proto_item_append_text(ldm_tree, " %%s", valstr); @@ -407,10 +407,10 @@ ldap_conv_info_t *ldap_info; int old_offset = offset; /* extract the value of the octetstring */ - offset = dissect_ber_octet_string(FALSE, pinfo, NULL, tvb, offset, hf_index, &next_tvb); + offset = dissect_ber_octet_string(FALSE, actx->pinfo, NULL, tvb, offset, hf_index, &next_tvb); /* if we have an attribute type that isn't binary see if there is a better dissector */ - if(!attr_type || !dissector_try_string(ldap_name_dissector_table, attr_type, next_tvb, pinfo, tree)) { + if(!attr_type || !dissector_try_string(ldap_name_dissector_table, attr_type, next_tvb, actx->pinfo, tree)) { offset = old_offset; /* do the default thing */ @@ -442,7 +442,7 @@ ldap_conv_info_t *ldap_info; %(DEFAULT_BODY)s - ldap_do_protocolop(pinfo); + ldap_do_protocolop(actx->pinfo); if((branch > -1) && (branch < (gint)(sizeof AuthenticationChoice_choice/sizeof AuthenticationChoice_choice[0]))) auth = AuthenticationChoice_choice[branch].value; @@ -450,8 +450,8 @@ ldap_conv_info_t *ldap_info; valstr = val_to_str(auth, ldap_AuthenticationChoice_vals, "Unknown auth(%%u)"); /* If auth is NTLM (10 or 11) don't add to column as the NTLM dissection will do this */ - if (check_col(pinfo->cinfo, COL_INFO) && (auth != 10) && (auth != 11)) - col_append_fstr(pinfo->cinfo, COL_INFO, "%%s ", valstr); + if (check_col(actx->pinfo->cinfo, COL_INFO) && (auth != 10) && (auth != 11)) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, "%%s ", valstr); if(ldm_tree) proto_item_append_text(ldm_tree, " %%s", valstr); @@ -463,7 +463,7 @@ ldap_conv_info_t *ldap_info; %(DEFAULT_BODY)s - ldap_do_protocolop(pinfo); + ldap_do_protocolop(actx->pinfo); @@ -510,7 +510,7 @@ ldap_conv_info_t *ldap_info; it=proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset), "and: "); tr=proto_item_add_subtree(it, ett_ldap_T_and); } - offset = dissect_ber_set_of(implicit_tag, pinfo, tr, tvb, offset, + offset = dissect_ber_set_of(implicit_tag, actx, tr, tvb, offset, and_set_of, -1, ett_ldap_T_and); proto_item_append_text(it, "%%s", and_filter_string); @@ -537,7 +537,7 @@ ldap_conv_info_t *ldap_info; it=proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset), "or: "); tr=proto_item_add_subtree(it, ett_ldap_T_or); } - offset = dissect_ber_set_of(implicit_tag, pinfo, tr, tvb, offset, + offset = dissect_ber_set_of(implicit_tag, actx, tr, tvb, offset, or_set_of, -1, ett_ldap_T_or); proto_item_append_text(it, "%%s", or_filter_string); @@ -553,7 +553,7 @@ ldap_conv_info_t *ldap_info; #.FN_BODY BOOLEAN gboolean val; - offset = dissect_ber_boolean_value(implicit_tag, pinfo, tree, tvb, offset, hf_index, &val); + offset = dissect_ber_boolean_value(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, &val); if (hf_index == hf_ldap_dnAttributes) { matching_rule_dnattr = val; @@ -600,7 +600,7 @@ ldap_conv_info_t *ldap_info; it=proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset), "substring: "); tr=proto_item_add_subtree(it, ett_ldap_SubstringFilter); } - offset = dissect_ber_sequence(implicit_tag, pinfo, tr, tvb, offset, + offset = dissect_ber_sequence(implicit_tag, actx, tr, tvb, offset, SubstringFilter_sequence, hf_index, ett_ldap_SubstringFilter); @@ -616,7 +616,7 @@ ldap_conv_info_t *ldap_info; it=proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset), "Filter: "); tr=proto_item_add_subtree(it, ett_ldap_Filter); } - offset = dissect_ber_choice(pinfo, tr, tvb, offset, + offset = dissect_ber_choice(actx, tr, tvb, offset, Filter_choice, -1, ett_ldap_Filter, NULL); @@ -624,31 +624,31 @@ ldap_conv_info_t *ldap_info; #.FN_BODY AuthenticationChoice/ntlmsspNegotiate /* make sure the protocol op comes first */ - ldap_do_protocolop(pinfo); + ldap_do_protocolop(actx->pinfo); - call_dissector(ntlmssp_handle, tvb, pinfo, tree); + call_dissector(ntlmssp_handle, tvb, actx->pinfo, tree); offset+=tvb_length_remaining(tvb, offset); #.FN_BODY AuthenticationChoice/ntlmsspAuth /* make sure the protocol op comes first */ - ldap_do_protocolop(pinfo); + ldap_do_protocolop(actx->pinfo); - call_dissector(ntlmssp_handle, tvb, pinfo, tree); + call_dissector(ntlmssp_handle, tvb, actx->pinfo, tree); offset+=tvb_length_remaining(tvb, offset); #.FN_BODY BindResponse/matchedDN tvbuff_t *new_tvb=NULL; - offset = dissect_ber_octet_string(FALSE, pinfo, tree, tvb, offset, hf_ldap_matchedDN, &new_tvb); + offset = dissect_ber_octet_string(FALSE, actx->pinfo, tree, tvb, offset, hf_ldap_matchedDN, &new_tvb); if( new_tvb && (tvb_length(new_tvb)>=7) && (!tvb_memeql(new_tvb, 0, "NTLMSSP", 7))){ /* make sure the protocol op comes first */ - ldap_do_protocolop(pinfo); + ldap_do_protocolop(actx->pinfo); - call_dissector(ntlmssp_handle, new_tvb, pinfo, tree); + call_dissector(ntlmssp_handle, new_tvb, actx->pinfo, tree); } return offset; @@ -660,10 +660,10 @@ ldap_conv_info_t *ldap_info; if((object_identifier_id != NULL) && oid_has_dissector(object_identifier_id)) { /* remove the OCTET STRING encoding */ - offset=dissect_ber_identifier(pinfo, NULL, tvb, offset, &class, &pc, &tag); - offset=dissect_ber_length(pinfo, NULL, tvb, offset, &len, &ind); + offset=dissect_ber_identifier(actx->pinfo, NULL, tvb, offset, &class, &pc, &tag); + offset=dissect_ber_length(actx->pinfo, NULL, tvb, offset, &len, &ind); - call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); offset += len; } else { diff --git a/asn1/ldap/packet-ldap-template.c b/asn1/ldap/packet-ldap-template.c index eec670746e..d9b829000b 100644 --- a/asn1/ldap/packet-ldap-template.c +++ b/asn1/ldap/packet-ldap-template.c @@ -275,7 +275,7 @@ static char *ldapvalue_string=NULL; * display it as a string, othervise just display it in hex. */ static int -dissect_ldap_AssertionValue(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) +dissect_ldap_AssertionValue(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index) { gint8 class; gboolean pc, ind, is_ascii; @@ -319,7 +319,7 @@ dissect_ldap_AssertionValue(gboolean implicit_tag, tvbuff_t *tvb, int offset, pa e_uuid_t uuid; /* This octet string contained a GUID */ - dissect_dcerpc_uuid_t(tvb, offset, pinfo, tree, drep, hf_ldap_guid, &uuid); + dissect_dcerpc_uuid_t(tvb, offset, actx->pinfo, tree, drep, hf_ldap_guid, &uuid); ldapvalue_string=ep_alloc(1024); g_snprintf(ldapvalue_string, 1023, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", diff --git a/asn1/mms/mms.cnf b/asn1/mms/mms.cnf index 6e7e89b7ef..bbb060e00f 100644 --- a/asn1/mms/mms.cnf +++ b/asn1/mms/mms.cnf @@ -20,25 +20,25 @@ MMSpdu #.FIELD_RENAME #.FN_BODY ApplicationReference/ap-title - offset=dissect_acse_AP_title(FALSE, tvb, offset, pinfo, tree, hf_mms_ap_title); + offset=dissect_acse_AP_title(FALSE, tvb, offset, actx, tree, hf_mms_ap_title); #.FN_BODY ApplicationReference/ap-invocation-id - offset=dissect_acse_AP_invocation_identifier(FALSE, tvb, offset, pinfo, tree, hf_mms_ap_invocation_id); + offset=dissect_acse_AP_invocation_identifier(FALSE, tvb, offset, actx, tree, hf_mms_ap_invocation_id); #.FN_BODY ApplicationReference/ae-qualifier - offset=dissect_acse_AE_qualifier(FALSE, tvb, offset, pinfo, tree, hf_mms_ae_qualifier); + offset=dissect_acse_AE_qualifier(FALSE, tvb, offset, actx, tree, hf_mms_ae_qualifier); #.FN_BODY ApplicationReference/ae-invocation-id - offset=dissect_acse_AE_invocation_identifier(FALSE, tvb, offset, pinfo, tree, hf_mms_ae_invocation_id); + offset=dissect_acse_AE_invocation_identifier(FALSE, tvb, offset, actx, tree, hf_mms_ae_invocation_id); #.FN_BODY MMSpdu gint branch_taken; - offset = dissect_ber_choice(pinfo, tree, tvb, offset, + offset = dissect_ber_choice(actx, tree, tvb, offset, MMSpdu_choice, hf_index, ett_mms_MMSpdu, &branch_taken); - if(check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, "%%s ", val_to_str(branch_taken, mms_MMSpdu_vals, "Unknown")); + if(check_col(actx->pinfo->cinfo, COL_INFO)) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, "%%s ", val_to_str(branch_taken, mms_MMSpdu_vals, "Unknown")); diff --git a/asn1/mms/packet-mms-template.c b/asn1/mms/packet-mms-template.c index 776d7b8a8e..9026e1bf56 100644 --- a/asn1/mms/packet-mms-template.c +++ b/asn1/mms/packet-mms-template.c @@ -30,6 +30,7 @@ #include <glib.h> #include <epan/packet.h> #include <epan/conversation.h> +#include <epan/asn1.h> #include <stdio.h> #include <string.h> @@ -63,6 +64,8 @@ dissect_mms(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) int old_offset; proto_item *item=NULL; proto_tree *tree=NULL; + asn1_ctx_t asn1_ctx; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); if(parent_tree){ item = proto_tree_add_item(parent_tree, proto_mms, tvb, 0, -1, FALSE); @@ -75,7 +78,7 @@ dissect_mms(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) while (tvb_reported_length_remaining(tvb, offset) > 0){ old_offset=offset; - offset=dissect_mms_MMSpdu(FALSE, tvb, offset, pinfo , tree, -1); + offset=dissect_mms_MMSpdu(FALSE, tvb, offset, &asn1_ctx , tree, -1); if(offset == old_offset){ proto_tree_add_text(tree, tvb, offset, -1,"Internal error, zero-byte MMS PDU"); offset = tvb_length(tvb); diff --git a/asn1/ocsp/ocsp.cnf b/asn1/ocsp/ocsp.cnf index 1403eb688b..d34f2002ce 100644 --- a/asn1/ocsp/ocsp.cnf +++ b/asn1/ocsp/ocsp.cnf @@ -18,7 +18,7 @@ PKIX1Explicit88 pkix1explicit #.REGISTER BasicOCSPResponse B "1.3.6.1.5.5.7.48.1.1" "id-pkix-ocsp-basic" -CrlID B "1.3.6.1.5.5.7.48.1.3" "id-pkix-ocsp-crl" +CrlID B "1.3.6.1.5.5.7.48.1.3" "id-pkix-ocsp-crl" AcceptableResponses B "1.3.6.1.5.5.7.48.1.4" "id-pkix-ocsp-response" ArchiveCutoff B "1.3.6.1.5.5.7.48.1.6" "id-pkix-ocsp-archive-cutoff" ServiceLocator B "1.3.6.1.5.5.7.48.1.7" "id-pkix-ocsp-service-locator" @@ -38,8 +38,8 @@ ServiceLocator B "1.3.6.1.5.5.7.48.1.7" "id-pkix-ocsp-service-locator" gint32 tag; guint32 len; /* skip past the T and L */ - offset = dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag); - offset = dissect_ber_length(pinfo, tree, tvb, offset, &len, &ind); - offset=call_ber_oid_callback(responseType_id, tvb, offset, pinfo, tree); + offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &class, &pc, &tag); + offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind); + offset=call_ber_oid_callback(responseType_id, tvb, offset, actx->pinfo, tree); #.END diff --git a/asn1/ocsp/packet-ocsp-template.c b/asn1/ocsp/packet-ocsp-template.c index f79d020172..d5bd0a12a0 100644 --- a/asn1/ocsp/packet-ocsp-template.c +++ b/asn1/ocsp/packet-ocsp-template.c @@ -32,6 +32,7 @@ #include <stdio.h> #include <string.h> +#include <asn1.h> #include "packet-ber.h" #include "packet-ocsp.h" @@ -64,6 +65,8 @@ dissect_ocsp_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { proto_item *item=NULL; proto_tree *tree=NULL; + asn1_ctx_t asn1_ctx; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); if (check_col(pinfo->cinfo, COL_PROTOCOL)) col_set_str(pinfo->cinfo, COL_PROTOCOL, "OCSP"); @@ -80,7 +83,7 @@ dissect_ocsp_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) tree = proto_item_add_subtree(item, ett_ocsp); } - return dissect_ocsp_OCSPRequest(FALSE, tvb, 0, pinfo, tree, -1); + return dissect_ocsp_OCSPRequest(FALSE, tvb, 0, &asn1_ctx, tree, -1); } @@ -89,6 +92,8 @@ dissect_ocsp_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree { proto_item *item=NULL; proto_tree *tree=NULL; + asn1_ctx_t asn1_ctx; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); if (check_col(pinfo->cinfo, COL_PROTOCOL)) col_set_str(pinfo->cinfo, COL_PROTOCOL, "OCSP"); @@ -105,7 +110,7 @@ dissect_ocsp_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree tree = proto_item_add_subtree(item, ett_ocsp); } - return dissect_ocsp_OCSPResponse(FALSE, tvb, 0, pinfo, tree, -1); + return dissect_ocsp_OCSPResponse(FALSE, tvb, 0, &asn1_ctx, tree, -1); } /*--- proto_register_ocsp ----------------------------------------------*/ diff --git a/asn1/pkcs1/packet-pkcs1-template.c b/asn1/pkcs1/packet-pkcs1-template.c index 70539c8146..e543fb294d 100644 --- a/asn1/pkcs1/packet-pkcs1-template.c +++ b/asn1/pkcs1/packet-pkcs1-template.c @@ -30,12 +30,13 @@ #include <glib.h> #include <epan/packet.h> #include <epan/conversation.h> +#include <epan/asn1.h> #include <stdio.h> #include <string.h> -#include "packet-pkcs1.h" #include "packet-ber.h" +#include "packet-pkcs1.h" #include "packet-x509af.h" #define PNAME "PKCS#1" diff --git a/asn1/pkcs12/packet-pkcs12-template.c b/asn1/pkcs12/packet-pkcs12-template.c index 7b4ac014b0..8d4ac23e48 100644 --- a/asn1/pkcs12/packet-pkcs12-template.c +++ b/asn1/pkcs12/packet-pkcs12-template.c @@ -88,17 +88,21 @@ static int strip_octet_string(tvbuff_t *tvb, proto_tree *tree) static void dissect_AuthenticatedSafe_OCTETSTRING_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { int offset = 0; + asn1_ctx_t asn1_ctx; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); if((offset = strip_octet_string(tvb, tree)) > 0) - dissect_pkcs12_AuthenticatedSafe(FALSE, tvb, offset, pinfo, tree, hf_pkcs12_AuthenticatedSafe_PDU); + dissect_pkcs12_AuthenticatedSafe(FALSE, tvb, offset, &asn1_ctx, tree, hf_pkcs12_AuthenticatedSafe_PDU); } static void dissect_SafeContents_OCTETSTRING_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { int offset = 0; + asn1_ctx_t asn1_ctx; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); if((offset = strip_octet_string(tvb, tree)) > 0) - dissect_pkcs12_SafeContents(FALSE, tvb, offset, pinfo, tree, hf_pkcs12_SafeContents_PDU); + dissect_pkcs12_SafeContents(FALSE, tvb, offset, &asn1_ctx, tree, hf_pkcs12_SafeContents_PDU); } #if 0 diff --git a/asn1/pkcs12/pkcs12.cnf b/asn1/pkcs12/pkcs12.cnf index 4a86238dc4..6e60b9bc3a 100644 --- a/asn1/pkcs12/pkcs12.cnf +++ b/asn1/pkcs12/pkcs12.cnf @@ -15,11 +15,11 @@ PKCS-5 x509af #.REGISTER -KeyBag B "1.2.840.113549.1.12.10.1.1" "keyBag" +KeyBag B "1.2.840.113549.1.12.10.1.1" "keyBag" PKCS8ShroudedKeyBag B "1.2.840.113549.1.12.10.1.2" "pkcs8ShroudedKeyBag" -CertBag B "1.2.840.113549.1.12.10.1.3" "certBag" -SecretBag B "1.2.840.113549.1.12.10.1.4" "secretBag" -CRLBag B "1.2.840.113549.1.12.10.1.5" "crlBag" +CertBag B "1.2.840.113549.1.12.10.1.3" "certBag" +SecretBag B "1.2.840.113549.1.12.10.1.4" "secretBag" +CRLBag B "1.2.840.113549.1.12.10.1.5" "crlBag" SafeContents B "1.2.840.113549.1.12.10.1.6" "safeContentsBag" # PKCS#9 Attributes - see master list in x509sat.cnf @@ -42,7 +42,7 @@ PBEParameter B "1.2.840.113549.1.5.10" "pbeWithSHA1AndDES-CBC" PBEParameter B "1.2.840.113549.1.5.11" "pbeWithSHA1AndRC2-CBC" PBKDF2Params B "1.2.840.113549.1.5.12" "id-PBKDF2" -PBES2Params B "1.2.840.113549.1.5.13" "id-PBES2" +PBES2Params B "1.2.840.113549.1.5.13" "id-PBES2" PBMAC1Params B "1.2.840.113549.1.5.14" "id-PBMAC1" #.NO_EMIT @@ -94,23 +94,23 @@ AuthenticatedSafe #.FN_BODY T_bagValue if(object_identifier_id) - offset = call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.FN_BODY T_attrValues_item if(object_identifier_id) - offset = call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.FN_BODY T_certValue if(object_identifier_id) - offset = call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.FN_BODY T_crlValue if(object_identifier_id) - offset = call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.FN_BODY T_secretValue if(object_identifier_id) - offset = call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.END diff --git a/asn1/pkinit/packet-pkinit-template.c b/asn1/pkinit/packet-pkinit-template.c index 1e9a4d1d91..fddcf1fda5 100644 --- a/asn1/pkinit/packet-pkinit-template.c +++ b/asn1/pkinit/packet-pkinit-template.c @@ -30,6 +30,7 @@ #include <glib.h> #include <epan/packet.h> #include <epan/conversation.h> +#include <epan/asn1.h> #include <stdio.h> #include <string.h> @@ -51,32 +52,32 @@ static int proto_pkinit = -1; /* Initialize the subtree pointers */ #include "packet-pkinit-ett.c" -static int dissect_KerberosV5Spec2_KerberosTime(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index _U_); -static int dissect_KerberosV5Spec2_Checksum(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index _U_); +static int dissect_KerberosV5Spec2_KerberosTime(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_); +static int dissect_KerberosV5Spec2_Checksum(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_); #include "packet-pkinit-fn.c" int -dissect_pkinit_PA_PK_AS_REQ(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_) { - offset = dissect_pkinit_PaPkAsReq(FALSE, tvb, offset, pinfo, tree, -1); +dissect_pkinit_PA_PK_AS_REQ(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_) { + offset = dissect_pkinit_PaPkAsReq(FALSE, tvb, offset, actx, tree, -1); return offset; } int -dissect_pkinit_PA_PK_AS_REP(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_) { - offset = dissect_pkinit_PaPkAsRep(FALSE, tvb, offset, pinfo, tree, -1); +dissect_pkinit_PA_PK_AS_REP(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_) { + offset = dissect_pkinit_PaPkAsRep(FALSE, tvb, offset, actx, tree, -1); return offset; } static int -dissect_KerberosV5Spec2_KerberosTime(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index _U_) { - offset = dissect_krb5_ctime(pinfo, tree, tvb, offset, NULL /* actx */); +dissect_KerberosV5Spec2_KerberosTime(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_) { + offset = dissect_krb5_ctime(tree, tvb, offset, actx); return offset; } static int -dissect_KerberosV5Spec2_Checksum(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index _U_) { - offset = dissect_krb5_Checksum(pinfo, tree, tvb, offset, NULL /* actx */); +dissect_KerberosV5Spec2_Checksum(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_) { + offset = dissect_krb5_Checksum(tree, tvb, offset, actx); return offset; } diff --git a/asn1/pkinit/packet-pkinit-template.h b/asn1/pkinit/packet-pkinit-template.h index 06185fafa0..9d0d82f5ce 100644 --- a/asn1/pkinit/packet-pkinit-template.h +++ b/asn1/pkinit/packet-pkinit-template.h @@ -26,8 +26,8 @@ #ifndef PACKET_PKINIT_H #define PACKET_PKINIT_H -int dissect_pkinit_PA_PK_AS_REQ(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_); -int dissect_pkinit_PA_PK_AS_REP(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_); +int dissect_pkinit_PA_PK_AS_REQ(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_); +int dissect_pkinit_PA_PK_AS_REP(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_); /*#include "packet-pkinit-exp.h"*/ diff --git a/asn1/pkix1explicit/packet-pkix1explicit-template.c b/asn1/pkix1explicit/packet-pkix1explicit-template.c index 1e25b07105..7e49bd27de 100644 --- a/asn1/pkix1explicit/packet-pkix1explicit-template.c +++ b/asn1/pkix1explicit/packet-pkix1explicit-template.c @@ -31,6 +31,7 @@ #include <glib.h> #include <epan/packet.h> #include <epan/conversation.h> +#include <epan/asn1.h> #include <stdio.h> #include <string.h> @@ -57,39 +58,39 @@ static int hf_pkix1explicit_object_identifier_id = -1; static const char *object_identifier_id; int -dissect_pkix1explicit_Certificate(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { - offset = dissect_x509af_Certificate(implicit_tag, tvb, offset, pinfo, tree, hf_index); +dissect_pkix1explicit_Certificate(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index) { + offset = dissect_x509af_Certificate(implicit_tag, tvb, offset, actx, tree, hf_index); return offset; } int -dissect_pkix1explicit_CertificateList(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { - offset = dissect_x509af_CertificateList(implicit_tag, tvb, offset, pinfo, tree, hf_index); +dissect_pkix1explicit_CertificateList(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index) { + offset = dissect_x509af_CertificateList(implicit_tag, tvb, offset, actx, tree, hf_index); return offset; } int -dissect_pkix1explicit_GeneralName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { - offset = dissect_x509ce_GeneralName(implicit_tag, tvb, offset, pinfo, tree, hf_index); +dissect_pkix1explicit_GeneralName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index) { + offset = dissect_x509ce_GeneralName(implicit_tag, tvb, offset, actx, tree, hf_index); return offset; } int -dissect_pkix1explicit_Name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { - offset = dissect_x509if_Name(implicit_tag, tvb, offset, pinfo, tree, hf_index); +dissect_pkix1explicit_Name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index) { + offset = dissect_x509if_Name(implicit_tag, tvb, offset, actx, tree, hf_index); return offset; } int -dissect_pkix1explicit_AlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { - offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index); +dissect_pkix1explicit_AlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index) { + offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, actx, tree, hf_index); return offset; } int -dissect_pkix1explicit_SubjectPublicKeyInfo(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index) { - offset = dissect_x509af_SubjectPublicKeyInfo(implicit_tag, tvb, offset, pinfo, tree, hf_index); +dissect_pkix1explicit_SubjectPublicKeyInfo(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index) { + offset = dissect_x509af_SubjectPublicKeyInfo(implicit_tag, tvb, offset, actx, tree, hf_index); return offset; } diff --git a/asn1/pkix1explicit/packet-pkix1explicit-template.h b/asn1/pkix1explicit/packet-pkix1explicit-template.h index 48e8105fc2..b0d101f4f9 100644 --- a/asn1/pkix1explicit/packet-pkix1explicit-template.h +++ b/asn1/pkix1explicit/packet-pkix1explicit-template.h @@ -25,13 +25,13 @@ #ifndef PACKET_PKIX1EXPLICIT_H #define PACKET_PKIX1EXPLICIT_H -int dissect_pkix1explicit_Certificate(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); -int dissect_pkix1explicit_CertificateList(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); -int dissect_pkix1explicit_CertificateSerialNumber(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); -int dissect_pkix1explicit_Name(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); -int dissect_pkix1explicit_GeneralName(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); -int dissect_pkix1explicit_AlgorithmIdentifier(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index); -int dissect_pkix1explicit_SubjectPublicKeyInfo(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); +int dissect_pkix1explicit_Certificate(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index); +int dissect_pkix1explicit_CertificateList(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index); +int dissect_pkix1explicit_CertificateSerialNumber(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index); +int dissect_pkix1explicit_Name(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index); +int dissect_pkix1explicit_GeneralName(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index); +int dissect_pkix1explicit_AlgorithmIdentifier(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx,proto_tree *tree, int hf_index); +int dissect_pkix1explicit_SubjectPublicKeyInfo(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index); #include "packet-pkix1explicit-exp.h" diff --git a/asn1/pkix1explicit/pkix1explicit.cnf b/asn1/pkix1explicit/pkix1explicit.cnf index 2ee8302b40..4c066c8e84 100644 --- a/asn1/pkix1explicit/pkix1explicit.cnf +++ b/asn1/pkix1explicit/pkix1explicit.cnf @@ -29,13 +29,13 @@ DomainParameters B "1.2.840.10046.2.1" "dhpublicnumber" #.FIELD_RENAME #.FN_BODY DirectoryString - offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL); + offset = dissect_ber_octet_string(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, NULL); #.FN_PARS AttributeTypeAndValue/value FN_VARIANT = _str HF_INDEX = hf_pkix1explicit_object_identifier_id VAL_PTR = &object_identifier_id #.FN_BODY AttributeTypeAndValue/value - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.FN_PARS Extension/extnId FN_VARIANT = _str HF_INDEX = hf_pkix1explicit_object_identifier_id VAL_PTR = &object_identifier_id @@ -46,9 +46,9 @@ DomainParameters B "1.2.840.10046.2.1" "dhpublicnumber" gint32 tag; guint32 len; /* skip past the T and L */ - offset = dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag); - offset = dissect_ber_length(pinfo, tree, tvb, offset, &len, &ind); - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &class, &pc, &tag); + offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.END diff --git a/asn1/pkix1implicit/packet-pkix1implicit-template.c b/asn1/pkix1implicit/packet-pkix1implicit-template.c index 39e816f5d3..931290e3c4 100644 --- a/asn1/pkix1implicit/packet-pkix1implicit-template.c +++ b/asn1/pkix1implicit/packet-pkix1implicit-template.c @@ -33,6 +33,7 @@ #include <stdio.h> #include <string.h> +#include <epan/asn1.h> #include "packet-ber.h" #include "packet-pkix1implicit.h" #include "packet-pkix1explicit.h" @@ -51,14 +52,14 @@ static int proto_pkix1implicit = -1; int -dissect_pkix1implicit_ReasonFlags(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { - offset = dissect_x509ce_ReasonFlags(implicit_tag, tvb, offset, pinfo, tree, hf_index); +dissect_pkix1implicit_ReasonFlags(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_) { + offset = dissect_x509ce_ReasonFlags(implicit_tag, tvb, offset, actx, tree, hf_index); return offset; } int -dissect_pkix1implicit_GeneralName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { - offset = dissect_x509ce_GeneralName(implicit_tag, tvb, offset, pinfo, tree, hf_index); +dissect_pkix1implicit_GeneralName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_) { + offset = dissect_x509ce_GeneralName(implicit_tag, tvb, offset, actx, tree, hf_index); return offset; } diff --git a/asn1/pkix1implicit/packet-pkix1implicit-template.h b/asn1/pkix1implicit/packet-pkix1implicit-template.h index 8ce33f6d94..5876422ad6 100644 --- a/asn1/pkix1implicit/packet-pkix1implicit-template.h +++ b/asn1/pkix1implicit/packet-pkix1implicit-template.h @@ -25,8 +25,8 @@ #ifndef PACKET_PKIX1IMPLICIT_H #define PACKET_PKIX1IMPLICIT_H -int dissect_pkix1implicit_GeneralName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_); -int dissect_pkix1implicit_ReasonFlags(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_); +int dissect_pkix1implicit_GeneralName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_); +int dissect_pkix1implicit_ReasonFlags(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_); #include "packet-pkix1implicit-exp.h" diff --git a/asn1/pkixcmp/cmp.cnf b/asn1/pkixcmp/cmp.cnf index 66798b85bf..e572d88425 100644 --- a/asn1/pkixcmp/cmp.cnf +++ b/asn1/pkixcmp/cmp.cnf @@ -63,7 +63,7 @@ RevReqContent FN_VARIANT = _str HF_INDEX = hf_cmp_type_oid VAL_PTR = &object_identifier_id #.FN_BODY InfoTypeAndValue/infoValue - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.END diff --git a/asn1/pkixcmp/packet-cmp-template.c b/asn1/pkixcmp/packet-cmp-template.c index 81d4495f7d..e53b6f5b4e 100644 --- a/asn1/pkixcmp/packet-cmp-template.c +++ b/asn1/pkixcmp/packet-cmp-template.c @@ -34,6 +34,7 @@ #include <stdio.h> #include <string.h> +#include <epan/asn1.h> #include "packet-ber.h" #include "packet-cmp.h" #include "packet-crmf.h" @@ -73,9 +74,9 @@ static const char *object_identifier_id; #include "packet-cmp-fn.c" static int -dissect_cmp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +dissect_cmp_pdu(tvbuff_t *tvb, proto_tree *tree, asn1_ctx_t *actx) { - return dissect_cmp_PKIMessage(FALSE, tvb, 0, pinfo, tree, -1); + return dissect_cmp_PKIMessage(FALSE, tvb, 0, actx,tree, -1); } #define CMP_TYPE_PKIMSG 0 @@ -102,9 +103,11 @@ static void dissect_cmp_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *p guint32 pdu_len; guint8 pdu_type; nstime_t ts; - proto_item *item=NULL; proto_tree *tree=NULL; + asn1_ctx_t asn1_ctx; + + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); if (check_col(pinfo->cinfo, COL_PROTOCOL)) col_set_str(pinfo->cinfo, COL_PROTOCOL, "CMP"); @@ -134,7 +137,7 @@ static void dissect_cmp_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *p switch(pdu_type){ case CMP_TYPE_PKIMSG: next_tvb = tvb_new_subset(tvb, 5, tvb_length_remaining(tvb, 5), pdu_len); - dissect_cmp_pdu(next_tvb, pinfo, tree); + dissect_cmp_pdu(next_tvb, tree, &asn1_ctx); break; case CMP_TYPE_POLLREP: proto_tree_add_item(tree, hf_cmp_poll_ref, tvb, 0, 4, FALSE); @@ -156,11 +159,11 @@ static void dissect_cmp_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *p proto_tree_add_time(tree, hf_cmp_ttcb, tvb, 4, 4, &ts); next_tvb = tvb_new_subset(tvb, 13, tvb_length_remaining(tvb, 13), pdu_len); - dissect_cmp_pdu(next_tvb, pinfo, tree); + dissect_cmp_pdu(next_tvb, tree, &asn1_ctx); break; case CMP_TYPE_FINALMSGREP: next_tvb = tvb_new_subset(tvb, 5, tvb_length_remaining(tvb, 5), pdu_len); - dissect_cmp_pdu(next_tvb, pinfo, tree); + dissect_cmp_pdu(next_tvb, tree, &asn1_ctx); break; case CMP_TYPE_ERRORMSGREP: /*XXX to be added*/ @@ -227,6 +230,9 @@ dissect_cmp_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { proto_item *item=NULL; proto_tree *tree=NULL; + asn1_ctx_t asn1_ctx; + + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); if (check_col(pinfo->cinfo, COL_PROTOCOL)) col_set_str(pinfo->cinfo, COL_PROTOCOL, "CMP"); @@ -243,7 +249,7 @@ dissect_cmp_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) tree = proto_item_add_subtree(item, ett_cmp); } - return dissect_cmp_pdu(tvb, pinfo, tree); + return dissect_cmp_pdu(tvb, tree, &asn1_ctx); } diff --git a/asn1/pkixcrmf/crmf.cnf b/asn1/pkixcrmf/crmf.cnf index 969a2c9d2f..2b902b1f5f 100644 --- a/asn1/pkixcrmf/crmf.cnf +++ b/asn1/pkixcrmf/crmf.cnf @@ -56,7 +56,7 @@ PKMACValue/value pkmac_value FN_VARIANT = _str HF_INDEX = hf_crmf_type_oid VAL_PTR = &object_identifier_id #.FN_BODY AttributeTypeAndValue/value - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.END diff --git a/asn1/pkixcrmf/packet-crmf-template.c b/asn1/pkixcrmf/packet-crmf-template.c index f8ad6b5b2f..5e5966dfe5 100644 --- a/asn1/pkixcrmf/packet-crmf-template.c +++ b/asn1/pkixcrmf/packet-crmf-template.c @@ -30,6 +30,7 @@ #include <glib.h> #include <epan/packet.h> #include <epan/conversation.h> +#include <epan/asn1.h> #include <stdio.h> #include <string.h> diff --git a/asn1/pkixproxy/packet-pkixproxy-template.c b/asn1/pkixproxy/packet-pkixproxy-template.c index 45f32b10cf..eb9b1a71bd 100644 --- a/asn1/pkixproxy/packet-pkixproxy-template.c +++ b/asn1/pkixproxy/packet-pkixproxy-template.c @@ -30,6 +30,7 @@ #include <glib.h> #include <epan/packet.h> #include <epan/oid_resolv.h> +#include <epan/asn1.h> #include <stdio.h> #include <string.h> diff --git a/asn1/pkixqualified/packet-pkixqualified-template.c b/asn1/pkixqualified/packet-pkixqualified-template.c index 801d21032c..1d669c2b0a 100644 --- a/asn1/pkixqualified/packet-pkixqualified-template.c +++ b/asn1/pkixqualified/packet-pkixqualified-template.c @@ -30,6 +30,7 @@ #include <glib.h> #include <epan/packet.h> #include <epan/conversation.h> +#include <epan/asn1.h> #include <stdio.h> #include <string.h> diff --git a/asn1/pkixqualified/pkixqualified.cnf b/asn1/pkixqualified/pkixqualified.cnf index 51231f1ad2..1e19ce4cd3 100644 --- a/asn1/pkixqualified/pkixqualified.cnf +++ b/asn1/pkixqualified/pkixqualified.cnf @@ -30,7 +30,7 @@ Printablestring B "1.3.6.1.5.5.7.9.5" "id-pda-countryOfResidence" FN_VARIANT = _str HF_INDEX = hf_pkixqualified_statementId VAL_PTR = &object_identifier_id #.FN_BODY QCStatement/statementInfo - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.END diff --git a/asn1/pkixtsp/packet-pkixtsp-template.c b/asn1/pkixtsp/packet-pkixtsp-template.c index 826b97554b..b5f79b02e5 100644 --- a/asn1/pkixtsp/packet-pkixtsp-template.c +++ b/asn1/pkixtsp/packet-pkixtsp-template.c @@ -33,6 +33,7 @@ #include <stdio.h> #include <string.h> +#include <epan/asn1.h> #include "packet-ber.h" #include "packet-pkixtsp.h" #include "packet-pkix1explicit.h" @@ -60,6 +61,8 @@ dissect_timestamp_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tr { proto_item *item=NULL; proto_tree *tree=NULL; + asn1_ctx_t asn1_ctx; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); if (check_col(pinfo->cinfo, COL_PROTOCOL)) col_set_str(pinfo->cinfo, COL_PROTOCOL, "PKIXTSP"); @@ -76,7 +79,7 @@ dissect_timestamp_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tr tree = proto_item_add_subtree(item, ett_pkixtsp); } - return dissect_pkixtsp_TimeStampResp(FALSE, tvb, 0, pinfo, tree, -1); + return dissect_pkixtsp_TimeStampResp(FALSE, tvb, 0, &asn1_ctx, tree, -1); } static int @@ -84,6 +87,8 @@ dissect_timestamp_query(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tr { proto_item *item=NULL; proto_tree *tree=NULL; + asn1_ctx_t asn1_ctx; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); if (check_col(pinfo->cinfo, COL_PROTOCOL)) col_set_str(pinfo->cinfo, COL_PROTOCOL, "PKIXTSP"); @@ -100,7 +105,7 @@ dissect_timestamp_query(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tr tree = proto_item_add_subtree(item, ett_pkixtsp); } - return dissect_pkixtsp_TimeStampReq(FALSE, tvb, 0, pinfo, tree, -1); + return dissect_pkixtsp_TimeStampReq(FALSE, tvb, 0, &asn1_ctx, tree, -1); } diff --git a/asn1/pres/packet-pres-template.c b/asn1/pres/packet-pres-template.c index 2afed32f14..aede2abbba 100644 --- a/asn1/pres/packet-pres-template.c +++ b/asn1/pres/packet-pres-template.c @@ -36,6 +36,7 @@ #include <stdio.h> #include <string.h> +#include <epan/asn1.h> #include "packet-ber.h" #include "packet-ses.h" #include "packet-pres.h" @@ -158,7 +159,10 @@ dissect_ppdu(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) proto_item *ti; proto_tree *pres_tree = NULL; guint s_type; -/* do we have spdu type from the session dissector? */ + asn1_ctx_t asn1_ctx; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); + + /* do we have spdu type from the session dissector? */ if( !pinfo->private_data ){ if(tree){ proto_tree_add_text(tree, tvb, offset, -1, @@ -189,32 +193,32 @@ dissect_ppdu(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) switch(session->spdu_type){ case SES_CONNECTION_REQUEST: - offset = dissect_pres_CP_type(FALSE, tvb, offset, pinfo, pres_tree, hf_pres_CP_type); + offset = dissect_pres_CP_type(FALSE, tvb, offset, &asn1_ctx, pres_tree, hf_pres_CP_type); break; case SES_CONNECTION_ACCEPT: - offset = dissect_pres_CPA_PPDU(FALSE, tvb, offset, pinfo, pres_tree, hf_pres_CPA_PPDU); + offset = dissect_pres_CPA_PPDU(FALSE, tvb, offset, &asn1_ctx, pres_tree, hf_pres_CPA_PPDU); break; case SES_ABORT: case SES_ABORT_ACCEPT: - offset = dissect_pres_Abort_type(FALSE, tvb, offset, pinfo, pres_tree, hf_pres_Abort_type); + offset = dissect_pres_Abort_type(FALSE, tvb, offset, &asn1_ctx, pres_tree, hf_pres_Abort_type); break; case SES_DATA_TRANSFER: - offset = dissect_pres_CPC_type(FALSE, tvb, offset, pinfo, pres_tree, hf_pres_user_data); + offset = dissect_pres_CPC_type(FALSE, tvb, offset, &asn1_ctx, pres_tree, hf_pres_user_data); break; case SES_TYPED_DATA: - offset = dissect_pres_Typed_data_type(FALSE, tvb, offset, pinfo, pres_tree, hf_pres_Typed_data_type); + offset = dissect_pres_Typed_data_type(FALSE, tvb, offset, &asn1_ctx, pres_tree, hf_pres_Typed_data_type); break; case SES_RESYNCHRONIZE: - offset = dissect_pres_RS_PPDU(FALSE, tvb, offset, pinfo, pres_tree, -1); + offset = dissect_pres_RS_PPDU(FALSE, tvb, offset, &asn1_ctx, pres_tree, -1); break; case SES_RESYNCHRONIZE_ACK: - offset = dissect_pres_RSA_PPDU(FALSE, tvb, offset, pinfo, pres_tree, -1); + offset = dissect_pres_RSA_PPDU(FALSE, tvb, offset, &asn1_ctx, pres_tree, -1); break; case SES_REFUSE: - offset = dissect_pres_CPR_PPDU(FALSE, tvb, offset, pinfo, pres_tree, hf_pres_CPR_PPDU); + offset = dissect_pres_CPR_PPDU(FALSE, tvb, offset, &asn1_ctx, pres_tree, hf_pres_CPR_PPDU); break; default: - offset = dissect_pres_CPC_type(FALSE, tvb, offset, pinfo, pres_tree, hf_pres_user_data); + offset = dissect_pres_CPC_type(FALSE, tvb, offset, &asn1_ctx, pres_tree, hf_pres_user_data); break; } diff --git a/asn1/pres/pres.cnf b/asn1/pres/pres.cnf index 303d5e49c2..96180d59ce 100644 --- a/asn1/pres/pres.cnf +++ b/asn1/pres/pres.cnf @@ -36,10 +36,10 @@ CPR-PPDU/normal-mode-parameters/provider-reason cPR_PPDU__provider-reason tvbuff_t *next_tvb; char *oid; - oid=find_oid_by_pres_ctx_id(pinfo, presentation_context_identifier); + oid=find_oid_by_pres_ctx_id(actx->pinfo, presentation_context_identifier); if(oid){ next_tvb = tvb_new_subset(tvb, offset, -1, -1); - call_ber_oid_callback(oid, next_tvb, offset, pinfo, global_tree); + call_ber_oid_callback(oid, next_tvb, offset, actx->pinfo, global_tree); } else { proto_tree_add_text(tree, tvb, offset, -1,"dissector is not available"); %(DEFAULT_BODY)s @@ -49,10 +49,10 @@ CPR-PPDU/normal-mode-parameters/provider-reason cPR_PPDU__provider-reason tvbuff_t *next_tvb; char *oid; - oid=find_oid_by_pres_ctx_id(pinfo, presentation_context_identifier); + oid=find_oid_by_pres_ctx_id(actx->pinfo, presentation_context_identifier); if(oid){ next_tvb = tvb_new_subset(tvb, offset, -1, -1); - call_ber_oid_callback(oid, next_tvb, offset, pinfo, global_tree); + call_ber_oid_callback(oid, next_tvb, offset, actx->pinfo, global_tree); } else { proto_tree_add_text(tree, tvb, offset, -1,"dissector is not available"); %(DEFAULT_BODY)s @@ -76,5 +76,5 @@ CPR-PPDU/normal-mode-parameters/provider-reason cPR_PPDU__provider-reason abstract_syntax_name_oid=NULL; #.END #.FN_FTR Context-list/_item - register_ctx_id_and_oid(pinfo, presentation_context_identifier, abstract_syntax_name_oid); + register_ctx_id_and_oid(actx->pinfo, presentation_context_identifier, abstract_syntax_name_oid); #.END diff --git a/asn1/q932/packet-q932-ros-template.c b/asn1/q932/packet-q932-ros-template.c index 5fb6124c74..e038008374 100644 --- a/asn1/q932/packet-q932-ros-template.c +++ b/asn1/q932/packet-q932-ros-template.c @@ -33,6 +33,7 @@ #include <epan/prefs.h> #include <epan/strutil.h> #include <epan/emem.h> +#include <epan/asn1.h> #include "packet-ber.h" #include "packet-q932-ros.h" diff --git a/asn1/q932/packet-q932-template.c b/asn1/q932/packet-q932-template.c index 0bc5efdbc8..1c7ffe08a1 100644 --- a/asn1/q932/packet-q932-template.c +++ b/asn1/q932/packet-q932-template.c @@ -31,6 +31,7 @@ #include <epan/prefs.h> #include <epan/strutil.h> #include <epan/emem.h> +#include <epan/asn1.h> #include "packet-ber.h" #include "packet-q932-ros.h" diff --git a/asn1/q932/q932-ros.cnf b/asn1/q932/q932-ros.cnf index e2d69f5abd..8053a1ea08 100644 --- a/asn1/q932/q932-ros.cnf +++ b/asn1/q932/q932-ros.cnf @@ -87,8 +87,8 @@ Invoke/argument TYPE = FT_BYTES DISPLAY = BASE_HEX proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), rose_ctx->apdu_depth), " %s", code_global); } if (arg_next_tvb) { - pinfo->private_data = rose_ctx; - call_dissector((arg_handle)?arg_handle:data_handle, arg_next_tvb, pinfo, tree); + actx->pinfo->private_data = rose_ctx; + call_dissector((arg_handle)?arg_handle:data_handle, arg_next_tvb, actx->pinfo, tree); } #.END @@ -130,8 +130,8 @@ ReturnResult/result/result TYPE = FT_BYTES DISPLAY = BASE_HEX proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), rose_ctx->apdu_depth), " %s", code_global); } if (res_next_tvb) { - pinfo->private_data = rose_ctx; - call_dissector((res_handle)?res_handle:data_handle, res_next_tvb, pinfo, tree); + actx->pinfo->private_data = rose_ctx; + call_dissector((res_handle)?res_handle:data_handle, res_next_tvb, actx->pinfo, tree); } #.END @@ -173,8 +173,8 @@ ReturnError/parameter TYPE = FT_BYTES DISPLAY = BASE_HEX proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), rose_ctx->apdu_depth), " %s", code_global); } if (err_next_tvb) { - pinfo->private_data = rose_ctx; - call_dissector((err_handle)?err_handle:data_handle, err_next_tvb, pinfo, tree); + actx->pinfo->private_data = rose_ctx; + call_dissector((err_handle)?err_handle:data_handle, err_next_tvb, actx->pinfo, tree); } #.END diff --git a/asn1/qsig/packet-qsig-template.c b/asn1/qsig/packet-qsig-template.c index 7f29241cbf..868986e177 100644 --- a/asn1/qsig/packet-qsig-template.c +++ b/asn1/qsig/packet-qsig-template.c @@ -31,6 +31,7 @@ #include <epan/prefs.h> #include <epan/strutil.h> #include <epan/emem.h> +#include <epan/asn1.h> #include "packet-ber.h" #include "packet-qsig.h" diff --git a/asn1/ros/packet-ros-template.c b/asn1/ros/packet-ros-template.c index 9ec29dacaa..a0a44b3fc6 100644 --- a/asn1/ros/packet-ros-template.c +++ b/asn1/ros/packet-ros-template.c @@ -31,6 +31,7 @@ #include <epan/packet.h> #include <epan/conversation.h> #include <epan/emem.h> +#include <epan/asn1.h> #include <stdio.h> #include <string.h> @@ -269,6 +270,8 @@ dissect_ros(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) proto_tree *tree=NULL; conversation_t *conversation; ros_conv_info_t *ros_info = NULL; + asn1_ctx_t asn1_ctx; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); /* save parent_tree so subdissectors can create new top nodes */ top_tree=parent_tree; @@ -330,7 +333,7 @@ dissect_ros(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) while (tvb_reported_length_remaining(tvb, offset) > 0){ old_offset=offset; - offset=dissect_ros_ROS(FALSE, tvb, offset, pinfo , tree, -1); + offset=dissect_ros_ROS(FALSE, tvb, offset, &asn1_ctx , tree, -1); if(offset == old_offset){ proto_tree_add_text(tree, tvb, offset, -1,"Internal error, zero-byte ROS PDU"); offset = tvb_length(tvb); diff --git a/asn1/ros/ros.cnf b/asn1/ros/ros.cnf index 9c3f33b7c1..462a7c9c3d 100644 --- a/asn1/ros/ros.cnf +++ b/asn1/ros/ros.cnf @@ -22,14 +22,14 @@ Reject/problem/returnResult rejectResult /* not sure what the length should be - -1 for now */ proto_tree_add_text(tree, tvb, offset,-1, "invoke argument"); - ros_match_call_response(tvb, pinfo, tree, invokeid, TRUE); + ros_match_call_response(tvb, actx->pinfo, tree, invokeid, TRUE); - if(session && session->pres_ctx_id && (oid = find_oid_by_pres_ctx_id(pinfo, session->pres_ctx_id))) { + if(session && session->pres_ctx_id && (oid = find_oid_by_pres_ctx_id(actx->pinfo, session->pres_ctx_id))) { /* this should be ROS! */ session->ros_op = (ROS_OP_INVOKE | ROS_OP_ARGUMENT); /* now add the opcode */ session->ros_op |= opcode; - offset = call_ros_oid_callback(oid, tvb, offset, pinfo, top_tree); + offset = call_ros_oid_callback(oid, tvb, offset, actx->pinfo, top_tree); } #.FN_BODY OperationResult @@ -37,14 +37,14 @@ Reject/problem/returnResult rejectResult /* not sure what the length should be - -1 for now */ proto_tree_add_text(tree, tvb, offset,-1, "return result"); - ros_match_call_response(tvb, pinfo, tree, invokeid, FALSE); + ros_match_call_response(tvb, actx->pinfo, tree, invokeid, FALSE); - if(session && session->pres_ctx_id && (oid = find_oid_by_pres_ctx_id(pinfo, session->pres_ctx_id))) { + if(session && session->pres_ctx_id && (oid = find_oid_by_pres_ctx_id(actx->pinfo, session->pres_ctx_id))) { /* this should be ROS! */ session->ros_op = (ROS_OP_INVOKE | ROS_OP_RESULT); /* now add the opcode */ session->ros_op |= opcode; - offset = call_ros_oid_callback(oid, tvb, offset, pinfo, top_tree); + offset = call_ros_oid_callback(oid, tvb, offset, actx->pinfo, top_tree); } #.FN_BODY T_parameter @@ -52,14 +52,14 @@ Reject/problem/returnResult rejectResult /* not sure what the length should be - -1 for now */ proto_tree_add_text(tree, tvb, offset,-1, "return result"); - ros_match_call_response(tvb, pinfo, tree, invokeid, FALSE); + ros_match_call_response(tvb, actx->pinfo, tree, invokeid, FALSE); - if(session && session->pres_ctx_id && (oid = find_oid_by_pres_ctx_id(pinfo, session->pres_ctx_id))) { + if(session && session->pres_ctx_id && (oid = find_oid_by_pres_ctx_id(actx->pinfo, session->pres_ctx_id))) { /* this should be ROS! */ session->ros_op = (ROS_OP_INVOKE | ROS_OP_ERROR); /* now add the opcode (really the errode) */ session->ros_op |= opcode; - offset = call_ros_oid_callback(oid, tvb, offset, pinfo, top_tree); + offset = call_ros_oid_callback(oid, tvb, offset, actx->pinfo, top_tree); } @@ -68,10 +68,10 @@ Reject/problem/returnResult rejectResult /* not sure what the length should be - -1 for now */ proto_tree_add_text(tree, tvb, offset,-1, "bind-invoke"); - if(session && session->pres_ctx_id && (oid = find_oid_by_pres_ctx_id(pinfo, session->pres_ctx_id))) { + if(session && session->pres_ctx_id && (oid = find_oid_by_pres_ctx_id(actx->pinfo, session->pres_ctx_id))) { /* this should be ROS! */ session->ros_op = (ROS_OP_BIND | ROS_OP_ARGUMENT); - offset = call_ros_oid_callback(oid, tvb, offset, pinfo, top_tree); + offset = call_ros_oid_callback(oid, tvb, offset, actx->pinfo, top_tree); } #.FN_BODY T_bind_result @@ -79,10 +79,10 @@ Reject/problem/returnResult rejectResult /* not sure what the length should be - -1 for now */ proto_tree_add_text(tree, tvb, offset,-1, "bind-result"); - if(session && session->pres_ctx_id && (oid = find_oid_by_pres_ctx_id(pinfo, session->pres_ctx_id))) { + if(session && session->pres_ctx_id && (oid = find_oid_by_pres_ctx_id(actx->pinfo, session->pres_ctx_id))) { /* this should be ROS! */ session->ros_op = (ROS_OP_BIND | ROS_OP_RESULT); - offset = call_ros_oid_callback(oid, tvb, offset, pinfo, top_tree); + offset = call_ros_oid_callback(oid, tvb, offset, actx->pinfo, top_tree); } #.FN_BODY T_bind_error @@ -90,10 +90,10 @@ Reject/problem/returnResult rejectResult /* not sure what the length should be - -1 for now */ proto_tree_add_text(tree, tvb, offset,-1, "bind-error"); - if(session && session->pres_ctx_id && (oid = find_oid_by_pres_ctx_id(pinfo, session->pres_ctx_id))) { + if(session && session->pres_ctx_id && (oid = find_oid_by_pres_ctx_id(actx->pinfo, session->pres_ctx_id))) { /* this should be ROS! */ session->ros_op = (ROS_OP_BIND | ROS_OP_ERROR); - offset = call_ros_oid_callback(oid, tvb, offset, pinfo, top_tree); + offset = call_ros_oid_callback(oid, tvb, offset, actx->pinfo, top_tree); } @@ -102,10 +102,10 @@ Reject/problem/returnResult rejectResult /* not sure what the length should be - -1 for now */ proto_tree_add_text(tree, tvb, offset,-1, "unbind-invoke"); - if(session && session->pres_ctx_id && (oid = find_oid_by_pres_ctx_id(pinfo, session->pres_ctx_id))) { + if(session && session->pres_ctx_id && (oid = find_oid_by_pres_ctx_id(actx->pinfo, session->pres_ctx_id))) { /* this should be ROS! */ session->ros_op = (ROS_OP_UNBIND | ROS_OP_ARGUMENT); - offset = call_ros_oid_callback(oid, tvb, offset, pinfo, top_tree); + offset = call_ros_oid_callback(oid, tvb, offset, actx->pinfo, top_tree); } @@ -114,10 +114,10 @@ Reject/problem/returnResult rejectResult /* not sure what the length should be - -1 for now */ proto_tree_add_text(tree, tvb, offset,-1, "unbind-result"); - if(session && session->pres_ctx_id && (oid = find_oid_by_pres_ctx_id(pinfo, session->pres_ctx_id))) { + if(session && session->pres_ctx_id && (oid = find_oid_by_pres_ctx_id(actx->pinfo, session->pres_ctx_id))) { /* this should be ROS! */ session->ros_op = (ROS_OP_UNBIND | ROS_OP_RESULT); - offset = call_ros_oid_callback(oid, tvb, offset, pinfo, top_tree); + offset = call_ros_oid_callback(oid, tvb, offset, actx->pinfo, top_tree); } #.FN_BODY T_unbind_error @@ -125,9 +125,9 @@ Reject/problem/returnResult rejectResult /* not sure what the length should be - -1 for now */ proto_tree_add_text(tree, tvb, offset,-1, "unbind-error"); - if(session && session->pres_ctx_id && (oid = find_oid_by_pres_ctx_id(pinfo, session->pres_ctx_id))) { + if(session && session->pres_ctx_id && (oid = find_oid_by_pres_ctx_id(actx->pinfo, session->pres_ctx_id))) { /* this should be ROS! */ session->ros_op = (ROS_OP_UNBIND | ROS_OP_ERROR); - offset = call_ros_oid_callback(oid, tvb, offset, pinfo, top_tree); + offset = call_ros_oid_callback(oid, tvb, offset, actx->pinfo, top_tree); } #.END diff --git a/asn1/rtse/packet-rtse-template.c b/asn1/rtse/packet-rtse-template.c index 7ce9e0aabf..202fd082e3 100644 --- a/asn1/rtse/packet-rtse-template.c +++ b/asn1/rtse/packet-rtse-template.c @@ -30,6 +30,7 @@ #include <glib.h> #include <epan/packet.h> #include <epan/conversation.h> +#include <epan/asn1.h> #include <stdio.h> #include <string.h> @@ -133,6 +134,8 @@ dissect_rtse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) int old_offset; proto_item *item=NULL; proto_tree *tree=NULL; + asn1_ctx_t asn1_ctx; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); /* save parent_tree so subdissectors can create new top nodes */ top_tree=parent_tree; @@ -160,7 +163,7 @@ dissect_rtse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) while (tvb_reported_length_remaining(tvb, offset) > 0){ old_offset=offset; - offset=dissect_rtse_RTSE_apdus(FALSE, tvb, offset, pinfo , tree, -1); + offset=dissect_rtse_RTSE_apdus(FALSE, tvb, offset, &asn1_ctx , tree, -1); if(offset == old_offset){ proto_tree_add_text(tree, tvb, offset, -1,"Internal error, zero-byte RTSE PDU"); offset = tvb_length(tvb); diff --git a/asn1/rtse/rtse.cnf b/asn1/rtse/rtse.cnf index d3ea8f5a71..2f527dc4a6 100644 --- a/asn1/rtse/rtse.cnf +++ b/asn1/rtse/rtse.cnf @@ -17,7 +17,7 @@ EXTERNALt break; default: if(session && session->pres_ctx_id) - oid = find_oid_by_pres_ctx_id(pinfo, session->pres_ctx_id); + oid = find_oid_by_pres_ctx_id(actx->pinfo, session->pres_ctx_id); break; } @@ -25,10 +25,10 @@ EXTERNALt oid = "applicationProtocol.12"; if(oid) { - if((session = (struct SESSION_DATA_STRUCTURE*)(pinfo->private_data)) != NULL) + if((session = (struct SESSION_DATA_STRUCTURE*)(actx->pinfo->private_data)) != NULL) session->ros_op = (ROS_OP_BIND | ROS_OP_ERROR); - offset = call_rtse_oid_callback(oid, tvb, offset, pinfo, top_tree ? top_tree : tree); + offset = call_rtse_oid_callback(oid, tvb, offset, actx->pinfo, top_tree ? top_tree : tree); } #.FN_BODY RTABapdu/userdataAB @@ -36,7 +36,7 @@ EXTERNALt #.FN_BODY RTORQapdu - if((session = (struct SESSION_DATA_STRUCTURE*)(pinfo->private_data)) != NULL) + if((session = (struct SESSION_DATA_STRUCTURE*)(actx->pinfo->private_data)) != NULL) session->ros_op = (ROS_OP_BIND | ROS_OP_ARGUMENT); open_request=TRUE; %(DEFAULT_BODY)s @@ -44,7 +44,7 @@ EXTERNALt #.FN_BODY RTOACapdu - if((session = (struct SESSION_DATA_STRUCTURE*)(pinfo->private_data)) != NULL) + if((session = (struct SESSION_DATA_STRUCTURE*)(actx->pinfo->private_data)) != NULL) session->ros_op = (ROS_OP_BIND | ROS_OP_RESULT); %(DEFAULT_BODY)s @@ -62,7 +62,7 @@ EXTERNALt break; default: if(session && session->pres_ctx_id) - oid = find_oid_by_pres_ctx_id(pinfo, session->pres_ctx_id); + oid = find_oid_by_pres_ctx_id(actx->pinfo, session->pres_ctx_id); break; } @@ -71,7 +71,7 @@ EXTERNALt if(oid) { - offset = call_rtse_oid_callback(oid, tvb, offset, pinfo, top_tree ? top_tree : tree); + offset = call_rtse_oid_callback(oid, tvb, offset, actx->pinfo, top_tree ? top_tree : tree); } /* else XXX: need to flag we can't find the presentation context */ @@ -79,7 +79,7 @@ EXTERNALt #.FN_BODY RTTRapdu tvbuff_t *next_tvb = NULL; - offset = dissect_ber_octet_string(FALSE, pinfo, tree, tvb, offset, hf_index, &next_tvb); + offset = dissect_ber_octet_string(FALSE, actx->pinfo, tree, tvb, offset, hf_index, &next_tvb); if(next_tvb) { @@ -89,7 +89,7 @@ EXTERNALt if(session) session->ros_op = (ROS_OP_INVOKE | ROS_OP_ARGUMENT); - offset = dissect_rtse_EXTERNALt(FALSE, next_tvb, 0, pinfo, tree, -1); + offset = dissect_rtse_EXTERNALt(FALSE, next_tvb, 0, actx, tree, -1); } @@ -108,33 +108,33 @@ EXTERNALt offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_ber_sequence(TRUE, pinfo, tree, tvb, offset, + offset = dissect_ber_sequence(TRUE, actx, tree, tvb, offset, EXTERNALt_sequence, hf_index, ett_rtse_EXTERNALt); #.FN_BODY EXTERNALt/indirect-reference char *oid; - offset = dissect_ber_integer(FALSE, pinfo, tree, tvb, offset, + offset = dissect_ber_integer(FALSE, actx->pinfo, tree, tvb, offset, hf_rtse_indirect_reference, &indir_ref); /* look up the indirect reference */ - if((oid = find_oid_by_pres_ctx_id(pinfo, indir_ref)) != NULL) { + if((oid = find_oid_by_pres_ctx_id(actx->pinfo, indir_ref)) != NULL) { g_snprintf(object_identifier_id, MAX_OID_STR_LEN, "%%s", oid); } #.FN_BODY EXTERNALt/encoding/single-ASN1-type - offset=call_rtse_oid_callback(object_identifier_id, tvb, offset, pinfo, top_tree); + offset=call_rtse_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, top_tree); #.FN_BODY T_applicationProtocol - offset = dissect_ber_integer(TRUE, pinfo, tree, tvb, offset, hf_index, &app_proto); + offset = dissect_ber_integer(TRUE, actx->pinfo, tree, tvb, offset, hf_index, &app_proto); #.FN_BODY SessionConnectionIdentifier - if(open_request && check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, "Recover"); + if(open_request && check_col(actx->pinfo->cinfo, COL_INFO)) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, "Recover"); %(DEFAULT_BODY)s #.FN_PARS T61String @@ -142,23 +142,23 @@ EXTERNALt #.FN_BODY T61String tvbuff_t *string = NULL; %(DEFAULT_BODY)s - if(open_request && string && check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, " %%s", tvb_format_text(string, 0, tvb_length(string))); + if(open_request && string && check_col(actx->pinfo->cinfo, COL_INFO)) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", tvb_format_text(string, 0, tvb_length(string))); #.FN_PARS CommonReference VAL_PTR=&string #.FN_BODY CommonReference tvbuff_t *string = NULL; %(DEFAULT_BODY)s - if(open_request && string && check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, " %%s", tvb_format_text(string, 0, tvb_length(string))); + if(open_request && string && check_col(actx->pinfo->cinfo, COL_INFO)) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", tvb_format_text(string, 0, tvb_length(string))); #.FN_PARS OCTET_STRING VAL_PTR=&string #.FN_BODY OCTET_STRING tvbuff_t *string = NULL; %(DEFAULT_BODY)s - if(open_request && string && check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, " %%s", tvb_format_text(string, 0, tvb_length(string))); + if(open_request && string && check_col(actx->pinfo->cinfo, COL_INFO)) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", tvb_format_text(string, 0, tvb_length(string))); #.END diff --git a/asn1/s4406/packet-s4406-template.c b/asn1/s4406/packet-s4406-template.c index 57e0dcea24..438ee54739 100644 --- a/asn1/s4406/packet-s4406-template.c +++ b/asn1/s4406/packet-s4406-template.c @@ -30,6 +30,7 @@ #include <glib.h> #include <epan/packet.h> #include <epan/conversation.h> +#include <epan/asn1.h> #include <stdio.h> #include <string.h> @@ -67,6 +68,8 @@ dissect_s4406(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) int offset = 0; proto_item *item=NULL; proto_tree *tree=NULL; + asn1_ctx_t asn1_ctx; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); if(parent_tree){ item = proto_tree_add_item(parent_tree, proto_s4406, tvb, 0, -1, FALSE); @@ -78,7 +81,7 @@ dissect_s4406(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) if (check_col(pinfo->cinfo, COL_INFO)) col_add_str(pinfo->cinfo, COL_INFO, "Military"); - dissect_s4406_InformationObject(TRUE, tvb, offset, pinfo , tree, -1); + dissect_s4406_InformationObject(TRUE, tvb, offset, &asn1_ctx , tree, -1); } diff --git a/asn1/s4406/s4406.cnf b/asn1/s4406/s4406.cnf index 61ae35e7cc..0eb1a238ad 100644 --- a/asn1/s4406/s4406.cnf +++ b/asn1/s4406/s4406.cnf @@ -33,21 +33,21 @@ Acp127NotificationType SecurityInformationLabels #.REGISTER -PrimaryPrecedence B "1.3.26.0.4406.0.2.0" "primary-precedence" -CopyPrecedence B "1.3.26.0.4406.0.2.1" "copy-precedence" -MessageType B "1.3.26.0.4406.0.2.2" "message-type" +PrimaryPrecedence B "1.3.26.0.4406.0.2.0" "primary-precedence" +CopyPrecedence B "1.3.26.0.4406.0.2.1" "copy-precedence" +MessageType B "1.3.26.0.4406.0.2.2" "message-type" AddressListDesignatorSeq B "1.3.26.0.4406.0.2.3" "address-list-indicator" -ExemptedAddressSeq B "1.3.26.0.4406.0.2.4" "exempted-address" +ExemptedAddressSeq B "1.3.26.0.4406.0.2.4" "exempted-address" ExtendedAuthorisationInfo B "1.3.26.0.4406.0.2.5" "extended-authorisation-info" -DistributionCodes B "1.3.26.0.4406.0.2.6" "distribution-codes" +DistributionCodes B "1.3.26.0.4406.0.2.6" "distribution-codes" HandlingInstructions B "1.3.26.0.4406.0.2.7" "handling-instructions" MessageInstructions B "1.3.26.0.4406.0.2.8" "message-instructions" -CodressMessage B "1.3.26.0.4406.0.2.9" "codress-message" +CodressMessage B "1.3.26.0.4406.0.2.9" "codress-message" OriginatorReference B "1.3.26.0.4406.0.2.10" "originator-reference" -OtherRecipientDesignatorSeq B "1.3.26.0.4406.0.2.11" "other-recipients-indicator" +OtherRecipientDesignatorSeq B "1.3.26.0.4406.0.2.11" "other-recipients-indicator" PilotInformationSeq B "1.3.26.0.4406.0.2.12" "pilot-forwarding-info" Acp127MessageIdentifier B "1.3.26.0.4406.0.2.13" "acp127-message-identifier" -OriginatorPlad B "1.3.26.0.4406.0.2.14" "originator-plad" +OriginatorPlad B "1.3.26.0.4406.0.2.14" "originator-plad" Acp127NotificationType B "1.3.26.0.4406.0.2.15" "acp127-notification-request" SecurityInformationLabels B "1.3.26.0.4406.0.2.17" "information-labels" @@ -69,13 +69,13 @@ InformationObject B "2.6.1.4.17.1.3.26.0.4406.0.4.1" "id-et-content-p772" #.FN_BODY PrimaryPrecedence int precedence = -1; %(DEFAULT_BODY)s - if((precedence != -1) && check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, " (primary=%%s)", val_to_str(precedence, s4406_PrimaryPrecedence_vals, "precedence(%%d)")); + if((precedence != -1) && check_col(actx->pinfo->cinfo, COL_INFO)) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " (primary=%%s)", val_to_str(precedence, s4406_PrimaryPrecedence_vals, "precedence(%%d)")); #.FN_PARS CopyPrecedence VAL_PTR=&precedence #.FN_BODY CopyPrecedence int precedence = -1; %(DEFAULT_BODY)s - if((precedence != -1) && check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, " (copy=%%s)", val_to_str(precedence, s4406_CopyPrecedence_vals, "precedence(%%d)")); + if((precedence != -1) && check_col(actx->pinfo->cinfo, COL_INFO)) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " (copy=%%s)", val_to_str(precedence, s4406_CopyPrecedence_vals, "precedence(%%d)")); diff --git a/asn1/smrse/packet-smrse-template.c b/asn1/smrse/packet-smrse-template.c index 4549f55eca..8b1e26a8cd 100644 --- a/asn1/smrse/packet-smrse-template.c +++ b/asn1/smrse/packet-smrse-template.c @@ -30,6 +30,7 @@ #include <glib.h> #include <epan/packet.h> #include <epan/conversation.h> +#include <epan/asn1.h> #include <stdio.h> #include <string.h> @@ -81,6 +82,8 @@ dissect_smrse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) guint8 reserved, tag; guint16 length; int offset=0; + asn1_ctx_t asn1_ctx; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); reserved=tvb_get_guint8(tvb, 0); length=tvb_get_ntohs(tvb,1); @@ -111,31 +114,31 @@ dissect_smrse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) offset=4; break; case 3: - offset=dissect_smrse_SMR_Bind(FALSE, tvb, 4, pinfo, tree, -1); + offset=dissect_smrse_SMR_Bind(FALSE, tvb, 4, &asn1_ctx, tree, -1); break; case 4: - offset=dissect_smrse_SMR_Bind_Confirm(FALSE, tvb, 4, pinfo, tree, -1); + offset=dissect_smrse_SMR_Bind_Confirm(FALSE, tvb, 4, &asn1_ctx, tree, -1); break; case 5: - offset=dissect_smrse_SMR_Bind_Failure(FALSE, tvb, 4, pinfo, tree, -1); + offset=dissect_smrse_SMR_Bind_Failure(FALSE, tvb, 4, &asn1_ctx, tree, -1); break; case 6: - offset=dissect_smrse_SMR_Unbind(FALSE, tvb, 4, pinfo, tree, -1); + offset=dissect_smrse_SMR_Unbind(FALSE, tvb, 4, &asn1_ctx, tree, -1); break; case 7: - offset=dissect_smrse_RPDataMT(FALSE, tvb, 4, pinfo, tree, -1); + offset=dissect_smrse_RPDataMT(FALSE, tvb, 4, &asn1_ctx, tree, -1); break; case 8: - offset=dissect_smrse_RPDataMO(FALSE, tvb, 4, pinfo, tree, -1); + offset=dissect_smrse_RPDataMO(FALSE, tvb, 4, &asn1_ctx, tree, -1); break; case 9: - offset=dissect_smrse_RPAck(FALSE, tvb, 4, pinfo, tree, -1); + offset=dissect_smrse_RPAck(FALSE, tvb, 4, &asn1_ctx, tree, -1); break; case 10: - offset=dissect_smrse_RPError(FALSE, tvb, 4, pinfo, tree, -1); + offset=dissect_smrse_RPError(FALSE, tvb, 4, &asn1_ctx, tree, -1); break; case 11: - offset=dissect_smrse_RPAlertSC(FALSE, tvb, 4, pinfo, tree, -1); + offset=dissect_smrse_RPAlertSC(FALSE, tvb, 4, &asn1_ctx, tree, -1); break; } diff --git a/asn1/smrse/smrse.cnf b/asn1/smrse/smrse.cnf index e746de4b16..60fb53f018 100644 --- a/asn1/smrse/smrse.cnf +++ b/asn1/smrse/smrse.cnf @@ -27,8 +27,8 @@ start_offset=offset; /* skip the tag and length */ - offset=dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag); - offset=dissect_ber_length(pinfo, tree, tvb, offset, &len, &ind); + offset=dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &class, &pc, &tag); + offset=dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind); if(len>10){ len=10; } diff --git a/asn1/snmp/packet-snmp-template.c b/asn1/snmp/packet-snmp-template.c index 4c6e273f5c..574f734882 100644 --- a/asn1/snmp/packet-snmp-template.c +++ b/asn1/snmp/packet-snmp-template.c @@ -62,6 +62,7 @@ #include <epan/emem.h> #include <epan/next_tvb.h> #include <epan/uat.h> +#include <epan/asn1.h> #include "packet-ipx.h" #include "packet-hpext.h" @@ -247,8 +248,8 @@ static gint ett_internet = -1; #include "packet-snmp-ett.c" -static int dissect_snmp_IpAddressIpv6(gboolean, tvbuff_t* ,int , packet_info*, proto_tree*, int); -static int dissect_snmp_IpAddressOther(gboolean, tvbuff_t* ,int , packet_info*, proto_tree*, int); +static int dissect_snmp_IpAddressIpv6(gboolean, tvbuff_t* ,int , asn1_ctx_t* , proto_tree*, int); +static int dissect_snmp_IpAddressOther(gboolean, tvbuff_t* ,int , asn1_ctx_t* , proto_tree*, int); static const true_false_string auth_flags = { "OK", @@ -1527,6 +1528,9 @@ dissect_snmp_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *snmp_tree = NULL; proto_item *item = NULL; + asn1_ctx_t asn1_ctx; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); + usm_p.msg_tvb = tvb; usm_p.start_offset = offset_from_real_beginning(tvb,0) ; @@ -1641,14 +1645,14 @@ dissect_snmp_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo, switch (version){ case 0: /* v1 */ case 1: /* v2c */ - offset = dissect_snmp_Message(FALSE , tvb, start_offset, pinfo, snmp_tree, -1); + offset = dissect_snmp_Message(FALSE , tvb, start_offset, &asn1_ctx, snmp_tree, -1); break; case 2: /* v2u */ - offset = dissect_snmp_Messagev2u(FALSE , tvb, start_offset, pinfo, snmp_tree, -1); + offset = dissect_snmp_Messagev2u(FALSE , tvb, start_offset, &asn1_ctx, snmp_tree, -1); break; /* v3 */ case 3: - offset = dissect_snmp_SNMPv3Message(FALSE , tvb, start_offset, pinfo, snmp_tree, -1); + offset = dissect_snmp_SNMPv3Message(FALSE , tvb, start_offset, &asn1_ctx, snmp_tree, -1); break; default: /* diff --git a/asn1/snmp/snmp.cnf b/asn1/snmp/snmp.cnf index c35da22bd9..ab8ad77165 100644 --- a/asn1/snmp/snmp.cnf +++ b/asn1/snmp/snmp.cnf @@ -30,8 +30,8 @@ BulkPDU/request-id bulkPDU_request-id gint pdu_type; %(DEFAULT_BODY)s - if (check_col(pinfo->cinfo, COL_INFO)) - col_add_str(pinfo->cinfo, COL_INFO, val_to_str(pdu_type, snmp_PDUs_vals,"Unknown PDU type (%%u)")); + if (check_col(actx->pinfo->cinfo, COL_INFO)) + col_add_str(actx->pinfo->cinfo, COL_INFO, val_to_str(pdu_type, snmp_PDUs_vals,"Unknown PDU type (%%u)")); #.FN_BODY PDUs/get-request gint8 class; @@ -46,7 +46,7 @@ gint pdu_type; offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_snmp_PDU(TRUE, tvb, offset, pinfo, tree, hf_index); + offset = dissect_snmp_PDU(TRUE, tvb, offset, actx, tree, hf_index); #.FN_BODY PDUs/get-next-request gint8 class; @@ -61,7 +61,7 @@ gint pdu_type; offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_snmp_PDU(TRUE, tvb, offset, pinfo, tree, hf_index); + offset = dissect_snmp_PDU(TRUE, tvb, offset, actx, tree, hf_index); #.FN_BODY PDUs/get-response gint8 class; @@ -76,7 +76,7 @@ gint pdu_type; offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_snmp_PDU(TRUE, tvb, offset, pinfo, tree, hf_index); + offset = dissect_snmp_PDU(TRUE, tvb, offset, actx, tree, hf_index); #.FN_BODY PDUs/set-request gint8 class; @@ -91,7 +91,7 @@ gint pdu_type; offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_snmp_PDU(TRUE, tvb, offset, pinfo, tree, hf_index); + offset = dissect_snmp_PDU(TRUE, tvb, offset, actx, tree, hf_index); #.FN_BODY PDUs/trap @@ -107,7 +107,7 @@ gint pdu_type; offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_snmp_Trap_PDU(TRUE, tvb, offset, pinfo, tree, hf_index); + offset = dissect_snmp_Trap_PDU(TRUE, tvb, offset, actx, tree, hf_index); #.FN_BODY PDUs/getBulkRequest gint8 class; @@ -122,7 +122,7 @@ gint pdu_type; offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_snmp_GetBulkRequest_PDU(TRUE, tvb, offset, pinfo, tree, hf_index); + offset = dissect_snmp_GetBulkRequest_PDU(TRUE, tvb, offset, actx, tree, hf_index); #.FN_BODY PDUs/informRequest gint8 class; @@ -137,7 +137,7 @@ gint pdu_type; offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_snmp_InformRequest_PDU(TRUE, tvb, offset, pinfo, tree, hf_index); + offset = dissect_snmp_InformRequest_PDU(TRUE, tvb, offset, actx, tree, hf_index); #.FN_BODY PDUs/sNMPv2-Trap gint8 class; @@ -152,7 +152,7 @@ gint pdu_type; offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_snmp_SNMPv2_Trap_PDU(TRUE, tvb, offset, pinfo, tree, hf_index); + offset = dissect_snmp_SNMPv2_Trap_PDU(TRUE, tvb, offset, actx, tree, hf_index); #.FN_BODY PDUs/report gint8 class; @@ -167,7 +167,7 @@ gint pdu_type; offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_snmp_Report_PDU(TRUE, tvb, offset, pinfo, tree, hf_index); + offset = dissect_snmp_Report_PDU(TRUE, tvb, offset, actx, tree, hf_index); #.FN_PARS HeaderData/msgSecurityModel @@ -184,7 +184,7 @@ gint pdu_type; #.FN_BODY UsmSecurityParameters/msgAuthoritativeEngineID tvbuff_t *parameter_tvb = NULL; - offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, + offset = dissect_ber_octet_string(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, &usm_p.engine_tvb); if (parameter_tvb) { proto_tree* engine_tree = proto_item_add_subtree(get_ber_last_created_item(),ett_engineid); @@ -195,7 +195,7 @@ gint pdu_type; VAL_PTR = &usm_p.user_tvb #.FN_BODY UsmSecurityParameters/msgAuthenticationParameters - offset = dissect_ber_octet_string(FALSE, pinfo, tree, tvb, offset, hf_index, &usm_p.auth_tvb); + offset = dissect_ber_octet_string(FALSE, actx->pinfo, tree, tvb, offset, hf_index, &usm_p.auth_tvb); if (usm_p.auth_tvb) { usm_p.auth_item = get_ber_last_created_item(); usm_p.auth_offset = offset_from_real_beginning(usm_p.auth_tvb,0); @@ -205,7 +205,7 @@ gint pdu_type; #.FN_BODY ScopedPduData/encryptedPDU tvbuff_t* crypt_tvb; - offset = dissect_ber_octet_string(FALSE, pinfo, tree, tvb, offset, hf_snmp_encryptedPDU, &crypt_tvb); + offset = dissect_ber_octet_string(FALSE, actx->pinfo, tree, tvb, offset, hf_snmp_encryptedPDU, &crypt_tvb); if( usm_p.encrypted && crypt_tvb && usm_p.user_assoc @@ -219,7 +219,7 @@ gint pdu_type; proto_item* cause = proto_tree_add_text(encryptedpdu_tree, cleartext_tvb, 0, -1, "Failed to decrypt encryptedPDU: %%s", error); - expert_add_info_format(pinfo, cause, PI_MALFORMED, PI_WARN, + expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "Failed to decrypt encryptedPDU: %%s", error); return offset; @@ -231,18 +231,18 @@ gint pdu_type; proto_item* cause = proto_tree_add_text(encryptedpdu_tree, cleartext_tvb, 0, -1, "Decrypted data not formated as expected, wrong key?"); - expert_add_info_format(pinfo, cause, PI_MALFORMED, PI_WARN, + expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "Decrypted data not formated as expected"); return offset; } - add_new_data_source(pinfo, cleartext_tvb, "Decrypted ScopedPDU"); + add_new_data_source(actx->pinfo, cleartext_tvb, "Decrypted ScopedPDU"); tvb_set_child_real_data_tvbuff(tvb, cleartext_tvb); decrypted_item = proto_tree_add_item(encryptedpdu_tree, hf_snmp_decryptedPDU,cleartext_tvb,0,-1,FALSE); decrypted_tree = proto_item_add_subtree(decrypted_item,ett_decrypted); - dissect_snmp_ScopedPDU(FALSE, cleartext_tvb, 0, pinfo, decrypted_tree, -1); + dissect_snmp_ScopedPDU(FALSE, cleartext_tvb, 0, actx, decrypted_tree, -1); } } @@ -250,7 +250,7 @@ gint pdu_type; switch(MsgSecurityModel){ case SNMP_SEC_USM: /* 3 */ - offset = dissect_snmp_UsmSecurityParameters(FALSE, tvb, offset+2, pinfo, tree, -1); + offset = dissect_snmp_UsmSecurityParameters(FALSE, tvb, offset+2, actx, tree, -1); usm_p.user_assoc = get_user_assoc(usm_p.engine_tvb, usm_p.user_tvb); break; case SNMP_SEC_ANY: /* 0 */ @@ -277,7 +277,7 @@ gint pdu_type; if (error) { authen_item = proto_tree_add_text(authen_tree,tvb,0,0,"Error while verifying Messsage authenticity: %s", error); PROTO_ITEM_SET_GENERATED(authen_item); - expert_add_info_format( pinfo, authen_item, PI_MALFORMED, PI_ERROR, "Error while verifying Messsage authenticity: %s", error ); + expert_add_info_format( actx->pinfo, authen_item, PI_MALFORMED, PI_ERROR, "Error while verifying Messsage authenticity: %s", error ); } else { int severity; gchar* fmt; @@ -295,7 +295,7 @@ gint pdu_type; severity = PI_WARN; } - expert_add_info_format( pinfo, authen_item, PI_CHECKSUM, severity, fmt ); + expert_add_info_format( actx->pinfo, authen_item, PI_CHECKSUM, severity, fmt ); } } @@ -336,25 +336,25 @@ gint pdu_type; #.FN_BODY String-value guint length; - snmp_variable_decode(tvb, tree, pinfo, oid_tvb, offset, &length, &value_tvb); + snmp_variable_decode(tvb, tree, actx->pinfo, oid_tvb, offset, &length, &value_tvb); offset = offset + length; #.FN_BODY Integer-value guint length; - snmp_variable_decode(tvb, tree, pinfo, oid_tvb, offset, &length, NULL); + snmp_variable_decode(tvb, tree, actx->pinfo, oid_tvb, offset, &length, NULL); offset = offset + length; #.FN_BODY ObjectID-value guint length; - snmp_variable_decode(tvb, tree, pinfo, oid_tvb, offset, &length, NULL); + snmp_variable_decode(tvb, tree, actx->pinfo, oid_tvb, offset, &length, NULL); offset = offset + length; #.FN_BODY Empty guint length; - snmp_variable_decode(tvb, tree, pinfo, oid_tvb, offset, &length, NULL); + snmp_variable_decode(tvb, tree, actx->pinfo, oid_tvb, offset, &length, NULL); offset = offset + length; #.FN_BODY NetworkAddress/internet @@ -366,9 +366,9 @@ gint pdu_type; get_ber_length(NULL, tvb, cur_offset, &len, NULL); switch (len) { - case 4: offset = dissect_snmp_IpAddress(FALSE, tvb, offset, pinfo, tree, hf_snmp_internet); break; - case 16: offset = dissect_snmp_IpAddressIpv6(FALSE, tvb, offset, pinfo, tree, hf_snmp_internet_ipv6); break; - default: offset = dissect_snmp_IpAddressOther(FALSE, tvb, offset, pinfo, tree, hf_snmp_internet_other); break; + case 4: offset = dissect_snmp_IpAddress(FALSE, tvb, offset, actx, tree, hf_snmp_internet); break; + case 16: offset = dissect_snmp_IpAddressIpv6(FALSE, tvb, offset, actx, tree, hf_snmp_internet_ipv6); break; + default: offset = dissect_snmp_IpAddressOther(FALSE, tvb, offset, actx, tree, hf_snmp_internet_other); break; } if (len != 4) { @@ -384,7 +384,7 @@ gint pdu_type; "The host that generated this packet is violating" "the SNMP protocol definition and sends corrupt and invalid packets"); PROTO_ITEM_SET_GENERATED(pi); - expert_add_info_format( pinfo, pi, PI_MALFORMED, PI_ERROR, + expert_add_info_format( actx->pinfo, pi, PI_MALFORMED, PI_ERROR, "Corrupt and Invalid packet" ); } diff --git a/asn1/spnego/packet-spnego-template.c b/asn1/spnego/packet-spnego-template.c index 8ef17d96ea..4e52960d75 100644 --- a/asn1/spnego/packet-spnego-template.c +++ b/asn1/spnego/packet-spnego-template.c @@ -44,6 +44,7 @@ #include <epan/crypt/crypt-rc4.h> #include <epan/conversation.h> #include <epan/emem.h> +#include <epan/asn1.h> #include <stdio.h> #include <string.h> @@ -94,7 +95,7 @@ static dissector_handle_t data_handle; * definition. */ static int dissect_spnego_PrincipalSeq(gboolean implicit_tag, tvbuff_t *tvb, - int offset, packet_info *pinfo, + int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index); #include "packet-spnego-fn.c" @@ -877,8 +878,10 @@ dissect_spnego_wrap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *item; proto_tree *subtree; - int offset = 0; + asn1_ctx_t asn1_ctx; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); + /* @@ -900,7 +903,7 @@ dissect_spnego_wrap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) * ASN1 code addet to spnego.asn to handle this. */ - offset = dissect_spnego_InitialContextToken(FALSE, tvb, offset, pinfo , subtree, -1); + offset = dissect_spnego_InitialContextToken(FALSE, tvb, offset, &asn1_ctx , subtree, -1); return offset; } @@ -913,6 +916,8 @@ dissect_spnego(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) proto_tree *subtree; int offset = 0; conversation_t *conversation; + asn1_ctx_t asn1_ctx; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); /* * We need this later, so lets get it now ... @@ -971,7 +976,7 @@ dissect_spnego(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) * as well. Naughty, naughty. * */ - offset = dissect_spnego_NegotiationToken(FALSE, tvb, offset, pinfo, subtree, -1); + offset = dissect_spnego_NegotiationToken(FALSE, tvb, offset, &asn1_ctx, subtree, -1); } diff --git a/asn1/spnego/spnego.cnf b/asn1/spnego/spnego.cnf index 620a4bceb6..b6c0f9ab7a 100644 --- a/asn1/spnego/spnego.cnf +++ b/asn1/spnego/spnego.cnf @@ -78,7 +78,7 @@ NegTokenInit/mechListMIC negTokenInit_mechListMIC */ token_tvb = tvb_new_subset(tvb, offset, -1, -1); if (next_level_value && next_level_value->wrap_handle) { - len = call_dissector(next_level_value->wrap_handle, token_tvb, pinfo, + len = call_dissector(next_level_value->wrap_handle, token_tvb, actx->pinfo, subtree); if (len == 0) offset = tvb_length(tvb); @@ -100,15 +100,15 @@ NegTokenInit/mechListMIC negTokenInit_mechListMIC * does not provide a supportedMech. */ if(saw_mechanism){ - conversation = find_conversation(pinfo->fd->num, - &pinfo->src, &pinfo->dst, - pinfo->ptype, - pinfo->srcport, pinfo->destport, 0); + conversation = find_conversation(actx->pinfo->fd->num, + &actx->pinfo->src, &actx->pinfo->dst, + actx->pinfo->ptype, + actx->pinfo->srcport, actx->pinfo->destport, 0); if(!conversation){ - conversation = conversation_new(pinfo->fd->num, - &pinfo->src, &pinfo->dst, - pinfo->ptype, - pinfo->srcport, pinfo->destport, 0); + conversation = conversation_new(actx->pinfo->fd->num, + &actx->pinfo->src, &actx->pinfo->dst, + actx->pinfo->ptype, + actx->pinfo->srcport, actx->pinfo->destport, 0); } conversation_add_proto_data(conversation, proto_spnego, next_level_value); } @@ -128,7 +128,7 @@ NegTokenInit/mechListMIC negTokenInit_mechListMIC * the token and we have information on how to dissect its contents. */ if (mechToken_tvb && next_level_value) - call_dissector(next_level_value->handle, mechToken_tvb, pinfo, tree); + call_dissector(next_level_value->handle, mechToken_tvb, actx->pinfo, tree); #.FN_BODY NegTokenInit/mechListMIC @@ -150,7 +150,7 @@ NegTokenInit/mechListMIC negTokenInit_mechListMIC /* * It's a sequence. */ - return dissect_spnego_PrincipalSeq(FALSE, tvb, offset, pinfo, tree, + return dissect_spnego_PrincipalSeq(FALSE, tvb, offset, actx, tree, hf_spnego_mechListMIC); } else { /* @@ -158,14 +158,14 @@ NegTokenInit/mechListMIC negTokenInit_mechListMIC * which is what it's supposed to be; that'll cause the * right error report if it's not an octet string, either. */ - offset = dissect_ber_octet_string(FALSE, pinfo, tree, tvb, offset, + offset = dissect_ber_octet_string(FALSE, actx->pinfo, tree, tvb, offset, hf_spnego_mechListMIC, &mechListMIC_tvb); /* * Now, we should be able to dispatch with that tvbuff. */ if (mechListMIC_tvb && next_level_value) - call_dissector(next_level_value->handle, mechListMIC_tvb, pinfo, tree); + call_dissector(next_level_value->handle, mechListMIC_tvb, actx->pinfo, tree); return offset; } @@ -183,15 +183,15 @@ NegTokenInit/mechListMIC negTokenInit_mechListMIC * negTokenInit. */ if(saw_mechanism){ - conversation = find_conversation(pinfo->fd->num, - &pinfo->src, &pinfo->dst, - pinfo->ptype, - pinfo->srcport, pinfo->destport, 0); + conversation = find_conversation(actx->pinfo->fd->num, + &actx->pinfo->src, &actx->pinfo->dst, + actx->pinfo->ptype, + actx->pinfo->srcport, actx->pinfo->destport, 0); if(!conversation){ - conversation = conversation_new(pinfo->fd->num, - &pinfo->src, &pinfo->dst, - pinfo->ptype, - pinfo->srcport, pinfo->destport, 0); + conversation = conversation_new(actx->pinfo->fd->num, + &actx->pinfo->src, &actx->pinfo->dst, + actx->pinfo->ptype, + actx->pinfo->srcport, actx->pinfo->destport, 0); } conversation_add_proto_data(conversation, proto_spnego, next_level_value); } @@ -219,7 +219,7 @@ NegTokenInit/mechListMIC negTokenInit_mechListMIC gssapi_oid_value *value=next_level_value; if(value){ - call_dissector(value->handle, responseToken_tvb, pinfo, tree); + call_dissector(value->handle, responseToken_tvb, actx->pinfo, tree); } } @@ -244,7 +244,7 @@ NegTokenInit/mechListMIC negTokenInit_mechListMIC gssapi_oid_value *value=next_level_value; if(value){ - call_dissector(value->handle, mechListMIC_tvb, pinfo, tree); + call_dissector(value->handle, mechListMIC_tvb, actx->pinfo, tree); } } diff --git a/asn1/tcap/packet-tcap-template.c b/asn1/tcap/packet-tcap-template.c index e3829e73d5..3d89ff7b39 100644 --- a/asn1/tcap/packet-tcap-template.c +++ b/asn1/tcap/packet-tcap-template.c @@ -34,6 +34,7 @@ #include <epan/conversation.h> #include <epan/oid_resolv.h> #include <epan/emem.h> +#include <epan/asn1.h> #include <stdio.h> #include <string.h> @@ -101,9 +102,9 @@ static dissector_table_t sccp_ssn_table; static void raz_tcap_private(struct tcap_private_t * p_tcap_private); static int dissect_tcap_param(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset); -static int dissect_tcap_UserInformation(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_); -static int dissect_tcap_TheComponent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_); -static int dissect_tcap_TheExternUserInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_); +static int dissect_tcap_UserInformation(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_); +static int dissect_tcap_TheComponent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_); +static int dissect_tcap_TheExternUserInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset,asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_); static GHashTable* ansi_sub_dissectors = NULL; static GHashTable* itu_sub_dissectors = NULL; @@ -157,10 +158,13 @@ dissect_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { proto_item *item=NULL; proto_tree *tree=NULL; - proto_item *stat_item=NULL; - proto_tree *stat_tree=NULL; + proto_item *stat_item=NULL; + proto_tree *stat_tree=NULL; + gint offset = 0; struct tcaphash_context_t * p_tcap_context; dissector_handle_t subdissector_handle; + asn1_ctx_t asn1_ctx; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); tcap_top_tree = parent_tree; if (check_col(pinfo->cinfo, COL_PROTOCOL)) @@ -183,43 +187,36 @@ dissect_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) gp_tcapsrt_info=tcapsrt_razinfo(); tcap_subdissector_used=FALSE; gp_tcap_context=NULL; - dissect_tcap_TCMessage(FALSE, tvb, 0, pinfo, tree, -1); - - if (gtcap_HandleSRT && - !tcap_subdissector_used ) { - if (gtcap_DisplaySRT && tree) { - stat_item = proto_tree_add_text(tree, tvb, 0, 0, "Stat"); - PROTO_ITEM_SET_GENERATED(stat_item); - stat_tree = proto_item_add_subtree(stat_item, ett_tcap_stat); - } - p_tcap_context=tcapsrt_call_matching(tvb, pinfo, stat_tree, gp_tcapsrt_info); - tcap_private.context=p_tcap_context; - - /* If the current message is TCAP only, - save the Application contexte name for the next messages */ - if ( p_tcap_context && - cur_oid && - !p_tcap_context->oid_present ) { - /* Save the application context and the sub dissector */ - ber_oid_dissector_table = find_dissector_table("ber.oid"); - strncpy(p_tcap_context->oid,cur_oid, LENGTH_OID); - if ( (subdissector_handle - = dissector_get_string_handle(ber_oid_dissector_table, cur_oid)) ) { - p_tcap_context->subdissector_handle=subdissector_handle; - p_tcap_context->oid_present=TRUE; - } - } + dissect_tcap_TCMessage(FALSE, tvb, 0, &asn1_ctx, tree, -1); - if (gtcap_HandleSRT && - p_tcap_context && - p_tcap_context->callback) { - /* Callback fonction for the upper layer */ - (p_tcap_context->callback)(tvb, pinfo, stat_tree, p_tcap_context); - } - } + if (gtcap_HandleSRT && !tcap_subdissector_used ) { + if (gtcap_DisplaySRT && tree) { + stat_item = proto_tree_add_text(tree, tvb, 0, 0, "Stat"); + PROTO_ITEM_SET_GENERATED(stat_item); + stat_tree = proto_item_add_subtree(stat_item, ett_tcap_stat); + } + p_tcap_context=tcapsrt_call_matching(tvb, pinfo, stat_tree, gp_tcapsrt_info); + tcap_private.context=p_tcap_context; + + /* If the current message is TCAP only, + * save the Application contexte name for the next messages + */ + if ( p_tcap_context && cur_oid && !p_tcap_context->oid_present ) { + /* Save the application context and the sub dissector */ + ber_oid_dissector_table = find_dissector_table("ber.oid"); + strncpy(p_tcap_context->oid,cur_oid, LENGTH_OID); + if ( (subdissector_handle = dissector_get_string_handle(ber_oid_dissector_table, cur_oid)) ) { + p_tcap_context->subdissector_handle=subdissector_handle; + p_tcap_context->oid_present=TRUE; + } + } + if (gtcap_HandleSRT && p_tcap_context && p_tcap_context->callback) { + /* Callback fonction for the upper layer */ + (p_tcap_context->callback)(tvb, pinfo, stat_tree, p_tcap_context); + } + } } - void proto_reg_handoff_tcap(void) { @@ -480,7 +477,7 @@ static void raz_tcap_private(struct tcap_private_t * p_tcap_private) static int -dissect_tcap_TheComponent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) +dissect_tcap_TheComponent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) { tvbuff_t * next_tvb; dissector_handle_t subdissector_handle; @@ -506,7 +503,7 @@ dissect_tcap_TheComponent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, if (!next_tvb) return offset+len; - dissect_ber_choice(pinfo, tree, next_tvb, 0, + dissect_ber_choice(actx, tree, next_tvb, 0, Component_choice, hf_index, ett_tcap_Component,NULL); @@ -521,7 +518,7 @@ dissect_tcap_TheComponent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, PROTO_ITEM_SET_GENERATED(stat_item); stat_tree = proto_item_add_subtree(stat_item, ett_tcap_stat); } - p_tcap_context=tcapsrt_call_matching(tvb, pinfo, stat_tree, gp_tcapsrt_info); + p_tcap_context=tcapsrt_call_matching(tvb, actx->pinfo, stat_tree, gp_tcapsrt_info); tcap_subdissector_used=TRUE; gp_tcap_context=p_tcap_context; tcap_private.context=p_tcap_context; @@ -593,7 +590,7 @@ dissect_tcap_TheComponent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, } else { /* Search if we can found the sub protocol according to the SSN table */ if ( (subdissector_handle - = get_itu_tcap_subdissector(pinfo->match_port))) { + = get_itu_tcap_subdissector(actx->pinfo->match_port))) { /* Found according to SSN */ is_subdissector=TRUE; } else { @@ -604,7 +601,7 @@ dissect_tcap_TheComponent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, } /* ACN */ } else { /* There is no A.C.N for this transaction, so search in the SSN table */ - if ( (subdissector_handle = get_itu_tcap_subdissector(pinfo->match_port))) { + if ( (subdissector_handle = get_itu_tcap_subdissector(actx->pinfo->match_port))) { /* Found according to SSN */ is_subdissector=TRUE; } else { @@ -618,14 +615,14 @@ dissect_tcap_TheComponent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, /* Call the sub dissector if present, and not already called */ if (is_subdissector) - call_dissector(subdissector_handle, next_tvb, pinfo, tcap_top_tree); + call_dissector(subdissector_handle, next_tvb, actx->pinfo, tcap_top_tree); return offset+len; } static int -dissect_tcap_TheExternUserInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) +dissect_tcap_TheExternUserInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) { tvbuff_t *next_tvb; gint8 class; @@ -647,14 +644,14 @@ dissect_tcap_TheExternUserInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int off return offset+len; if (ber_oid_dissector_table && tcapext_oid){ - if(!dissector_try_string(ber_oid_dissector_table, tcapext_oid, next_tvb, pinfo, tcap_top_tree)) + if(!dissector_try_string(ber_oid_dissector_table, tcapext_oid, next_tvb, actx->pinfo, tcap_top_tree)) { + dissect_tcap_param(actx->pinfo,tree,next_tvb,0); + offset+=len; + return offset; } } - dissect_tcap_param(pinfo,tree,next_tvb,0); - offset+=len; - - return offset; + return offset+len; } diff --git a/asn1/tcap/tcap.cnf b/asn1/tcap/tcap.cnf index be0c2ac96c..39623e6a82 100644 --- a/asn1/tcap/tcap.cnf +++ b/asn1/tcap/tcap.cnf @@ -32,15 +32,15 @@ gint8 class; gint ind_field; -offset = dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag); -offset = dissect_ber_length(pinfo, tree, tvb, offset, &len, &ind_field); +offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &class, &pc, &tag); +offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind_field); next_tvb = tvb_new_subset(tvb, offset, len-(2*ind_field), len-(2*ind_field)); if (!next_tvb) return offset; - dissect_tcap_ExternalPDU(TRUE, next_tvb, 0, pinfo, tree, -1); + dissect_tcap_ExternalPDU(TRUE, next_tvb, 0, actx, tree, -1); return offset+len; @@ -52,8 +52,8 @@ gint8 class; guint32 len; gint ind_field; /* Workaround for tagged fields */ -offset = dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag); -offset = dissect_ber_length(pinfo, tree, tvb, offset, &len, &ind_field); +offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &class, &pc, &tag); +offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind_field); %(DEFAULT_BODY)s #.FN_BODY Dialog1 @@ -67,7 +67,7 @@ gint8 class; offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len, &ind_field); - dissect_tcap_DialoguePDU(TRUE, tvb, 0, pinfo, tree, -1); + dissect_tcap_DialoguePDU(TRUE, tvb, 0, actx, tree, -1); return offset+len; @@ -80,14 +80,14 @@ gint8 class; gint ind_field; - offset = dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag); - offset = dissect_ber_length(pinfo, tree, tvb, offset, &len, &ind_field); + offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &class, &pc, &tag); + offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind_field); /* need to strip the EOC off the next_tvb */ next_tvb = tvb_new_subset(tvb, offset, len-(2*ind_field), len-(2*ind_field)); if (!next_tvb) return offset; - dissect_tcap_param(pinfo,tree,tvb,0); + dissect_tcap_param(actx->pinfo,tree,tvb,0); offset += len; return offset; @@ -100,17 +100,17 @@ gint8 class; gint ind_field; -offset = dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag); -offset = dissect_ber_length(pinfo, tree, tvb, offset, &len, &ind_field); +offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &class, &pc, &tag); +offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind_field); next_tvb = tvb_new_subset(tvb, offset, len-(2*ind_field), len-(2*ind_field)); if (!next_tvb) return offset+len; -dissect_tcap_UserInformation(TRUE, next_tvb, 0, pinfo, tree, -1); +dissect_tcap_UserInformation(TRUE, next_tvb, 0, actx, tree, -1); return offset+len; #.FN_BODY Component -dissect_tcap_TheComponent(implicit_tag, tvb, offset, pinfo, tree, hf_index); +dissect_tcap_TheComponent(implicit_tag, tvb, offset, actx, tree, hf_index); #.FN_BODY Applicationcontext FN_VARIANT = _str VAL_PTR = &cur_oid %(DEFAULT_BODY)s @@ -125,16 +125,16 @@ dissect_tcap_TheComponent(implicit_tag, tvb, offset, pinfo, tree, hf_index); # tcap_private.acv=TRUE; #.FN_BODY ExternUserInfo -dissect_tcap_TheExternUserInfo(implicit_tag, tvb, offset, pinfo, tree, hf_index); +dissect_tcap_TheExternUserInfo(implicit_tag, tvb, offset, actx, tree, hf_index); #.FN_BODY ANSIParameters /* we are doing the ParamSet here so need to look at the tags*/ guint32 len; len = tvb_length_remaining(tvb, offset); if (len > 2) /* arghhh I dont know whether this is constructed or not! */ - offset = dissect_tcap_param(pinfo,tree,tvb,offset); + offset = dissect_tcap_param(actx->pinfo,tree,tvb,offset); else -offset = dissect_ber_octet_string(TRUE, pinfo, tree, tvb, 0, hf_index, +offset = dissect_ber_octet_string(TRUE, actx->pinfo, tree, tvb, 0, hf_index, NULL); @@ -144,15 +144,15 @@ dissector_handle_t subdissector_handle; next_tvb = tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset), tvb_length_remaining(tvb, offset)); -if (! (subdissector_handle = get_ansi_tcap_subdissector(pinfo->match_port))) { +if (! (subdissector_handle = get_ansi_tcap_subdissector(actx->pinfo->match_port))) { subdissector_handle = data_handle; } tcap_subdissector_used=TRUE; -call_dissector(subdissector_handle, next_tvb, pinfo, tcap_top_tree); +call_dissector(subdissector_handle, next_tvb, actx->pinfo, tcap_top_tree); -offset = dissect_ber_choice(pinfo, tree, tvb, offset, +offset = dissect_ber_choice(actx, tree, tvb, offset, ComponentPDU_choice, hf_index, ett_tcap_ComponentPDU,NULL); #.FN_BODY OrigTransactionID @@ -163,7 +163,7 @@ proto_tree *subtree; tid_item = proto_tree_add_text(tree, tvb, offset, -1, "Source Transaction ID"); subtree = proto_item_add_subtree(tid_item, ett_otid); -offset = dissect_ber_octet_string(implicit_tag, pinfo, subtree, tvb, offset, hf_tcap_tid, +offset = dissect_ber_octet_string(implicit_tag, actx->pinfo, subtree, tvb, offset, hf_tcap_tid, ¶meter_tvb); if (parameter_tvb){ @@ -183,11 +183,11 @@ if (parameter_tvb){ break; } - if ((len)&&(check_col(pinfo->cinfo, COL_INFO))){ - col_append_fstr(pinfo->cinfo, COL_INFO, "otid("); + if ((len)&&(check_col(actx->pinfo->cinfo, COL_INFO))){ + col_append_fstr(actx->pinfo->cinfo, COL_INFO, "otid("); for(i=0;i<len;i++) - col_append_fstr(pinfo->cinfo, COL_INFO, "%%02x",tvb_get_guint8(parameter_tvb,i)); - col_append_fstr(pinfo->cinfo, COL_INFO, ") "); + col_append_fstr(actx->pinfo->cinfo, COL_INFO, "%%02x",tvb_get_guint8(parameter_tvb,i)); + col_append_fstr(actx->pinfo->cinfo, COL_INFO, ") "); } } @@ -201,7 +201,7 @@ proto_tree *subtree; tid_item = proto_tree_add_text(tree, tvb, offset, -1, "Destination Transaction ID"); subtree = proto_item_add_subtree(tid_item, ett_otid); -offset = dissect_ber_octet_string(implicit_tag, pinfo, subtree, tvb, offset, hf_tcap_tid, +offset = dissect_ber_octet_string(implicit_tag, actx->pinfo, subtree, tvb, offset, hf_tcap_tid, ¶meter_tvb); if (parameter_tvb){ @@ -221,66 +221,66 @@ if (parameter_tvb){ break; } - if ((len)&&(check_col(pinfo->cinfo, COL_INFO))){ - col_append_fstr(pinfo->cinfo, COL_INFO, "dtid("); + if ((len)&&(check_col(actx->pinfo->cinfo, COL_INFO))){ + col_append_fstr(actx->pinfo->cinfo, COL_INFO, "dtid("); for(i=0;i<len;i++) - col_append_fstr(pinfo->cinfo, COL_INFO, "%%02x",tvb_get_guint8(parameter_tvb,i)); - col_append_fstr(pinfo->cinfo, COL_INFO, ") "); + col_append_fstr(actx->pinfo->cinfo, COL_INFO, "%%02x",tvb_get_guint8(parameter_tvb,i)); + col_append_fstr(actx->pinfo->cinfo, COL_INFO, ") "); } } #.FN_BODY Begin gp_tcapsrt_info->ope=TC_BEGIN; -if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, " Begin "); +if (check_col(actx->pinfo->cinfo, COL_INFO)) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " Begin "); %(DEFAULT_BODY)s #.FN_BODY End gp_tcapsrt_info->ope=TC_END; -if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, " End "); +if (check_col(actx->pinfo->cinfo, COL_INFO)) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " End "); %(DEFAULT_BODY)s #.FN_BODY Continue gp_tcapsrt_info->ope=TC_CONT; -if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, " Continue "); +if (check_col(actx->pinfo->cinfo, COL_INFO)) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " Continue "); %(DEFAULT_BODY)s #.FN_BODY Abort gp_tcapsrt_info->ope=TC_ABORT; -if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, " Abort "); +if (check_col(actx->pinfo->cinfo, COL_INFO)) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " Abort "); %(DEFAULT_BODY)s #.FN_BODY AbortPDU -if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, " Abort "); +if (check_col(actx->pinfo->cinfo, COL_INFO)) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " Abort "); %(DEFAULT_BODY)s #.FN_BODY TransactionPDU -if ((hf_index == hf_tcap_ansiqueryWithPerm)&&(check_col(pinfo->cinfo, COL_INFO))) - col_append_fstr(pinfo->cinfo, COL_INFO, " QueryWithPerm"); +if ((hf_index == hf_tcap_ansiqueryWithPerm)&&(check_col(actx->pinfo->cinfo, COL_INFO))) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " QueryWithPerm"); -if ((hf_index == hf_tcap_ansiqueryWithoutPerm)&&(check_col(pinfo->cinfo, COL_INFO))) - col_append_fstr(pinfo->cinfo, COL_INFO, " QueryWithOutPerm"); +if ((hf_index == hf_tcap_ansiqueryWithoutPerm)&&(check_col(actx->pinfo->cinfo, COL_INFO))) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " QueryWithOutPerm"); -if ((hf_index == hf_tcap_ansiresponse)&&(check_col(pinfo->cinfo, COL_INFO))) - col_append_fstr(pinfo->cinfo, COL_INFO, " Response"); +if ((hf_index == hf_tcap_ansiresponse)&&(check_col(actx->pinfo->cinfo, COL_INFO))) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " Response"); -if ((hf_index == hf_tcap_ansiconversationWithPerm)&&(check_col(pinfo->cinfo, COL_INFO))) - col_append_fstr(pinfo->cinfo, COL_INFO, " ConversationWithPerm"); +if ((hf_index == hf_tcap_ansiconversationWithPerm)&&(check_col(actx->pinfo->cinfo, COL_INFO))) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " ConversationWithPerm"); -if ((hf_index == hf_tcap_ansiconversationWithoutPerm)&&(check_col(pinfo->cinfo, COL_INFO))) - col_append_fstr(pinfo->cinfo, COL_INFO, " ConversationWithoutPerm"); +if ((hf_index == hf_tcap_ansiconversationWithoutPerm)&&(check_col(actx->pinfo->cinfo, COL_INFO))) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " ConversationWithoutPerm"); %(DEFAULT_BODY)s diff --git a/asn1/wlancertextn/packet-wlancertextn-template.c b/asn1/wlancertextn/packet-wlancertextn-template.c index 133ce7609e..ab097af442 100644 --- a/asn1/wlancertextn/packet-wlancertextn-template.c +++ b/asn1/wlancertextn/packet-wlancertextn-template.c @@ -31,6 +31,7 @@ #include <epan/packet.h> #include <epan/conversation.h> #include <epan/oid_resolv.h> +#include <epan/asn1.h> #include <stdio.h> #include <string.h> diff --git a/asn1/x411/packet-x411-template.c b/asn1/x411/packet-x411-template.c index c3dde9165c..fa4a5f36cc 100644 --- a/asn1/x411/packet-x411-template.c +++ b/asn1/x411/packet-x411-template.c @@ -31,6 +31,7 @@ #include <epan/packet.h> #include <epan/conversation.h> #include <epan/oid_resolv.h> +#include <epan/asn1.h> #include <stdio.h> #include <string.h> @@ -107,6 +108,8 @@ dissect_x411_mts_apdu (tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tre { proto_item *item=NULL; proto_tree *tree=NULL; + asn1_ctx_t asn1_ctx; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); /* save parent_tree so subdissectors can create new top nodes */ top_tree=parent_tree; @@ -121,7 +124,7 @@ dissect_x411_mts_apdu (tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tre if (check_col(pinfo->cinfo, COL_INFO)) col_set_str(pinfo->cinfo, COL_INFO, "Transfer"); - dissect_x411_MTS_APDU (FALSE, tvb, 0, pinfo, tree, hf_x411_MTS_APDU_PDU); + dissect_x411_MTS_APDU (FALSE, tvb, 0, &asn1_ctx, tree, hf_x411_MTS_APDU_PDU); } /* @@ -134,9 +137,11 @@ dissect_x411(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) int old_offset; proto_item *item=NULL; proto_tree *tree=NULL; - int (*x411_dissector)(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) = NULL; + int (*x411_dissector)(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) = NULL; char *x411_op_name; int hf_x411_index; + asn1_ctx_t asn1_ctx; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); /* save parent_tree so subdissectors can create new top nodes */ top_tree=parent_tree; @@ -192,7 +197,7 @@ dissect_x411(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) while (tvb_reported_length_remaining(tvb, offset) > 0){ old_offset=offset; - offset=(*x411_dissector)(FALSE, tvb, offset, pinfo , tree, hf_x411_index); + offset=(*x411_dissector)(FALSE, tvb, offset, &asn1_ctx , tree, hf_x411_index); if(offset == old_offset){ proto_tree_add_text(tree, tvb, offset, -1,"Internal error, zero-byte X411 PDU"); offset = tvb_length(tvb); diff --git a/asn1/x411/x411.cnf b/asn1/x411/x411.cnf index 483766c244..ec72538bd1 100644 --- a/asn1/x411/x411.cnf +++ b/asn1/x411/x411.cnf @@ -1,5 +1,5 @@ #.TYPE_ATTR -CountryName TYPE = FT_UINT32 DISPLAY = BASE_DEC STRINGS = VALS(x411_CountryName_vals) BITMASK = 0 +CountryName TYPE = FT_UINT32 DISPLAY = BASE_DEC STRINGS = VALS(x411_CountryName_vals) BITMASK = 0 Time TYPE = FT_STRING DISPLAY = BASE_NONE STRING = NULL BITMASK = 0 #.INCLUDE ../acse/acse-exp.cnf @@ -137,11 +137,11 @@ MTABindError MTS-APDU #.REGISTER -RecipientReassignmentProhibited B "x411.extension.1" "recipient-reassignment-prohibited" -MTSOriginatorRequestedAlternateRecipient B "x411.extension.2" "originator-requested-alternate-recipient" -DLExpansionProhibited B "x411.extension.3" "dl-expansion-prohibited" -ConversionWithLossProhibited B "x411.extension.4" "conversion-with-loss-prohibited" -LatestDeliveryTime B "x411.extension.5" "latest-delivery-time" +RecipientReassignmentProhibited B "x411.extension.1" "recipient-reassignment-prohibited" +MTSOriginatorRequestedAlternateRecipient B "x411.extension.2" "originator-requested-alternate-recipient" +DLExpansionProhibited B "x411.extension.3" "dl-expansion-prohibited" +ConversionWithLossProhibited B "x411.extension.4" "conversion-with-loss-prohibited" +LatestDeliveryTime B "x411.extension.5" "latest-delivery-time" RequestedDeliveryMethod B "x411.extension.6" "requested-delivery-method" PhysicalForwardingProhibited B "x411.extension.7" "physical-forwarding-prohibited" PhysicalForwardingAddressRequest B "x411.extension.8" "physical-forwarding-address-request" @@ -232,14 +232,14 @@ ORAddress B "2.16.840.1.101.2.2.1.134.1" "id-at-collective-mhs-or-addresses" guint32 len = 0; /* work out the length */ - loffset = dissect_ber_identifier(pinfo, tree, tvb, offset, NULL, NULL, NULL); - (void) dissect_ber_length(pinfo, tree, tvb, loffset, &len, NULL); + loffset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, NULL, NULL, NULL); + (void) dissect_ber_length(actx->pinfo, tree, tvb, loffset, &len, NULL); item = proto_tree_add_item(tree, hf_index, tvb, offset, len, FALSE); tree = proto_item_add_subtree(item, ett_x411_additional_information); proto_item_append_text(tree, " (The use of this field is \"strongly deprecated\".)"); - offset = dissect_unknown_ber(pinfo, tvb, offset, tree); + offset = dissect_unknown_ber(actx->pinfo, tvb, offset, tree); #.FN_BODY RegistrationTypes/extensions/_item /*XXX not implemented yet */ @@ -248,9 +248,9 @@ ORAddress B "2.16.840.1.101.2.2.1.134.1" "id-at-collective-mhs-or-addresses" const char *name; if(extension_id != -1) - offset=call_x411_oid_callback("x411.extension", tvb, offset, pinfo, tree); + offset=call_x411_oid_callback("x411.extension", tvb, offset, actx->pinfo, tree); else if(object_identifier_id) { - call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); name = get_oid_str_name(object_identifier_id); proto_item_append_text(tree, " (%%s)", name ? name : object_identifier_id); } @@ -258,11 +258,11 @@ ORAddress B "2.16.840.1.101.2.2.1.134.1" "id-at-collective-mhs-or-addresses" #.FN_BODY CategoryValue - offset = dissect_unknown_ber(pinfo, tvb, offset, tree); + offset = dissect_unknown_ber(actx->pinfo, tvb, offset, tree); #.FN_BODY ExtensionAttribute/extension-attribute-value - offset=call_x411_oid_callback("x411.extension-attribute", tvb, offset, pinfo, tree); + offset=call_x411_oid_callback("x411.extension-attribute", tvb, offset, actx->pinfo, tree); #.FN_BODY RefusedOperation/refused-argument/refused-extension /*XXX not implemented yet */ @@ -284,7 +284,7 @@ ORAddress B "2.16.840.1.101.2.2.1.134.1" "id-at-collective-mhs-or-addresses" if(doing_address) g_strlcat(oraddress, "/C=", MAX_ORA_STR_LEN); - offset = dissect_ber_choice(pinfo, tree, tvb, offset, + offset = dissect_ber_choice(actx, tree, tvb, offset, CountryName_choice, hf_index, ett_x411_CountryName, NULL); @@ -306,7 +306,7 @@ ORAddress B "2.16.840.1.101.2.2.1.134.1" "id-at-collective-mhs-or-addresses" if(doing_address) g_strlcat(oraddress, "/A=", MAX_ORA_STR_LEN); - offset = dissect_ber_choice(pinfo, tree, tvb, offset, + offset = dissect_ber_choice(actx, tree, tvb, offset, AdministrationDomainName_choice, hf_index, ett_x411_AdministrationDomainName, NULL); #.FN_BODY ContentIdentifier @@ -325,7 +325,7 @@ ORAddress B "2.16.840.1.101.2.2.1.134.1" "id-at-collective-mhs-or-addresses" /* this is magic I haven't seen used before - I've stripped the tag - but now I'm going to say it is IMPLICIT! */ offset = dissect_ber_restricted_string(TRUE, BER_UNI_TAG_PrintableString, - pinfo, tree, tvb, offset, hf_index, + actx->pinfo, tree, tvb, offset, hf_index, NULL); @@ -381,11 +381,11 @@ ORAddress B "2.16.840.1.101.2.2.1.134.1" "id-at-collective-mhs-or-addresses" tvbuff_t *next_tvb; /* we can do this now constructed octet strings are supported */ - offset = dissect_ber_octet_string(FALSE, pinfo, NULL, tvb, offset, hf_index, &next_tvb); + offset = dissect_ber_octet_string(FALSE, actx->pinfo, NULL, tvb, offset, hf_index, &next_tvb); if (next_tvb) { if (content_type_id) { - (void) call_ber_oid_callback(content_type_id, next_tvb, 0, pinfo, top_tree ? top_tree : tree); + (void) call_ber_oid_callback(content_type_id, next_tvb, 0, actx->pinfo, top_tree ? top_tree : tree); } else { proto_item *item = NULL; proto_tree *next_tree = NULL; @@ -394,7 +394,7 @@ ORAddress B "2.16.840.1.101.2.2.1.134.1" "id-at-collective-mhs-or-addresses" if (item) { next_tree=proto_item_add_subtree(item, ett_x411_content_unknown); } - dissect_unknown_ber(pinfo, next_tvb, 0, next_tree); + dissect_unknown_ber(actx->pinfo, next_tvb, 0, next_tree); } } @@ -412,8 +412,8 @@ ORAddress B "2.16.840.1.101.2.2.1.134.1" "id-at-collective-mhs-or-addresses" } else { - if (check_col(pinfo->cinfo, COL_INFO) && mtaname) { - col_append_fstr(pinfo->cinfo, COL_INFO, " %%s", tvb_format_text(mtaname, 0, tvb_length(mtaname))); + if (check_col(actx->pinfo->cinfo, COL_INFO) && mtaname) { + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", tvb_format_text(mtaname, 0, tvb_length(mtaname))); } } @@ -569,8 +569,8 @@ ORAddress B "2.16.840.1.101.2.2.1.134.1" "id-at-collective-mhs-or-addresses" if(*oraddress) { proto_item_append_text(address_item, " (%%s/", oraddress); - if(doing_subjectid && check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " (%%s/", oraddress); + if(doing_subjectid && check_col(actx->pinfo->cinfo, COL_INFO)) { + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " (%%s/", oraddress); } } @@ -587,8 +587,8 @@ ORAddress B "2.16.840.1.101.2.2.1.134.1" "id-at-collective-mhs-or-addresses" if(doing_address) proto_item_append_text(address_item, " $ %%s)", tvb_format_text(id, 0, tvb_length(id))); - if(doing_subjectid && check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, " $ %%s)", tvb_format_text(id, 0, tvb_length(id))); + if(doing_subjectid && check_col(actx->pinfo->cinfo, COL_INFO)) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " $ %%s)", tvb_format_text(id, 0, tvb_length(id))); } #.FN_BODY MTSIdentifier @@ -682,8 +682,8 @@ ORAddress B "2.16.840.1.101.2.2.1.134.1" "id-at-collective-mhs-or-addresses" #.FN_BODY MTABindError int error = -1; %(DEFAULT_BODY)s - if((error != -1) && check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, " (%%s)", val_to_str(error, x411_MTABindError_vals, "error(%%d)")); + if((error != -1) && check_col(actx->pinfo->cinfo, COL_INFO)) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " (%%s)", val_to_str(error, x411_MTABindError_vals, "error(%%d)")); #.FN_PARS TokenTypeIdentifier FN_VARIANT = _str VAL_PTR = &object_identifier_id @@ -691,7 +691,7 @@ ORAddress B "2.16.840.1.101.2.2.1.134.1" "id-at-collective-mhs-or-addresses" #.FN_BODY TokenTypeData if(object_identifier_id) - call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.FN_PARS Credentials VAL_PTR = &credentials @@ -701,14 +701,14 @@ ORAddress B "2.16.840.1.101.2.2.1.134.1" "id-at-collective-mhs-or-addresses" %(DEFAULT_BODY)s - if (check_col(pinfo->cinfo, COL_INFO)) { + if (check_col(actx->pinfo->cinfo, COL_INFO)) { if(credentials == -1) credentials = 0; - col_append_fstr(pinfo->cinfo, COL_INFO, " %%s", val_to_str(credentials, x411_Credentials_vals, "Credentials(%%d)")); + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", val_to_str(credentials, x411_Credentials_vals, "Credentials(%%d)")); } #.FN_BODY T_value - offset=call_x411_oid_callback("x411.tokendata", tvb, offset, pinfo, tree); + offset=call_x411_oid_callback("x411.tokendata", tvb, offset, actx->pinfo, tree); #.FN_BODY T_bilateral_information proto_item *item = NULL; @@ -716,14 +716,14 @@ ORAddress B "2.16.840.1.101.2.2.1.134.1" "id-at-collective-mhs-or-addresses" guint32 len = 0; /* work out the length */ - loffset = dissect_ber_identifier(pinfo, tree, tvb, offset, NULL, NULL, NULL); - (void) dissect_ber_length(pinfo, tree, tvb, loffset, &len, NULL); + loffset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, NULL, NULL, NULL); + (void) dissect_ber_length(actx->pinfo, tree, tvb, loffset, &len, NULL); /* create some structure so we can tell what this unknown ASN.1 represents */ item = proto_tree_add_item(tree, hf_index, tvb, offset, len, FALSE); tree = proto_item_add_subtree(item, ett_x411_bilateral_information); - offset = dissect_unknown_ber(pinfo, tvb, offset, tree); + offset = dissect_unknown_ber(actx->pinfo, tvb, offset, tree); #.FN_PARS MTS-APDU VAL_PTR = &apdu @@ -733,8 +733,8 @@ ORAddress B "2.16.840.1.101.2.2.1.134.1" "id-at-collective-mhs-or-addresses" %(DEFAULT_BODY)s - if(check_col(pinfo->cinfo, COL_INFO) && (apdu != 0)) { /* we don't show "message" - sub-dissectors have better idea */ - col_append_fstr(pinfo->cinfo, COL_INFO, " %%s", val_to_str(apdu, x411_MTS_APDU_vals, "MTS-APDU(%%d)")); + if(check_col(actx->pinfo->cinfo, COL_INFO) && (apdu != 0)) { /* we don't show "message" - sub-dissectors have better idea */ + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", val_to_str(apdu, x411_MTS_APDU_vals, "MTS-APDU(%%d)")); } #.FN_PARS ReportType @@ -745,8 +745,8 @@ ORAddress B "2.16.840.1.101.2.2.1.134.1" "id-at-collective-mhs-or-addresses" %(DEFAULT_BODY)s - if(check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " %%s", val_to_str(report, x411_ReportType_vals, "report-type(%%d)")); + if(check_col(actx->pinfo->cinfo, COL_INFO)) { + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", val_to_str(report, x411_ReportType_vals, "report-type(%%d)")); } #.END diff --git a/asn1/x420/packet-x420-template.c b/asn1/x420/packet-x420-template.c index f99f31dc77..2ea131ab9c 100644 --- a/asn1/x420/packet-x420-template.c +++ b/asn1/x420/packet-x420-template.c @@ -31,6 +31,7 @@ #include <epan/packet.h> #include <epan/conversation.h> #include <epan/oid_resolv.h> +#include <epan/asn1.h> #include <stdio.h> #include <string.h> @@ -100,6 +101,8 @@ dissect_x420(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) int offset = 0; proto_item *item=NULL; proto_tree *tree=NULL; + asn1_ctx_t asn1_ctx; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); if(parent_tree){ item = proto_tree_add_item(parent_tree, proto_x420, tvb, 0, -1, FALSE); @@ -111,7 +114,7 @@ dissect_x420(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) if (check_col(pinfo->cinfo, COL_INFO)) col_add_str(pinfo->cinfo, COL_INFO, "InterPersonal"); - dissect_x420_InformationObject(TRUE, tvb, offset, pinfo , tree, -1); + dissect_x420_InformationObject(TRUE, tvb, offset, &asn1_ctx , tree, -1); } diff --git a/asn1/x420/x420.cnf b/asn1/x420/x420.cnf index fd83b59f4d..f40cd9f917 100644 --- a/asn1/x420/x420.cnf +++ b/asn1/x420/x420.cnf @@ -50,58 +50,58 @@ ChangeOfAddressAdvice IPMAssemblyInstructions #.REGISTER -OriginatingUA B "1.2.826.0.1004.10.1.1" "nexor-originating-ua" -AbsenceAdvice B "2.6.1.19.0" "id-on-absence-advice" +OriginatingUA B "1.2.826.0.1004.10.1.1" "nexor-originating-ua" +AbsenceAdvice B "2.6.1.19.0" "id-on-absence-advice" ChangeOfAddressAdvice B "2.6.1.19.1" "id-on-change-of-address-advice" IPMAssemblyInstructions B "2.6.1.17.2" "id-mst-assembly-instructions" IncompleteCopy B "2.6.1.5.0" "id-hex-incomplete-copy" -Languages B "2.6.1.5.1" "id-hex-languages" +Languages B "2.6.1.5.1" "id-hex-languages" AutoSubmitted B "2.6.1.5.2" "id-hex-auto-submitted" BodyPartSignatures B "2.6.1.5.3" "id-hex-body-part-signatures" IPMSecurityLabel B "2.6.1.5.4" "id-hex-ipm-security-label" AuthorizationTime B "2.6.1.5.5" "id-hex-authorization-time" CirculationList B "2.6.1.5.6" "id-hex-circulation-list-recipients" CirculationListIndicator B "2.6.1.20.0" "id-rex-circulation-list-indicator" -DistributionCodes B "2.6.1.5.7" "id-hex-distribution-codes" -ExtendedSubject B "2.6.1.5.8" "id-hex-extended-subject" +DistributionCodes B "2.6.1.5.7" "id-hex-distribution-codes" +ExtendedSubject B "2.6.1.5.8" "id-hex-extended-subject" InformationCategories B "2.6.1.5.9" "id-hex-information-categories" ManualHandlingInstructions B "2.6.1.5.10" "id-hex-manual-handling-instructions" OriginatorsReference B "2.6.1.5.11" "id-hex-originators-reference" PrecedencePolicyIdentifier B "2.6.1.5.12" "id-hex-precedence-policy-id" -Precedence B "2.6.1.20.1" "id-rex-precedence" +Precedence B "2.6.1.20.1" "id-rex-precedence" -IA5TextData B "2.6.1.4.0" "id-et-ia5-text" -IA5TextParameters B "2.6.1.11.0" "id-ep-ia5-text" -G3FacsimileData B "2.6.1.4.2" "id-et-g3-facsimile" +IA5TextData B "2.6.1.4.0" "id-et-ia5-text" +IA5TextParameters B "2.6.1.11.0" "id-ep-ia5-text" +G3FacsimileData B "2.6.1.4.2" "id-et-g3-facsimile" G3FacsimileParameters B "2.6.1.11.2" "id-ep-g3-facsimile" -G4Class1Data B "2.6.1.4.3" "id-et-g4-class1" -TeletexData B "2.6.1.4.4" "id-et-teletex" -TeletexParameters B "2.6.1.11.4" "id-ep-teletex" -VideotexData B "2.6.1.4.5" "id-et-videotex" -VideotexParameters B "2.6.1.11.5" "id-ep-videotex" -EncryptedData B "2.6.1.4.6" "id-et-encrypted" +G4Class1Data B "2.6.1.4.3" "id-et-g4-class1" +TeletexData B "2.6.1.4.4" "id-et-teletex" +TeletexParameters B "2.6.1.11.4" "id-ep-teletex" +VideotexData B "2.6.1.4.5" "id-et-videotex" +VideotexParameters B "2.6.1.11.5" "id-ep-videotex" +EncryptedData B "2.6.1.4.6" "id-et-encrypted" EncryptedParameters B "2.6.1.11.6" "id-ep-encrypted" -MessageData B "2.6.1.4.7" "id-et-message" -MessageParameters B "2.6.1.11.7" "id-ep-message" -MixedModeData B "2.6.1.4.8" "id-et-mixed-mode" +MessageData B "2.6.1.4.7" "id-et-message" +MessageParameters B "2.6.1.11.7" "id-ep-message" +MixedModeData B "2.6.1.4.8" "id-et-mixed-mode" BilaterallyDefinedBodyPart B "2.6.1.4.9" "id-et-bilaterally-defined" GeneralTextParameters B "2.6.1.11.11" "id-ep-general-text" -GeneralTextData B "2.6.1.4.11" "id-et-general-text" +GeneralTextData B "2.6.1.4.11" "id-et-general-text" # FileTransferBodyPart {id-et 12} in a separate dissector (ftbp) # {id-et 13} is no longer defined # ForwardedReportBodyPart {id-et 14} defined in x411.cnf -MessageParameters B "2.6.1.11.15" "id-ep-notification" -IPN B "2.6.1.4.15" "id-et-notification" -VoiceParameters B "2.6.1.11.16" "id-ep-voice" -VoiceData B "2.6.1.4.16" "id-et-voice" +MessageParameters B "2.6.1.11.15" "id-ep-notification" +IPN B "2.6.1.4.15" "id-et-notification" +VoiceParameters B "2.6.1.11.16" "id-ep-voice" +VoiceData B "2.6.1.4.16" "id-et-voice" # P22 ForwardedContentParameters B "2.6.1.11.17.2.6.1.10.1" "id-ep-content-p22" -InformationObject B "2.6.1.4.17.2.6.1.10.1" "id-et-content-p22" +InformationObject B "2.6.1.4.17.2.6.1.10.1" "id-et-content-p22" #p2 ForwardedContentParameters B "2.6.1.11.17.2.6.1.10.0" "id-ep-content-p2" -InformationObject B "2.6.1.4.17.2.6.1.10.0" "id-et-content-p2" +InformationObject B "2.6.1.4.17.2.6.1.10.0" "id-et-content-p2" #p722 ForwardedContentParameters B "2.6.1.11.17.1.3.26.0.4406.0.4.1" "id-ep-content-p772" @@ -121,20 +121,20 @@ ForwardedContentParameters B "2.6.1.11.17.1.3.26.0.4406.0.4.1" "id-ep-content- #.FN_BODY T_value - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.FN_BODY IPM - if((hf_index == hf_x420_ipm) && check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, " Message"); + if((hf_index == hf_x420_ipm) && check_col(actx->pinfo->cinfo, COL_INFO)) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " Message"); %(DEFAULT_BODY)s #.FN_BODY IPN - if((hf_index == hf_x420_ipn) && check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, " Notification"); + if((hf_index == hf_x420_ipn) && check_col(actx->pinfo->cinfo, COL_INFO)) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " Notification"); %(DEFAULT_BODY)s @@ -146,8 +146,8 @@ ForwardedContentParameters B "2.6.1.11.17.1.3.26.0.4406.0.4.1" "id-ep-content- %(DEFAULT_BODY)s - if(subject && check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, " (%%s)", tvb_format_text(subject, 0, tvb_length(subject))); + if(subject && check_col(actx->pinfo->cinfo, COL_INFO)) + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " (%%s)", tvb_format_text(subject, 0, tvb_length(subject))); #.FN_PARS CharacterSetRegistration VAL_PTR=&crs diff --git a/asn1/x509af/packet-x509af-template.c b/asn1/x509af/packet-x509af-template.c index a784b9b700..74b9f949ad 100644 --- a/asn1/x509af/packet-x509af-template.c +++ b/asn1/x509af/packet-x509af-template.c @@ -31,6 +31,7 @@ #include <epan/packet.h> #include <epan/conversation.h> #include <epan/oid_resolv.h> +#include <epan/asn1.h> #include <stdio.h> #include <string.h> @@ -71,6 +72,8 @@ dissect_pkix_crl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { proto_item *item=NULL; proto_tree *tree=NULL; + asn1_ctx_t asn1_ctx; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); if (check_col(pinfo->cinfo, COL_PROTOCOL)) col_set_str(pinfo->cinfo, COL_PROTOCOL, "PKIX-CRL"); @@ -87,7 +90,7 @@ dissect_pkix_crl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) tree = proto_item_add_subtree(item, ett_pkix_crl); } - return dissect_x509af_CertificateList(FALSE, tvb, 0, pinfo, tree, -1); + return dissect_x509af_CertificateList(FALSE, tvb, 0, &asn1_ctx, tree, -1); } /*--- proto_register_x509af ----------------------------------------------*/ diff --git a/asn1/x509af/x509af.cnf b/asn1/x509af/x509af.cnf index e8842d6c8b..c52ac2654e 100644 --- a/asn1/x509af/x509af.cnf +++ b/asn1/x509af/x509af.cnf @@ -34,15 +34,15 @@ Version #.PDU #.REGISTER -Certificate B "2.5.4.36" "id-at-userCertificate" -Certificate B "2.5.4.37" "id-at-cAcertificate" -CertificateList B "2.5.4.38" "id-at-authorityRevocationList" -CertificateList B "2.5.4.39" "id-at-certificateRevocationList" -CertificatePair B "2.5.4.40" "id-at-crossCertificatePair" -AttributeCertificate B "2.5.4.58" "id-at-attributeCertificate" -CertificateList B "2.5.4.59" "id-at-attributeCertificateRevocationList" - -DSS-Params B "1.2.840.10040.4.1" "id-dsa" +Certificate B "2.5.4.36" "id-at-userCertificate" +Certificate B "2.5.4.37" "id-at-cAcertificate" +CertificateList B "2.5.4.38" "id-at-authorityRevocationList" +CertificateList B "2.5.4.39" "id-at-certificateRevocationList" +CertificatePair B "2.5.4.40" "id-at-crossCertificatePair" +AttributeCertificate B "2.5.4.58" "id-at-attributeCertificate" +CertificateList B "2.5.4.59" "id-at-attributeCertificateRevocationList" + +DSS-Params B "1.2.840.10040.4.1" "id-dsa" #.NO_EMIT #.TYPE_RENAME @@ -77,7 +77,7 @@ CertificateList/signedCertificateList/revokedCertificates/_item/userCertificate } #.FN_BODY AlgorithmIdentifier/parameters - offset=call_ber_oid_callback(algorithm_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(algorithm_id, tvb, offset, actx->pinfo, tree); #.FN_PARS Extension/extnId FN_VARIANT = _str HF_INDEX = hf_x509af_extension_id VAL_PTR = &extension_id @@ -99,9 +99,9 @@ CertificateList/signedCertificateList/revokedCertificates/_item/userCertificate gint32 tag; guint32 len; /* skip past the T and L */ - offset = dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag); - offset = dissect_ber_length(pinfo, tree, tvb, offset, &len, &ind); - offset=call_ber_oid_callback(extension_id, tvb, offset, pinfo, tree); + offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &class, &pc, &tag); + offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind); + offset=call_ber_oid_callback(extension_id, tvb, offset, actx->pinfo, tree); #.FN_BODY SubjectName diff --git a/asn1/x509ce/packet-x509ce-template.c b/asn1/x509ce/packet-x509ce-template.c index 1ec0206261..30480ffa78 100644 --- a/asn1/x509ce/packet-x509ce-template.c +++ b/asn1/x509ce/packet-x509ce-template.c @@ -30,6 +30,7 @@ #include <glib.h> #include <epan/packet.h> #include <epan/conversation.h> +#include <epan/asn1.h> #include <stdio.h> #include <string.h> @@ -64,13 +65,18 @@ static const char *object_identifier_id; static void dissect_x509ce_invalidityDate_callback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - dissect_x509ce_GeneralizedTime(FALSE, tvb, 0, pinfo, tree, hf_x509ce_id_ce_invalidityDate); + asn1_ctx_t asn1_ctx; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); + + dissect_x509ce_GeneralizedTime(FALSE, tvb, 0, &asn1_ctx, tree, hf_x509ce_id_ce_invalidityDate); } static void dissect_x509ce_baseUpdateTime_callback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - dissect_x509ce_GeneralizedTime(FALSE, tvb, 0, pinfo, tree, hf_x509ce_id_ce_baseUpdateTime); + asn1_ctx_t asn1_ctx; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); + dissect_x509ce_GeneralizedTime(FALSE, tvb, 0, &asn1_ctx, tree, hf_x509ce_id_ce_baseUpdateTime); } /*--- proto_register_x509ce ----------------------------------------------*/ diff --git a/asn1/x509ce/x509ce.cnf b/asn1/x509ce/x509ce.cnf index 797ac465d2..555a8c2ab5 100644 --- a/asn1/x509ce/x509ce.cnf +++ b/asn1/x509ce/x509ce.cnf @@ -111,7 +111,7 @@ CertificatePairExactAssertion/issuedByThisCAAssertion cpea_issuedByThisCAAsserti FN_VARIANT = _str HF_INDEX = hf_x509ce_object_identifier_id VAL_PTR = &object_identifier_id #.FN_BODY PolicyQualifierValue - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.FN_BODY GeneralName/iPAddress proto_tree_add_item(tree, hf_x509ce_IPAddress, tvb, offset, 4, FALSE); @@ -121,7 +121,7 @@ CertificatePairExactAssertion/issuedByThisCAAssertion cpea_issuedByThisCAAsserti FN_VARIANT = _str VAL_PTR = &object_identifier_id #.FN_BODY OtherNameValue - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.FN_FTR IA5String if(hf_index == hf_x509ce_uniformResourceIdentifier) diff --git a/asn1/x509if/packet-x509if-template.c b/asn1/x509if/packet-x509if-template.c index 5e8926a048..8cea032b31 100644 --- a/asn1/x509if/packet-x509if-template.c +++ b/asn1/x509if/packet-x509if-template.c @@ -31,12 +31,13 @@ #include <epan/packet.h> #include <epan/conversation.h> #include <epan/oid_resolv.h> +#include <epan/asn1.h> #include <stdio.h> #include <string.h> -#include "packet-x509if.h" #include "packet-ber.h" +#include "packet-x509if.h" #include "packet-x509sat.h" #include <epan/emem.h> #include <epan/strutil.h> diff --git a/asn1/x509if/x509if.cnf b/asn1/x509if/x509if.cnf index 7c12f17764..e31af525c9 100644 --- a/asn1/x509if/x509if.cnf +++ b/asn1/x509if/x509if.cnf @@ -128,7 +128,7 @@ DistinguishedName B "2.16.840.1.101.2.2.1.140" "id-at-garrison" FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &object_identifier_id #.FN_BODY ContextValue - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.FN_PARS AttributeId FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &object_identifier_id @@ -171,14 +171,14 @@ DistinguishedName B "2.16.840.1.101.2.2.1.140" "id-at-garrison" const char *name = NULL; const char *orig_oid = object_identifier_id; - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); /* in dissecting the value we may have overridden the OID of the value - which is a problem if there are multiple values */ object_identifier_id = orig_oid; /* try and dissect as a string */ - dissect_ber_octet_string(FALSE, pinfo, NULL, tvb, old_offset, hf_x509if_any_string, &out_tvb); + dissect_ber_octet_string(FALSE, actx->pinfo, NULL, tvb, old_offset, hf_x509if_any_string, &out_tvb); /* should also try and dissect as an OID and integer */ /* of course, if I can look up the syntax .... */ @@ -207,16 +207,16 @@ DistinguishedName B "2.16.840.1.101.2.2.1.140" "id-at-garrison" } #.FN_BODY SelectedValues - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.FN_PARS DefaultValueType FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &object_identifier_id #.FN_BODY DefaultValueValues - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.FN_BODY ValuesWithContextValue - offset=call_ber_oid_callback("unknown", tvb, offset, pinfo, tree); + offset=call_ber_oid_callback("unknown", tvb, offset, actx->pinfo, tree); #.FN_BODY RelativeDistinguishedName char *temp_dn; @@ -274,10 +274,10 @@ DistinguishedName B "2.16.840.1.101.2.2.1.140" "id-at-garrison" proto_item_append_text(top_of_dn, " (%%s)", last_dn); /* see if we should append this to the col info */ - if(check_col(pinfo->cinfo, COL_INFO) && + if(check_col(actx->pinfo->cinfo, COL_INFO) && (fmt = val_to_str(hf_index, fmt_vals, "")) && *fmt) { /* we have a format */ - col_append_fstr(pinfo->cinfo, COL_INFO, " %%s%%s", fmt, last_dn); + col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s%%s", fmt, last_dn); } diff --git a/asn1/x509sat/packet-x509sat-template.c b/asn1/x509sat/packet-x509sat-template.c index 836fd8a3dd..6f141f9c14 100644 --- a/asn1/x509sat/packet-x509sat-template.c +++ b/asn1/x509sat/packet-x509sat-template.c @@ -31,6 +31,7 @@ #include <epan/packet.h> #include <epan/conversation.h> #include <epan/oid_resolv.h> +#include <epan/asn1.h> #include <stdio.h> #include <string.h> |