aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/test/asn1_SUITE_data/ROSE.asn1
blob: 2fefae3cafd2f14bd101d2b95e7280a29c243d4e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
ROSE DEFINITIONS IMPLICIT TAGS ::=


BEGIN

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,
  &idempotent  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]
   [IDEMPOTENT &idempotent]
   [ALWAYS RESPONDS &alwaysReturns]
   [INVOKE PRIORITY &InvokePriority]
   [RESULT-PRIORITY &ResultPriority]
   [CODE &operationCode]
 }

ERROR ::= CLASS
{
    &ParameterType OPTIONAL,
    &parameterTypeOptional BOOLEAN OPTIONAL,
    &ErrorPriority Priority OPTIONAL,
    &errorCode Code UNIQUE OPTIONAL
    }
WITH SYNTAX
{
    [PARAMETER &ParameterType [OPTIONAL &parameterTypeOptional]]
    [PRIORITY &ErrorPriority]
    [CODE &errorCode]
    }

OPERATION-PACKAGE ::= CLASS
{
    &Both OPERATION OPTIONAL,
    &Consumer OPERATION OPTIONAL,
    &Supplier OPERATION OPTIONAL,
    &id OBJECT IDENTIFIER UNIQUE OPTIONAL
    }
WITH SYNTAX
{
    [OPERATIONS &Both]
    [CONSUMER INVOKES &Supplier]
    [SUPPLIER INVOKES &Consumer]
    [ID &id]
    }

CONNECTION-PACKAGE ::= CLASS
{
    &bind OPERATION DEFAULT emptyBind,
    &unbind OPERATION DEFAULT emptyUnbind,
    &responderCanUnbind BOOLEAN DEFAULT FALSE,
    &unbindCanFail BOOLEAN DEFAULT FALSE,
    &id OBJECT IDENTIFIER UNIQUE OPTIONAL
    }
WITH SYNTAX
{
    [BIND &bind]
    [UNBIND &unbind]
    [RESPONDER UNBIND &responderCanUnbind]
    [FAILURE TO UNBIND &unbindCanFail]
    [ID &id]
    }

CONTRACT ::= CLASS
{
    &connection CONNECTION-PACKAGE OPTIONAL,
    &OperationsOf OPERATION-PACKAGE OPTIONAL,
    &InitiatorConsumerOf OPERATION-PACKAGE OPTIONAL,
    &InitiatorSupplierOf OPERATION-PACKAGE OPTIONAL,
    &id OBJECT IDENTIFIER UNIQUE OPTIONAL
    }
WITH SYNTAX
{
    [CONNECTION &connection]
    [OPERATIONS OF &OperationsOf]
    [INITIATOR CONSUMER OF &InitiatorConsumerOf]
    [RESPONDER CONSUMER OF &InitiatorSupplierOf]
    [ID &id]
}

ROS-OBJECT-CLASS ::= CLASS
{
    &Is ROS-OBJECT-CLASS OPTIONAL,
    &Initiates CONTRACT OPTIONAL,
    &Responds CONTRACT OPTIONAL,
    &InitiatesAndResponds CONTRACT OPTIONAL,
    &id OBJECT IDENTIFIER UNIQUE
    }
WITH SYNTAX
{
    [IS &Is]
    [BOTH &InitiatesAndResponds]
    [INITIATES &Initiates]
    [RESPONDS &Responds]
    ID &id
    }

Code ::= CHOICE
{
    local INTEGER,
    global OBJECT IDENTIFIER
    }

Priority ::= INTEGER (0..MAX)

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
 }
(CONSTRAINED BY {-- must conform to the above definition --}
 ! RejectProblem : general-unrecognizedPDU)

Invoke {InvokeId:InvokeIdSet, OPERATION:Operations} ::= SEQUENCE
{
  invokeId InvokeId (InvokeIdSet)
  (CONSTRAINED BY {-- must be unambiguous --}
   ! RejectProblem : invoke-duplicateInvocation),
  linkedId CHOICE {
    present [0] IMPLICIT present < InvokeId,
    absent [1] IMPLICIT NULL
  }
    (CONSTRAINED BY {-- must identify an outstanding operation --}
    ! RejectProblem : invoke-unrecognizedLinkedId)
    (CONSTRAINED BY {-- which has one or more linked operations--}
    ! RejectProblem : invoke-linkedResponseUnexpected)
    OPTIONAL,
    opcode OPERATION.&operationCode
    ({Operations}
    ! RejectProblem : invoke-unrecognizedOperation),
    argument OPERATION.&ArgumentType
    ({Operations} {@opcode}
    ! RejectProblem : invoke-mistypedArgument)
    OPTIONAL
    }
(CONSTRAINED BY {-- must conform to the above definition --}
 ! RejectProblem : general-mistypedPDU)
(
WITH COMPONENTS
{...,
    linkedId ABSENT
    }
| WITH COMPONENTS
{...,
    linkedId PRESENT,
    opcode
    (CONSTRAINED BY {-- must be in the &Linked field of the associated operation --
	}
    ! RejectProblem : invoke-unexpectedLinkedOperation)
    }
)

ReturnResult {OPERATION:Operations}::= SEQUENCE
{
    invokeId InvokeId
    (CONSTRAINED BY {-- must be that for an outstanding operation --}
     ! RejectProblem:returnResult-unrecognizedInvocation)
  (CONSTRAINED BY {-- which returns a result --}
   ! RejectProblem:returnResult-resultResponseUnexpected),
  result SEQUENCE
   {
     opcode OPERATION.&operationCode
     ({Operations})(CONSTRAINED BY {-- identified by invokeId --}
		    ! RejectProblem:returnResult-unrecognizedInvocation),
     result OPERATION.&ResultType     ({Operations} {@.opcode}
	! RejectProblem:returnResult-mistypedResult)
	}
    OPTIONAL
    }
(CONSTRAINED BY {-- must conform to the above definition --
    }
! RejectProblem:general-mistypedPDU)

ReturnError {ERROR:Errors} ::= SEQUENCE
{
    invokeId InvokeId
    (CONSTRAINED BY {-- must be that for an outstanding operation --
	}
    ! RejectProblem : returnError-unrecognizedInvocation)
    (CONSTRAINED BY {-- which returns an error --
	}
    ! RejectProblem : returnError-errorResponseUnexpected),
    errcode ERROR.&errorCode
    ({Errors}
    ! RejectProblem : returnError-unrecognizedError)
    (CONSTRAINED BY {-- must be in the &Errors field of the associated operation --
	}
    ! RejectProblem : returnError-unexpectedError),
    parameter ERROR.&ParameterType
    ({Errors}{@errcode}
    ! RejectProblem : returnError-mistypedParameter) OPTIONAL
    }
(CONSTRAINED BY {-- must conform to the above definition --
    }
! RejectProblem : general-mistypedPDU)

Reject ::= SEQUENCE
{
    invokeId InvokeId,
    problem CHOICE
    {
	general [0] GeneralProblem,
	invoke [1] InvokeProblem,
	returnResult [2] ReturnResultProblem,
	returnError [3] ReturnErrorProblem
	}
    }
(CONSTRAINED BY {-- must conform to the above definition --
    }
! RejectProblem : general-mistypedPDU)

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)
    }

InvokeId ::= CHOICE
{
    present INTEGER,
    absent NULL
    }

noInvokeId InvokeId ::= absent:NULL

NoInvokeId InvokeId ::= {noInvokeId}

Errors {OPERATION:Operations} ERROR ::= {Operations.&Errors}

Bind {OPERATION:operation} ::= CHOICE
{
    bind-invoke [16] OPERATION.&ArgumentType({operation}),
    bind-result [17] OPERATION.&ResultType ({operation}),
    bind-error [18] OPERATION.&Errors.&ParameterType ({operation})
    }

Unbind {OPERATION:operation} ::= CHOICE
{
    unbind-invoke [19] OPERATION.&ArgumentType({operation}),
    unbind-result [20] OPERATION.&ResultType ({operation}),
    unbind-error [21] OPERATION.&Errors.&ParameterType ({operation})
    }

emptyBind OPERATION ::= {ERRORS {refuse} SYNCHRONOUS TRUE}

emptyUnbind OPERATION ::= { SYNCHRONOUS TRUE }

refuse ERROR ::= {CODE local:-1}

no-op OPERATION ::=
 {
   IDEMPOTENT TRUE
   ALWAYS RESPONDS FALSE
   CODE local:-1
 }

Forward {OPERATION:OperationSet} OPERATION ::=
{
    OperationSet |
    OperationSet.&Linked.&Linked |
    OperationSet.&Linked.&Linked.&Linked.&Linked
    }

Reverse {OPERATION:OperationSet} OPERATION ::=
{Forward{{OperationSet.&Linked}}}

ConsumerPerforms {OPERATION-PACKAGE:package} OPERATION ::=
{
    Forward{{package.&Consumer}} |
    Forward{{package.&Both}} |
    Reverse{{package.&Supplier}} |
    Reverse{{package.&Both}}
    }

SupplierPerforms {OPERATION-PACKAGE:package} OPERATION ::=
{
    Forward{{package.&Supplier}} |
    Forward{{package.&Both}} |
    Reverse{{package.&Consumer}} |
    Reverse{{package.&Both}}
    }

AllOperations {OPERATION-PACKAGE:package} OPERATION ::=
{
    ConsumerPerforms {package} |
    SupplierPerforms {package}
    }

recode {OPERATION:operation, Code:code} OPERATION ::=
{
    ARGUMENT operation.&ArgumentType
    OPTIONAL operation.&argumentTypeOptional
    RESULT operation.&ResultType
    OPTIONAL operation.&resultTypeOptional
    RETURN RESULT operation.&returnResult
    ERRORS {operation.&Errors}
    LINKED {operation.&Linked}
    SYNCHRONOUS operation.&synchronous
    ALWAYS RESPONDS operation.&alwaysReturns
    INVOKE PRIORITY {operation.&InvokePriority}
    RESULT-PRIORITY {operation.&ResultPriority}
    CODE code
    }

switch {OPERATION-PACKAGE:package, OBJECT IDENTIFIER:id} OPERATION-PACKAGE ::=
{
    OPERATIONS {package.&Both}
    CONSUMER INVOKES {package.&Consumer}
    SUPPLIER INVOKES {package.&Supplier}
    ID id
    }

combine {OPERATION-PACKAGE:ConsumerConsumes,OPERATION-PACKAGE:ConsumerSupplies,
    OPERATION-PACKAGE:base
    } OPERATION-PACKAGE ::=
{
    OPERATIONS {ConsumerConsumes.&Both | ConsumerSupplies.&Both}
    CONSUMER INVOKES {ConsumerConsumes.&Consumer | ConsumerSupplies.&Supplier}
    SUPPLIER INVOKES {ConsumerConsumes.&Supplier | ConsumerSupplies.&Consumer}
    ID base.&id
    }

ROS-SingleAS {InvokeId:InvokeIdSet, OPERATION-PACKAGE:package} ::= ROS
{{InvokeIdSet}, {AllOperations{package}}, {AllOperations{package}}}

ROS-ConsumerAS {InvokeId:InvokeIdSet, OPERATION-PACKAGE:package} ::= ROS
{{InvokeIdSet}, {ConsumerPerforms{package}}, {SupplierPerforms{package}}}

ROS-SupplierAS {InvokeId:InvokeIdSet, OPERATION-PACKAGE:package} ::= ROS
{{InvokeIdSet}, {SupplierPerforms{package}}, {ConsumerPerforms{package}}}

probe OPERATION ::= 
 { 
   ARGUMENT SEQUENCE 
    { 
      invokeId [0] InvokeId 
    } 
   RESULT ENUMERATED{running(0), finished(1), unknown(2), ...} 
   IDEMPOTENT TRUE 
   CODE local:-2 
 } 

acknowledge OPERATION ::= 
 { 
   ARGUMENT InvokeId 
   RESULT ENUMERATED{acknowledged(0), unknown(1), ...} 
   IDEMPOTENT TRUE 
   CODE local:-3 
 } 

ProbeAndAcknowledge OPERATION ::= {probe | acknowledge} 

cancel OPERATION ::= 
 { 
   ARGUMENT InvokeId 
   ERRORS {cancelFailed} 
   IDEMPOTENT TRUE 
   CODE local:-4 
 } 

cancelFailed ERROR ::= 
 { 
   PARAMETER SET 
    { 
      problem [0] CancelProblem, 
      operation [1] InvokeId 
    } 
   CODE local:-2 
 } 

CancelProblem ::= ENUMERATED 
{unknownOperation(0), tooLate(1), operationNotCancellable(2), ...} 

cancelled ERROR ::= {CODE local:-3}

END -- end of useful definitions.