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 s

⟦a412f7e8d⟧ TextFile

    Length: 2524 (0x9dc)
    Types: TextFile
    Names: »ssaprelease2.c«

Derivation

└─⟦3d0c2be1b⟧ Bits:30001254 ISODE-5.0 Tape
    └─⟦eba4602b1⟧ »./isode-5.0.tar.Z« 
        └─⟦d3ac74d73⟧ 
            └─⟦this⟧ »isode-5.0/ssap/ssaprelease2.c« 

TextFile

/* ssaprelease2.c - SPM: respond to release */

#ifndef	lint
static char *rcsid = "$Header: /f/osi/ssap/RCS/ssaprelease2.c,v 6.0 89/03/18 23:43:58 mrose Rel $";
#endif

/* 
 * $Header: /f/osi/ssap/RCS/ssaprelease2.c,v 6.0 89/03/18 23:43:58 mrose Rel $
 *
 *
 * $Log:	ssaprelease2.c,v $
 * Revision 6.0  89/03/18  23:43:58  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 <stdio.h>
#include <signal.h>
#include "spkt.h"

/* \f

   S-RELEASE.RESPONSE */

int	SRelResponse (sd, status, data, cc, si)
int	sd;
int	status,
	cc;
char   *data;
struct SSAPindication *si;
{
    SBV	    smask;
    int     result;
    register struct ssapblk *sb;

    missingP (si);

    smask = sigioblock ();

    ssapFsig (sb, sd);
    toomuchP (sb, data, cc, SR_SIZE, "release");

    result = SRelResponseAux (sb, status, data, cc, si);

    (void) sigiomask (smask);

    return result;
}

/* \f

   S-RELEASE.RESPONSE */

static int  SRelResponseAux (sb, status, data, cc, si)
register struct ssapblk *sb;
int	status,
	cc;
char   *data;
struct SSAPindication *si;
{
    int     code,
            result;
    register struct ssapkt *s;

    switch (status) {
	case SC_ACCEPT: 
	    code = SPDU_DN;
	    break;

	case SC_REJECTED:
	    if (!(sb -> sb_requirements & SR_NEGOTIATED))
		return ssaplose (si, SC_OPERATION, NULLCP,
			"negotiated release service unavailable");
	    if (!(sb -> sb_requirements & SR_RLS_EXISTS))
		return ssaplose (si, SC_OPERATION, NULLCP,
			    "release token unavailable");
	    if (sb -> sb_owned & ST_RLS_TOKEN)
		return ssaplose (si, SC_OPERATION, NULLCP,
			    "release token owned by you");

	    code = SPDU_NF;
	    break;

	default: 
	    return ssaplose (si, SC_PARAMETER, NULLCP,
			"invalid value for status parameter");
    }

    if ((s = newspkt (code)) == NULL)
	return ssaplose (si, SC_CONGEST, NULLCP, "out of memory");

    if (cc > 0) {
	s -> s_mask |= SMASK_UDATA_PGI;
	s -> s_udata = data, s -> s_ulen = cc;
    }
    else
	s -> s_udata = NULL, s -> s_ulen = 0;
    result = spkt2sd (s, sb -> sb_fd, 0, si);
    s -> s_mask &= ~SMASK_UDATA_PGI;
    s -> s_udata = NULL, s -> s_ulen = 0;

    freespkt (s);
    if (result == NOTOK || code == SPDU_DN)
	freesblk (sb);
    else
	sb -> sb_flags &= ~SB_FINN;

    return result;
}