|
|
Initial revision
/* conn_finish.c - deal with request to finish the association */
#ifndef lint
static char *rcsid = "$Header: /var/lib/cvsd/repos/CSRG/43BSDReno/contrib/isode-beta/quipu/conn_finish.c,v 1.1 2018/04/24 16:12:56 root Exp $";
#endif
/*
* $Header: /var/lib/cvsd/repos/CSRG/43BSDReno/contrib/isode-beta/quipu/conn_finish.c,v 1.1 2018/04/24 16:12:56 root Exp $
*
*
* $Log: conn_finish.c,v $
* Revision 1.1 2018/04/24 16:12:56 root
* Initial revision
*
* Revision 7.1 90/03/15 11:18:41 mrose
* quipu-sync
*
* Revision 7.0 89/11/23 22:16: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.
*
*/
/* LINTLIBRARY */
#include "quipu/dsap.h"
#include "quipu/util.h"
#include "quipu/connection.h"
extern LLog * log_dsap;
void ds_log();
void acs_log ();
/* ARGSUSED */
conn_finish(conn, df)
struct connection * conn;
struct DSAPfinish * df;
{
int result;
struct oper_act * on;
extern time_t conn_timeout, timenow;
struct DSAPindication di_s;
struct DSAPindication * di = &(di_s);
DLOG(log_dsap, LLOG_TRACE, ("conn_finish()"));
/* Can release be negotiated? */
if (conn->cn_start.cs_ds.ds_start.acs_start.ps_srequirements & SR_NEGOTIATED)
{
/* Should release be rejected? */
for(on=conn->cn_operlist; on!=NULLOPER; on=on->on_next_conn)
if (on->on_state == ON_CHAINED)
break;
if (on != NULLOPER)
{
/*
* See if oper has had time to complete
* if so remote DSA has probably lost the operation (never !!!)
* else reject the release
*/
if ( timenow - conn->cn_last_used < conn_timeout)
{
watch_dog ("DUnBindReject");
result = DUnBindReject (conn->cn_ad, ACS_REJECT,
ACR_NOTFINISHED, di);
watch_dog_reset ();
if (result != OK)
{
do_ds_unbind(conn);
watch_dog ("DUAbortRequest (release)");
result = DUAbortRequest (conn->cn_ad, di);
watch_dog_reset();
conn_extract(conn);
}
return;
}
}
}
do_ds_unbind(conn);
watch_dog ("DUnBindAccept");
result = DUnBindAccept (conn->cn_ad, di);
watch_dog_reset();
if (result != OK) {
watch_dog ("DUAbortRequest (release)");
result = DUAbortRequest (conn->cn_ad, di);
watch_dog_reset();
}
conn_extract(conn);
}
conn_rel_abort (conn)
struct connection * conn;
{
int result;
struct DSAPindication di_s;
struct DSAPindication *di = &di_s;
struct DSAPabort *da = &(di->di_abort);
if (!conn->cn_initiator)
return;
LLOG(log_dsap, LLOG_NOTICE, ("conn_rel_abort %d",conn->cn_ad));
watch_dog ("DUAbortRequest (release)");
result = DUAbortRequest (conn->cn_ad, di);
watch_dog_reset();
if (result != OK)
{
ds_log (da, "DUAbortRequest in conn_rel_abort()");
}
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.