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 n

⟦6acd37c0f⟧ TextFile

    Length: 3937 (0xf61)
    Types: TextFile
    Names: »net_init.c«

Derivation

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

TextFile

/* net_init.c - Init network section of DSA process */

#ifndef	lint
static char *rcsid = "$Header: /f/osi/dsap/net/RCS/net_init.c,v 6.0 89/03/18 23:28:38 mrose Rel $";
#endif

/* 
 * $Header: /f/osi/dsap/net/RCS/net_init.c,v 6.0 89/03/18 23:28:38 mrose Rel $
 *
 *
 * $Log:	net_init.c,v $
 * Revision 6.0  89/03/18  23:28:38  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 "rosap.h"
#include "tsap.h"
#include "quipu/util.h"
#include "quipu/connection.h"
#include "quipu/oid.h"

extern	LLog	* log_dsap;
char	*mydsaname = "undefined";

OID	acse_pci;
OID	x500_da_ac;
OID	x500_ds_ac;
OID	x500_da_as;
OID	x500_ds_as;
struct PSAPctxlist         x500_da_pcdl_s;
struct PSAPctxlist	* x500_da_pcdl = &x500_da_pcdl_s;
struct PSAPctxlist         x500_ds_pcdl_s;
struct PSAPctxlist	* x500_ds_pcdl = &x500_ds_pcdl_s;

net_init()
{
    DSAinfo                     info = &(id_st.info);
    struct TSAPdisconnect       td_s;
    struct TSAPdisconnect       *td = &(td_s);
    struct PSAPaddr *           get_dsa_psap ();

    DLOG(log_dsap, LLOG_TRACE, ("Net Starting"));
    isodetailor("server", 0);

    info->aei = NULLAEI;
    if ((info->addr = get_dsa_psap (str2dn(mydsaname))) == NULLPA)
    {
	LLOG(log_dsap, LLOG_EXCEPTIONS, ("invalid dsa name %s",mydsaname));
	return NOTOK;
    }

    if((acse_pci = oid_cpy(ode2oid("acse pci version 1"))) == NULLOID)
    {
	LLOG(log_dsap, LLOG_EXCEPTIONS, ("acse pci version 1 OID not found"));
	return NOTOK;
    }

    x500_da_ac = DIR_ACCESS_AC;
    x500_ds_ac = DIR_SYSTEM_AC;
    x500_da_as = DIR_ACCESS_AS;
    x500_ds_as = DIR_SYSTEM_AS;

    x500_da_pcdl->pc_nctx = 2;
    x500_da_pcdl->pc_ctx[0].pc_id = 1;
    x500_da_pcdl->pc_ctx[0].pc_asn = oid_cpy(x500_da_as);
    x500_da_pcdl->pc_ctx[0].pc_atn = NULLOID;
    x500_da_pcdl->pc_ctx[1].pc_id = 3;
    x500_da_pcdl->pc_ctx[1].pc_asn = oid_cpy(acse_pci);
    x500_da_pcdl->pc_ctx[1].pc_atn = NULLOID;

    x500_ds_pcdl->pc_nctx = 2;
    x500_ds_pcdl->pc_ctx[0].pc_id = 1;
    x500_ds_pcdl->pc_ctx[0].pc_asn = oid_cpy(x500_ds_as);
    x500_ds_pcdl->pc_ctx[0].pc_atn = NULLOID;
    x500_ds_pcdl->pc_ctx[1].pc_id = 3;
    x500_ds_pcdl->pc_ctx[1].pc_asn = oid_cpy(acse_pci);
    x500_ds_pcdl->pc_ctx[1].pc_atn = NULLOID;

    info->p_req = PR_MYREQUIRE;         /* No prequirements */
    info->s_req = ROS_MYREQUIRE;        /* Standard srequirements */
    info->isn = SERIAL_NONE;            /* Default initial serial number */
    info->settings = 0;                 /* No settings */
    bzero ((char *) &info -> qos, sizeof info -> qos);
    info -> qos.qos_sversion = 2;	/* QOS: session version 2*/
    info->async = ROS_ASYNC;            /* Asynchronous mode */


/*
    if(TNetUnique(&(info->addr->pa_addr.sa_addr), td) == NOTOK)
    if(TNetListen(&(info->addr->pa_addr.sa_addr), td) == NOTOK)
    if(TNetListen(&(info->addr->pa_addr.sa_addr.ta_addrs[0]), td) == NOTOK)
*/
    (void) fprintf(stderr,"-- %s --\n",paddr2str(info->addr,NULLNA));
    if(TNetListen(&(info->addr->pa_addr.sa_addr), td) == NOTOK)
    {
	LLOG(log_dsap, LLOG_EXCEPTIONS, ("TNetListen failed on address %s",paddr2str(info->addr,NULLNA)));
	if(td->td_cc > 0)
	{
	    (void) fprintf(stderr, "TNetListen: [%s] %*.*s\n\n",
		TErrString(td->td_reason), td->td_cc, td->td_cc, td->td_data);
	    LLOG(log_dsap, LLOG_FATAL, ("TNetListen: [%s] %*.*s",
		TErrString(td->td_reason), td->td_cc, td->td_cc, td->td_data));
	}
	else
	{
	    (void) fprintf(stderr, "TNetListen: [%s]\n\n",
		TErrString(td->td_reason));
	    LLOG(log_dsap, LLOG_FATAL, ("TNetListen: [%s]",
		TErrString(td->td_reason)));
	}
	return NOTOK;
    }

    id_st.connlist = NULLCONN;         /* No connections yet */

    return OK;
}