|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T t
Length: 3935 (0xf5f)
Types: TextFile
Names: »tsaprespond.c«
└─⟦3d0c2be1b⟧ Bits:30001254 ISODE-5.0 Tape
└─⟦eba4602b1⟧ »./isode-5.0.tar.Z«
└─⟦d3ac74d73⟧
└─⟦this⟧ »isode-5.0/tsap/tsaprespond.c«
/* tsaprespond.c - TPM: responder */
#ifndef lint
static char *rcsid = "$Header: /f/osi/tsap/RCS/tsaprespond.c,v 6.0 89/03/18 23:45:37 mrose Rel $";
#endif
/*
* $Header: /f/osi/tsap/RCS/tsaprespond.c,v 6.0 89/03/18 23:45:37 mrose Rel $
*
*
* $Log: tsaprespond.c,v $
* Revision 6.0 89/03/18 23:45:37 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 "tpkt.h"
#include "tailor.h"
/* \f
T-CONNECT.INDICATION */
int TInit (vecp, vec, ts, td)
register int vecp;
register char **vec;
register struct TSAPstart *ts;
register struct TSAPdisconnect *td;
{
register struct tsapblk *tb;
isodetailor (NULLCP, 0);
if (vecp < 3)
return tsaplose (td, DR_PARAMETER, NULLCP,
"bad initialization vector");
missingP (vec);
missingP (ts);
missingP (td);
if ((tb = newtblk ()) == NULL)
return tsaplose (td, DR_CONGEST, NULLCP, "out of memory");
vec += vecp - 2;
switch (*vec[0]) {
case NT_TCP:
#ifdef TCP
if (tcprestore (tb, vec[0] + 1, td) == NOTOK)
goto out;
break;
#else
goto not_supported;
#endif
case NT_X25:
#ifdef X25
if (x25restore (tb, vec[0] + 1, td) == NOTOK)
goto out;
break;
#else
goto not_supported;
#endif
case NT_CONS:
#ifdef CONS
if (consrestore (tb, vec[0] + 1, td) == NOTOK)
goto out;
break;
#else
goto not_supported;
#endif
case NT_BRG:
#ifdef BRIDGE_X25
if (bridgerestore (tb, vec[0] + 1, td) == NOTOK)
goto out;
break;
#else
goto not_supported;
#endif
case NT_WIN:
#if defined(TP4) && defined(WINTLI)
if (tp4restore (tb, vec[0] + 1, td) == NOTOK)
goto out;
break;
#else
goto not_supported;
#endif
case NT_SUN:
#ifdef SUN_TP4
if (tp4restore (tb, vec[0] + 1, td) == NOTOK)
goto out;
break;
#else
goto not_supported;
#endif
default:
(void) tsaplose (td, DR_PARAMETER, NULLCP,
"unknown network type: 0x%x (%c)", *vec[0], *vec[0]);
goto out;
}
bzero (vec[0], strlen (vec[0]));
if ((*tb -> tb_startPfnx) (tb, vec[1], ts, td) == NOTOK)
goto out;
bzero (vec[1], strlen (vec[1]));
*vec = NULL;
return OK;
not_supported: ;
(void) tsaplose (td, DR_PARAMETER, NULLCP,
"not configured for network type: 0x%x (%c)",
*vec[0], *vec[0]);
out: ;
freetblk (tb);
return NOTOK;
}
/* \f
T-CONNECT.RESPONSE */
int TConnResponse (sd, responding, expedited, data, cc, qos, td)
int sd;
register struct TSAPaddr *responding;
int expedited,
cc;
char *data;
struct QOStype *qos;
register struct TSAPdisconnect *td;
{
int result;
register struct tsapblk *tb;
if ((tb = findtblk (sd)) == NULL || (tb -> tb_flags & TB_CONN))
return tsaplose (td, DR_PARAMETER, NULLCP, "invalid transport descriptor");
#ifdef notdef
missingP (responding);
#endif
if (responding) {
if (bcmp ((char *) &tb -> tb_responding, (char *) responding,
sizeof *responding))
tb -> tb_responding = *responding; /* struct copy */
else
responding = NULLTA;
}
if (expedited && !(tb -> tb_flags & TB_EXPD))
return tsaplose (td, DR_PARAMETER, NULLCP,
"expedited service not available");
toomuchP (data, cc, TC_SIZE, "initial");
#ifdef notdef
missingP (qos);
#endif
missingP (td);
if (!expedited)
tb -> tb_flags &= ~TB_EXPD;
if ((result = (*tb -> tb_acceptPfnx) (tb, responding ? 1 : 0, data, cc,
qos, td)) == NOTOK)
freetblk (tb);
#ifdef X25
else
if (tb -> tb_flags & TB_X25)
LLOG (x25_log, LLOG_NOTICE,
("connection %d from %s",
sd, na2str (tb -> tb_initiating.ta_addrs)));
#endif
return result;
}