Annotation of 43BSDReno/contrib/isode-beta/rosap/ros.py, revision 1.1.1.1

1.1       root        1: -- ros.py - ROS definitions
                      2: --     lifted directly from ISO9072-2
                      3: 
                      4: -- $Header: /f/osi/rosap/RCS/ros.py,v 7.0 89/11/23 22:21:24 mrose Rel $
                      5: --
                      6: -- Based on an TCP-based implementation by George Michaelson of University
                      7: -- College London.
                      8: --
                      9: --
                     10: -- $Log:       ros.py,v $
                     11: -- Revision 7.0  89/11/23  22:21:24  mrose
                     12: -- Release 6.0
                     13: -- 
                     14: 
                     15: --
                     16: --                               NOTICE
                     17: --
                     18: --    Acquisition, use, and distribution of this module and related
                     19: --    materials are subject to the restrictions of a license agreement.
                     20: --    Consult the Preface in the User's Manual for the full terms of
                     21: --    this agreement.
                     22: --
                     23: --
                     24: 
                     25: 
                     26: --* Remote-Operations-APDUs *-- ROS
                     27: --*   { joint-iso-ccitt remote-operations(4) apdus(1) } *--
                     28: DEFINITIONS ::=
                     29: 
                     30: %{
                     31: #ifndef        lint
                     32: static char *rcsid = "$Header: /f/osi/rosap/RCS/ros.py,v 7.0 89/11/23 22:21:24 mrose Rel $";
                     33: #endif
                     34: 
                     35: #include <stdio.h>
                     36: #include "ropkt.h"
                     37: 
                     38: 
                     39: int    rosap_operation;
                     40: int    rosap_error;
                     41: int    rosap_type;
                     42: int    rosap_id;
                     43: int    rosap_null;
                     44: int    rosap_linked;
                     45: int    rosap_lnull;
                     46: PE     rosap_data;
                     47: int    rosap_reason;
                     48: 
                     49: /*  */
                     50: %}
                     51: 
                     52: BEGIN
                     53: 
                     54: -- EXPORTS
                     55: --     rOSE, InvokeIDType;
                     56: 
                     57: -- IMPORTS
                     58: --     OPERATION, ERROR
                     59: --         FROM Remote-Operation-Notation
                     60: --         { joint-ccitt-iso remote-operations(4) notation(0) }
                     61: --     APPLICATION-SERVICE-ELEMENT
                     62: --         FROM RemoteOperations-Notation-extension
                     63: --         { joint-ccitt-iso remote-operations(4) notation-extension(2) };
                     64:   
                     65: -- rOSE APPLICATION-SERVICE-ELEMENT ::=
                     66: --     { joint-iso-ccitt remote-opreations(4) aseID(3) }
                     67: 
                     68: Operation ::=
                     69:        INTEGER
                     70:        %{ rosap_operation = $$; %}
                     71: 
                     72: Error ::=
                     73:        INTEGER
                     74:        %{ rosap_error = $$; %}
                     75: 
                     76: 
                     77: -- APDUs
                     78: -- Types and values of operations and errors are defined in an ROSE-user
                     79: -- protocol specification using the RO-notation.  Operation values are either
                     80: -- of object identifier type or integer type.  If integer types are used they
                     81: -- shall be distinct within an abstract syntax.  Error values are either of
                     82: -- object identifier type or integer type.  If integer types are used they
                     83: -- shall be distinct within an abstract syntax.  There is no object identifier
                     84: -- specified for the abstract syntax name for ROSE.  However all ASN.1 data
                     85: -- types defnied in this module shall be included in the name abstract syntax
                     86: -- defined in the ROSE-user protocol specification.
                     87: 
                     88: ROSEapdus ::=
                     89:        CHOICE {
                     90:            roiv-apdu[1] %{ rosap_type = APDU_INVOKE; %}
                     91:                IMPLICIT ROIVapdu,
                     92: 
                     93:            rors-apdu[2] %{ rosap_type = APDU_RESULT; %}
                     94:                IMPLICIT RORSapdu,
                     95: 
                     96:            roer-apdu[3] %{ rosap_type = APDU_ERROR; %}
                     97:                IMPLICIT ROERapdu,
                     98: 
                     99:            rorj-apdu [4] %{ rosap_type = APDU_REJECT; %}
                    100:                IMPLICIT RORJapdu
                    101:        }
                    102: 
                    103: 
                    104: -- APDU types
                    105: 
                    106: ROIVapdu ::=
                    107:        SEQUENCE {
                    108:            invokeID
                    109:                InvokeIDType,
                    110: 
                    111:            linked-ID[0]
                    112:                IMPLICIT --* InvokeIDType *-- INTEGER
                    113:                %{ rosap_linked = $$; rosap_lnull = 0; %}
                    114:                OPTIONAL,
                    115: 
                    116:            operation-value
                    117:                Operation,
                    118: 
                    119:            argument
                    120:                ANY DEFINED BY operation-value
                    121:                %{ rosap_data = $$; %}
                    122:                OPTIONAL
                    123:                -- ANY is filled by the single ASN.1 data type following the
                    124:                -- key word ARGUMENT in the type definition of a particular
                    125:                -- operation.
                    126:        }
                    127:        
                    128: InvokeIDType ::=
                    129:        INTEGER                 %{ rosap_id = $$; %}
                    130: 
                    131: RORSapdu ::=
                    132:        SEQUENCE {
                    133:            invokeID
                    134:                InvokeIDType,
                    135: 
                    136:            SEQUENCE {
                    137:                operation-value
                    138:                    Operation,
                    139: 
                    140:                result
                    141:                    ANY DEFINED BY operation-value
                    142:                    %{ rosap_data = $$; %}
                    143:                    -- ANY is filled by the single ASN.1 data type following
                    144:                    -- the key word RESULT in the type definition of a
                    145:                    -- particular operation.
                    146:            }
                    147:            OPTIONAL
                    148:        }
                    149: 
                    150: ROERapdu ::=
                    151:        SEQUENCE {
                    152:            invokeID
                    153:                InvokeIDType,
                    154: 
                    155:            error-value
                    156:                Error,
                    157: 
                    158:            parameter
                    159:                ANY DEFINED BY error-value
                    160:                %{ rosap_data = $$; %}
                    161:                -- ANY is filled by the single ASN.1 data type following
                    162:                -- the key word PARAMETER in the type definition of a
                    163:                -- particular error.
                    164:                OPTIONAL
                    165:        }
                    166:        
                    167: RORJapdu ::=
                    168:        SEQUENCE {
                    169:            invokeID
                    170:                CHOICE {
                    171:                        InvokeIDType,
                    172: 
                    173:                        NULL
                    174:                        %{ rosap_null = 1; %}
                    175:                },
                    176: 
                    177:            problem
                    178:                CHOICE {
                    179:                    [0]
                    180:                        IMPLICIT GeneralProblem,
                    181: 
                    182:                    [1]
                    183:                        IMPLICIT InvokeProblem,
                    184: 
                    185:                    [2]
                    186:                        IMPLICIT ReturnResultProblem,
                    187: 
                    188:                    [3]
                    189:                        IMPLICIT ReturnErrorProblem
                    190:            }
                    191:        }
                    192: 
                    193: GeneralProblem ::=
                    194:        INTEGER {                       -- ROSE-provider detected
                    195:            unrecognizedAPDU(0)         %{ rosap_reason = ROS_GP_UNRECOG; %},
                    196:            mistypedAPDU(1)             %{ rosap_reason = ROS_GP_MISTYPED; %},
                    197:            badlyStructuredAPDU(2)      %{ rosap_reason = ROS_GP_STRUCT; %}
                    198:        }
                    199:        
                    200: 
                    201: InvokeProblem ::=
                    202:        INTEGER {                       -- ROSE-user detected
                    203:            duplicateInvocation(0)      %{ rosap_reason = ROS_IP_DUP; %},
                    204:            unrecognizedOperation(1)    %{ rosap_reason = ROS_IP_UNRECOG; %},
                    205:            mistypedArgument(2)         %{ rosap_reason = ROS_IP_MISTYPED; %},
                    206:            resourceLimitation(3)       %{ rosap_reason = ROS_IP_LIMIT; %},
                    207:            initiatorReleasing(4)       %{ rosap_reason = ROS_IP_RELEASE; %},
                    208:            unrecognizedLinkedID(5)     %{ rosap_reason = ROS_IP_UNLINKED; %},
                    209:            linkedResponseUnexpected(6) %{ rosap_reason = ROS_IP_LINKED; %},
                    210:            unexpectedChildOperation(7) %{ rosap_reason = ROS_IP_CHILD; %}
                    211:        }
                    212: 
                    213: ReturnResultProblem ::=
                    214:        INTEGER {                       -- ROSE-user detected
                    215:            unrecognizedInvocation(0)   %{ rosap_reason = ROS_RRP_UNRECOG; %},
                    216:            resultResponseUnexpected(1) %{ rosap_reason = ROS_RRP_UNEXP; %},
                    217:            mistypedresult(2)           %{ rosap_reason = ROS_RRP_MISTYPED; %}
                    218:        }
                    219: 
                    220: ReturnErrorProblem ::=
                    221:        INTEGER {                       -- ROSE-user detected
                    222:            unrecognizedInvocation(0)   %{ rosap_reason = ROS_REP_UNRECOG; %},
                    223:            errorResponseUnexpected(1)  %{ rosap_reason = ROS_REP_UNEXP; %},
                    224:            unrecognizedError(2)        %{ rosap_reason = ROS_REP_RECERR; %},
                    225:            unexpectedError(3)          %{ rosap_reason = ROS_REP_UNEXPERR; %},
                    226:            mistypedParameter(4)        %{ rosap_reason = ROS_REP_MISTYPED; %}
                    227:        }
                    228: 
                    229: 
                    230: -- Note that although ISO 9072-2 uses different names for types, the syntax
                    231: -- and semantics are nearly identical to the specifications in ECMA TR/31
                    232: -- and CCITT recommendation X.410 which are used here
                    233: 
                    234: -- OPDU
                    235: 
                    236: OPDU ::=
                    237:        CHOICE {
                    238:            [1] %{ rosap_type = APDU_INVOKE; %}
                    239:                Invoke,
                    240: 
                    241:            [2] %{ rosap_type = APDU_RESULT; %}
                    242:                ReturnResult,
                    243: 
                    244:            [3] %{ rosap_type = APDU_ERROR; %}
                    245:                ReturnError,
                    246: 
                    247:            [4] %{ rosap_type = APDU_REJECT; %}
                    248:                Reject
                    249:        }
                    250: 
                    251: 
                    252: -- OPDU types
                    253: 
                    254: Invoke ::=
                    255:        SEQUENCE {
                    256:            invokeID
                    257:                INTEGER %{ rosap_id = $$; %},
                    258: 
                    259:                Operation,
                    260: 
                    261:            argument
                    262:                ANY
                    263:                %{ rosap_data = $$; %}
                    264:                OPTIONAL
                    265:        }
                    266:        
                    267: ReturnResult ::=
                    268:        SEQUENCE {
                    269:            invokeID
                    270:                InvokeIDType,
                    271: 
                    272:            result
                    273:                ANY
                    274:                %{ rosap_data = $$; %}
                    275:                OPTIONAL
                    276:        }
                    277:        
                    278: ReturnError ::=
                    279:        SEQUENCE {
                    280:            invokeID
                    281:                INTEGER
                    282:                %{ rosap_id = $$; %},
                    283: 
                    284:                Error,
                    285: 
                    286:            parameter
                    287:                ANY
                    288:                %{ rosap_data = $$; %}
                    289:                OPTIONAL
                    290:        }
                    291:        
                    292: Reject ::=
                    293:        RORJapdu
                    294: 
                    295: END

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.