|
|
Initial revision
/* acsapblock.c - manage association blocks */
#ifndef lint
static char *rcsid = "$Header: /var/lib/cvsd/repos/CSRG/43BSDReno/contrib/isode-beta/acsap/acsapblock.c,v 1.1 2018/04/24 16:12:56 root Exp $";
#endif
/*
* $Header: /var/lib/cvsd/repos/CSRG/43BSDReno/contrib/isode-beta/acsap/acsapblock.c,v 1.1 2018/04/24 16:12:56 root Exp $
*
*
* $Log: acsapblock.c,v $
* Revision 1.1 2018/04/24 16:12:56 root
* Initial revision
*
* Revision 7.0 89/11/23 21:21:46 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 <stdio.h>
#include "acpkt.h"
/* DATA */
static int once_only = 0;
static struct assocblk assocque;
static struct assocblk *ACHead = &assocque;
/* ASSOCIATION BLOCKS */
struct assocblk *newacblk () {
register struct assocblk *acb;
acb = (struct assocblk *) calloc (1, sizeof *acb);
if (acb == NULL)
return NULL;
acb -> acb_fd = NOTOK;
if (once_only == 0) {
ACHead -> acb_forw = ACHead -> acb_back = ACHead;
once_only++;
}
insque (acb, ACHead -> acb_back);
return acb;
}
/* */
freeacblk (acb)
register struct assocblk *acb;
{
if (acb == NULL)
return;
if (acb -> acb_flags & ACB_STICKY) {
acb -> acb_flags &= ~ACB_STICKY;
return;
}
if (acb -> acb_fd != NOTOK && acb -> acb_uabort)
if (acb -> acb_flags & ACB_ACS) {
if (acb -> acb_flags & ACB_RTS) {/* recurse */
struct AcSAPindication acis;
(void) (*acb -> acb_uabort) (acb -> acb_fd, NULLPEP, 0, &acis);
return;
}
else {
struct PSAPindication pis;
(void) (*acb -> acb_uabort) (acb -> acb_fd, NULLPEP, 0, &pis);
}
}
else {
struct SSAPindication sis;
(void) (*acb -> acb_uabort) (acb -> acb_fd, NULLCP, 0, &sis);
}
if (acb -> acb_flags & ACB_FINISH)
ACFFREE (&acb -> acb_finish);
if (acb -> acb_context)
oid_free (acb -> acb_context);
if (acb -> acb_retry)
pe_free (acb -> acb_retry);
FREEACB (acb);
if (acb -> acb_apdu)
pe_free (acb -> acb_apdu);
remque (acb);
free ((char *) acb);
}
/* */
struct assocblk *findacblk (sd)
register int sd;
{
register struct assocblk *acb;
if (once_only == 0)
return NULL;
for (acb = ACHead -> acb_forw; acb != ACHead; acb = acb -> acb_forw)
if (acb -> acb_fd == sd)
return acb;
return NULL;
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.