|
|
1.1 ! root 1: /* acsaplose.c - ACPM: you lose */ ! 2: ! 3: #ifndef lint ! 4: static char *rcsid = "$Header: /f/osi/acsap/RCS/acsaplose.c,v 7.1 90/07/01 21:01:58 mrose Exp $"; ! 5: #endif ! 6: ! 7: /* ! 8: * $Header: /f/osi/acsap/RCS/acsaplose.c,v 7.1 90/07/01 21:01:58 mrose Exp $ ! 9: * ! 10: * ! 11: * $Log: acsaplose.c,v $ ! 12: * Revision 7.1 90/07/01 21:01:58 mrose ! 13: * pepsy ! 14: * ! 15: * Revision 7.0 89/11/23 21:21:52 mrose ! 16: * Release 6.0 ! 17: * ! 18: */ ! 19: ! 20: /* ! 21: * NOTICE ! 22: * ! 23: * Acquisition, use, and distribution of this module and related ! 24: * materials are subject to the restrictions of a license agreement. ! 25: * Consult the Preface in the User's Manual for the full terms of ! 26: * this agreement. ! 27: * ! 28: */ ! 29: ! 30: ! 31: /* LINTLIBRARY */ ! 32: ! 33: #include <stdio.h> ! 34: #include <varargs.h> ! 35: #include "ACS-types.h" ! 36: #define ACSE ! 37: #include "acpkt.h" ! 38: #include "tailor.h" ! 39: ! 40: /* */ ! 41: ! 42: #ifndef lint ! 43: int acpktlose (va_alist) ! 44: va_dcl ! 45: { ! 46: int reason, ! 47: result; ! 48: PE pe; ! 49: register struct assocblk *acb; ! 50: register struct AcSAPindication *aci; ! 51: struct PSAPindication pis; ! 52: struct type_ACS_ABRT__apdu pdus; ! 53: register struct type_ACS_ABRT__apdu *pdu = &pdus; ! 54: va_list ap; ! 55: ! 56: va_start (ap); ! 57: ! 58: acb = va_arg (ap, struct assocblk *); ! 59: aci = va_arg (ap, struct AcSAPindication *); ! 60: reason = va_arg (ap, int); ! 61: ! 62: result = _acsaplose (aci, reason, ap); ! 63: ! 64: va_end (ap); ! 65: ! 66: if (acb == NULLACB || acb -> acb_fd == NOTOK) ! 67: return result; ! 68: ! 69: if (acb -> acb_sversion == 1) { ! 70: if (PUAbortRequest (acb -> acb_fd, NULLPEP, 0, &pis) != NOTOK) ! 71: acb -> acb_fd = NOTOK; ! 72: ! 73: return result; ! 74: } ! 75: ! 76: pdu -> abort__source = int_ACS_abort__source_acse__service__provider; ! 77: pdu -> user__information = NULL; ! 78: ! 79: pe = NULLPE; ! 80: if (encode_ACS_ABRT__apdu (&pe, 1, 0, NULLCP, pdu) != NOTOK) { ! 81: pe -> pe_context = acb -> acb_id; ! 82: ! 83: PLOGP (acsap_log,ACS_ACSE__apdu, pe, "ABRT-apdu", 0); ! 84: ! 85: if (PUAbortRequest (acb -> acb_fd, &pe, 1, &pis) != NOTOK) ! 86: acb -> acb_fd = NOTOK; ! 87: } ! 88: if (pe) ! 89: pe_free (pe); ! 90: ! 91: return result; ! 92: } ! 93: #else ! 94: /* VARARGS5 */ ! 95: ! 96: int acpktlose (acb, aci, reason, what, fmt) ! 97: struct assocblk *acb; ! 98: struct AcSAPindication *aci; ! 99: int reason; ! 100: char *what, ! 101: *fmt; ! 102: { ! 103: return acpktlose (acb, aci, reason, what, fmt); ! 104: } ! 105: #endif ! 106: ! 107: /* */ ! 108: ! 109: #ifndef lint ! 110: int acsaplose (va_alist) ! 111: va_dcl ! 112: { ! 113: int reason, ! 114: result; ! 115: struct AcSAPindication *aci; ! 116: va_list ap; ! 117: ! 118: va_start (ap); ! 119: ! 120: aci = va_arg (ap, struct AcSAPindication *); ! 121: reason = va_arg (ap, int); ! 122: ! 123: result = _acsaplose (aci, reason, ap); ! 124: ! 125: va_end (ap); ! 126: ! 127: return result; ! 128: } ! 129: #else ! 130: /* VARARGS4 */ ! 131: ! 132: int acsaplose (aci, reason, what, fmt) ! 133: struct AcSAPindication *aci; ! 134: int reason; ! 135: char *what, ! 136: *fmt; ! 137: { ! 138: return acsaplose (aci, reason, what, fmt); ! 139: } ! 140: #endif ! 141: ! 142: /* */ ! 143: ! 144: #ifndef lint ! 145: static int _acsaplose (aci, reason, ap) /* what, fmt, args ... */ ! 146: register struct AcSAPindication *aci; ! 147: int reason; ! 148: va_list ap; ! 149: { ! 150: register char *bp; ! 151: char buffer[BUFSIZ]; ! 152: register struct AcSAPabort *aca; ! 153: ! 154: if (aci) { ! 155: bzero ((char *) aci, sizeof *aci); ! 156: aci -> aci_type = ACI_ABORT; ! 157: aca = &aci -> aci_abort; ! 158: ! 159: asprintf (bp = buffer, ap); ! 160: bp += strlen (bp); ! 161: ! 162: aca -> aca_source = ACA_LOCAL; ! 163: aca -> aca_reason = reason; ! 164: copyAcSAPdata (buffer, bp - buffer, aca); ! 165: } ! 166: ! 167: return NOTOK; ! 168: } ! 169: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.