|
|
1.1 ! root 1: /* tsaperror.c - print out TPKT error codes */ ! 2: ! 3: #ifndef lint ! 4: static char *rcsid = "$Header: /f/osi/tsap/RCS/tsaperror.c,v 7.0 89/11/23 22:30:43 mrose Rel $"; ! 5: #endif ! 6: ! 7: /* ! 8: * $Header: /f/osi/tsap/RCS/tsaperror.c,v 7.0 89/11/23 22:30:43 mrose Rel $ ! 9: * ! 10: * ! 11: * $Log: tsaperror.c,v $ ! 12: * Revision 7.0 89/11/23 22:30:43 mrose ! 13: * Release 6.0 ! 14: * ! 15: */ ! 16: ! 17: /* ! 18: * NOTICE ! 19: * ! 20: * Acquisition, use, and distribution of this module and related ! 21: * materials are subject to the restrictions of a license agreement. ! 22: * Consult the Preface in the User's Manual for the full terms of ! 23: * this agreement. ! 24: * ! 25: */ ! 26: ! 27: ! 28: /* LINTLIBRARY */ ! 29: ! 30: #include <stdio.h> ! 31: #include "tsap.h" ! 32: ! 33: /* */ ! 34: ! 35: static char *disc_err0[] = { ! 36: "Reason not specified", ! 37: "Congestion at TSAP", ! 38: "Session entity not attached to TSAP", ! 39: "Address unknown" ! 40: }; ! 41: ! 42: static int disc_err0_cnt = sizeof disc_err0 / sizeof disc_err0[0]; ! 43: ! 44: ! 45: static char *disc_err8[] = { ! 46: "Normal disconnect initiated by session entity", ! 47: "Remote transport entity congestion at connect time", ! 48: "Connection negotiation failed (proposed class(es) not supported)", ! 49: "Duplicate source reference detected for the same pair of NSAPs", ! 50: "Mismatched references", ! 51: "Protocol error", ! 52: "Not used", ! 53: "Reference overflow", ! 54: "Connect request refused on this network connection", ! 55: "Not used", ! 56: "Header or parameter length invalid", ! 57: "Network disconnect", ! 58: "Invalid parameter", ! 59: "Invalid operation", ! 60: "Timer expired", ! 61: "Indications waiting" ! 62: }; ! 63: ! 64: static int disc_err8_cnt = sizeof disc_err8 / sizeof disc_err8[0]; ! 65: ! 66: /* */ ! 67: ! 68: char *TErrString(code) ! 69: register int code; ! 70: { ! 71: register int fcode; ! 72: static char buffer[BUFSIZ]; ! 73: ! 74: code &= 0xff; ! 75: if (code & DR_BASE) { ! 76: if ((fcode = code & ~DR_BASE) < disc_err8_cnt) ! 77: return disc_err8[fcode]; ! 78: } ! 79: else ! 80: if (code < disc_err0_cnt) ! 81: return disc_err0[code]; ! 82: ! 83: (void) sprintf (buffer, "unknown error code 0x%x", code); ! 84: return buffer; ! 85: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.