|
|
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 d
Length: 8955 (0x22fb)
Types: TextFile
Names: »ds_error.c«
└─⟦3d0c2be1b⟧ Bits:30001254 ISODE-5.0 Tape
└─⟦eba4602b1⟧ »./isode-5.0.tar.Z«
└─⟦d3ac74d73⟧
└─⟦this⟧ »isode-5.0/dsap/common/ds_error.c«
/* ds_error.c - Directory Operation Errors */
#ifndef lint
static char *rcsid = "$Header: /f/osi/dsap/common/RCS/ds_error.c,v 6.0 89/03/18 23:27:33 mrose Rel $";
#endif
/*
* $Header: /f/osi/dsap/common/RCS/ds_error.c,v 6.0 89/03/18 23:27:33 mrose Rel $
*
*
* $Log: ds_error.c,v $
* Revision 6.0 89/03/18 23:27:33 mrose
* Release 5.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.
*
*/
/* LINTLIBRARY */
#include "quipu/util.h"
#include "quipu/name.h"
#include "quipu/dsp.h"
#include "quipu/ds_error.h"
extern LLog * log_dsap;
extern int dn_print ();
extern int AttrT_print ();
int dsa_dead;
static char * abandon_fail [] = {
"No error !!!",
"No such operation",
"Too late",
"Cannot abandon"
};
static char * at_problem [] = {
"No error !!!",
"No such attribute in the entry",
"Invalid attribute syntax",
"Undefined Attribute type",
"Inappropriate Matching",
"Constrain violation",
"Attribute or Value already exists"
};
static char * name [] = {
"No error !!!",
"No such object",
"Alias problem",
"Invalid attribute syntax",
"Alias dereference"
};
static char * security [] = {
"No error !!!",
"Authentication",
"Invalid credentials",
"Access rights",
"Invalid signature",
"Protection required",
"No information"
};
static char * service [] = {
"No error !!!",
"Busy",
"Unavailable",
"Unwilling to perform",
"Chaining required",
"Unable to proceed",
"Invalid Reference",
"Timelimit exceeded",
"Administrative size limit exceeded",
"Loop detect",
"Unavailable critical extension",
"Out of scope",
"DIT error"
};
static char * update [] = {
"No error !!!",
"Naming violation",
"Object class violation",
"Only allowed on leaf entries",
"Can't alter the RDN",
"Already exists",
"Affects multiple DSAs",
"Object class modifications Prohibited"
};
ds_error (ps,err)
PS ps;
struct DSError *err;
{
struct DSE_at_problem *at_prob;
switch (err->dse_type) {
case DSE_NOERROR:
ps_print (ps,"No error !!!\n");
break;
case DSE_ABANDON_FAILED:
ps_printf (ps,"*** Abandon failure: %s, id %d ***\n" ,abandon_fail[err->ERR_ABANDON_FAIL.DSE_ab_problem], err->ERR_ABANDON_FAIL.DSE_ab_invokeid);
break;
case DSE_ATTRIBUTEERROR:
ps_print (ps,"*** Attribute error ***\n");
dn_decode (err->ERR_ATTRIBUTE.DSE_at_name);
dn_print (ps,err->ERR_ATTRIBUTE.DSE_at_name, READOUT);
ps_print (ps,"\n");
for (at_prob = &err->ERR_ATTRIBUTE.DSE_at_plist; at_prob != DSE_AT_NOPROBLEM; at_prob = at_prob -> dse_at_next) {
ps_print (ps,"Attribute type ");
AttrT_print (ps,at_prob->DSE_at_type,READOUT);
if (at_prob->DSE_at_value != NULLAttrV) {
ps_print (ps,", value ");
AttrV_print (ps,at_prob->DSE_at_value,READOUT);
}
ps_printf (ps," - %s\n", at_problem[at_prob->DSE_at_what]);
}
break;
case DSE_NAMEERROR:
ps_printf (ps,"*** Name error: %s ***\n( ",name[err->ERR_NAME.DSE_na_problem]);
dn_decode (err->ERR_NAME.DSE_na_matched);
dn_print (ps,err->ERR_NAME.DSE_na_matched,READOUT);
ps_print (ps," )\n");
break;
case DSE_SERVICEERROR:
ps_printf (ps,"*** Service error: %s ***\n", service[err->ERR_SERVICE.DSE_sv_problem] );
break;
case DSE_REFERRAL:
if (err->ERR_REFERRAL.DSE_ref_candidates == NULLCONTINUATIONREF) {
ps_print (ps,"*** Can't contact remote DSA - Address Unknown ***\n");
break;
}
ps_print (ps,"*** Can't contact DSA \"");
dn_decode (err->ERR_REFERRAL.DSE_ref_candidates->cr_accesspoints.ap_name);
dn_print (ps,err->ERR_REFERRAL.DSE_ref_candidates->cr_accesspoints.ap_name,READOUT);
ps_printf (ps,"\" ***\n (%s)\n", paddr2str (&err->ERR_REFERRAL.DSE_ref_candidates->cr_accesspoints.ap_address,NULLNA));
break;
case DSE_DSAREFERRAL:
if (err->ERR_REFERRAL.DSE_ref_candidates == NULLCONTINUATIONREF) {
ps_print (ps,"*** Referral error - Null reference ***\n");
break;
}
ps_print (ps,"*** DSA Referral error - ");
dn_decode (err->ERR_REFERRAL.DSE_ref_candidates->cr_accesspoints.ap_name);
dn_print (ps,err->ERR_REFERRAL.DSE_ref_candidates->cr_accesspoints.ap_name,READOUT);
ps_printf (ps," - %s ***\n", paddr2str (&err->ERR_REFERRAL.DSE_ref_candidates->cr_accesspoints.ap_address,NULLNA));
dn_decode (err->ERR_REFERRAL.DSE_ref_prefix);
dn_print (ps,err->ERR_REFERRAL.DSE_ref_prefix,READOUT);
break;
case DSE_SECURITYERROR:
ps_printf (ps,"*** Security error - %s ***\n",security[err->ERR_SECURITY.DSE_sc_problem]);
break;
case DSE_UPDATEERROR:
ps_printf (ps,"*** Update error - %s ***\n",update[err->ERR_UPDATE.DSE_up_problem]);
break;
case DSE_ABANDONED:
ps_print (ps,"*** Abandoned error ***\n");
break;
case DSE_REMOTEERROR:
dsa_dead = TRUE;
ps_print (ps,"*** Problem with DSA ***\n");
break;
case DSE_LOCALERROR:
ps_print (ps,"*** Problem with DUA ***\n");
break;
default:
dsa_dead = TRUE;
ps_printf (ps,"*** Undefined error '%d' ***",err->dse_type);
break;
}
ds_error_free (err);
}
log_ds_error (err)
struct DSError *err;
{
struct DSE_at_problem *at_prob;
switch (err->dse_type) {
case DSE_NOERROR:
LLOG (log_dsap,LLOG_EXCEPTIONS,("No error !!!"));
break;
case DSE_ABANDON_FAILED:
LLOG (log_dsap,LLOG_EXCEPTIONS,("Abandon failure"));
LLOG (log_dsap,LLOG_TRACE,("%s,id %d" ,abandon_fail[err->ERR_ABANDON_FAIL.DSE_ab_problem], err->ERR_ABANDON_FAIL.DSE_ab_invokeid));
break;
case DSE_ATTRIBUTEERROR:
LLOG (log_dsap,LLOG_EXCEPTIONS,("Attribute error\n"));
dn_decode (err->ERR_ATTRIBUTE.DSE_at_name);
pslog (log_dsap,LLOG_TRACE,"...",dn_print,(caddr_t)err->ERR_ATTRIBUTE.DSE_at_name);
for (at_prob = &err->ERR_ATTRIBUTE.DSE_at_plist; at_prob != DSE_AT_NOPROBLEM; at_prob = at_prob -> dse_at_next) {
LLOG (log_dsap,LLOG_TRACE, (at_problem[at_prob->DSE_at_what]));
pslog (log_dsap,LLOG_TRACE,"type", AttrT_print, (caddr_t) at_prob->DSE_at_type);
}
break;
case DSE_NAMEERROR:
LLOG (log_dsap,LLOG_EXCEPTIONS,("Name error: %s",name[err->ERR_NAME.DSE_na_problem]));
dn_decode (err->ERR_NAME.DSE_na_matched);
pslog (log_dsap,LLOG_TRACE,"matched name",dn_print, (caddr_t)err->ERR_NAME.DSE_na_matched);
break;
case DSE_SERVICEERROR:
LLOG (log_dsap,LLOG_EXCEPTIONS,("Service error: %s ", service[err->ERR_SERVICE.DSE_sv_problem] ));
break;
case DSE_REFERRAL:
LLOG (log_dsap,LLOG_EXCEPTIONS,("Referral error"));
if (err->ERR_REFERRAL.DSE_ref_candidates == NULLCONTINUATIONREF) {
LLOG (log_dsap,LLOG_EXCEPTIONS,("NULL reference in referral error"));
break;
}
dn_decode (err->ERR_REFERRAL.DSE_ref_candidates->cr_accesspoints.ap_name);
pslog (log_dsap,LLOG_TRACE,"ap_name",dn_print, (caddr_t)err->ERR_REFERRAL.DSE_ref_candidates->cr_accesspoints.ap_name);
break;
case DSE_DSAREFERRAL:
LLOG (log_dsap,LLOG_EXCEPTIONS,("DSA!! Referral error"));
if (err->ERR_REFERRAL.DSE_ref_candidates == NULLCONTINUATIONREF) {
LLOG (log_dsap,LLOG_EXCEPTIONS,("NULL reference in DSA referral error"));
break;
}
dn_decode (err->ERR_REFERRAL.DSE_ref_candidates->cr_accesspoints.ap_name);
pslog (log_dsap,LLOG_TRACE,"ap_name",dn_print, (caddr_t)err->ERR_REFERRAL.DSE_ref_candidates->cr_accesspoints.ap_name);
break;
case DSE_SECURITYERROR:
LLOG (log_dsap,LLOG_EXCEPTIONS,("Security error - %s ",security[err->ERR_SECURITY.DSE_sc_problem]));
break;
case DSE_UPDATEERROR:
LLOG (log_dsap,LLOG_EXCEPTIONS,("Update error - %s ",update[err->ERR_UPDATE.DSE_up_problem]));
break;
case DSE_ABANDONED:
LLOG (log_dsap,LLOG_EXCEPTIONS,("Abandoned error"));
break;
case DSE_REMOTEERROR:
LLOG (log_dsap, LLOG_EXCEPTIONS,("remote DSA error !!!"));
break;
case DSE_LOCALERROR:
LLOG (log_dsap, LLOG_EXCEPTIONS,("local DUA error !!!"));
break;
default:
LLOG (log_dsap,LLOG_EXCEPTIONS,("Unknown ds error type (%d)",err->dse_type));
break;
}
}
ds_error_free (err)
struct DSError * err;
{
register struct DSE_at_problem *at_prob;
switch (err->dse_type) {
case DSE_ATTRIBUTEERROR:
dn_free (err->ERR_ATTRIBUTE.DSE_at_name);
at_prob = &err->ERR_ATTRIBUTE.DSE_at_plist;
if (at_prob->DSE_at_value != NULLAttrV)
AttrV_free (at_prob->DSE_at_value);
if (at_prob->DSE_at_type != NULLAttrT)
AttrT_free (at_prob->DSE_at_type);
for (at_prob = at_prob->dse_at_next; at_prob != DSE_AT_NOPROBLEM; at_prob = at_prob -> dse_at_next) {
if (at_prob->DSE_at_value != NULLAttrV)
AttrV_free (at_prob->DSE_at_value);
if (at_prob->DSE_at_type != NULLAttrT)
AttrT_free (at_prob->DSE_at_type);
free ((char *) at_prob);
}
break;
case DSE_NAMEERROR:
dn_free (err->ERR_NAME.DSE_na_matched);
break;
case DSE_REFERRAL:
if(err->ERR_REFERRAL.DSE_ref_prefix != NULLDN)
LLOG(log_dsap,LLOG_FATAL,("SCREAM! prefix in referral"));
case DSE_DSAREFERRAL:
dn_free (err->ERR_REFERRAL.DSE_ref_prefix);
crefs_free (err->ERR_REFERRAL.DSE_ref_candidates);
break;
default:
break;
}
}