|
|
1.1 ! root 1: /* ronotlose.c - RONOT: Support for ABSTRACT-BIND mappings */ ! 2: ! 3: #ifndef lint ! 4: static char *rcsid = "$Header: /f/osi/ronot/RCS/ronotlose.c,v 7.1 90/07/26 14:33:59 mrose Exp $"; ! 5: #endif ! 6: ! 7: /* ! 8: * $Header: /f/osi/ronot/RCS/ronotlose.c,v 7.1 90/07/26 14:33:59 mrose Exp $ ! 9: * ! 10: * ! 11: * $Log: ronotlose.c,v $ ! 12: * Revision 7.1 90/07/26 14:33:59 mrose ! 13: * template ! 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 <varargs.h> ! 32: #include "tailor.h" ! 33: #include "logger.h" ! 34: #include "ronot.h" ! 35: ! 36: /* */ ! 37: ! 38: #ifndef lint ! 39: int ronotlose (va_alist) ! 40: va_dcl ! 41: { ! 42: int reason, ! 43: result; ! 44: struct RoNOTindication *rni; ! 45: va_list ap; ! 46: ! 47: va_start (ap); ! 48: ! 49: rni = va_arg (ap, struct RoNOTindication *); ! 50: reason = va_arg (ap, int); ! 51: ! 52: result = _ronotlose (rni, reason, ap); ! 53: ! 54: va_end (ap); ! 55: ! 56: return result; ! 57: } ! 58: #else ! 59: /* VARARGS4 */ ! 60: ! 61: int ronotlose (rni, reason, what, fmt) ! 62: struct RoNOTindication *rni; ! 63: int reason; ! 64: char *what, ! 65: *fmt; ! 66: { ! 67: return ronotlose (rni, reason, what, fmt); ! 68: } ! 69: #endif ! 70: ! 71: /* */ ! 72: ! 73: #ifndef lint ! 74: static int _ronotlose (rni, reason, ap) /* what, fmt, args ... */ ! 75: register struct RoNOTindication *rni; ! 76: int reason; ! 77: va_list ap; ! 78: { ! 79: register char *bp; ! 80: char buffer[BUFSIZ]; ! 81: ! 82: if (rni) { ! 83: bzero ((char *) rni, sizeof *rni); ! 84: rni -> rni_reason = reason; ! 85: ! 86: asprintf (bp = buffer, ap); ! 87: bp += strlen (bp); ! 88: ! 89: copyRoNOTdata (buffer, bp - buffer, rni); ! 90: } ! 91: ! 92: return NOTOK; ! 93: } ! 94: #endif ! 95: ! 96: /* ACSAP interface */ ! 97: ! 98: int acs2ronotlose (rni, event, aca) ! 99: struct RoNOTindication * rni; ! 100: char * event; ! 101: struct AcSAPabort * aca; ! 102: { ! 103: ! 104: char * cp; ! 105: char buffer[BUFSIZ]; ! 106: ! 107: /* ! 108: * ADT: Not sure about having events logged from the BIND abstraction, ! 109: * since it is a MACRO defined abstraction and not a level or ASE. ! 110: * Currently not performed but would be something like the following: ! 111: */ ! 112: /* ! 113: if (event) ! 114: SLOG (addr_log, LLOG_EXCEPTIONS, NULLCP, ! 115: ((aca->aca_cc > 0) ? "%s: %s [%*.*s]" : "%s: %s", ! 116: event, AcErrString (aca->aca_reason), aca->aca_cc, ! 117: aca->aca_cc, aca->aca_data)); ! 118: */ ! 119: ! 120: /* event string used as (pseudo-)events label of the BIND abstraction */ ! 121: ! 122: if (event) ! 123: (void) sprintf (cp = buffer, " {%s} (%s at ACSE)", ! 124: event, AcErrString (aca->aca_reason)); ! 125: else ! 126: (void) sprintf (cp = buffer, " (%s at ACSE)", ! 127: AcErrString (aca->aca_reason)); ! 128: ! 129: if (aca->aca_cc > 0) ! 130: return (ronotlose (rni, RBI_ACSE, NULLCP, "%*.*s%s", ! 131: aca->aca_cc, aca->aca_cc, aca->aca_data, cp)); ! 132: else ! 133: return (ronotlose (rni, RBI_ACSE, NULLCP, "%s", cp)); ! 134: } ! 135:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.