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 m

⟦176cd4516⟧ TextFile

    Length: 3094 (0xc16)
    Types: TextFile
    Names: »mrelease.c«

Derivation

└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
    └─⟦e83f91978⟧ »EurOpenD22/isode/osimis-2.0.tar.Z« 
        └─⟦d846658bd⟧ 
            └─⟦this⟧ »osimis/msap/mrelease.c« 

TextFile

/*
 * Copyright (c) 1988 University College London
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms are permitted
 * provided that the above copyright notice and this paragraph are
 * duplicated in all such forms and that any documentation,
 * advertising materials, and other materials related to such
 * distribution and use acknowledge that the software was developed
 * by the Department of Computer Science, University College London.
 * The name of the University may not be used to
 * endorse or promote products derived from this software without
 * specific prior written permission.
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */

/* Routines to release a management association */

/*
 * By George Pavlou, April 1990
 */

#include <stdio.h>
#include "isode/rosap.h"
#include "msap.h"

/* LINTLIBRARY */

int  M_TerminateReq (msd, reason, info, mi)
int msd, reason;
PE  info;
struct MSAPindication * mi;
{
    struct AcSAPrelease acrs;
    struct AcSAPindication acis;
    int  ninfo = (info ? 1 : 0);

    if (AcRelRequest(msd, reason, &info, ninfo, NOTOK, &acrs, &acis) == NOTOK) {
	mi->mi_type = MI_ABORT;
	mi->mi_abort.ma_source = MA_PROVIDER;
	mi->mi_abort.ma_reason = acis.aci_abort.aca_reason;
	mi->mi_abort.ma_info   = NULL;
	(void) strncpy(mi->mi_abort.ma_data, acis.aci_abort.aca_data, MA_SIZE);
	ACAFREE(&acis.aci_abort);
	return NOTOK;
    }
    ACRFREE(&acrs);
    if (acrs.acr_affirmative)
	return OK;
    mi->mi_type =  MI_ABORT;
    mi->mi_abort.ma_source = MA_USER;
    mi->mi_abort.ma_reason = MA_NOTREL;
    mi->mi_abort.ma_info   = NULL;
    (void) strncpy(mi->mi_abort.ma_data, "Peer refused to release", MA_SIZE);
    return NOTOK;
}

int  M_TerminateResp (msd, status, reason, info, mi)
int msd, status, reason;
PE info;
struct MSAPindication  * mi;
{
    struct AcSAPindication acis;
    int  ninfo = (info ? 1 : 0);

    if (AcRelResponse(msd, status, reason, &info, ninfo, &acis) == NOTOK) {
	mi->mi_type = MI_ABORT;
	mi->mi_abort.ma_source = MA_PROVIDER;
	mi->mi_abort.ma_reason = acis.aci_abort.aca_reason;
	mi->mi_abort.ma_info   = NULL;
	(void) strncpy(mi->mi_abort.ma_data, acis.aci_abort.aca_data, MA_SIZE);
	ACAFREE(&acis.aci_abort);
	return NOTOK;
    }
    return OK;
}

/* M_AbortReq - abort an association unilaterally
 */

int  M_AbortReq (msd, info, mi)
int msd;
External * info;
struct MSAPindication * mi;
{
    struct AcSAPindication acis;
    struct MSAPabort mas;
    PE pe;

    mas.ma_info   = info;
    mas.ma_source = MA_USER;
    (void) build_CMIPAbort_CMIPAbortInfo(&pe, 1, 0, NULLCP, &mas);
    pe -> pe_context = 1;
    if (AcUAbortRequest(msd, &pe, 1, &acis) == NOTOK) {
	mi->mi_type = MI_ABORT;
	mi->mi_abort.ma_source = acis.aci_abort.aca_source;
	mi->mi_abort.ma_reason = acis.aci_abort.aca_reason;
	(void) strncpy(mi->mi_abort.ma_data, acis.aci_abort.aca_data, MA_SIZE);
	ACAFREE(&acis.aci_abort);
	return NOTOK;
    }
    return OK;
}