|
|
1.1 ! root 1: -- if-dec.py - manually-augmented InformationFramework module ! 2: ! 3: -- $Header: /f/osi/dsap/x500as/RCS/if-dec.py,v 7.0 89/11/23 21:50:40 mrose Rel $ ! 4: -- ! 5: -- ! 6: -- $Log: if-dec.py,v $ ! 7: -- Revision 7.0 89/11/23 21:50:40 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: DECODER decode ! 55: ! 56: AttributeType [[P AttributeType *]] ! 57: %{ ! 58: OID oid; ! 59: AttributeType AttrT_decode_aux (); ! 60: %} ! 61: ::= ! 62: %{ ! 63: DLOG(log_dsap, LLOG_PDUS, ("About to decode AttributeType (IF)")); ! 64: %} ! 65: OBJECT IDENTIFIER [[O oid]] ! 66: %{ ! 67: *parm = AttrT_decode_aux (oid); ! 68: DLOG(log_dsap, LLOG_PDUS, ("Done decode AttributeType (IF)")); ! 69: %} ! 70: ! 71: AttributeValue [[P AttributeValue]] ! 72: %{ ! 73: PE any = NULLPE; ! 74: %} ! 75: ::= ! 76: %{ ! 77: DLOG(log_dsap, LLOG_PDUS, ("About to decode AttributeValue (IF)")); ! 78: parm->av_syntax = 0; ! 79: parm->av_struct = NULL; ! 80: %} ! 81: ANY [[a any]] ! 82: %{ ! 83: parm -> av_struct = (caddr_t) any; ! 84: DLOG(log_dsap, LLOG_PDUS, ("Done decode AttributeValue (IF)")); ! 85: %} ! 86: ! 87: AttributeValueAssertion [[P AVA *]] ! 88: %{ ! 89: %} ! 90: ::= ! 91: %{ ! 92: DLOG(log_dsap, LLOG_PDUS, ("About to decode AttributeValueAssertion (IF)")); ! 93: parm->ava_value = AttrV_alloc(); ! 94: %} ! 95: SEQUENCE ! 96: { ! 97: AttributeType [[p &parm->ava_type]] ! 98: %{ ! 99: %} , ! 100: AttributeValue [[p parm->ava_value]] ! 101: %{ ! 102: AttrV_decode (parm->ava_type,parm->ava_value); ! 103: %} ! 104: } ! 105: %{ ! 106: DLOG(log_dsap, LLOG_PDUS, ("Done decode AttributeValueAssertion (IF)")); ! 107: %} ! 108: ! 109: Attribute [[P Attr_Sequence]] ! 110: %{ ! 111: AV_Sequence av_tmp; ! 112: %} ! 113: ::= ! 114: %{ ! 115: DLOG(log_dsap, LLOG_PDUS, ("About to decode Attribute (IF)")); ! 116: parm->attr_value = NULLAV; ! 117: parm->attr_acl = NULLACL_INFO; ! 118: parm->attr_link = NULLATTR; ! 119: %} ! 120: SEQUENCE ! 121: { ! 122: type ! 123: AttributeType [[p &(parm->attr_type)]] ! 124: %{ ! 125: %} , ! 126: values ! 127: SET OF ! 128: %{ ! 129: av_tmp = avs_comp_alloc(); ! 130: av_tmp->avseq_next = NULLAV; ! 131: %} ! 132: AttributeValue [[p &(av_tmp->avseq_av)]] ! 133: %{ ! 134: AttrV_decode (parm->attr_type,&(av_tmp->avseq_av)); ! 135: parm->attr_value = avs_merge(parm->attr_value, av_tmp); ! 136: %} ! 137: } ! 138: %{ ! 139: DLOG(log_dsap, LLOG_PDUS, ("Done decode Attribute (IF)")); ! 140: %} ! 141: ! 142: RelativeDistinguishedName [[P RDN*]] ! 143: %{ ! 144: AVA ava_next_s; ! 145: AVA * ava_next = &(ava_next_s); ! 146: RDN rdn_tmp; ! 147: %} ! 148: ::= ! 149: %{ ! 150: DLOG(log_dsap, LLOG_PDUS, ("About to decode RelativeDistinguishedName (IF)")); ! 151: (*parm) = NULLRDN; ! 152: %} ! 153: SET OF ! 154: %{ ! 155: %} ! 156: AttributeValueAssertion [[p ava_next]] ! 157: %{ ! 158: rdn_tmp = rdn_comp_alloc(); ! 159: rdn_tmp->rdn_next = NULLRDN; ! 160: rdn_tmp->rdn_at = ava_next->ava_type; ! 161: rdn_tmp->rdn_av.av_syntax = ava_next->ava_value->av_syntax; ! 162: rdn_tmp->rdn_av.av_struct = ava_next->ava_value->av_struct; ! 163: free ((char *)ava_next->ava_value); ! 164: (*parm) = rdn_merge((*parm), rdn_tmp); ! 165: %} ! 166: %{ ! 167: DLOG(log_dsap, LLOG_PDUS, ("Done decode RelativeDistinguishedName (IF)")); ! 168: %} ! 169: ! 170: RDNSequence [[P DN*]] ! 171: %{ ! 172: DN * dn_next; ! 173: %} ! 174: ::= ! 175: %{ ! 176: DLOG(log_dsap, LLOG_PDUS, ("About to decode RDNSequence (IF)")); ! 177: (*parm) = NULLDN; ! 178: dn_next = parm; ! 179: %} ! 180: SEQUENCE OF ! 181: %{ ! 182: (*dn_next) = dn_comp_alloc(); ! 183: %} ! 184: RelativeDistinguishedName [[p &((*dn_next)->dn_rdn)]] ! 185: %{ ! 186: dn_next = &((*dn_next)->dn_parent); ! 187: %} ! 188: %{ ! 189: (*dn_next) = NULLDN; ! 190: DLOG(log_dsap, LLOG_PDUS, ("Done decode RDNSequence (IF)")); ! 191: %} ! 192: ! 193: DistinguishedName [[P DN*]] ! 194: %{ ! 195: %} ! 196: ::= ! 197: %{ ! 198: DLOG(log_dsap, LLOG_TRACE, ("About to decode DistinguishedName (IF)")); ! 199: %} ! 200: RDNSequence [[p parm]] ! 201: %{ ! 202: DLOG(log_dsap, LLOG_TRACE, ("Done decode DistinguishedName (IF)")); ! 203: %} ! 204: ! 205: Name [[P DN*]] ! 206: %{ ! 207: %} ! 208: ::= ! 209: %{ ! 210: DLOG(log_dsap, LLOG_PDUS, ("About to decode Name (IF)")); ! 211: %} ! 212: CHOICE ! 213: { ! 214: RDNSequence [[p parm]] ! 215: %{ ! 216: %} ! 217: } ! 218: %{ ! 219: DLOG(log_dsap, LLOG_PDUS, ("Done decode Name (IF)")); ! 220: %} ! 221: ! 222: END
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.