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

1.1       root        1: -- if-enc.py - manually-augmented InformationFramework module
                      2: 
                      3: -- $Header: /f/osi/dsap/x500as/RCS/if-enc.py,v 7.0 89/11/23 21:50:41 mrose Rel $
                      4: --
                      5: --
                      6: -- $Log:       if-enc.py,v $
                      7: -- Revision 7.0  89/11/23  21:50:41  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: IF
                     23:        {
                     24:        joint-iso-ccitt
                     25:        ds(5)
                     26:        modules(1)
                     27:        informationFramework(1)
                     28:        }
                     29: 
                     30: DEFINITIONS ::=
                     31: 
                     32: %{
                     33: #include <stdio.h>
                     34: #include "quipu/util.h"
                     35: #include "quipu/attrvalue.h"
                     36: 
                     37: extern  LLog    * log_dsap;
                     38: PE              grab_pe();
                     39: %}
                     40: 
                     41: PREFIXES encode decode print
                     42: 
                     43: BEGIN
                     44: 
                     45: -- EXPORTS
                     46: --     AttributeType,
                     47: --     AttributeValue,
                     48: --     AttributeValueAssertion,
                     49: --     Attribute, 
                     50: --     RelativeDistinguishedName,
                     51: --     DistinguishedName,
                     52: --     Name;
                     53: 
                     54: ENCODER encode
                     55: 
                     56: AttributeType [[P AttributeType]]
                     57: %{
                     58: OID     new_oid = grab_oid(parm);
                     59: %}
                     60:         ::=
                     61:         %{
                     62:         DLOG(log_dsap, LLOG_PDUS, ("About to encode AttributeType (IF)"));
                     63:         %}
                     64:         OBJECT IDENTIFIER [[O new_oid]]
                     65:         %{
                     66:         DLOG(log_dsap, LLOG_PDUS, ("Done encode AttributeType (IF)"));
                     67:         %}
                     68: 
                     69: AttributeValue [[P AttributeValue]]
                     70: %{
                     71: PE      new_pe = grab_pe(parm);
                     72: %}
                     73:         ::=
                     74:         %{
                     75:         DLOG(log_dsap, LLOG_PDUS, ("About to encode AttributeValue (IF)"));
                     76:         %}
                     77:         ANY [[a new_pe]]
                     78:         %{
                     79:        pe_free (new_pe);
                     80:         DLOG(log_dsap, LLOG_PDUS, ("Done encode AttributeValue (IF)"));
                     81:         %}
                     82: 
                     83: AttributeValueAssertion [[P AVA *]]
                     84: %{
                     85: %}
                     86:         ::=
                     87:         %{
                     88:         DLOG(log_dsap, LLOG_PDUS, ("About to encode AttributeValueAssertion (IF)"));
                     89:         %}
                     90:         SEQUENCE
                     91:         {
                     92:                 AttributeType [[p parm->ava_type]]
                     93:                 %{
                     94:                 %} ,
                     95:                 AttributeValue [[p parm->ava_value]]
                     96:                 %{
                     97:                 %}
                     98:         }
                     99:         %{
                    100:         DLOG(log_dsap, LLOG_PDUS, ("Done encode AttributeValueAssertion (IF)"));
                    101:         %}
                    102: 
                    103: Attribute [[P Attr_Sequence]]
                    104: %{
                    105:         AV_Sequence     avs_temp;
                    106: %}
                    107:         ::=
                    108:         %{
                    109:         DLOG(log_dsap, LLOG_PDUS, ("About to encode Attribute (IF)"));
                    110:         %}
                    111:         SEQUENCE
                    112:         {
                    113:         type
                    114:                 AttributeType [[p parm->attr_type]]
                    115:                 %{
                    116:                 %} ,
                    117:         values
                    118:                 SET OF
                    119:                 %{
                    120:                 %}
                    121:                 <<avs_temp=parm->attr_value;avs_temp!=NULLAV;avs_temp=avs_temp->avseq_next>>
                    122:                         AttributeValue [[p &(avs_temp->avseq_av)]]
                    123:                         %{
                    124:                         %}
                    125:                 %{
                    126:                 %}
                    127:         }
                    128:         %{
                    129:         DLOG(log_dsap, LLOG_PDUS, ("Done encode Attribute (IF)"));
                    130:         %}
                    131: 
                    132: RelativeDistinguishedName [[P RDN]]
                    133: %{
                    134:         AVA             ava_temp_s;
                    135:         AVA             * ava_temp = &(ava_temp_s);
                    136:         RDN             rdn_temp;
                    137: %}
                    138:         ::=
                    139:         %{
                    140:         DLOG(log_dsap, LLOG_PDUS, ("About to encode RelativeDistinguishedName (IF)"));
                    141:         %}
                    142:         SET OF
                    143:         %{
                    144:                 ava_temp->ava_type = rdn_temp->rdn_at;
                    145:                 ava_temp->ava_value = &rdn_temp->rdn_av;
                    146:         %}
                    147:         <<rdn_temp=parm;rdn_temp!=NULLRDN;rdn_temp=rdn_temp->rdn_next>>
                    148:                 AttributeValueAssertion [[p ava_temp]]
                    149:                 %{
                    150:                 %}
                    151:         %{
                    152:         DLOG(log_dsap, LLOG_PDUS, ("Done encode RelativeDistinguishedName (IF)"));
                    153:         %}
                    154: 
                    155: RDNSequence [[P DN]]
                    156: %{
                    157:         DN              dn_temp;
                    158: %}
                    159:         ::=
                    160:         %{
                    161:         DLOG(log_dsap, LLOG_PDUS, ("About to encode RDNSequence (IF)"));
                    162:         %}
                    163:         SEQUENCE OF
                    164:         %{
                    165:         %}
                    166:         <<dn_temp=parm;dn_temp!=NULLDN;dn_temp=dn_temp->dn_parent>>
                    167:                 RelativeDistinguishedName [[p dn_temp->dn_rdn]]
                    168:                 %{
                    169:                 %}
                    170:         %{
                    171:         DLOG(log_dsap, LLOG_PDUS, ("Done encode RDNSequence (IF)"));
                    172:         %}
                    173: 
                    174: DistinguishedName [[P DN]]
                    175: %{
                    176: %}
                    177:         ::=
                    178:         %{
                    179:         DLOG(log_dsap, LLOG_TRACE, ("About to encode DistinguishedName (IF)"));
                    180:         %}
                    181:         RDNSequence [[p parm]]
                    182:         %{
                    183:         DLOG(log_dsap, LLOG_TRACE, ("Done encode DistinguishedName (IF)"));
                    184:         %}
                    185: 
                    186: Name [[P DN]]
                    187: %{
                    188: %}
                    189:         ::=
                    190:         %{
                    191:         DLOG(log_dsap, LLOG_PDUS, ("About to encode Name (IF)"));
                    192:         %}
                    193:         CHOICE
                    194:         <<1>>
                    195:         {
                    196:                 RDNSequence [[p parm]]
                    197:                 %{
                    198:                 %}
                    199:         }
                    200:         %{
                    201:         DLOG(log_dsap, LLOG_PDUS, ("Done encode Name (IF)"));
                    202:         %}
                    203: 
                    204: END

unix.superglobalmegacorp.com

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