|
|
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: 6992 (0x1b50)
Types: TextFile
Names: »dsa_schedule.c«
└─⟦3d0c2be1b⟧ Bits:30001254 ISODE-5.0 Tape
└─⟦eba4602b1⟧ »./isode-5.0.tar.Z«
└─⟦d3ac74d73⟧
└─⟦this⟧ »isode-5.0/quipu/dsa_schedule.c«
/* dsa_schedule.c - Schedule DSA operations */
#ifndef lint
static char *rcsid = "$Header: /f/osi/quipu/RCS/dsa_schedule.c,v 6.0 89/03/18 23:41:30 mrose Rel $";
#endif
/*
* $Header: /f/osi/quipu/RCS/dsa_schedule.c,v 6.0 89/03/18 23:41:30 mrose Rel $
*
*
* $Log: dsa_schedule.c,v $
* Revision 6.0 89/03/18 23:41:30 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.
*
*/
#include "acsap.h"
#include "quipu/util.h"
#include "quipu/connection.h"
extern LLog * log_dsap;
dsa_schedule(tk)
register struct activity * tk;
{
DN originator;
DN baseobject;
switch(tk->act_type)
{
case ACT_TYPE_REQ:
if(tk->act_conn->cn_dsa)
{
originator = dn_cpy(tk->act_req.dca_charg.cha_originator);
baseobject = dn_cpy(tk->act_req.dca_charg.cha_target);
}
else
{
originator = dn_cpy(tk->act_conn->cn_who);
baseobject = NULLDN;
}
dsa_work_open_request(tk, originator, baseobject);
dn_free(originator);
dn_free(baseobject);
break;
case ACT_TYPE_CHN:
dsa_collate(tk);
break;
case ACT_TYPE_RESP:
LLOG (log_dsap,LLOG_EXCEPTIONS,( "PROBLEMS"));
tk->act_class = ACTIVITY_NET_SEND;
break;
}
}
dsa_work_init_request(conn)
register struct connection * conn;
{
DLOG (log_dsap,LLOG_TRACE,( "dsa_work_init_req()"));
switch(do_ds_bind(&(conn->cn_init_act.ia_req),
&(conn->cn_init_act.ia_resp.init_resp_err),
&(conn->cn_init_act.ia_resp.init_resp_res),
&(conn->cn_tasklist), conn->cn_dsa))
{
case DS_OK:
conn->cn_init_act.ia_resp.init_ret_type = RET_TYPE_RES;
conn->cn_init_act.ia_class = ACTIVITY_NET_SEND;
conn->cn_init_act.ia_type = ACT_TYPE_RESP;
conn->cn_init_act.ia_resp.init_resp_type = RESP_TYPE_RET;
break;
case DS_CONTINUE :
conn->cn_init_act.ia_class = ACTIVITY_NET_WAIT;
conn->cn_init_act.ia_type = ACT_TYPE_CHN;
conn->cn_tasklist->act_conn = conn;
dsa_chain(conn->cn_tasklist);
break;
default :
conn->cn_init_act.ia_resp.init_ret_type = RET_TYPE_ERR;
conn->cn_init_act.ia_class = ACTIVITY_NET_SEND;
conn->cn_init_act.ia_type = ACT_TYPE_RESP;
conn->cn_init_act.ia_resp.init_resp_type = RESP_TYPE_RET;
break;
}
}
dsa_bind_collate(conn)
register struct connection * conn;
{
register struct activity *tk = conn->cn_tasklist;
register struct init_activity *ia = &(conn->cn_init_act);
register struct init_response *ir = &(ia->ia_resp);
DLOG(log_dsap, LLOG_TRACE, ("dsa_bind_collate "));
if((tk->act_resp.resp_type == RESP_TYPE_RET)
&& (tk->act_resp.ret_type == RET_TYPE_RES)
&& (tk->act_result->dcr_dsres.res_cm.cmr_matched))
{
ia->ia_class = ACTIVITY_NET_SEND;
ia->ia_type = ACT_TYPE_RESP;
ir->init_resp_type = RESP_TYPE_RET;
ir->init_ret_type = RET_TYPE_RES;
make_dsa_bind_arg(&(ir->init_resp_res));
}
else
{
ia->ia_class = ACTIVITY_NET_SEND;
ia->ia_type = ACT_TYPE_RESP;
ir->init_resp_type = RESP_TYPE_RET;
ir->init_ret_type = RET_TYPE_ERR;
ir->init_resp_err.dbe_version = DBA_VERSION_V1988;
ir->init_resp_err.dbe_type = DBE_TYPE_SECURITY;
ir->init_resp_err.dbe_value = DSE_SC_AUTHENTICATION;
if((tk->act_resp.resp_type == RESP_TYPE_RET)
&& (tk->act_resp.ret_type == RET_TYPE_ERR))
{
if(tk->act_error->dse_type == DSE_SECURITYERROR)
{
ir->init_resp_err.dbe_type = DBE_TYPE_SECURITY;
ir->init_resp_err.dbe_value = tk->act_error->ERR_SECURITY.DSE_sc_problem;
}
if(tk->act_error->dse_type == DSE_SERVICEERROR)
{
ir->init_resp_err.dbe_type = DBE_TYPE_SERVICE;
ir->init_resp_err.dbe_value = tk->act_error->ERR_SERVICE.DSE_sv_problem;
}
if(tk->act_error->dse_type == DSE_REFERRAL)
{
ir->init_resp_err.dbe_type = DBE_TYPE_SERVICE;
ir->init_resp_err.dbe_value = DSE_SV_UNAVAILABLE;
}
}
}
task_extract(conn->cn_tasklist);
net_send_init_response(conn);
}
dsa_work_init_response(conn)
register struct connection * conn;
{
DLOG (log_dsap,LLOG_TRACE,( "dsa_work_init_resp()"));
if((conn->cn_init_act.ia_resp.init_resp_type == RESP_TYPE_RET)
&& (conn->cn_init_act.ia_resp.init_ret_type == RET_TYPE_RES))
{
conn->cn_state = CN_STATE_OPEN;
}
else
{
conn->cn_state = CN_STATE_FAIL;
conn->cn_ad = 0;
}
}
dsa_work_open_request(act, orig, base)
struct activity * act;
DN orig;
DN base;
{
int dsa_ret;
dsa_ret = dsa_apply(&(act->act_req.dca_dsarg), &(act->act_resp.resp_err),
&(act->act_resp.resp_res.dcr_dsres), orig, base,
&(act->local_st), &(act->refer_st));
DLOG (log_dsap,LLOG_TRACE,( "Activity applied"));
switch(dsa_ret)
{
case DS_CONTINUE:
{
struct ds_search_result * tk_sr = &(act->act_resp.resp_res.dcr_dsres.res_sr);
/* Set up next part of search result to collate remote sub-searches */
if(tk_sr->srr_next == NULLSRR)
{
LLOG(log_dsap, LLOG_DEBUG, ("Allocating a search result"));
tk_sr->srr_next = (struct ds_search_result *) calloc(1, sizeof(struct ds_search_result));
tk_sr->srr_next->srr_correlated = TRUE;
tk_sr->srr_next->srr_un.srr_unit = (struct ds_search_unit *) calloc(1, sizeof(struct ds_search_unit));
}
/* Map any new elements in the refer list onto opers */
st_chain(act);
if((act->local_st != NULL_ST) && (act->act_class == ACTIVITY_NET_WAIT))
{
act->act_class = ACTIVITY_DSA_WORK;
}
break;
}
case DS_OK:
if((act->referred_st == NULL_ST) || (act->tk_operlist == NULLACTIVITY))
{
act->act_class = ACTIVITY_NET_SEND;
act->act_type = ACT_TYPE_RESP;
}
else
{
act->act_class = ACTIVITY_COLLATE;
act->act_type = ACT_TYPE_CHN;
}
act->act_resp.resp_type = RESP_TYPE_RET;
act->act_resp.ret_type = RET_TYPE_RES;
act->act_result = &(act->act_resp.resp_res);
act->act_result->dcr_dsres.result_type = act->act_req.dca_dsarg.arg_type;
break;
default:
if((act->act_resp.resp_err.dse_type == DSE_REFERRAL) && chain_ok(act))
{
act->act_class = ACTIVITY_DSA_WORK;
act->act_type = ACT_TYPE_CHN;
dsa_chain(act);
}
else
{
act->act_class = ACTIVITY_NET_SEND;
act->act_type = ACT_TYPE_RESP;
act->act_resp.resp_type = RESP_TYPE_RET;
act->act_resp.ret_type = RET_TYPE_ERR;
act->act_error = &(act->act_resp.resp_err);
}
break;
}
}
dsa_work_exit_request(conn)
register struct connection * conn;
{
(void) do_ds_unbind(conn);
conn->cn_exit_act.exit_act_class = ACTIVITY_NET_SEND;
conn->cn_exit_act.exit_act_type = ACT_TYPE_RESP;
}
/* ARGSUSED */
dsa_work_exit_response(conn)
register struct connection * conn;
{
(void) do_ds_unbind(conn);
DLOG (log_dsap,LLOG_TRACE,( "dsa_work_exit_response() ad = %d", conn->cn_ad));
}