summaryrefslogtreecommitdiff
path: root/asn1/cmip
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2007-05-13 20:58:29 +0000
committerAnders Broman <anders.broman@ericsson.com>2007-05-13 20:58:29 +0000
commitc01f3829742dacd6d94dc50be54537661bad0581 (patch)
treeeb3da0d69d5bc62ca587ebd999b6beacd693f168 /asn1/cmip
parentb80cb43018aa49bac3e24cabca009ca0471cd579 (diff)
downloadwireshark-c01f3829742dacd6d94dc50be54537661bad0581.tar.gz
Second step in introducing asn context to BER dissectors just like in PER.
svn path=/trunk/; revision=21753
Diffstat (limited to 'asn1/cmip')
-rw-r--r--asn1/cmip/cmip.cnf95
-rw-r--r--asn1/cmip/packet-cmip-template.c54
2 files changed, 58 insertions, 91 deletions
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"
}