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 t

⟦e9f72b393⟧ TextFile

    Length: 3210 (0xc8a)
    Types: TextFile
    Names: »tsaplose.c«

Derivation

└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
    └─⟦e83f91978⟧ »EurOpenD22/isode/osimis-2.0.tar.Z« 
        └─⟦d846658bd⟧ 
            └─⟦this⟧ »osimis/misode/tsap/tsaplose.c« 
└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
    └─⟦35176feda⟧ »EurOpenD22/isode/isode-6.tar.Z« 
        └─⟦de7628f85⟧ 
            └─⟦this⟧ »isode-6.0/tsap/tsaplose.c« 

TextFile

/* tsaplose.c - TPM: you lose */


#ifndef	lint
static char *rcsid = "$Header: /f/osi/tsap/RCS/tsaplose.c,v 7.1 89/12/07 22:15:50 mrose Exp $";
#endif

/* 
 * $Header: /f/osi/tsap/RCS/tsaplose.c,v 7.1 89/12/07 22:15:50 mrose Exp $
 *
 *
 * $Log:	tsaplose.c,v $
 * Revision 7.1  89/12/07  22:15:50  mrose
 * touch-up
 * 
 * Revision 7.0  89/11/23  22:30:51  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 <varargs.h>
#include "tpkt.h"
#include "mpkt.h"
#include "tailor.h"


#ifdef	LPP
#undef	MGMT
#endif

/* \f

 */

#ifndef	lint
int	tpktlose (va_alist)
va_dcl
{
    int	    reason,
    	    result;
    register struct tsapblk *tb;
    struct TSAPdisconnect   tds;
    register struct TSAPdisconnect  *td;
    va_list ap;

    va_start (ap);

    tb = va_arg (ap, struct tsapblk *);

    td = va_arg (ap, struct TSAPdisconnect *);
    if (td == NULL)
	td = &tds;

    reason = va_arg (ap, int);

    result = _tsaplose (td, reason, ap);

    va_end (ap);

    if (td -> td_cc > 0) {
	SLOG (tsap_log, LLOG_EXCEPTIONS, NULLCP,
	  ("tpktlose [%s] %*.*s", TErrString (td -> td_reason), td -> td_cc,
	   td -> td_cc, td -> td_data));
    }
    else
	SLOG (tsap_log, LLOG_EXCEPTIONS, NULLCP,
	      ("tpktlose [%s]", TErrString (td -> td_reason)));

#ifdef  MGMT
    if (tb -> tb_manfnx)
	switch (reason) {
	    case DR_REMOTE:
	    case DR_CONGEST:
	        (*tb -> tb_manfnx) (CONGEST, tb);
		break;

	    case DR_PROTOCOL:
	    case DR_MISMATCH:
		(*tb -> tb_manfnx) (PROTERR, tb);
		break;

	    case DR_SESSION:
	    case DR_ADDRESS:
	    case DR_CONNECT:
	    case DR_DUPLICATE:
	    case DR_OVERFLOW:
	    case DR_REFUSED:
		(*tb -> tb_manfnx) (CONFIGBAD, tb);
		break;

	    default:
		(*tb -> tb_manfnx) (OPREQINBAD, tb);
	}
#endif

    (*tb -> tb_losePfnx) (tb, reason, td);

    return result;
}
#else
/* VARARGS5 */

int	tpktlose (tb, td, reason, what, fmt)
struct tsapblk *tb;
struct TSAPdisconnect *td;
int	reason;
char   *what,
       *fmt;
{
    return tpktlose (tb, td, reason, what, fmt);
}
#endif

/* \f

 */

#ifndef	lint
int	tsaplose (va_alist)
va_dcl
{
    int	    reason,
    	    result;
    struct TSAPdisconnect *td;
    va_list ap;

    va_start (ap);

    td = va_arg (ap, struct TSAPdisconnect *);
    reason = va_arg (ap, int);

    result = _tsaplose (td, reason, ap);

    va_end (ap);

    return result;

}
#else
/* VARARGS4 */

int	tsaplose (td, reason, what, fmt)
struct TSAPdisconnect *td;
int	reason;
char   *what,
       *fmt;
{
    return tsaplose (td, reason, what, fmt);
}
#endif

/* \f

 */

#ifndef	lint
static int  _tsaplose (td, reason, ap)	/* what, fmt, args ... */
register struct TSAPdisconnect *td;
int     reason;
va_list	ap;
{
    register char  *bp;
    char    buffer[BUFSIZ];

    if (td) {
	bzero ((char *) td, sizeof *td);

	asprintf (bp = buffer, ap);
	bp += strlen (bp);

	td -> td_reason = reason;
	copyTSAPdata (buffer, bp - buffer, td);
    }

    return NOTOK;
}
#endif