Annotation of 43BSDReno/contrib/isode-beta/dsap/x500as/sa-enc.py, revision 1.1

1.1     ! root        1: -- sa-dec.py - Seleted Attributes 
        !             2: 
        !             3: -- $Header: /f/osi/dsap/x500as/RCS/sa-enc.py,v 7.0 89/11/23 21:50:51 mrose Rel $
        !             4: --
        !             5: --
        !             6: -- $Log:       sa-enc.py,v $
        !             7: -- Revision 7.0  89/11/23  21:50:51  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: SA
        !            23:        {
        !            24:        joint-iso-ccitt
        !            25:        ds(5)
        !            26:        modules(1)
        !            27:        selectedAttributeTypes(5)
        !            28:        }
        !            29: 
        !            30: DEFINITIONS ::=
        !            31: 
        !            32: %{
        !            33: #include <stdio.h>
        !            34: #include "quipu/util.h"
        !            35: #include "quipu/entry.h"
        !            36: 
        !            37: extern  LLog    * log_dsap;
        !            38: 
        !            39: #define encode_UNIV_PrintableString build_UNIV_PrintableString
        !            40: #define encode_UNIV_TeletexString   build_UNIV_TeletexString
        !            41: #define encode_UNIV_OctetString     build_UNIV_OctetString
        !            42: #define encode_UNIV_IA5String      build_UNIV_IA5String
        !            43: #define encode_UNIV_T61String      build_UNIV_T61String
        !            44: 
        !            45: %}
        !            46: 
        !            47: PREFIXES encode decode print
        !            48: 
        !            49: BEGIN
        !            50: 
        !            51: IMPORTS
        !            52:        AttributeType
        !            53:                FROM IF
        !            54:                        {
        !            55:                        joint-iso-ccitt
        !            56:                        ds(5)
        !            57:                        modules(1)
        !            58:                        informationFramework(1)
        !            59:                        };
        !            60: 
        !            61: ENCODER encode
        !            62: 
        !            63: FacsimileTelephoneNumber [[P struct fax *]]
        !            64: %{
        !            65:     char *bit_parm;
        !            66: %}
        !            67:         ::=
        !            68:         %{
        !            69:                 DLOG(log_dsap, LLOG_PDUS, ("About to encode FacsimileTelephoneNumber"));
        !            70:         %}
        !            71:         SEQUENCE
        !            72:         {
        !            73:        telephoneNumber
        !            74:                PrintableString [[s parm->number]],
        !            75:        parameters
        !            76:                BIT STRING
        !            77:                [[x bit_parm = bitstr2strb (parm -> bits, &len) $ len]]
        !            78:                 %{
        !            79:                     free (bit_parm);
        !            80:                 %}
        !            81:                 OPTIONAL <<parm -> bits>>
        !            82: 
        !            83:         }
        !            84:         %{
        !            85:                 DLOG(log_dsap, LLOG_PDUS, ("Done encode FacsimileTelephoneNumber"));
        !            86:         %}
        !            87: 
        !            88: PostalAddress [[P struct postaddr *]]
        !            89: %{
        !            90: struct postaddr * tmp;
        !            91: %}
        !            92:        ::=
        !            93:         %{
        !            94:                 DLOG(log_dsap, LLOG_PDUS, ("About to encode PostalAddress"));
        !            95:         %}
        !            96:        SEQUENCE OF 
        !            97:                <<tmp=parm; tmp != (struct postaddr *) NULL; tmp=tmp->pa_next>>
        !            98:        CHOICE << tmp->addrtype >>
        !            99:                {
        !           100:                T61String [[s tmp->addrcomp]],
        !           101:                PrintableString [[s tmp->addrcomp]]
        !           102:                }
        !           103: 
        !           104:         %{
        !           105:                 DLOG(log_dsap, LLOG_PDUS, ("Done encode PostalAddress"));
        !           106:         %}
        !           107: 
        !           108: TelexNumber [[P struct telex *]]
        !           109:        ::=
        !           110:         %{
        !           111:                 DLOG(log_dsap, LLOG_PDUS, ("About to encode TelexNumber"));
        !           112:         %}
        !           113:        SEQUENCE
        !           114:        {
        !           115:                telexNumber     PrintableString [[s parm->telexnumber]],
        !           116:                countryCode     PrintableString [[s parm->countrycode]],
        !           117:                answerback      PrintableString [[s parm->answerback]]
        !           118:        }
        !           119:         %{
        !           120:                 DLOG(log_dsap, LLOG_PDUS, ("Done encode TelexNumber"));
        !           121:         %}
        !           122: 
        !           123: TeletexTerminalIdentifier [[P struct teletex *]]
        !           124:        ::=
        !           125:         %{
        !           126:                 DLOG(log_dsap, LLOG_PDUS, ("About to encode TeletexTerminalIdentifier"));
        !           127:         %}
        !           128:        SEQUENCE
        !           129:        {
        !           130:        teletexTerminal
        !           131:                PrintableString [[s  parm->terminal]],
        !           132:        parameters
        !           133:                SET {
        !           134:                graphic-character-sets [0] TeletexString
        !           135:                        [[s parm->graphic]] OPTIONAL <<parm->graphic != NULLCP>>,
        !           136:                control-character-sets [1] TeletexString
        !           137:                        [[s parm->control]] OPTIONAL << parm->control != NULLCP>>,
        !           138:                page-formats [2] OCTET STRING 
        !           139:                        [[s parm->page]] OPTIONAL << parm->page != NULLCP >>,
        !           140:                miscellaneous-terminal-capabilities [3] TeletexString
        !           141:                        [[s parm->misc]] OPTIONAL << parm->misc != NULLCP >>,
        !           142:                private-use [4] OCTET STRING 
        !           143:                        [[s parm->t_private]] OPTIONAL << parm->t_private != NULLCP >>
        !           144:                } OPTIONAL << (parm->graphic != NULLCP) || (parm->control != NULLCP)
        !           145:                           || (parm->page != NULLCP) || (parm->misc != NULLCP) 
        !           146:                           || (parm->t_private != NULLCP) >>
        !           147:        }
        !           148:         %{
        !           149:                 DLOG(log_dsap, LLOG_PDUS, ("Done encode TeletexTerminalIdentifier"));
        !           150:         %}
        !           151: 
        !           152: PreferredDeliveryMethod [[P struct pref_deliv *]]
        !           153: %{
        !           154: struct pref_deliv * tmp;
        !           155: %}
        !           156:        ::=
        !           157:         %{
        !           158:                 DLOG(log_dsap, LLOG_PDUS, ("About to encode PreferredDeliveryMethod"));
        !           159:         %}
        !           160:        SEQUENCE OF 
        !           161:                <<tmp=parm; tmp != (struct pref_deliv *)NULL; tmp=tmp->pd_next>>
        !           162:        INTEGER [[i tmp->deliv ]]
        !           163:        {
        !           164:        any-delivery-method     (0),
        !           165:        mhs-delivery            (1),
        !           166:        physical-delivery       (2),
        !           167:        telex-delivery          (3),
        !           168:        teletex-delivery        (4),
        !           169:        g3-facsimilie-delivery  (5),
        !           170:        g4-facsimilie-delivery  (6),
        !           171:        ia5-terminal-delivery   (7),
        !           172:        videotex-delivery       (8),
        !           173:        telephone-delivery      (9)
        !           174:        }
        !           175:         %{
        !           176:                 DLOG(log_dsap, LLOG_PDUS, ("Done encode PreferredDeliveryMethod"));
        !           177:         %}
        !           178: 
        !           179: CriteriaItem [[P struct CriteriaItem *]]
        !           180:     ::=
        !           181:          CHOICE <<parm -> offset>> {
        !           182:                     equality[0]
        !           183:                         AttributeType
        !           184:                         [[p parm -> attrib ]],
        !           185: 
        !           186:                     substrings[1]
        !           187:                         AttributeType
        !           188:                         [[p parm -> attrib ]],
        !           189: 
        !           190:                     greaterOrEqual[2]
        !           191:                         AttributeType
        !           192:                         [[p parm -> attrib ]],
        !           193: 
        !           194:                     lessOrEqual[3]
        !           195:                         AttributeType
        !           196:                         [[p parm -> attrib ]],
        !           197: 
        !           198:                     approximateMatch[4]
        !           199:                         AttributeType
        !           200:                         [[p parm -> attrib ]]
        !           201:                 
        !           202:         }
        !           203: 
        !           204: 
        !           205: Criteria [[P struct Criteria *]]
        !           206:     %{
        !           207:        struct and_or_set *and_or_set;
        !           208:     %}
        !           209:     ::=
        !           210:         CHOICE
        !           211:             %{
        !           212:                 and_or_set = parm -> un.and_or;
        !           213:             %}
        !           214:             <<parm -> offset>>
        !           215:         {
        !           216:             type[0]
        !           217:                 CriteriaItem
        !           218:                 [[p parm -> un.type ]],
        !           219: 
        !           220:             and[1]
        !           221:                 SET OF
        !           222:                     <<and_or_set = parm -> un.and_or;
        !           223:                             and_or_set;
        !           224:                             and_or_set = and_or_set -> and_or_next>>
        !           225:                     Criteria
        !           226:                     [[p and_or_set -> and_or_comp]],
        !           227: 
        !           228:             or[2]
        !           229:                SET OF
        !           230:                     <<and_or_set = parm -> un.and_or;
        !           231:                             and_or_set;
        !           232:                             and_or_set = and_or_set -> and_or_next>>
        !           233:                     Criteria
        !           234:                     [[p and_or_set -> and_or_comp]],
        !           235: 
        !           236:             not[3]
        !           237:                 Criteria
        !           238:                 [[p parm -> un.not ]]
        !           239:         }
        !           240: 
        !           241: 
        !           242: 
        !           243: Guide [[ P struct Guide *]]
        !           244:     ::=
        !           245:     SET {
        !           246:         objectClass [0]
        !           247:                 OBJECT IDENTIFIER
        !           248:                 [[O parm -> objectClass ]]
        !           249:                 OPTIONAL <<parm -> objectClass>>,
        !           250:        criteria [1]
        !           251:                Criteria [[p parm -> criteria]]
        !           252:     }
        !           253: 
        !           254: END
        !           255: 
        !           256: 
        !           257: 
        !           258: 

unix.superglobalmegacorp.com

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