Annotation of 43BSDReno/contrib/isode-beta/dsap/x500as/nrs-dec.py, revision 1.1.1.1

1.1       root        1: -- nrs-dec.py - additional QUIPU NRS type definitions module
                      2: 
                      3: --
                      4: --                               NOTICE
                      5: --
                      6: --    Acquisition, use, and distribution of this module and related
                      7: --    materials are subject to the restrictions of a license agreement.
                      8: --    Consult the Preface in the User's Manual for the full terms of
                      9: --    this agreement.
                     10: --
                     11: --
                     12: 
                     13: 
                     14: QuipuNRS
                     15:        {
                     16:        ccitt
                     17:        data(9)
                     18:        pss(2342)
                     19:        ucl(19200300)
                     20:        quipu(99)
                     21:        nRSDefinitions(2)
                     22:        }
                     23: 
                     24: DEFINITIONS ::=
                     25: 
                     26: %{
                     27: #include <stdio.h>
                     28: #include "quipu/util.h"
                     29: #include "quipu/nrs_info.h"
                     30: 
                     31: extern  LLog    * log_dsap;
                     32: #define decode_UNIV_NumericString parse_UNIV_NumericString
                     33: #define decode_UNIV_VisibleString parse_UNIV_VisibleString
                     34: #define decode_UNIV_OCTETSTRING parse_UNIV_OCTETSTRING
                     35: %}
                     36: 
                     37: PREFIXES encode decode print
                     38: 
                     39: BEGIN
                     40: 
                     41: DECODER decode
                     42: 
                     43: Context [[P int *]]
                     44:        ::=
                     45:         INTEGER
                     46:         [[i (*parm)]]
                     47:         {
                     48:             context-unknown(-1),
                     49:             x29(0),
                     50:             ts29(1),
                     51:             niftp(2),
                     52:             mail-niftp(3),
                     53:             not-used(4),
                     54:             mail-telex(5),
                     55:             jtmp(6),
                     56:             jtmp-files(7),
                     57:             jtmp-reg(8),
                     58:             ybts-node(9),
                     59:             ybts(10),
                     60:             ftam(11),
                     61:             jtm(12),
                     62:             jtm-reg(13),
                     63:             vt(14),
                     64:             motis(15)
                     65:         }
                     66: 
                     67: Address-space-id [[P int *]]
                     68:        ::=
                     69:         INTEGER
                     70:         [[i (*parm)]]
                     71:         {
                     72:             pss(0),
                     73:             janet(1),
                     74:             telex(2),
                     75:             osi-cons(3)
                     76:         }
                     77: 
                     78: Route-cost [[P PE *]]
                     79:        ::=
                     80:         ANY
                     81:         [[a (*parm)]]
                     82: 
                     83: Addressing-info [[P struct addr_info **]]
                     84:     %{
                     85:        struct str_seq          **ss;
                     86:     %}
                     87:        ::=
                     88:     %{
                     89:        if(((*parm) = (struct addr_info *) calloc(1, sizeof(struct addr_info))) == (struct addr_info *)NULL)
                     90:        {
                     91:        }
                     92:     %}
                     93:         CHOICE
                     94:         {
                     95:         dte-only
                     96:                [0] NumericString [[s (*parm)->dte_number]]
                     97:             %{
                     98:                (*parm)->addr_info_type = ADDR_INFO_DTE_ONLY;
                     99:            %} ,
                    100: 
                    101:         dte-appli-info
                    102:                [1] SEQUENCE
                    103:                     %{
                    104:                        ss = &((*parm)->applic_info);
                    105:                     %}
                    106:                 {
                    107:                dte-number
                    108:                        [0] NumericString [[s (*parm)->dte_number]] ,
                    109: 
                    110:                applic-info
                    111:                        [1] SEQUENCE OF
                    112:                             %{
                    113:                                if(((*ss) = (struct str_seq *) calloc(1, sizeof(struct str_seq))) == (struct str_seq *)NULL)
                    114:                                {
                    115:                                }
                    116:                             %}
                    117:                                VisibleString [[s (*ss)->ss_str]]
                    118:                             %{
                    119:                                ss = &((*ss)->ss_next);
                    120:                            %}
                    121:                    %{
                    122:                        (*ss) = (struct str_seq *)NULL;
                    123:                    %}
                    124:                 }
                    125:             %{
                    126:                (*parm)->addr_info_type = ADDR_INFO_DTE_APPLIC_INFO;
                    127:            %} ,
                    128: 
                    129:        dte-cudf
                    130:                [2] SEQUENCE
                    131:                 {
                    132:                 dte-number
                    133:                        [0] NumericString [[s (*parm)->dte_number]] ,
                    134: 
                    135:                 cudf
                    136:                        [1] OCTET STRING [[s (*parm)->cudf]]
                    137:                 }
                    138:             %{
                    139:                (*parm)->addr_info_type = ADDR_INFO_DTE_CUDF;
                    140:            %} ,
                    141: 
                    142:         dte-cudf-applic-info
                    143:                [3] SEQUENCE
                    144:                     %{
                    145:                        ss = &((*parm)->applic_info);
                    146:                     %}
                    147:                 {
                    148:                 dte-number
                    149:                        [0] NumericString [[s (*parm)->dte_number]] ,
                    150: 
                    151:                 cudf
                    152:                        [1] OCTET STRING [[s (*parm)->cudf]] ,
                    153: 
                    154:                 applic-info
                    155:                        [2] SEQUENCE OF
                    156:                             %{
                    157:                                if(((*ss) = (struct str_seq *) calloc(1, sizeof(struct str_seq))) == (struct str_seq *)NULL)
                    158:                                {
                    159:                                }
                    160:                             %}
                    161:                                VisibleString [[s (*ss)->ss_str]]
                    162:                             %{
                    163:                                ss = &((*ss)->ss_next);
                    164:                            %}
                    165:                     %{
                    166:                        (*ss) = (struct str_seq *)NULL;
                    167:                    %}
                    168:                 }
                    169:             %{
                    170:                (*parm)->addr_info_type = ADDR_INFO_DTE_CUDF_APPLIC_INFO;
                    171:            %} ,
                    172: 
                    173:         dte-ybts
                    174:                [4] SEQUENCE
                    175:                 {
                    176:                 dte-number
                    177:                        [0] NumericString [[s (*parm)->dte_number]] ,
                    178: 
                    179:                 ybts-string
                    180:                        [1] VisibleString [[s (*parm)->ybts_string]]
                    181:                 }
                    182:             %{
                    183:                (*parm)->addr_info_type = ADDR_INFO_DTE_YBTS;
                    184:            %} ,
                    185: 
                    186:             dte-ybts-applic-info[5]
                    187:                 SEQUENCE
                    188:                     %{
                    189:                        ss = &((*parm)->applic_info);
                    190:                     %}
                    191:                 {
                    192:                 dte-number
                    193:                        [0] NumericString [[s (*parm)->dte_number]] ,
                    194: 
                    195:                 ybts-string
                    196:                        [1] VisibleString [[s (*parm)->ybts_string]] ,
                    197: 
                    198:                 applic-info
                    199:                        [2] SEQUENCE OF
                    200:                             %{
                    201:                                if(((*ss) = (struct str_seq *) calloc(1, sizeof(struct str_seq))) == (struct str_seq *)NULL)
                    202:                                {
                    203:                                }
                    204:                             %}
                    205:                                VisibleString [[s (*ss)->ss_str]]
                    206:                             %{
                    207:                                ss = &((*ss)->ss_next);
                    208:                            %}
                    209:                     %{
                    210:                        (*ss) = (struct str_seq *)NULL;
                    211:                    %}
                    212:                 }
                    213:             %{
                    214:                (*parm)->addr_info_type = ADDR_INFO_DTE_YBTS_APPLIC_INFO;
                    215:            %} ,
                    216: 
                    217:             dte-ybts-appli-relays[6]
                    218:                 SEQUENCE
                    219:                     %{
                    220:                        ss = &((*parm)->applic_relay);
                    221:                     %}
                    222:                 {
                    223:                 dte-number
                    224:                        [0] NumericString [[s (*parm)->dte_number]] ,
                    225: 
                    226:                 ybts-string
                    227:                        [1] VisibleString [[s (*parm)->ybts_string]] ,
                    228: 
                    229:                 applic-relay
                    230:                        [2] SEQUENCE OF
                    231:                             %{
                    232:                                if(((*ss) = (struct str_seq *) calloc(1, sizeof(struct str_seq))) == (struct str_seq *)NULL)
                    233:                                {
                    234:                                }
                    235:                             %}
                    236:                                 VisibleString [[s (*ss)->ss_str]]
                    237:                             %{
                    238:                                ss = &((*ss)->ss_next);
                    239:                            %}
                    240:                     %{
                    241:                        (*ss) = (struct str_seq *)NULL;
                    242:                    %}
                    243:                 }
                    244:             %{
                    245:                (*parm)->addr_info_type = ADDR_INFO_DTE_YBTS_APPLIC_RELAY;
                    246:            %} ,
                    247: 
                    248:         none-needed
                    249:                [7] NULL
                    250:             %{
                    251:                (*parm)->addr_info_type = ADDR_INFO_NONE_NEEDED;
                    252:            %} ,
                    253: 
                    254:         osi-addressing
                    255:                [8] SEQUENCE
                    256:                 {
                    257:                 nsap
                    258:                        [0] NumericString [[s (*parm)->nsap]] ,
                    259: 
                    260:                 tselector
                    261:                        [1] OCTET STRING [[s (*parm)->tselector]]
                    262:                             OPTIONAL ,
                    263: 
                    264:                 sselector
                    265:                        [2] OCTET STRING [[s (*parm)->sselector]]
                    266:                             OPTIONAL ,
                    267: 
                    268:                 pselector
                    269:                        [3] OCTET STRING [[s (*parm)->pselector]]
                    270:                             OPTIONAL ,
                    271: 
                    272:                 place-holder
                    273:                        [4] ANY [[a (*parm)->place_holder]]
                    274:                             OPTIONAL ,
                    275: 
                    276:                 application-title
                    277:                        [5] ANY [[a (*parm)->application_title]]
                    278:                             OPTIONAL ,
                    279: 
                    280:                 per-application-context-info
                    281:                        [6] ANY [[a (*parm)->per_app_context_info]]
                    282:                             OPTIONAL
                    283:                 }
                    284:             %{
                    285:                (*parm)->addr_info_type = ADDR_INFO_OSI_ADDRESSING;
                    286:            %} ,
                    287: 
                    288:         osi-nsap-only
                    289:                [9] NumericString [[s (*parm)->nsap]]
                    290:             %{
                    291:                (*parm)->addr_info_type = ADDR_INFO_OSI_NSAP_ONLY;
                    292:            %} ,
                    293: 
                    294:         osi-nsap-applic-info
                    295:                [10] SEQUENCE
                    296:                     %{
                    297:                        ss = &((*parm)->applic_info);
                    298:                     %}
                    299:                 {
                    300:                 nsap
                    301:                        [0] NumericString [[s (*parm)->nsap]] ,
                    302: 
                    303:                 applic-info
                    304:                        [1] SEQUENCE OF
                    305:                             %{
                    306:                                if(((*ss) = (struct str_seq *) calloc(1, sizeof(struct str_seq))) == (struct str_seq *)NULL)
                    307:                                {
                    308:                                }
                    309:                             %}
                    310:                                VisibleString [[s (*ss)->ss_str]]
                    311:                             %{
                    312:                                ss = &((*ss)->ss_next);
                    313:                            %}
                    314:                     %{
                    315:                        (*ss) = (struct str_seq *)NULL;
                    316:                    %}
                    317:                 }
                    318:             %{
                    319:                (*parm)->addr_info_type = ADDR_INFO_OSI_NSAP_APPLIC_INFO;
                    320:            %} ,
                    321: 
                    322:         osi-nsap-applic-relays
                    323:                [11] SEQUENCE
                    324:                     %{
                    325:                        ss = &((*parm)->applic_relay);
                    326:                     %}
                    327:                 {
                    328:                 nsap
                    329:                        [0] NumericString [[s (*parm)->nsap]] ,
                    330: 
                    331:                 applic-relay
                    332:                        [1] SEQUENCE OF
                    333:                             %{
                    334:                                if(((*ss) = (struct str_seq *) calloc(1, sizeof(struct str_seq))) == (struct str_seq *)NULL)
                    335:                                {
                    336:                                }
                    337:                             %}
                    338:                                 VisibleString [[s (*ss)->ss_str]]
                    339:                             %{
                    340:                                ss = &((*ss)->ss_next);
                    341:                            %}
                    342:                     %{
                    343:                        (*ss) = (struct str_seq *)NULL;
                    344:                    %}
                    345:                 }
                    346:             %{
                    347:                (*parm)->addr_info_type = ADDR_INFO_OSI_NSAP_APPLIC_RELAY;
                    348:            %} ,
                    349: 
                    350:         dte-ybts-osi-addressing
                    351:                [12] SEQUENCE
                    352:                 {
                    353:                 dte-number
                    354:                        [0] NumericString [[s (*parm)->dte_number]] ,
                    355: 
                    356:                 ybts-string
                    357:                        [1] VisibleString [[s (*parm)->ybts_string]] ,
                    358: 
                    359:                 tselector
                    360:                        [2] OCTET STRING [[s (*parm)->tselector]]
                    361:                             OPTIONAL ,
                    362: 
                    363:                 sselector
                    364:                        [3] OCTET STRING [[s (*parm)->sselector]]
                    365:                             OPTIONAL ,
                    366: 
                    367:                 pselector
                    368:                        [4] OCTET STRING [[s (*parm)->pselector]]
                    369:                             OPTIONAL ,
                    370: 
                    371:                 place-holder
                    372:                        [5] ANY [[a (*parm)->place_holder]]
                    373:                             OPTIONAL ,
                    374: 
                    375:                 application-title
                    376:                        [6] ANY [[a (*parm)->application_title]]
                    377:                             OPTIONAL ,
                    378: 
                    379:                 per-application-context-info
                    380:                        [7] ANY [[a (*parm)->per_app_context_info]]
                    381:                             OPTIONAL
                    382:                 }
                    383:             %{
                    384:                (*parm)->addr_info_type = ADDR_INFO_DTE_YBTS_OSI_ADDRESSING;
                    385:            %}
                    386:         }
                    387: 
                    388: NRSInformation [[P struct nrs_info **]]
                    389:     %{
                    390:        struct nrs_routes       **rt;
                    391:     %}
                    392:        ::=
                    393:     %{
                    394:        if(((*parm) = (struct nrs_info *) calloc(1, sizeof(struct nrs_info))) == (struct nrs_info *)NULL)
                    395:        {
                    396:        }
                    397:     %}
                    398:        SET
                    399:        {
                    400:                [0] Context [[p &((*parm)->context)]],
                    401:                [1] Address-space-id [[p &((*parm)->addr_sp_id)]],
                    402:        routes
                    403:            %{
                    404:                rt = &((*parm)->routes);
                    405:            %}
                    406:                [2] SEQUENCE OF
                    407:                    %{
                    408:                        if(((*rt) = (struct nrs_routes *) calloc(1, sizeof(struct nrs_routes))) == (struct nrs_routes *)NULL)
                    409:                        {
                    410:                        }
                    411:                    %}
                    412:                        SEQUENCE
                    413:                        {
                    414:                                Route-cost [[p &((*rt)->cost)]],
                    415:                                Addressing-info [[p &((*rt)->addr_info)]]
                    416:                        }
                    417:                    %{
                    418:                        rt = &((*rt)->next);
                    419:                    %}
                    420:            %{
                    421:                (*rt) = (struct nrs_routes *)NULL;
                    422:            %}
                    423:        }
                    424: 
                    425: END
                    426: 

unix.superglobalmegacorp.com

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