|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T q
Length: 12598 (0x3136)
Types: TextFile
Names: »qu-dec.py«
└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
└─⟦35176feda⟧ »EurOpenD22/isode/isode-6.tar.Z«
└─⟦de7628f85⟧
└─⟦this⟧ »isode-6.0/dsap/x500as/qu-dec.py«
-- quipu-dec.py - additional QUIPU directory type definitions module
-- $Header: /f/osi/dsap/x500as/RCS/qu-dec.py,v 7.0 89/11/23 21:50:45 mrose Rel $
--
--
-- $Log: qu-dec.py,v $
-- Revision 7.0 89/11/23 21:50:45 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.
--
--
Quipu
{
ccitt
data(9)
pss(2342)
ucl(19200300)
quipu(99)
directoryDefinitions(1)
}
DEFINITIONS ::=
%{
#include <stdio.h>
#include "quipu/util.h"
#include "quipu/entry.h"
#include "quipu/authen.h"
extern LLog * log_dsap;
#define decode_UNIV_PrintableString parse_UNIV_PrintableString
#define decode_UNIV_UTCTime parse_UNIV_UTCTime
%}
PREFIXES encode decode print
BEGIN
IMPORTS
NameError ,
ServiceError ,
SecurityError
FROM DAS
{
joint-iso-ccitt
ds(5)
modules(1)
directoryAbstractService(2)
}
DistinguishedName ,
RelativeDistinguishedName ,
Attribute ,
AttributeType
FROM IF
{
joint-iso-ccitt
ds(5)
modules(1)
informationFramework(1)
}
AlgorithmIdentifier
FROM AF {
joint-iso-ccitt
ds(5)
modules(1)
authenticationFramework(7)
};
-- ReliableROSData
-- ::=
-- SEQUENCE
-- {
-- rosOperation
-- INTEGER ,
-- the operation being applied
-- data
-- ANY ,
-- the Operation Argument
-- oldVersion
-- ANY ,
-- data version to which operation should be applied
-- newVersion
-- ANY
-- version number which results from operation
-- }
DECODER decode
AccessSelector [[P struct acl_info *]]
::=
%{
DLOG(log_dsap, LLOG_PDUS, ("About to decode AccessSelector"));
parm->acl_name = NULLDNSEQ;
%}
CHOICE
{
entry
[0] NULL
%{
parm->acl_selector_type = ACL_ENTRY;
%} ,
other
[2] NULL
%{
parm->acl_selector_type = ACL_OTHER;
%} ,
prefix
[3] NameList [[p &(parm->acl_name)]]
%{
parm->acl_selector_type = ACL_PREFIX;
%} ,
group
[4] NameList [[p &(parm->acl_name)]]
%{
parm->acl_selector_type = ACL_GROUP;
%}
}
%{
DLOG(log_dsap, LLOG_PDUS, ("Done decode AccessSelector"));
%}
AccessCategories [[P u_char *]]
::=
%{
DLOG(log_dsap, LLOG_PDUS, ("About to decode AccessCategories"));
%}
ENUMERATED [[i (*parm)]]
{
none (0) ,
detect (1) ,
compare (2) ,
read (3) ,
add (4) ,
write (5)
}
%{
DLOG(log_dsap, LLOG_PDUS, ("Done decode AccessCategories"));
%}
ACLInfo [[P struct acl_info * *]]
%{
%}
::=
%{
DLOG(log_dsap, LLOG_PDUS, ("About to decode ACLInfo"));
%}
SET OF
%{
(*parm) = (struct acl_info *) malloc(sizeof(struct acl_info));
%}
SEQUENCE
{
AccessSelector [[p (*parm)]] ,
AccessCategories [[p &((*parm)->acl_categories)]]
}
%{
parm = &((*parm)->acl_next);
%}
%{
(*parm) = NULLACL_INFO;
DLOG(log_dsap, LLOG_PDUS, ("Done decode ACLInfo"));
%}
AttributeACL [[P struct acl_attr *]]
%{
struct oid_seq * osp;
%}
::=
%{
DLOG(log_dsap, LLOG_PDUS, ("About to decode AttributeACL"));
parm->aa_types = NULLOIDSEQ;
parm->aa_acl = acl_dflt();
parm->aa_next = NULLACL_ATTR;
%}
SEQUENCE
{
SET OF
%{
osp = (struct oid_seq *) malloc(sizeof(struct oid_seq));
osp->oid_oid = NULLOID;
osp->oid_next = NULLOIDSEQ;
%}
-- AttributeType
OBJECT IDENTIFIER [[O osp->oid_oid]]
%{
parm->aa_types = oid_seq_merge(parm->aa_types, osp);
%} ,
ACLInfo [[p &(parm->aa_acl)]]
-- DEFAULT {{other , read}, {entry, write}}
OPTIONAL
}
%{
DLOG(log_dsap, LLOG_PDUS, ("Done decode AttributeACL"));
%}
ACLSyntax [[P struct acl *]]
%{
struct acl_attr **aap;
%}
::=
%{
DLOG(log_dsap, LLOG_PDUS, ("About to decode ACLSyntax"));
parm->ac_child = acl_dflt();
parm->ac_entry = acl_dflt();
parm->ac_default = acl_dflt();
parm->ac_attributes = NULLACL_ATTR;
aap = &(parm->ac_attributes);
%}
SEQUENCE
{
childACL
[0] ACLInfo [[p &(parm->ac_child)]]
-- DEFAULT {{other , read}, {entry, write}} ,
OPTIONAL ,
entryACL
[1] ACLInfo [[p &(parm->ac_entry)]]
-- DEFAULT {{other , read}, {entry, write}} ,
OPTIONAL ,
defaultAttributeACL
[2] ACLInfo [[p &(parm->ac_default)]]
-- DEFAULT {{other , read}, {entry, write}} ,
OPTIONAL ,
[3] SET OF
%{
(*aap) = (struct acl_attr *) malloc(sizeof(struct acl_attr));
%}
AttributeACL [[p (*aap)]]
%{
aap = &((*aap)->aa_next);
%}
%{
(*aap) = NULLACL_ATTR;
%}
}
%{
DLOG(log_dsap, LLOG_PDUS, ("Done decode ACLSyntax"));
%}
NameList [[P struct dn_seq **]]
::=
%{
DLOG(log_dsap, LLOG_PDUS, ("About to decode NameList"));
*parm = NULLDNSEQ;
%}
SET OF
%{
*parm = (struct dn_seq *) malloc(sizeof(struct dn_seq));
%}
DistinguishedName [[p &((*parm)->dns_dn)]]
%{
parm = &((*parm)->dns_next);
%}
%{
(*parm) = NULLDNSEQ;
DLOG(log_dsap, LLOG_PDUS, ("Done decode NameList"));
%}
EDBInfoSyntax [[P struct edb_info *]]
::=
%{
DLOG(log_dsap, LLOG_PDUS, ("About to decode EDBInfoSyntax"));
parm->edb_name = NULLDN;
parm->edb_getfrom = NULLDN;
parm->edb_sendto = NULLDNSEQ;
parm->edb_allowed = NULLDNSEQ;
%}
SEQUENCE
{
edb
DistinguishedName [[p &(parm->edb_name)]] ,
getFromDSA
DistinguishedName [[p &(parm->edb_getfrom)]]
OPTIONAL ,
sendToDSAs
%{
DLOG(log_dsap, LLOG_PDUS, ("decode sendToDSAs"));
%}
NameList [[p &(parm->edb_sendto)]] ,
getEDBAllowed
%{
DLOG(log_dsap, LLOG_PDUS, ("decode getEDBAllowed"));
%}
NameList [[p &(parm->edb_allowed)]]
}
%{
DLOG(log_dsap, LLOG_PDUS, ("Done decode EDBInfoSyntax"));
%}
TreeStructureSyntax [[P struct tree_struct **]]
%{
AttributeType at_tmp;
OID oid_tmp;
int is_first;
objectclass * oc_add();
%}
::=
%{
DLOG(log_dsap, LLOG_PDUS, ("About to decode TreeStructureSyntax"));
is_first = 1;
at_tmp = AttrT_alloc();
%}
SET
{
mandatoryObjectClasses
[1] SET OF
OBJECT IDENTIFIER [[O oid_tmp]]
%{
if(is_first != 0)
{
(*parm) = tree_struct_alloc();
if (((*parm)->tree_object = oid2oc(oid_tmp)) == NULLOBJECTCLASS)
(*parm)->tree_object = oc_add (oid_tmp);
is_first = 0;
}
else
{
LLOG(log_dsap, LLOG_EXCEPTIONS, ("Multiple mandatory object classes"));
}
%} ,
optionalObjectClasses
[2] SET OF
OBJECT IDENTIFIER
OPTIONAL ,
permittedRDNs
[3] SET OF
SET OF
AttributeType [[p at_tmp]]
%{
AttrT_free(at_tmp);
at_tmp = AttrT_alloc();
%}
}
%{
free ((char *)at_tmp);
DLOG(log_dsap, LLOG_PDUS, ("Done decode TreeStructureSyntax"));
%}
EntryDataBlock [[P struct entry **]]
%{
struct entry **ent_tmp;
%}
::=
%{
DLOG(log_dsap, LLOG_TRACE, ("About to decode EntryDataBlock"));
(*parm) = NULLENTRY;
ent_tmp = parm;
%}
SEQUENCE OF
%{
(*ent_tmp) = entry_alloc();
(*ent_tmp)->e_leaf = TRUE;
(*ent_tmp)->e_complete = TRUE;
(*ent_tmp)->e_data = E_TYPE_SLAVE;
%}
RelativeEntry [[p (*ent_tmp)]]
%{
ent_tmp = &((*ent_tmp)->e_sibling);
%}
%{
(*ent_tmp) = NULLENTRY;
DLOG(log_dsap, LLOG_TRACE, ("Done decode EntryDataBlock"));
%}
RelativeEntry [[P struct entry *]]
%{
Attr_Sequence as_tmp;
%}
::=
%{
DLOG(log_dsap, LLOG_PDUS, ("About to decode RelativeEntry"));
parm->e_name = NULLRDN;
parm->e_attributes = NULLATTR;
%}
SEQUENCE
{
RelativeDistinguishedName [[p &(parm->e_name)]] ,
SET OF
%{
as_tmp = as_comp_alloc();
as_tmp->attr_value = NULLAV;
as_tmp->attr_acl = NULLACL_INFO;
as_tmp->attr_link = NULLATTR;
%}
Attribute [[p as_tmp]]
%{
parm->e_attributes = as_merge(parm->e_attributes, as_tmp);
%}
}
%{
DLOG(log_dsap, LLOG_PDUS, ("Done decode RelativeEntry"));
%}
EDBVersion [[P char **]]
%{
%}
::=
%{
DLOG(log_dsap, LLOG_PDUS, ("About to decode EDBVersion"));
(*parm) = NULLCP;
%}
UTCTime [[s (*parm)]]
%{
if((*parm) == NULLCP)
LLOG(log_dsap, LLOG_EXCEPTIONS, ("NULL CP Version!"));
DLOG(log_dsap, LLOG_PDUS, ("Done decode EDBVersion"));
%}
GetEntryDataBlockArgument [[P struct getedb_arg *]]
::=
%{
DLOG(log_dsap, LLOG_TRACE, ("About to decode GetEntryDataBlockArgument"));
parm->ga_entry = NULLDN;
parm->ga_version = NULL;
parm->get_next = NULL_GETARG;
%}
SET
{
entry
[0] DistinguishedName [[p &(parm->ga_entry)]] ,
sendIfMoreRecentThan
[1] EDBVersion [[p &(parm->ga_version)]]
OPTIONAL
-- if omitted, send in any case
}
%{
DLOG(log_dsap, LLOG_TRACE, ("Done decode GetEntryDataBlockArgument"));
%}
GetEntryDataBlockResult [[P struct getedb_result *]]
::=
%{
DLOG(log_dsap, LLOG_TRACE, ("About to decode GetEntryDataBlockResult"));
parm->gr_version = NULL;
parm->gr_edb = NULLENTRY;
parm->gr_next = NULL_GETRESULT;
%}
SEQUENCE
{
versionHeld
[0] EDBVersion [[p &(parm->gr_version)]] ,
[1] EntryDataBlock [[p &(parm->gr_edb)]]
OPTIONAL
}
%{
DLOG(log_dsap, LLOG_TRACE, ("Done decode GetEntryDataBlockResult"));
%}
ProtectedPassword [[P struct protected_password **]]
%{
struct alg_id alg;
%}
::=
%{
DLOG(log_dsap, LLOG_TRACE, ("About to decode ProtectedPassword"));
(*parm) = (struct protected_password *)
calloc(1, sizeof(**parm));
if ((*parm) == (struct protected_password *) 0)
return (NOTOK);
(*parm)->protected = (char) 0;
(*parm)->time1 = NULLCP;
(*parm)->time2 = NULLCP;
(*parm)->random1 = (struct random_number *) 0;
(*parm)->random2 = (struct random_number *) 0;
%}
SEQUENCE
{
algorithm [0] AlgorithmIdentifier [[p &alg]]
OPTIONAL,
salt [1] SET
{
time1 [0] UTCTime [[s (*parm)->time1]] OPTIONAL,
time2 [1] UTCTime [[s (*parm)->time2]] OPTIONAL,
random1 [2] BIT STRING OPTIONAL,
random2 [3] BIT STRING OPTIONAL
}
%{
(*parm)->protected = (char) 1;
%}
OPTIONAL,
password [2] OCTET STRING [[o (*parm)->passwd $ (*parm)->n_octets]]
}
%{
DLOG(log_dsap, LLOG_TRACE, ("Done decode ProtectedPassword"));
%}
END