|
|
1.1 ! root 1: /* ftamlose.c - FPM: you lose */ ! 2: ! 3: #ifndef lint ! 4: static char *rcsid = "$Header: /f/osi/ftam/RCS/ftamlose.c,v 7.0 89/11/23 21:53:43 mrose Rel $"; ! 5: #endif ! 6: ! 7: /* ! 8: * $Header: /f/osi/ftam/RCS/ftamlose.c,v 7.0 89/11/23 21:53:43 mrose Rel $ ! 9: * ! 10: * ! 11: * $Log: ftamlose.c,v $ ! 12: * Revision 7.0 89/11/23 21:53: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 <varargs.h> ! 32: #include "fpkt.h" ! 33: ! 34: /* */ ! 35: ! 36: #ifndef lint ! 37: int fpktlose (va_alist) ! 38: va_dcl ! 39: { ! 40: int observer, ! 41: reason, ! 42: result, ! 43: source; ! 44: struct FTAMindication ftis; ! 45: register struct ftamblk *fsb; ! 46: register struct FTAMindication *fti; ! 47: va_list ap; ! 48: ! 49: va_start (ap); ! 50: ! 51: fsb = va_arg (ap, struct ftamblk *); ! 52: fti = va_arg (ap, struct FTAMindication *); ! 53: reason = va_arg (ap, int); ! 54: ! 55: if (fsb -> fsb_flags & FSB_INIT) ! 56: observer = EREF_IFPM, source = EREF_RFPM; ! 57: else ! 58: observer = EREF_RFPM, source = EREF_IFPM; ! 59: ! 60: result = _ftamoops (fti, reason, 1, observer, source, ap); ! 61: ! 62: va_end (ap); ! 63: ! 64: if (fsb -> fsb_fd == NOTOK) ! 65: return result; ! 66: ! 67: (void) FAbortRequestAux (fsb, type_FTAM_PDU_f__p__abort__request, ! 68: FACTION_PERM, fti -> fti_abort.fta_diags, 1, ! 69: &ftis); ! 70: ! 71: return result; ! 72: } ! 73: #else ! 74: /* VARARGS5 */ ! 75: ! 76: int fpktlose (fsb, fti, reason, what, fmt) ! 77: struct ftamblk *fsb; ! 78: struct FTAMindication *fti; ! 79: int reason; ! 80: char *what, ! 81: *fmt; ! 82: { ! 83: return fpktlose (fsb, fti, reason, what, fmt); ! 84: } ! 85: #endif ! 86: ! 87: /* */ ! 88: ! 89: #ifndef lint ! 90: int ftamlose (va_alist) ! 91: va_dcl ! 92: { ! 93: int fatal, ! 94: reason, ! 95: result; ! 96: struct FTAMindication *fti; ! 97: va_list ap; ! 98: ! 99: va_start (ap); ! 100: ! 101: fti = va_arg (ap, struct FTAMindication *); ! 102: reason = va_arg (ap, int); ! 103: fatal = va_arg (ap, int); ! 104: ! 105: result = _ftamoops (fti, reason, fatal, EREF_NONE, EREF_NONE, ap); ! 106: ! 107: va_end (ap); ! 108: ! 109: return result; ! 110: } ! 111: #else ! 112: /* VARARGS4 */ ! 113: ! 114: int ftamlose (fti, reason, fatal, what, fmt) ! 115: register struct FTAMindication *fti; ! 116: int reason, ! 117: fatal; ! 118: char *what, ! 119: *fmt; ! 120: { ! 121: return ftamlose (fti, reason, fatal, what, fmt); ! 122: } ! 123: #endif ! 124: ! 125: /* */ ! 126: ! 127: #ifndef lint ! 128: int ftamoops (va_alist) ! 129: va_dcl ! 130: { ! 131: int reason, ! 132: result, ! 133: fatal, ! 134: observer, ! 135: source; ! 136: struct FTAMindication *fti; ! 137: va_list ap; ! 138: ! 139: va_start (ap); ! 140: ! 141: fti = va_arg (ap, struct FTAMindication *); ! 142: reason = va_arg (ap, int); ! 143: fatal = va_arg (ap, int); ! 144: observer = va_arg (ap, int); ! 145: source = va_arg (ap, int); ! 146: ! 147: result = _ftamoops (fti, reason, fatal, source, observer, ap); ! 148: ! 149: va_end (ap); ! 150: ! 151: return result; ! 152: } ! 153: ! 154: ! 155: static int _ftamoops (fti, reason, fatal, observer, source, ap) ! 156: register struct FTAMindication *fti; ! 157: int reason, ! 158: fatal, ! 159: observer, ! 160: source; ! 161: va_list ap; ! 162: { ! 163: register char *bp; ! 164: char buffer[BUFSIZ]; ! 165: register struct FTAMabort *fta; ! 166: register struct FTAMdiagnostic *ftd; ! 167: ! 168: if (fti) { ! 169: bzero ((char *) fti, sizeof *fti); ! 170: fti -> fti_type = FTI_ABORT; ! 171: fta = &fti -> fti_abort; ! 172: ! 173: asprintf (bp = buffer, ap); ! 174: bp += strlen (bp); ! 175: ! 176: fta -> fta_peer = 0; ! 177: fta -> fta_action = fatal ? FACTION_PERM : FACTION_TRANS; ! 178: ! 179: ftd = &fta -> fta_diags[0]; ! 180: ftd -> ftd_type = fatal ? DIAG_PERM : DIAG_TRANS; ! 181: ftd -> ftd_identifier = reason; ! 182: ftd -> ftd_observer = observer; ! 183: ftd -> ftd_source = source; ! 184: ftd -> ftd_delay = DIAG_NODELAY; ! 185: copyFTAMdata (buffer, bp - buffer, ftd); ! 186: ! 187: fta -> fta_ndiag = 1; ! 188: } ! 189: ! 190: return NOTOK; ! 191: } ! 192: #else ! 193: /* VARARGS7 */ ! 194: ! 195: int ftamoops (fti, reason, fatal, observer, source, what, fmt) ! 196: struct FTAMindication *fti; ! 197: int reason, ! 198: fatal, ! 199: observer, ! 200: source; ! 201: char *what, ! 202: *fmt; ! 203: { ! 204: return ftamoops (fti, reason, fatal, observer, source, what, fmt); ! 205: } ! 206: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.