DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T f

⟦15c123aa6⟧ TextFile

    Length: 3143 (0xc47)
    Types: TextFile
    Names: »ftamrelease2.c«

Derivation

└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
    └─⟦35176feda⟧ »EurOpenD22/isode/isode-6.tar.Z« 
        └─⟦de7628f85⟧ 
            └─⟦this⟧ »isode-6.0/ftam/ftamrelease2.c« 

TextFile

/* ftamrelease2.c - FPM: respond to release */

#ifndef	lint
static char *rcsid = "$Header: /f/osi/ftam/RCS/ftamrelease2.c,v 7.0 89/11/23 21:53:50 mrose Rel $";
#endif

/* 
 * $Header: /f/osi/ftam/RCS/ftamrelease2.c,v 7.0 89/11/23 21:53:50 mrose Rel $
 *
 *
 * $Log:	ftamrelease2.c,v $
 * Revision 7.0  89/11/23  21:53:50  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 <signal.h>
#include "fpkt.h"

/* \f

   F-TERMINATE.RESPONSE */

int	FTerminateResponse (sd, sharedASE, charging, fti)
int	sd;
PE	sharedASE;
struct FTAMcharging *charging;
struct FTAMindication *fti;
{
    SBV	    smask;
    int     result;
    register struct ftamblk *fsb;

    if (charging && charging -> fc_ncharge > NFCHRG)
	return ftamlose (fti, FS_GEN_NOREASON, 0, NULLCP,
			"too many charges");
    missingP (fti);

    smask = sigioblock ();

    ftamFsig (fsb, sd);

    result = FTerminateResponseAux (fsb, sharedASE, charging, fti);

    (void) sigiomask (smask);

    return result;
}

/* \f

 */

static int  FTerminateResponseAux (fsb, sharedASE, charging, fti)
register struct ftamblk *fsb;
PE	sharedASE;
struct FTAMcharging *charging;
struct FTAMindication *fti;
{
    int     result;
    PE	    pe;
    struct AcSAPindication  acis;
    register struct AcSAPindication *aci = &acis;
    register struct AcSAPabort *aca = &aci -> aci_abort;
    register struct type_FTAM_PDU *pdu;
    register struct type_FTAM_F__TERMINATE__response *rsp;

    pe = NULLPE;
    if ((pdu = (struct type_FTAM_PDU *) calloc (1, sizeof *pdu)) == NULL) {
no_mem: ;
	(void) ftamlose (fti, FS_GEN (fsb), 1, NULLCP, "out of memory");
out: ;
	if (pe)
	    pe_free (pe);
	if (pdu)
	    free_FTAM_PDU (pdu);
	if (fti -> fti_abort.fta_action == FACTION_PERM)
	    freefsblk (fsb);
	return NOTOK;
    }
    pdu -> offset = type_FTAM_PDU_f__terminate__response;
    if ((rsp = (struct type_FTAM_F__TERMINATE__response *)
			calloc (1, sizeof *rsp)) == NULL)
	goto no_mem;
    pdu -> un.f__terminate__response = rsp;
    if (sharedASE
	    && (rsp -> shared__ASE__information =
			shared2fpm (fsb, sharedASE, fti)) == NULL)
	goto out;
    if (charging
	    && charging -> fc_ncharge > 0
	    && (rsp -> charging = chrg2fpm (fsb, charging, fti)) == NULL)
	goto out;

    if (encode_FTAM_PDU (&pe, 1, 0, NULLCP, pdu) == NOTOK) {
	(void) ftamlose (fti, FS_GEN (fsb), 1, NULLCP,
			 "error encoding PDU: %s", PY_pepy);
	goto out;
    }

    pe -> pe_context = fsb -> fsb_id;

    fsbtrace (fsb, (fsb -> fsb_fd, "A-RELEASE.RESPONSE",
		    "F-TERMINATE-response", pe, 0));

    result = AcRelResponse (fsb -> fsb_fd, ACS_ACCEPT, ACR_NORMAL, &pe, 1,
			    aci);

    pe_free (pe);
    pe = NULLPE;
    free_FTAM_PDU (pdu);
    pdu = NULL;

    if (result == NOTOK) {
	(void) acs2ftamlose (fsb, fti, "AcRelResponse", aca);
	goto out;
    }

    fsb -> fsb_fd = NOTOK;
    freefsblk (fsb);

    return OK;
}