Dear Mounir,
I think you are speaking of OPERATION which is not an ASN.1 type but an
ASN.1 Information Object Class (before the 1997 edition of the standard it
was also known as a MACRO). The syntax can be defined in any ANY ASN.1
module but there are some well-known protocols that define ASN.1 modules
containing an OPERATION definition : ROSE, TCAP... When you define an
Information Object Class, you just define a canvas that will be used to
define further 'objects'; they are instances of the Information Object Class
taht gather several information at one time. Objects or Information Object
Class are never transmitted but objects or objects sets can be used in
definitions of types or constraints that are not known by advance by the
syntax specifier but that will be known by the aplication at runtime and
that will be transmitted (giving another piece of information to make it
understandable by another part).
For example, the ROSE OPERATION is defined like :
OPERATION ::= CLASS
{
&ArgumentType OPTIONAL,
&argumentTypeOptional BOOLEAN OPTIONAL,
&returnResult BOOLEAN DEFAULT TRUE,
&ResultType OPTIONAL,
&resultTypeOptional BOOLEAN OPTIONAL,
&Errors ERROR OPTIONAL,
&Linked OPERATION OPTIONAL,
&synchronous BOOLEAN DEFAULT FALSE,
&alwaysReturns BOOLEAN DEFAULT TRUE,
&InvokePriority Priority OPTIONAL,
&ResultPriority Priority OPTIONAL,
&operationCode Code UNIQUE OPTIONAL
}
WITH SYNTAX
{
[ARGUMENT &ArgumentType [OPTIONAL &argumentTypeOptional]]
[RESULT &ResultType [OPTIONAL &resultTypeOptional]]
[RETURN RESULT &returnResult]
[ERRORS &Errors]
[LINKED &Linked]
[SYNCHRONOUS &synchronous]
[ALWAYS RESPONDS &alwaysReturns]
[INVOKE PRIORITY &InvokePriority]
[RESULT-PRIORITY &ResultPriority]
[CODE &operationCode]
}
It means that when you want to define an object of this class, you must do
it using the user-friendly syntax :
myObject OPERATION ::=
{
ARGUMENT MyInvokeType
RESULT MyResultType
ERRORS {MyErrorsSet}
CODE local:12
}
where MyInvokeType can be NULL or can not be defined; as you can see all
elements in the WITH SYNTAX clause are optional (because in square
brackets)so they can be absent : meaning that myObject OPERATION ::= {} is
accepted.
However an OPERATION object cannot contain only a tag information, only
types (possibly using it or used in the definition of objects) can contain
some! The CODE field of the object is the information used to make both
parties recognize what object is effectively in use in the 'message' they
will receive. In other word, it identifies the object.
If you want the other part receives an 'information' you can define myNullOp
OPERATION ::= {ARGUMENT NULL, CODE local:99} or better myNULLOp OPERATION
::= {CODE local:99}. As said before, this information will be sent through a
type definition.
The ROSE protocol defines for instance its PDU like :
ROS {InvokeId:InvokeIdSet, OPERATION:Invokable, OPERATION:Returnable} ::=
CHOICE
{
invoke [1] Invoke {{InvokeIdSet}, {Invokable}},
returnResult [2] ReturnResult {{Returnable}},
returnError [3] ReturnError {{Errors{{Returnable}}}},
reject [4] Reject
}
Invoke {InvokeId:InvokeIdSet, OPERATION:Operations} ::= SEQUENCE
{
invokeId InvokeId (InvokeIdSet),
linkedId CHOICE {
present [0] IMPLICIT present < InvokeId,
absent [1] IMPLICIT NULL
}OPTIONAL,
opcode OPERATION.&operationCode
({Operations}
! RejectProblem :
invoke-unrecognisedOperation),
argument OPERATION.&ArgumentType
({Operations} {@opcode}
! RejectProblem : invoke-mistypedArgument)
OPTIONAL
}
..
It means that when you want to build an operation (ie : send an invoke to
the other part and wait for a result from it), you must build an Invoke type
and you need to send a ROS type chosing the invoke alternative. Building
your Invoke type means choose an object (let's say myNullOp defined before)
and then fill invokeId with an internal number representing the number of
this operation, fill opcode with 99 and fill argument with NULL type. As you
can see the NULL type is not mandatory since the argument component is
OPTIONAL which means that 99 is sufficient for the other part understands
that you wanted to send a myNullOp...
You can refer to Olivier Dubuisson's book
http://www.oss.com/asn1/dubuisson.html to find complete information about
Information Object Classes, objects and how information is extracted from an
object.
If you need further information about the ROSE or TCAP OPERATION, you can
refer to the ROSE protocol X880, X881, X882 at ITU or TCAP protocol (Q773 I
think).
hoping it has helped you...
Bruno KONIK - uniGone
Tel : +33 (0)1 60 12 77 64
Fax : +33 (0)1 60 12 77 65
41-43 rue de Cronstadt - 75015 PARIS FRANCE
mailto:[EMAIL PROTECTED]
URL : http://www.unigone.com
-- uniGone provides a complete environment for ASN.1 users : JAVA compiler,
ASN.1 IP analyzer, simulator... contact us for more information... --
> -----Message d'origine-----
> De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]De la part de Salim
> Mounir AlAoui
> Envoy� : mercredi 22 ao�t 2001 21:50
> � : [EMAIL PROTECTED]
> Objet : [ASN.1] question
>
>
>
> hello all,
>
> I have an operation that contains no argument just a tag value. Which
> means it is not a sequence, choice, integer it is null, but i need to
> define the operation anyway. How can i define this operation in asn1, what
> is the syntax. Is there like MyOperation::={NULL}
>
> thanks in advance.
>
>
>
>
>
>
>
>
> --------------------------------------------------------------------------
> Salim Mounir Alaoui [EMAIL PROTECTED]
> Computer Science Dept.
> [EMAIL PROTECTED]
> Research Assistant. [EMAIL PROTECTED]
> Florida Institute of Technology
> Melbourne, Florida
> Voice: (407) 537-8025.
> --------------------------------------------------------------------------
>
>