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 a

⟦392a37a09⟧ TextFile

    Length: 2844 (0xb1c)
    Types: TextFile
    Names: »acsapstub.c«

Derivation

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

TextFile

/* acsapstub.c - application entity titles -- stub directory service */

#ifndef	lint
static char *rcsid = "$Header: /f/osi/acsap/RCS/acsapstub.c,v 6.0 89/03/18 23:24:27 mrose Rel $";
#endif

/* 
 * $Header: /f/osi/acsap/RCS/acsapstub.c,v 6.0 89/03/18 23:24:27 mrose Rel $
 *
 *
 * $Log:	acsapstub.c,v $
 * Revision 6.0  89/03/18  23:24:27  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 <ctype.h>
#include <stdio.h>
#include "psap.h"
#include "isoaddrs.h"
#include "tailor.h"


#ifdef	AETDBM
#define	fetch_aet	str2aet_dbm
#else
#define	fetch_aet	str2aet_seq
#endif

/* \f

   DATA */

static struct isoentity ies;

/* \f

 */

AEI	str2aei_stub (designator, qualifier)
char   *designator,
       *qualifier;
{
    register struct NSAPaddr *na;
    register struct isoentity  *ie = &ies;

    if (fetch_aet (designator, qualifier, &ies) == NOTOK) {

	return NULLAEI;
    }

    if (ie -> ie_addr.pa_addr.sa_addr.ta_naddr <= 0) {
	register int	i;
	register char  *cp;
	register struct TSAPaddr *ta = &ie -> ie_addr.pa_addr.sa_addr;

	na = ta -> ta_addrs, ta -> ta_naddr = 1;
	bzero ((char *) na, sizeof *na);

	/* guess at what sort of address we have on our hands */

	if ((i = strlen (cp = designator)) > 6
	        && cp[0] == '4' && cp[2] == '0' && cp[3] == '0') {
	    na -> na_type = NA_NSAP;
	    na -> na_addrlen = implode ((u_char *) na -> na_address,
					cp, strlen (cp));
	    goto found_it;
	}

	if (i <= (NSAP_DTELEN + 1) /* Maximum X.121 DTE address length */ )
	   for (; *cp; cp++)
	       if (!isxdigit (*cp))
		   break;
	if (*cp) {
	    na -> na_type = NA_TCP;
	    (void) strncpy (na -> na_domain, designator,
			    sizeof na -> na_domain);
	}
	else {
	   (void) strcpy (na -> na_dte, designator);
	   na -> na_dtelen = strlen (na -> na_dte);
#ifdef	BRIDGE_X25
	   na -> na_type = bridgediscrim (na) ? NA_BRG : NA_X25;
#else
	   na -> na_type = NA_X25;
#endif
	}
    }


found_it: ;
    if (addr_log -> ll_events & LLOG_DEBUG)
	_printent (ie);

    return oid2aei (&ie -> ie_identifier);
}

/* \f

 */


/* \f

 */

struct PSAPaddr *aei2addr_stub (aei)
AEI	aei;
{
    register struct isoentity  *ie = &ies;
    register struct PSAPaddr   *pa;

    if (aei -> aei_ap_title
	    ? oid_cmp (&ie -> ie_identifier, prim2oid (aei -> aei_ap_title))
	    : ie -> ie_identifier.oid_nelem > 0) {
	SLOG (addr_log, LLOG_EXCEPTIONS, NULLCP,
	      ("aei2addr_stub cache miss on %s", sprintaei (aei)));

	return NULLPA;
    }
    pa = &ie -> ie_addr;
    if (addr_log -> ll_events & LLOG_DEBUG)
	_printent (ie);

    return (pa -> pa_addr.sa_addr.ta_naddr > 0 ? pa : NULLPA);
}