|
|
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 s
Length: 9073 (0x2371)
Types: TextFile
Names: »sa-dec.py«
└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
└─⟦35176feda⟧ »EurOpenD22/isode/isode-6.tar.Z«
└─⟦de7628f85⟧
└─⟦this⟧ »isode-6.0/dsap/x500as/sa-dec.py«
-- sa-dec.py - Seleted Attributes
-- $Header: /f/osi/dsap/x500as/RCS/sa-dec.py,v 7.0 89/11/23 21:50:49 mrose Rel $
--
--
-- $Log: sa-dec.py,v $
-- Revision 7.0 89/11/23 21:50:49 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.
--
--
SA
{
joint-iso-ccitt
ds(5)
modules(1)
selectedAttributeTypes(5)
}
DEFINITIONS ::=
%{
#include <stdio.h>
#include "quipu/util.h"
#include "quipu/entry.h"
extern LLog * log_dsap;
#define decode_UNIV_PrintableString parse_UNIV_PrintableString
#define decode_UNIV_TeletexString parse_UNIV_TeletexString
#define decode_UNIV_OctetString parse_UNIV_OctetString
#define decode_UNIV_IA5String parse_UNIV_IA5String
#define decode_UNIV_T61String parse_UNIV_T61String
%}
PREFIXES encode decode print
BEGIN
IMPORTS
AttributeType
FROM IF
{
joint-iso-ccitt
ds(5)
modules(1)
informationFramework(1)
};
DECODER decode
FacsimileTelephoneNumber [[P struct fax *]]
::=
%{
DLOG(log_dsap, LLOG_PDUS, ("About to decode FacsimileTelephoneNumber"));
parm -> bits = NULLPE;
%}
SEQUENCE
{
telephoneNumber
PrintableString [[s parm->number]]
%{
if ( strlen (parm->number) > UB_TELEPHONE_NUMBER) {
advise (NULLCP, "fax/phone number too long");
return NOTOK;
}
%},
parameters
BIT STRING
%{
if ((parm -> bits = pe_cpy ($$)) == NULLPE) {
advise (NULLCP, "out of memory");
return NOTOK;
}
%}
OPTIONAL
}
%{
DLOG(log_dsap, LLOG_PDUS, ("Done decode FacsimileTelephoneNumber"));
%}
PostalAddress [[P struct postaddr **]]
%{
struct postaddr ** tmp;
int pa_count;
%}
::=
%{
DLOG(log_dsap, LLOG_PDUS, ("About to decode PostalAddress"));
(*parm) = (struct postaddr *) NULL;
tmp = parm;
%}
SEQUENCE OF
%{
(*tmp) = (struct postaddr *) smalloc (sizeof (struct postaddr));
pa_count = 0;
%}
CHOICE
{
T61String [[s (*tmp)->addrcomp]]
%{
pa_count++;
(*tmp)->addrtype = 1;
if ( strlen ((*tmp)->addrcomp) > UB_POSTAL_STRING) {
advise (NULLCP, "postal string too long");
return NOTOK;
}
%} ,
PrintableString [[s (*tmp)->addrcomp]]
%{
pa_count++;
(*tmp)->addrtype = 2;
if ( strlen ((*tmp)->addrcomp) > UB_POSTAL_STRING) {
advise (NULLCP, "postal string too long");
return NOTOK;
}
%}
}
%{
tmp = & ((*tmp)->pa_next);
%}
%{
if (pa_count > UB_POSTAL_LINE) {
advise (NULLCP, "too many addr components");
return NOTOK;
}
(*tmp) = (struct postaddr *) NULL;
DLOG(log_dsap, LLOG_PDUS, ("Done decode PostalAddress"));
%}
TelexNumber [[P struct telex *]]
::=
%{
DLOG(log_dsap, LLOG_PDUS, ("About to decode TeletexTerminalIdentifier"));
%}
SEQUENCE
{
telexNumber PrintableString [[s parm->telexnumber]]
%{
if ( strlen (parm->telexnumber) > UB_TELEX_NUMBER) {
advise (NULLCP, "telex number too long");
return NOTOK;
}
%},
countryCode PrintableString [[s parm->countrycode]]
%{
if ( strlen (parm->countrycode) > UB_COUNTRY_CODE) {
advise (NULLCP, "countrycode too long");
return NOTOK;
}
%},
answerback PrintableString [[s parm->answerback]]
%{
if ( strlen (parm->answerback) > UB_ANSWERBACK) {
advise (NULLCP, "answerback number too long");
return NOTOK;
}
%}
}
%{
DLOG(log_dsap, LLOG_PDUS, ("Done decode FacsimileTelephoneNumber"));
%}
TeletexTerminalIdentifier [[P struct teletex *]]
::=
%{
DLOG(log_dsap, LLOG_PDUS, ("About to decode TeletexTerminalIdentifier"));
%}
SEQUENCE
{
teletexTerminal
PrintableString [[s parm->terminal]]
%{
if ( strlen (parm->terminal) > UB_TELETEX_TERMINAL_ID) {
advise (NULLCP, "teletex string too long");
return NOTOK;
}
%},
parameters
SET {
graphic-character-sets [0] TeletexString
[[s parm->graphic]] OPTIONAL ,
control-character-sets [1] TeletexString
[[s parm->control]] OPTIONAL,
page-formats [2] OCTET STRING
[[s parm->page]] OPTIONAL,
miscellaneous-terminal-capabilities [3] TeletexString
[[s parm->misc]] OPTIONAL,
private-use [4] OCTET STRING
[[s parm->t_private]] OPTIONAL
}
OPTIONAL
}
%{
DLOG(log_dsap, LLOG_PDUS, ("Done decode TeletexTerminalIdentifier"));
%}
PreferredDeliveryMethod [[P struct pref_deliv **]]
%{
struct pref_deliv ** tmp;
%}
::=
%{
DLOG(log_dsap, LLOG_PDUS, ("About to decode PreferredDeliveryMethod"));
(*parm) = (struct pref_deliv *) NULL;
tmp = parm;
%}
SEQUENCE OF
%{
(*tmp) = (struct pref_deliv *) smalloc (sizeof (struct pref_deliv));
%}
INTEGER [[i (*tmp)->deliv ]]
{
any-delivery-method (0),
mhs-delivery (1),
physical-delivery (2),
telex-delivery (3),
teletex-delivery (4),
g3-facsimilie-delivery (5),
g4-facsimilie-delivery (6),
ia5-terminal-delivery (7),
videotex-delivery (8),
telephone-delivery (9)
}
%{
tmp = & ((*tmp)->pd_next);
%}
%{
DLOG(log_dsap, LLOG_PDUS, ("Done decode PreferredDeliveryMethod"));
(*tmp) = (struct pref_deliv *) NULL;
%}
CriteriaItem [[P struct CriteriaItem **]]
::=
%{
if ((*(parm) = (struct CriteriaItem *)
calloc (1, sizeof **(parm))) == ((struct CriteriaItem *) 0)) {
advise (NULLCP, "out of memory");
return NOTOK;
}
(*parm)->attrib = AttrT_alloc();
%}
CHOICE
{
equality[0]
AttributeType
[[p (*parm) -> attrib]]
%{ (*parm) -> offset = choice_equality; %},
substrings[1]
AttributeType
[[p (*parm) -> attrib]]
%{ (*parm) -> offset = choice_substrings; %},
greaterOrEqual[2]
AttributeType
[[p (*parm) -> attrib]]
%{ (*parm) -> offset = choice_greaterOrEqual; %},
lessOrEqual[3]
AttributeType
[[p (*parm) -> attrib]]
%{ (*parm) -> offset = choice_lessOrEqual; %},
approximateMatch[4]
AttributeType
[[p (*parm) -> attrib]]
%{ (*parm) -> offset = choice_approximateMatch; %}
}
Criteria [[P struct Criteria **]]
%{
struct and_or_set **and_or_set;
%}
::=
%{
if ((*parm = (struct Criteria *)
calloc (1, sizeof **parm)) == ((struct Criteria *) 0)) {
advise (NULLCP, "out of memory");
return NOTOK;
}
and_or_set = &((*parm) -> un.and_or);
%}
CHOICE
%{
and_or_set = &((*parm) -> un.and_or);
%}
{
type[0]
CriteriaItem
[[p &((*parm) -> un.type)]]
%{ (*parm) -> offset = Criteria_type; %},
and[1]
SET OF
%{
if ((*(and_or_set) = (struct and_or_set *)
calloc (1, sizeof **(and_or_set))) == ((struct and_or_set *) 0)) {
advise (NULLCP, "out of memory");
return NOTOK;
}
%}
Criteria
[[p &((*and_or_set) -> and_or_comp)]]
%{ and_or_set = &((*and_or_set) -> and_or_next); (*parm) -> offset = Criteria_and; %},
or[2]
SET OF
%{
if ((*(and_or_set) = (struct and_or_set *)
calloc (1, sizeof **(and_or_set))) == ((struct and_or_set *) 0)) {
advise (NULLCP, "out of memory");
return NOTOK;
}
%}
Criteria
[[p &((*and_or_set) -> and_or_comp)]]
%{ and_or_set = &((*and_or_set) -> and_or_next); (*parm) -> offset = Criteria_or; %},
not[3]
Criteria
[[p &((*parm) -> un.not)]]
%{ (*parm) -> offset = Criteria_not; %}
}
Guide [[ P struct Guide **]]
::=
%{
*parm = (struct Guide *) smalloc (sizeof (struct Guide ));
(*parm)->objectClass = NULLOID;
%}
SET {
objectClass [0]
OBJECT IDENTIFIER
[[O ((*parm) -> objectClass)]]
OPTIONAL,
criteria [1]
Criteria [[p &((*parm) -> criteria)]]
}
END