|
|
Power 6/32 Unix version 1.21
/* D.L.Buck and Associates, Inc. - 8/27/84
*
* COPYRIGHT NOTICE:
* Copyright c 8/27/84 - An unpublished work by
* D.L.Buck and Associates, Inc.
*
* PROPRIETARY RIGHTS NOTICE:
* All rights reserved. This document and program contains
* proprietary information of D.L.Buck and Associates,Inc.
* of San Jose, California, U.S.A., embodying confidential
* information, ideas, and expressions, no part of which
* may be reproduced, or transmitted in any form or by any
* means, electronic, mechanical, or otherwise, without
* the written permission of D.L.Buck and Associates, Inc.
*
* NAME
* get_errors
*
* SYNOPSIS
* get_errors()
*
* DESCRIPTION
* get_errors - deal with transmit/receive errors - called from em3280
* RETURNS:
* 1 for `nasty' errors, 0 for `tame' errors
*/
#include <stdio.h>
#include "local.h"
#include <bsc/bscio.h>
#include <errno.h>
#include <empr.h>
char *bsc_errlist[] = {
"Internal error 0",
"Protocol error by remote host ",
"RVI abort ",
"NBID limit exceeded ",
"NNAK limit exceeded ",
"NRETRY limit exceeded ",
"NTTD limit exceeded ",
"NWACK limit exceeded ",
"No DSR indication from modem ",
"Transmit timeout ",
"Idle receive timeout ",
"Remote end sent DISC (DLE-EOT) ",
"Remote end aborted our sending ",
"Remote end aborted their sending ",
"Wrong host id ",
"Block received in transparent mode (not an error) ",
"Block began with SOH (not an error) ",
"Line contention (not an error) "
};
extern struct bscio p;
extern int devfd;
extern int errno;
extern char *sys_errlist[];
extern char devname[];
extern char note[];
#ifndef lint
static char sccsid[] = "@(#)emperrs.c 1.4 ";
#endif
get_errors()
{
/* check errno for system error */
if (errno == EINTR || errno == EINVAL)
return 1;
if (errno == EAGAIN)
return 0;
if (errno && errno != EIO) {
sprintf(note,"System error: %s",sys_errlist[errno]);
fprintf(stderr,"%s\n",note);
write_aud("E",note);
return 1;
}
/* do ioctl to get b_flags */
ioctl(devfd,BSCGET,&p);
switch(p.b_flags) {
case BSCPROTO:
case BSCRVI:
case BSCNBID:
case BSCNNAK:
case BSCNRETR:
case BSCNTTD:
case BSCNWACK:
case BSCNDSR:
case BSCTXTO:
case BSCDSC:
sprintf(note,"Comm.check: %s",bsc_errlist[p.b_flags]);
fprintf(stderr,"%s\n",note);
write_aud("E",note);
return 1;
case BSCRXTO:
case BSCRABT:
case BSCEEOF:
case BSCWHI:
case BSCTXP:
case BSCBSOH:
case BSCONTND:
default:
return 0;
}
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.