diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2004-11-14 05:12:49 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2004-11-14 05:12:49 +0000 |
commit | ede6ed2e8efa502a74213feb3c16b54c09860572 (patch) | |
tree | 64f8347287cdc368a6b86ed557fd3e82b9abbcff /asn1 | |
parent | bb0cf08d8cb55d61f1f1a8568098562477eff26e (diff) | |
download | wireshark-ede6ed2e8efa502a74213feb3c16b54c09860572.tar.gz wireshark-ede6ed2e8efa502a74213feb3c16b54c09860572.tar.bz2 wireshark-ede6ed2e8efa502a74213feb3c16b54c09860572.zip |
New protocol for the telco people to play with : CMIP
Only one function is implemented so fat M-Get but it would be trivial to add all the missing ones once there are example captures.
svn path=/trunk/; revision=12521
Diffstat (limited to 'asn1')
-rw-r--r-- | asn1/cmip/CMIP.asn | 227 | ||||
-rw-r--r-- | asn1/cmip/cmip.cnf | 124 | ||||
-rw-r--r-- | asn1/cmip/packet-cmip-template.c | 163 | ||||
-rw-r--r-- | asn1/cmip/packet-cmip-template.h | 32 |
4 files changed, 546 insertions, 0 deletions
diff --git a/asn1/cmip/CMIP.asn b/asn1/cmip/CMIP.asn new file mode 100644 index 0000000000..95d7fb16b1 --- /dev/null +++ b/asn1/cmip/CMIP.asn @@ -0,0 +1,227 @@ +-- some of the definitions use implicit tags so be careful when adding +-- new structures. +-- Module CMIP-A-ASSOCIATE-Information (X.711:10/1997) +CMIP-A-ASSOCIATE-Information {joint-iso-itu-t ms(9) cmip(1) modules(0) + aAssociateUserInfo(1)} DEFINITIONS ::= +BEGIN + +IMPORTS + DistinguishedName, RDNSequence + FROM InformationFramework; + + +ObjectClass ::= CHOICE { + ocglobalForm [0] IMPLICIT OBJECT IDENTIFIER, + oclocalForm [1] IMPLICIT INTEGER +} + +ObjectInstance ::= CHOICE { + distinguishedName [2] IMPLICIT DistinguishedName, + nonSpecificForm [3] IMPLICIT OCTET STRING, + localDistinguishedName [4] IMPLICIT RDNSequence +} + +BaseManagedObjectId ::= SEQUENCE { + baseManagedObjectClass ObjectClass, + baseManagedObjectInstance ObjectInstance +} + +AttributeId ::= CHOICE { + globalForm [0] IMPLICIT OBJECT IDENTIFIER, + localForm [1] IMPLICIT INTEGER +} + +Attribute ::= SEQUENCE { + id AttributeId, + value ANY +} + +-- This Recommendation | International Standard does not allocate any values for localForm. +-- Where this alternative is used, the permissible values for the integers and their meanings shall be defined +-- as part of the application context in which they are used +FilterItem ::= CHOICE { + equality [0] IMPLICIT Attribute, + substrings + [1] IMPLICIT SEQUENCE OF + CHOICE {initialString [0] IMPLICIT Attribute, + anyString [1] IMPLICIT Attribute, + finalString [2] IMPLICIT Attribute}, + greaterOrEqual [2] IMPLICIT Attribute, -- asserted value ? attribute value + lessOrEqual [3] IMPLICIT Attribute, -- asserted value <= attribute value + present [4] AttributeId, + subsetOf [5] IMPLICIT Attribute, -- asserted value is a subset of attribute value + supersetOf [6] IMPLICIT Attribute, -- asserted value is a superset of attribute value + nonNullSetIntersection [7] IMPLICIT Attribute +} + +CMISFilter ::= CHOICE { + item [8] FilterItem, + and [9] IMPLICIT SET OF CMISFilter, + or [10] IMPLICIT SET OF CMISFilter, + not [11] CMISFilter +} + +Scope ::= CHOICE { + namedNumbers INTEGER {baseObject(0), firstLevelOnly(1), wholeSubtree(2)}, + individualLevels [1] IMPLICIT INTEGER, -- POSITIVE integer indicates the level to be selected + baseToNthLevel [2] IMPLICIT INTEGER +} -- POSITIVE integer N indicates that the range of levels + +CMISSync ::= ENUMERATED {bestEffort(0), atomic(1)} + +-- Supporting type definitions +--XXX Dont support EXTERNAL yet +--AccessControl ::= EXTERNAL +AccessControl ::= OCTET STRING + + +GetArgument ::= SEQUENCE { +-- COMPONENTS OF BaseManagedObjectId, manually expanded + baseManagedObjectClass ObjectClass, + baseManagedObjectInstance ObjectInstance, + accessControl [5] AccessControl OPTIONAL, + synchronization [6] IMPLICIT CMISSync OPTIONAL, + scope [7] Scope OPTIONAL, + filter CMISFilter OPTIONAL, + attributeIdList [12] IMPLICIT SET OF AttributeId OPTIONAL, + ... +} + +GetResult ::= SEQUENCE { + managedObjectClass ObjectClass OPTIONAL, + managedObjectInstance ObjectInstance OPTIONAL, + currentTime [5] IMPLICIT GeneralizedTime OPTIONAL, + attributeList [6] IMPLICIT SET OF Attribute OPTIONAL, + ... +} + +Argument ::= ANY + +ReturnResultBody ::= SEQUENCE { + opcode Opcode, + argument Argument +} + +InvokeID ::= INTEGER + +Opcode ::= INTEGER { m-EventReport(0), m-EventReport-Confirmed(1), m-Linked-Reply(2), m-Get(3), m-Set(4), m-Set-Confirmed(5), m-Action(6), m-Action-Confirmed(7), m-Create(8), m-Delete(9), m-CancelGet(10) } + +InvokeLinkedId ::= CHOICE { + present [0] IMPLICIT InvokeId, + absent [1] IMPLICIT NULL +} + +InvokeId ::= CHOICE { + present InvokeID, + absent NULL +} + +Invoke ::= SEQUENCE { + invokeId InvokeId, + linkedId InvokeLinkedId OPTIONAL, + opcode Opcode, + argument Argument OPTIONAL +} + +ReturnResult ::= SEQUENCE { + invokeId InvokeId, + rRBody ReturnResultBody OPTIONAL +} + +ReturnError ::= SEQUENCE { + invokeId InvokeId +--XXX need to fill in missing fields here +} + + +GeneralProblem ::= INTEGER { + unrecognizedPDU(0), mistypedPDU(1), badlyStructuredPDU(2) +} + +InvokeProblem ::= INTEGER { + duplicateInvocation(0), unrecognizedOperation(1), mistypedArgument(2), + resourceLimitation(3), releaseInProgress(4), unrecognizedLinkedId(5), + linkedResponseUnexpected(6), unexpectedLinkedOperation(7) +} + +ReturnResultProblem ::= INTEGER { + unrecognizedInvocation(0), resultResponseUnexpected(1), mistypedResult(2) +} + +ReturnErrorProblem ::= INTEGER { + unrecognizedInvocation(0), errorResponseUnexpected(1), unrecognizedError(2), + unexpectedError(3), mistypedParameter(4) +} + +RejectProblem ::= INTEGER { + general-unrecognizedPDU(0), general-mistypedPDU(1), + general-badlyStructuredPDU(2), invoke-duplicateInvocation(10), + invoke-unrecognizedOperation(11), invoke-mistypedArgument(12), + invoke-resourceLimitation(13), invoke-releaseInProgress(14), + invoke-unrecognizedLinkedId(15), invoke-linkedResponseUnexpected(16), + invoke-unexpectedLinkedOperation(17), + returnResult-unrecognizedInvocation(20), + returnResult-resultResponseUnexpected(21), returnResult-mistypedResult(22), + returnError-unrecognizedInvocation(30), + returnError-errorResponseUnexpected(31), returnError-unrecognizedError(32), + returnError-unexpectedError(33), returnError-mistypedParameter(34) +} + +RejectProb ::= CHOICE { + generalProblem [0] IMPLICIT GeneralProblem, + invokeProblem [1] IMPLICIT InvokeProblem, + returnResultProblem [2] IMPLICIT ReturnResultProblem, + returnErrorProblem [3] IMPLICIT ReturnErrorProblem +} + +Reject ::= SEQUENCE { + invokeId InvokeId, + rejectProblem RejectProb +} + +ROS ::= CHOICE { + invoke [1] IMPLICIT Invoke, + returnResult [2] IMPLICIT ReturnResult, + returnError [3] IMPLICIT ReturnError, + reject [4] IMPLICIT Reject +} + + + + + + +-- CMIP-A-ABORT +-- Information carried in user-information parameter of A-ABORT +CMIPAbortInfo ::= SEQUENCE { + abortSource [0] IMPLICIT CMIPAbortSource +--XXX Dont know how to handle EXTERNAL yet +--XXX userInfo [1] EXTERNAL OPTIONAL +} + +CMIPAbortSource ::= ENUMERATED {cmiseServiceUser(0), cmiseServiceProvider(1)} + + + + +-- CMIP-A-ASSOCIATE +FunctionalUnits ::= BIT STRING { + multipleObjectSelection(0), filter(1), multipleReply(2), extendedService(3), + cancelGet(4)} + +-- Functional unit i is supported if and only if bit i is one +-- Information carried in user-information parameter of A-ASSOCIATE +CMIPUserInfo ::= SEQUENCE { + protocolVersion [0] IMPLICIT ProtocolVersion OPTIONAL, + functionalUnits [1] IMPLICIT FunctionalUnits OPTIONAL +--XXX Dont know how to handle EXTERNAL yet +--XXX accessControl [2] EXTERNAL OPTIONAL, +--XXX userInfo [3] EXTERNAL OPTIONAL +} + +ProtocolVersion ::= BIT STRING {version1(0), version2(1)} + +END + +-- Generated by Asnp, the ASN.1 pretty-printer of France Telecom R&D + diff --git a/asn1/cmip/cmip.cnf b/asn1/cmip/cmip.cnf new file mode 100644 index 0000000000..81bbe08f38 --- /dev/null +++ b/asn1/cmip/cmip.cnf @@ -0,0 +1,124 @@ +# cmip.cnf +# CMIP conformation file + +# $Id: cmip.cnf 12290 2004-10-13 00:21:00Z sahlberg $ + +#.MODULE_IMPORT +InformationFramework x509if + +#.INCLUDE ../x509if/x509if_exp.cnf + +#.EXPORTS +CMIPAbortInfo +CMIPUserInfo +ROS + +#.NO_EMIT + +#.PDU + +#.TYPE_RENAME + +#.FIELD_RENAME + +#.FN_HDR CMIPAbortInfo + if(check_col(pinfo->cinfo, COL_INFO)){ + col_append_fstr(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"); + } +#.END + +#.FN_BODY CMIPAbortSource + guint32 value; + offset = dissect_ber_integer_new(implicit_tag, pinfo, tree, tvb, offset, hf_index, &value); + if(check_col(pinfo->cinfo, COL_INFO)){ + col_append_fstr(pinfo->cinfo, COL_INFO, " AbortSource:%s", val_to_str(value, CMIPAbortSource_vals, " Unknown AbortSource:%d")); + } +#.END + +#.FN_BODY Opcode + offset = dissect_ber_integer_new(implicit_tag, pinfo, tree, tvb, offset, hf_index, &opcode); + if(check_col(pinfo->cinfo, COL_INFO)){ + col_prepend_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str(opcode, Opcode_vals, " Unknown Opcode:%d")); + } +#.END + +#.FN_FTR Invoke + opcode_type=OPCODE_INVOKE; + if(check_col(pinfo->cinfo, COL_INFO)){ + col_prepend_fstr(pinfo->cinfo, COL_INFO, "Invoke "); + } +#.END + +#.FN_FTR ReturnResult + opcode_type=OPCODE_RETURN_RESULT; + if(check_col(pinfo->cinfo, COL_INFO)){ + col_prepend_fstr(pinfo->cinfo, COL_INFO, "ReturnResult "); + } +#.END + +#.FN_FTR ReturnError + opcode_type=OPCODE_RETURN_ERROR; + if(check_col(pinfo->cinfo, COL_INFO)){ + col_prepend_fstr(pinfo->cinfo, COL_INFO, "ReturnError "); + } +#.END + +#.FN_FTR Reject + opcode_type=OPCODE_REJECT; + if(check_col(pinfo->cinfo, COL_INFO)){ + col_prepend_fstr(pinfo->cinfo, COL_INFO, "Reject "); + } +#.END + +#.FN_BODY AttributeId/globalForm + attributeform = ATTRIBUTE_GLOBAL_FORM; + offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, + hf_cmip_globalForm, attribute_identifier_id); + +#.FN_BODY AttributeId/localForm + attributeform = ATTRIBUTE_LOCAL_FORM; + offset = dissect_ber_integer_new(implicit_tag, 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); + } + +#.FN_BODY Argument + switch(opcode_type){ + case OPCODE_INVOKE: + switch(opcode){ + case 3: /* M-get */ + offset = dissect_cmip_GetArgument(FALSE, tvb, offset, pinfo, tree, -1); + break; + } + break; + case OPCODE_RETURN_RESULT: + switch(opcode){ + case 3: /* M-get */ + offset = dissect_cmip_GetResult(FALSE, tvb, offset, pinfo, tree, -1); + break; + } + break; + /*XXX add more types here */ + } + +#.FN_BODY ObjectClass/ocglobalForm + objectclassform = OBJECTCLASS_GLOBAL_FORM; + offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, + hf_cmip_ocglobalForm, objectclass_identifier_id); + +#.FN_BODY ObjectClass/oclocalForm + objectclassform = OBJECTCLASS_LOCAL_FORM; + offset = dissect_ber_integer_new(implicit_tag, pinfo, tree, tvb, offset, hf_cmip_oclocalForm, NULL); + +#.END + + diff --git a/asn1/cmip/packet-cmip-template.c b/asn1/cmip/packet-cmip-template.c new file mode 100644 index 0000000000..5eddcc2af9 --- /dev/null +++ b/asn1/cmip/packet-cmip-template.c @@ -0,0 +1,163 @@ +/* packet-cmip.c + * Routines for X.711 CMIP packet dissection + * Ronnie Sahlberg 2004 + * + * $Id: packet-cmip-template.c 12245 2004-10-08 20:28:04Z guy $ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs <gerald@ethereal.com> + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <glib.h> +#include <epan/packet.h> +#include <epan/conversation.h> + +#include <stdio.h> +#include <string.h> + +#include "packet-ber.h" +#include "packet-cmip.h" + +#define PNAME "X711 CMIP" +#define PSNAME "CMIP" +#define PFNAME "cmip" + +/* XXX some stuff we need until we can get rid of it */ +#include "packet-ses.h" +#include "packet-pres.h" + +/* Initialize the protocol and registered fields */ +int proto_cmip = -1; +#include "packet-cmip-hf.c" + +/* Initialize the subtree pointers */ +static gint ett_cmip = -1; +#include "packet-cmip-ett.c" + +static guint32 opcode; + +static int opcode_type; +#define OPCODE_INVOKE 1 +#define OPCODE_RETURN_RESULT 2 +#define OPCODE_RETURN_ERROR 3 +#define OPCODE_REJECT 4 + +static int attributeform; +#define ATTRIBUTE_LOCAL_FORM 0 +#define ATTRIBUTE_GLOBAL_FORM 1 +static char attribute_identifier_id[64]; /*64 chars should be long enough? */ + +static int objectclassform; +#define OBJECTCLASS_LOCAL_FORM 0 +#define OBJECTCLASS_GLOBAL_FORM 1 +static char objectclass_identifier_id[64]; /*64 chars should be long enough? */ + +#include "packet-cmip-fn.c" + +/* XXX this one should be broken out later and moved into the conformance file */ +static void +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; + + + /* do we have spdu type from the session dissector? */ + if( !pinfo->private_data ){ + if(tree){ + proto_tree_add_text(tree, tvb, 0, -1, + "Internal error:can't get spdu type from session dissector."); + return; + } + } else { + session = ( (struct SESSION_DATA_STRUCTURE*)(pinfo->private_data) ); + if(session->spdu_type == 0 ){ + if(tree){ + proto_tree_add_text(tree, tvb, 0, -1, + "Internal error:wrong spdu type %x from session dissector.",session->spdu_type); + return; + } + } + } + + if(parent_tree){ + item = proto_tree_add_item(parent_tree, proto_cmip, tvb, 0, -1, FALSE); + tree = proto_item_add_subtree(item, ett_cmip); + } + + if (check_col(pinfo->cinfo, COL_PROTOCOL)) + col_set_str(pinfo->cinfo, COL_PROTOCOL, "CMIP"); + if (check_col(pinfo->cinfo, COL_INFO)) + col_clear(pinfo->cinfo, COL_INFO); + switch(session->spdu_type){ + case SES_CONNECTION_REQUEST: + case SES_CONNECTION_ACCEPT: + case SES_DISCONNECT: + case SES_FINISH: + dissect_cmip_CMIPUserInfo(FALSE,tvb,0,pinfo,tree,-1); + break; + case SES_ABORT: + case SES_REFUSE: + dissect_cmip_CMIPAbortInfo(FALSE,tvb,0,pinfo,tree,-1); + break; + case SES_DATA_TRANSFER: + dissect_cmip_ROS(FALSE,tvb,0,pinfo,tree,-1); + break; + default: + ; + } +} + +/*--- proto_register_cmip ----------------------------------------------*/ +void proto_register_cmip(void) { + + /* List of fields */ + static hf_register_info hf[] = { +#include "packet-cmip-hfarr.c" + }; + + /* List of subtrees */ + static gint *ett[] = { + &ett_cmip, +#include "packet-cmip-ettarr.c" + }; + + /* Register protocol */ + proto_cmip = proto_register_protocol(PNAME, PSNAME, PFNAME); + + /* Register fields and subtrees */ + proto_register_field_array(proto_cmip, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); + +} + + +/*--- proto_reg_handoff_cmip -------------------------------------------*/ +void proto_reg_handoff_cmip(void) { + dissector_handle_t cmip_handle; + + /*XXX this to be removed later and shoved into the conformance file */ + cmip_handle = create_dissector_handle(dissect_cmip,proto_cmip); + dissector_add_string("acse.application_context", "2.9.0.0.2", cmip_handle); +} + diff --git a/asn1/cmip/packet-cmip-template.h b/asn1/cmip/packet-cmip-template.h new file mode 100644 index 0000000000..6728a7ab4a --- /dev/null +++ b/asn1/cmip/packet-cmip-template.h @@ -0,0 +1,32 @@ +/* packet-cmip.h + * Routines for X.711 CMIP packet dissection + * Ronnie Sahlberg 2004 + * + * $Id: packet-cmip-template.h 12203 2004-10-05 09:18:55Z guy $ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs <gerald@ethereal.com> + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef PACKET_CMIP_H +#define PACKET_CMIP_H + +#include "packet-cmip-exp.h" + +#endif /* PACKET_CMIP_H */ + |