Annotation of 43BSDReno/contrib/isode-beta/vt/send_asq.py, revision 1.1

1.1     ! root        1: -- VTPM: encode ASQ PDU
        !             2: 
        !             3: -- $Header: /f/osi/vt/RCS/send_asq.py,v 7.0 89/11/23 22:31:42 mrose Rel $
        !             4: --
        !             5: --
        !             6: -- $Log:       send_asq.py,v $
        !             7: -- Revision 7.0  89/11/23  22:31:42  mrose
        !             8: -- Release 6.0
        !             9: -- 
        !            10: 
        !            11: --
        !            12: --                               NOTICE
        !            13: --
        !            14: --    Acquisition, use, and distribution of this module and related
        !            15: --    materials are subject to the restrictions of a license agreement.
        !            16: --    Consult the Preface in the User's Manual for the full terms of
        !            17: --    this agreement.
        !            18: --
        !            19: --
        !            20: 
        !            21: 
        !            22: ASQPDU DEFINITIONS ::=
        !            23: 
        !            24: %{
        !            25: #include <stdio.h>
        !            26: #include "sector1.h"
        !            27: 
        !            28: #undef PEPYPARM
        !            29: #define PEPYPARM int *
        !            30: 
        !            31: #undef PEPYTEST
        !            32: 
        !            33: static int l,m,n;
        !            34: 
        !            35: #ifdef PEPYTEST
        !            36: 
        !            37: char *myname;
        !            38: ASQ_MSG ud;
        !            39: static char my_version = 0x01;
        !            40: static char my_fu = 0x1c;
        !            41: static char a_char = 0x01;
        !            42: 
        !            43: main(argc,argv)
        !            44: int argc;
        !            45: char **argv;
        !            46: {
        !            47: 
        !            48:        PE pe;
        !            49:        int i,j;
        !            50: 
        !            51:        myname = argv[0];
        !            52: 
        !            53:        ud.class = 1;
        !            54:        ud.valid_prof = 1;
        !            55:        ud.valid_imp = 0;
        !            56:        ud.valid_coll = 0;
        !            57:        ud.version.bitstring = my_version;
        !            58:        ud.version.bitcount = 1;
        !            59:        ud.func_units.bitstring = my_fu;
        !            60:        ud.func_units.bitcount = 5;
        !            61:        ud.asq_profile.oid_true = 1;
        !            62:        ud.asq_profile.prof_oid = ode2oid("telnet");
        !            63:        ud.asq_profile.num_sp_param = 1;
        !            64:        ud.asq_profile.num_cds_objects = 2;
        !            65:        ud.asq_profile.num_css_objects = 0;
        !            66:        ud.asq_profile.num_dev_objects = 0;
        !            67:        ud.asq_profile.sp_offer_list[0].param_num = 1;
        !            68:        ud.asq_profile.sp_offer_list[0].param_type = 1;
        !            69:        ud.asq_profile.sp_offer_list[0].args.int_arg.type = 0;
        !            70:        ud.asq_profile.sp_offer_list[0].args.int_arg.value = 80;
        !            71: 
        !            72:        ud.asq_profile.cds_offer_list[0].obj_name = "KB";
        !            73:        ud.asq_profile.cds_offer_list[1].obj_name = "DI";
        !            74:        for(i=0; i<ud.asq_profile.num_cds_objects; i++)
        !            75:        {
        !            76:            ud.asq_profile.cds_offer_list[i].valid_x_dim = 0;
        !            77:            ud.asq_profile.cds_offer_list[i].valid_y_dim = 0;
        !            78:            ud.asq_profile.cds_offer_list[i].valid_z_dim = 0;
        !            79:            ud.asq_profile.cds_offer_list[i].erasure.bitcount = 0;
        !            80:            ud.asq_profile.cds_offer_list[i].valid_rep_list = 1;
        !            81:            ud.asq_profile.cds_offer_list[i].valid_emp_list = 0;
        !            82:            ud.asq_profile.cds_offer_list[i].valid_fore_color = 0;
        !            83:            ud.asq_profile.cds_offer_list[i].valid_back_color = 0;
        !            84:            ud.asq_profile.cds_offer_list[i].access_right.bitcount = 0;
        !            85:            ud.asq_profile.cds_offer_list[i].rep_offer.valid_cap = 1;
        !            86:            ud.asq_profile.cds_offer_list[i].rep_offer.capability.type = 0;
        !            87:            ud.asq_profile.cds_offer_list[i].rep_offer.capability.value = 1;
        !            88:            ud.asq_profile.cds_offer_list[i].rep_offer.num_reps = 1;
        !            89:            ud.asq_profile.cds_offer_list[i].rep_offer.repertoire[0].rep_type = 2;
        !            90:            ud.asq_profile.cds_offer_list[i].rep_offer.repertoire[0].rep_assign = "ABC";
        !            91:            ud.asq_profile.cds_offer_list[i].rep_offer.repertoire[0].valid_font_cap = 0;
        !            92:        }
        !            93:            
        !            94:        build_ASQPDU_ASQpdu(&pe,1,NULL,NULLCP,&ud);
        !            95: 
        !            96:         print_ASQPDU_ASQpdu(pe,1,NULLIP,NULLVP,&ud);
        !            97: 
        !            98:         rcv_asq(pe);
        !            99: 
        !           100:        exit(0);
        !           101: }
        !           102: 
        !           103: #endif
        !           104: 
        !           105: %}
        !           106: 
        !           107: BEGIN
        !           108: 
        !           109: SECTIONS build none none
        !           110: 
        !           111: ASQpdu ::= CHOICE <<1>>
        !           112: 
        !           113: {
        !           114:        asqpdu [0] IMPLICIT ASQcontent [[p  (PEPYPARM)parm]]
        !           115: }
        !           116: 
        !           117: ASQcontent 
        !           118: %{
        !           119:        ASQ_MSG *arg = (ASQ_MSG *)parm;
        !           120: %}
        !           121:        ::= SEQUENCE
        !           122: {
        !           123:        [0] IMPLICIT INTEGER [[i arg->class]],
        !           124: 
        !           125:        [1] IMPLICIT ImplemIdent [[p (PEPYPARM)&(arg->imp_id)]]
        !           126:        OPTIONAL <<arg->valid_imp>>,
        !           127: 
        !           128:        [2] IMPLICIT BITSTRING
        !           129:        [[x int2strb (arg->func_units.bitstring, arg->func_units.bitcount)
        !           130:          $ arg->func_units.bitcount]],
        !           131: 
        !           132:        [3] IMPLICIT Profile [[p (PEPYPARM)&(arg->asq_profile)]]
        !           133:        OPTIONAL <<arg->valid_prof>>,
        !           134: 
        !           135:        [4] IMPLICIT BITSTRING
        !           136:        [[x int2strb (arg->version.bitstring, arg->version.bitcount)
        !           137:          $ arg->version.bitcount]],
        !           138: 
        !           139:        [5] IMPLICIT INTEGER [[i arg->coll_winner]]
        !           140:        OPTIONAL <<arg->valid_coll>>
        !           141: }
        !           142: 
        !           143: ImplemIdent 
        !           144: %{
        !           145:        IMPLEM_ID       *arg = (IMPLEM_ID *)parm;
        !           146: %}
        !           147:        ::= SEQUENCE
        !           148: {
        !           149:        impIdent [0] IMPLICIT OBJECT IDENTIFIER
        !           150:        [[O arg->imp_oid]]
        !           151:        OPTIONAL <<arg->oid_true>>,
        !           152: 
        !           153:        impName [1] IMPLICIT PrintableString
        !           154:        [[s arg->name]]
        !           155:        OPTIONAL <<arg->name_true>>,
        !           156: 
        !           157:        impVersion [2] IMPLICIT PrintableString
        !           158:        [[s arg->version]]
        !           159:        OPTIONAL <<arg->version_true>>
        !           160: }
        !           161: 
        !           162: Profile 
        !           163: %{
        !           164:        ARG_OFFER_LIST  *arg = (ARG_OFFER_LIST *)parm;
        !           165: %}
        !           166:        ::= SEQUENCE
        !           167: {
        !           168:        name OBJECT IDENTIFIER [[O arg->prof_oid]]
        !           169:        OPTIONAL <<arg->oid_true>>,
        !           170: 
        !           171:        ProfileArgList [[p parm]]
        !           172:        OPTIONAL <<arg->num_sp_param +
        !           173:                   arg->num_cds_objects +
        !           174:                   arg->num_css_objects +
        !           175:                   arg->num_dev_objects>>
        !           176: 
        !           177: }
        !           178: 
        !           179: ProfileArgList 
        !           180: %{
        !           181:        int j,k;
        !           182:        ARG_OFFER_LIST  *arg = (ARG_OFFER_LIST *)parm;
        !           183: %} 
        !           184:        ::= 
        !           185: 
        !           186: SEQUENCE OF <<n=0; n<(arg->num_sp_param
        !           187:                        + (arg->num_cds_objects?1:0)); n++>>
        !           188: 
        !           189:        CHOICE <<(n<arg->num_sp_param) ? 1 : 2>>
        !           190:        {
        !           191:                specialArgs [0] IMPLICIT SEQUENCE
        !           192:                %{k=1;%}
        !           193:                {
        !           194:                        identifier INTEGER
        !           195:                        [[i arg->sp_offer_list[n].param_num]],
        !           196: 
        !           197:                        offeredValues CHOICE
        !           198:                        <<arg->sp_offer_list[n].param_type + 1>>
        !           199:                        {
        !           200:                                boolean [0] IMPLICIT BITSTRING
        !           201:                                [[x arg->sp_offer_list[n].args.bool_arg $ k]],
        !           202: 
        !           203:                                integer [1] IMPLICIT IntOffer [[p (PEPYPARM)&(arg->sp_offer_list[n].args.int_arg)]],
        !           204: 
        !           205:                                string [2] IMPLICIT SET OF <<j=0; j<1; j++>>
        !           206:                                        PrintableString
        !           207:                                [[s arg->sp_offer_list[n].args.string_arg]]
        !           208:                        }
        !           209:                },
        !           210: 
        !           211:                vteParams [1] IMPLICIT ParamOfferList [[p parm]]
        !           212:        }
        !           213: 
        !           214: ParamOfferList 
        !           215: %{
        !           216:        ARG_OFFER_LIST  *arg = (ARG_OFFER_LIST *)parm;
        !           217: %}
        !           218:        ::= SEQUENCE
        !           219: {
        !           220:        displayObjects  [0] IMPLICIT CDSOffer [[p parm]]
        !           221:        OPTIONAL <<arg->num_cds_objects>>,
        !           222: 
        !           223: --     controlObjects  [1] IMPLICIT CSSOffer [[p parm]]
        !           224: --     OPTIONAL <<arg->num_css_objects>>,
        !           225: 
        !           226: --     deviceObjects   [2] IMPLICIT DEVOffer [[p parm]]
        !           227: --     OPTIONAL <<arg->num_dev_objects>>,
        !           228: 
        !           229:        deliveryControl [3] IMPLICIT BITSTRING
        !           230:        [[x int2strb (arg->del_ctrl.bitstring, arg->del_ctrl.bitcount)
        !           231:          $ arg->del_ctrl.bitcount]]
        !           232:        OPTIONAL <<arg->del_ctrl.bitcount>>
        !           233: }
        !           234: 
        !           235: --Note Problem with IMPLICIT SEQUENCE Definition below.  PEPY does not accept
        !           236: --it as defined in 9041 and in fact that definition is ridiculous.  At the
        !           237: --moment it is not clear if even hand coding available in ISODE 3.0 can
        !           238: --produce the requirement of 9041.
        !           239: 
        !           240: CDSOffer 
        !           241: %{
        !           242:        ARG_OFFER_LIST  *arg = (ARG_OFFER_LIST *)parm;
        !           243: %}
        !           244:        ::= SET OF <<l=0; l<arg->num_cds_objects; l++>> SEQUENCE
        !           245: {
        !           246:        objectName PrintableString
        !           247:                [[s arg->cds_offer_list[l].obj_name]],
        !           248: 
        !           249:        ObjectOffer [[p (PEPYPARM)&(arg->cds_offer_list[l])]]
        !           250: }
        !           251: 
        !           252: CSSOffer ::= NULL --Unused for now--
        !           253: 
        !           254: DEVOffer ::= NULL --Unused for now--
        !           255: 
        !           256: ObjectOffer 
        !           257: %{
        !           258:        CDS_OFFER       *arg = (CDS_OFFER *)parm;
        !           259: %}
        !           260:        ::= SEQUENCE
        !           261: {
        !           262:        dimensionOffer [0]      IMPLICIT BITSTRING
        !           263:        [[x int2strb (arg->dimensions.bitstring,
        !           264:                      arg->dimensions.bitcount) $ arg->dimensions.bitcount]]
        !           265:        OPTIONAL <<arg->dimensions.bitcount>>,
        !           266: 
        !           267:        xParamOffer [1]         IMPLICIT DimOffer [[p (PEPYPARM)&(arg->x_dim)]]
        !           268:        OPTIONAL <<arg->valid_x_dim>>,
        !           269: 
        !           270:        yParamOffer [2]         IMPLICIT DimOffer [[p (PEPYPARM)&(arg->y_dim)]]
        !           271:        OPTIONAL <<arg->valid_y_dim>>,
        !           272: 
        !           273:        zParamOffer [3]         IMPLICIT DimOffer [[p (PEPYPARM)&(arg->y_dim)]]
        !           274:        OPTIONAL <<arg->valid_z_dim>>,
        !           275: 
        !           276: --     erasuroffer [4]         IMPLICIT BITSTRING
        !           277: --     [[x int2strb (arg->erasure.bitstring,
        !           278: --                   arg->erasure.bitcount)
        !           279: --       $ arg->erasure.bitcount]]
        !           280: --     OPTIONAL <<arg->erasure.bitcount>>,
        !           281: 
        !           282:        repOfferList [5]        IMPLICIT CompRepOffer [[p (PEPYPARM)&(arg->rep_offer)]]
        !           283:        OPTIONAL <<arg->valid_rep_list>>,
        !           284: 
        !           285: --     empOfferList [6]        IMPLICIT CompEmpOffer [[p (PEPYPARM)&(arg->emp_offer)]]
        !           286: --     OPTIONAL <<arg->valid_emp_list>>,
        !           287: 
        !           288: --     foreColorList [7]       IMPLICIT ColorOffer [[p (PEPYPARM)&(arg->fore_color_list)]]
        !           289: --     OPTIONAL <<arg->valid_fore_color>>,
        !           290: 
        !           291: --     backColorList [8]       IMPLICIT ColorOffer [[p (PEPYPARM)&(arg->back_color_list)]]
        !           292: --     OPTIONAL <<arg->valid_back_color>>,
        !           293: 
        !           294:        objectAccRight [9]      IMPLICIT BITSTRING
        !           295:        [[x int2strb (arg->access_right.bitstring,
        !           296:                      arg->access_right.bitcount)
        !           297:          $ arg->access_right.bitcount]]
        !           298:        OPTIONAL <<arg->access_right.bitcount>>
        !           299: }
        !           300: 
        !           301: DimOffer 
        !           302: %{
        !           303:        DIMEN_PARAM     *arg = (DIMEN_PARAM *)parm;
        !           304: %}
        !           305:        ::= SEQUENCE
        !           306: {
        !           307:        bound           [0] IMPLICIT SEQUENCE
        !           308:        {
        !           309:                unbounded NULL
        !           310:                OPTIONAL <<arg->bound_type == 1>>,
        !           311: 
        !           312:                limit IntOffer [[p (PEPYPARM)&(arg->bound)]]
        !           313:                OPTIONAL <<arg->bound_type == 2>>
        !           314:        }
        !           315:        OPTIONAL <<arg->bound_type>>,
        !           316: 
        !           317:        addressing      [1] IMPLICIT BITSTRING
        !           318:        [[x int2strb (arg->addressing.bitstring,
        !           319:                      arg->addressing.bitcount)
        !           320:          $ arg->addressing.bitcount]]
        !           321:        OPTIONAL <<arg->addressing.bitcount>>,
        !           322: 
        !           323:        absolute        [2] IMPLICIT BITSTRING
        !           324:        [[x int2strb (arg->absolute.bitstring,
        !           325:                      arg->absolute.bitcount)
        !           326:          $ arg->absolute.bitcount]]
        !           327:        OPTIONAL <<arg->absolute.bitcount>>,
        !           328: 
        !           329:        window          [3] IMPLICIT SEQUENCE
        !           330:        {
        !           331:                unbounded NULL
        !           332:                OPTIONAL <<arg->window_type == 1>>,
        !           333: 
        !           334:                limit IntOffer [[p (PEPYPARM)&(arg->window)]]
        !           335:                OPTIONAL <<arg->window_type == 2>>
        !           336:        }
        !           337:        OPTIONAL <<arg->window_type>>
        !           338: }
        !           339: 
        !           340: CompRepOffer 
        !           341: %{
        !           342:        REP_LIST        *arg = (REP_LIST *)parm;
        !           343: %}
        !           344:        ::= SEQUENCE
        !           345: {
        !           346:        repCapability   [0] IMPLICIT IntOffer [[p (PEPYPARM)&(arg->capability)]]
        !           347:        OPTIONAL <<arg->valid_cap>>,
        !           348: 
        !           349:        [1] IMPLICIT SEQUENCE OF <<m=0; m<arg->num_reps; m++>>
        !           350:                RepFontOffer [[p (PEPYPARM)&(arg->repertoire[m])]]
        !           351:                OPTIONAL <<arg->num_reps>>
        !           352: }
        !           353: 
        !           354: RepFontOffer 
        !           355: %{ 
        !           356:        int i; 
        !           357:        REP_FONT        *arg = (REP_FONT *)parm;
        !           358: %} ::= 
        !           359: CHOICE <<arg->rep_type>>
        !           360: {
        !           361:        NULL,
        !           362: 
        !           363:        SEQUENCE
        !           364:        {
        !           365:                repertoire      [0] IMPLICIT PrintableString
        !           366:                [[s arg->rep_assign]]
        !           367:                OPTIONAL <<arg->rep_assign>>,
        !           368: 
        !           369:                fontCapability  [1] IMPLICIT IntOffer [[p (PEPYPARM)&(arg->capability)]]
        !           370:                OPTIONAL <<arg->valid_font_cap>>,
        !           371: 
        !           372:                                [2] IMPLICIT SEQUENCE OF
        !           373:                                <<i=0; i<arg->num_fonts; i++>>
        !           374:                                PrintableString
        !           375:                                [[s arg->font_names[i] ]]
        !           376:                                OPTIONAL <<arg->num_fonts>>
        !           377:        }
        !           378: }
        !           379: 
        !           380: --CompEmpOffer 
        !           381: --%{
        !           382: --     int i;
        !           383: --     EMP_LIST        *arg = (EMP_LIST *)parm;
        !           384: --%} ::= SEQUENCE
        !           385: --{
        !           386: --     empCap          [0] IMPLICIT IntOffer [[p (PEPYPARM)&(arg->capability)]]
        !           387: --                     OPTIONAL <<arg->valid_cap>>,
        !           388: 
        !           389: --                     SEQUENCE OF <<i=0; i<arg->num_emps; i++>>
        !           390: --                             PrintableString
        !           391: --                             [[s arg->emp_string[i] ]]
        !           392: --                             OPTIONAL <<arg->num_emps>>
        !           393: --}
        !           394: 
        !           395: --ColorOffer 
        !           396: --%{
        !           397: --     int i;
        !           398: --     COLOR_LIST      *arg = (COLOR_LIST *)parm;
        !           399: --%} ::= SEQUENCE
        !           400: --{
        !           401: --     colorCap        [0] IMPLICIT IntOffer [[p (PEPYPARM)&(arg->capability)]]
        !           402: --                     OPTIONAL <<arg->valid_cap>>,
        !           403: 
        !           404: --     colorNames      SEQUENCE OF <<i=0; i<arg->num_colors; i++>>
        !           405: --                             PrintableString
        !           406: --                             [[s arg->color_string[i] ]]
        !           407: --                             OPTIONAL <<arg->num_colors>>
        !           408: --}
        !           409: 
        !           410: IntOffer 
        !           411: %{
        !           412:        int i;
        !           413:        INT_OFFER       *arg = (INT_OFFER *)parm;
        !           414: %} ::= SEQUENCE OF <<i=0; i<1; i++>>
        !           415: 
        !           416:        CHOICE <<arg->type + 1>>
        !           417:        {
        !           418:                indivValue [0] IMPLICIT INTEGER
        !           419:                [[i arg->value]],
        !           420: 
        !           421:                range [1] IMPLICIT SEQUENCE
        !           422:                {
        !           423:                        INTEGER [[i arg->min_val]],
        !           424:                        INTEGER [[i arg->max_val]]
        !           425:                }
        !           426:        }
        !           427: 
        !           428: END
        !           429: 
        !           430: %{
        !           431: 
        !           432: #ifdef PEPYTEST
        !           433: 
        !           434: void advise(what,fmt,a,b,c,d,e,f,g,h,i,j)
        !           435: char *what, *fmt, *a, *b, *c, *d, *e, *f, *g, *h, *i, *j;
        !           436: {
        !           437: 
        !           438:        (void) fflush(stdout);
        !           439: 
        !           440:        fprintf(stderr,"%s:  ",myname);
        !           441:        fprintf(stderr,fmt,a,b,c,d,e,f,g,h,i,j);
        !           442:        if(what)
        !           443:                (void) fputc(' ',stderr),perror(what);
        !           444:        else
        !           445:                (void) fputc('\n',stderr);
        !           446:        (void)fflush(stderr);
        !           447: }
        !           448: 
        !           449: 
        !           450: testdebug(pe,words)
        !           451: PE pe;                 /*Not Really, but pretend*/
        !           452: char *words;
        !           453: {
        !           454: 
        !           455:        printf("%s \n",words);
        !           456: }
        !           457: 
        !           458: #endif
        !           459: %}

unix.superglobalmegacorp.com

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