|
|
Initial revision
-- if-dec.py - manually-augmented InformationFramework module
-- $Header: /var/lib/cvsd/repos/CSRG/43BSDReno/contrib/isode-beta/dsap/x500as/if-dec.py,v 1.1 2018/04/24 16:12:56 root Exp $
--
--
-- $Log: if-dec.py,v $
-- Revision 1.1 2018/04/24 16:12:56 root
-- Initial revision
--
-- Revision 7.0 89/11/23 21:50:40 mrose
-- Release 6.0
--
--
-- NOTICE
--
-- Acquisition, use, and distribution of this module and related
-- materials are subject to the restrictions of a license agreement.
-- Consult the Preface in the User's Manual for the full terms of
-- this agreement.
--
--
IF
{
joint-iso-ccitt
ds(5)
modules(1)
informationFramework(1)
}
DEFINITIONS ::=
%{
#include <stdio.h>
#include "quipu/util.h"
#include "quipu/attrvalue.h"
extern LLog * log_dsap;
PE grab_pe();
%}
PREFIXES encode decode print
BEGIN
-- EXPORTS
-- AttributeType,
-- AttributeValue,
-- AttributeValueAssertion,
-- Attribute,
-- RelativeDistinguishedName,
-- DistinguishedName,
-- Name;
DECODER decode
AttributeType [[P AttributeType *]]
%{
OID oid;
AttributeType AttrT_decode_aux ();
%}
::=
%{
DLOG(log_dsap, LLOG_PDUS, ("About to decode AttributeType (IF)"));
%}
OBJECT IDENTIFIER [[O oid]]
%{
*parm = AttrT_decode_aux (oid);
DLOG(log_dsap, LLOG_PDUS, ("Done decode AttributeType (IF)"));
%}
AttributeValue [[P AttributeValue]]
%{
PE any = NULLPE;
%}
::=
%{
DLOG(log_dsap, LLOG_PDUS, ("About to decode AttributeValue (IF)"));
parm->av_syntax = 0;
parm->av_struct = NULL;
%}
ANY [[a any]]
%{
parm -> av_struct = (caddr_t) any;
DLOG(log_dsap, LLOG_PDUS, ("Done decode AttributeValue (IF)"));
%}
AttributeValueAssertion [[P AVA *]]
%{
%}
::=
%{
DLOG(log_dsap, LLOG_PDUS, ("About to decode AttributeValueAssertion (IF)"));
parm->ava_value = AttrV_alloc();
%}
SEQUENCE
{
AttributeType [[p &parm->ava_type]]
%{
%} ,
AttributeValue [[p parm->ava_value]]
%{
AttrV_decode (parm->ava_type,parm->ava_value);
%}
}
%{
DLOG(log_dsap, LLOG_PDUS, ("Done decode AttributeValueAssertion (IF)"));
%}
Attribute [[P Attr_Sequence]]
%{
AV_Sequence av_tmp;
%}
::=
%{
DLOG(log_dsap, LLOG_PDUS, ("About to decode Attribute (IF)"));
parm->attr_value = NULLAV;
parm->attr_acl = NULLACL_INFO;
parm->attr_link = NULLATTR;
%}
SEQUENCE
{
type
AttributeType [[p &(parm->attr_type)]]
%{
%} ,
values
SET OF
%{
av_tmp = avs_comp_alloc();
av_tmp->avseq_next = NULLAV;
%}
AttributeValue [[p &(av_tmp->avseq_av)]]
%{
AttrV_decode (parm->attr_type,&(av_tmp->avseq_av));
parm->attr_value = avs_merge(parm->attr_value, av_tmp);
%}
}
%{
DLOG(log_dsap, LLOG_PDUS, ("Done decode Attribute (IF)"));
%}
RelativeDistinguishedName [[P RDN*]]
%{
AVA ava_next_s;
AVA * ava_next = &(ava_next_s);
RDN rdn_tmp;
%}
::=
%{
DLOG(log_dsap, LLOG_PDUS, ("About to decode RelativeDistinguishedName (IF)"));
(*parm) = NULLRDN;
%}
SET OF
%{
%}
AttributeValueAssertion [[p ava_next]]
%{
rdn_tmp = rdn_comp_alloc();
rdn_tmp->rdn_next = NULLRDN;
rdn_tmp->rdn_at = ava_next->ava_type;
rdn_tmp->rdn_av.av_syntax = ava_next->ava_value->av_syntax;
rdn_tmp->rdn_av.av_struct = ava_next->ava_value->av_struct;
free ((char *)ava_next->ava_value);
(*parm) = rdn_merge((*parm), rdn_tmp);
%}
%{
DLOG(log_dsap, LLOG_PDUS, ("Done decode RelativeDistinguishedName (IF)"));
%}
RDNSequence [[P DN*]]
%{
DN * dn_next;
%}
::=
%{
DLOG(log_dsap, LLOG_PDUS, ("About to decode RDNSequence (IF)"));
(*parm) = NULLDN;
dn_next = parm;
%}
SEQUENCE OF
%{
(*dn_next) = dn_comp_alloc();
%}
RelativeDistinguishedName [[p &((*dn_next)->dn_rdn)]]
%{
dn_next = &((*dn_next)->dn_parent);
%}
%{
(*dn_next) = NULLDN;
DLOG(log_dsap, LLOG_PDUS, ("Done decode RDNSequence (IF)"));
%}
DistinguishedName [[P DN*]]
%{
%}
::=
%{
DLOG(log_dsap, LLOG_TRACE, ("About to decode DistinguishedName (IF)"));
%}
RDNSequence [[p parm]]
%{
DLOG(log_dsap, LLOG_TRACE, ("Done decode DistinguishedName (IF)"));
%}
Name [[P DN*]]
%{
%}
::=
%{
DLOG(log_dsap, LLOG_PDUS, ("About to decode Name (IF)"));
%}
CHOICE
{
RDNSequence [[p parm]]
%{
%}
}
%{
DLOG(log_dsap, LLOG_PDUS, ("Done decode Name (IF)"));
%}
END
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.