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 r

⟦d2bb5631d⟧ TextFile

    Length: 4430 (0x114e)
    Types: TextFile
    Names: »rybind.c«

Derivation

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

TextFile

/* rybind.c - ROSY: bind */

#ifndef	lint
static char *rcsid = "$Header: /f/osi/dsap/net/RCS/rybind.c,v 7.2 89/12/19 16:19:38 mrose Exp $";
#endif

/* 
 * $Header: /f/osi/dsap/net/RCS/rybind.c,v 7.2 89/12/19 16:19:38 mrose Exp $
 *
 *
 * $Log:	rybind.c,v $
 * Revision 7.2  89/12/19  16:19:38  mrose
 * sync
 * 
 * Revision 7.1  89/11/24  16:21:50  mrose
 * sync
 * 
 * Revision 7.0  89/11/23  21:48:27  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 "rosy.h"
#include <varargs.h>

/* \f

   BIND */

/* ARGSUSED */

int	RyBind (ctx, calledaddr, ctxlist, defctxname, data, sversion, acc, aci)
OID	ctx;
struct PSAPaddr *calledaddr;
struct PSAPctxlist *ctxlist;
OID	defctxname;
PE      data;
int	sversion;
struct AcSAPconnect *acc;
struct AcSAPindication *aci;
{
    int     result;
    struct QOStype qos;
    struct SSAPref sfs;
    register struct SSAPref *sf;
    PE  user_data;
    PE *user_datap = &(user_data);
    int ndata;


    if ((sf = addr2ref (PLocalHostName ())) == NULL) {
	sf = &sfs;
	(void) bzero ((char *) sf, sizeof *sf);
    }

    bzero ((char *) &qos, sizeof qos);
    qos.qos_sversion = sversion;

    /* Wrap the user data with the remote operations BIND tag */
    if (data != NULLPE) {
	if (build_Remote__Operations__Notation_BindArgumentValue (user_datap, 
		1, 0, NULLCP, data) == NOTOK) { 
	    /* build_Remote__Operations__Notation_BindArgumentValue failed */
		    return NOTOK;
	}
	(*user_datap) -> pe_context = data->pe_context;
	ndata = 1;
    } else {
	ndata = 0;
    }

/*
    The result of this procedure should be based upon parsing the result in
    the case of an A-ASSOCIATE.CONFIRM and the presence of this data
*/

    if ((result = AcAssocRequest (ctx, NULLAEI, NULLAEI, NULLPA, calledaddr,
	    ctxlist, defctxname, PR_MYREQUIRE, ROS_MYREQUIRE, SERIAL_NONE, 0,
	    sf, user_datap, ndata, &qos, acc, aci)) == OK) {
	ParseRyBindResponse(acc);
    }
    return result;
}

int	RyAsynBind (ctx, calledaddr, ctxlist, defctxname, data, sversion, acc, aci, stime, quipuctx)
OID	ctx;
struct PSAPaddr *calledaddr;
struct PSAPctxlist *ctxlist;
OID	defctxname;
PE      data;
int	sversion;
struct AcSAPconnect *acc;
struct AcSAPindication *aci;
int	stime;
char quipuctx;
{
    int     result;
    struct QOStype qos;
    struct SSAPref sfs;
    register struct SSAPref *sf;
    PE  user_data;
    PE *user_datap = &(user_data);
    int ndata;


    if ((sf = addr2ref (PLocalHostName ())) == NULL) {
	sf = &sfs;
	(void) bzero ((char *) sf, sizeof *sf);
    }

    bzero ((char *) &qos, sizeof qos);
    qos.qos_sversion = sversion;
    qos.qos_maxtime = stime;

    /* Wrap the user data with the remote operations BIND tag */
    if (data != NULLPE) {
	if (build_Remote__Operations__Notation_BindArgumentValue (user_datap, 
		1, 0, NULLCP, data) == NOTOK) { 
	    /* build_Remote__Operations__Notation_BindArgumentValue failed */
		    return NOTOK;
	}
	(*user_datap) -> pe_context = data->pe_context;
	ndata = 1;
    } else {
	ndata = 0;
    }

/*
    The result of this procedure should be based upon parsing the result in
    the case of an A-ASSOCIATE.CONFIRM and the presence of this data
*/

    result = AcAsynAssocRequest (ctx, NULLAEI, NULLAEI, NULLPA, calledaddr,
	    ctxlist, defctxname, PR_MYREQUIRE,
	    quipuctx ? ROS_MYREQUIRE | SR_NEGOTIATED : ROS_MYREQUIRE,
	    SERIAL_NONE, 0, sf, user_datap, ndata, &qos, acc, aci, ROS_ASYNC);

    if (ndata)
	    pe_free (*user_datap);

    return result;
}

ParseRyBindResponse (acc)
struct AcSAPconnect *acc;
{
    PE	  pe;

    if (acc->acc_info[0] != NULLPE) {
	pe = pe_cpy (acc->acc_info[0]);
	pe_free (acc->acc_info[0]);
	if (acc -> acc_result == ACS_ACCEPT) {
	    if (parse_Remote__Operations__Notation_BindResultValue (pe, 
	    	1, NULLIP, NULLVP, &acc->acc_info[0]) != OK) {
		/* parse_Remote__Operations__Notation_BindResultValue failed */
		acc->acc_info[0] = pe_cpy(pe);
	    }
	} else {
	    if (parse_Remote__Operations__Notation_BindErrorValue (pe, 
		    1, NULLIP, NULLVP, &acc->acc_info[0]) != OK) {
		/* parse_Remote__Operations__Notation_BindErrorValue failed */
		acc->acc_info[0] = pe_cpy(pe);
	    }
	}
	pe_free (pe);
    }
}