|
|
1.1 ! root 1: /* ronotunbind2.c - RONOT: ABSTRACT-BIND mapping onto A-RELEASE.RESPONSE */ ! 2: ! 3: #ifndef lint ! 4: static char *rcsid = "$Header: /f/osi/ronot/RCS/ronotunbind2.c,v 7.1 90/07/26 14:34:03 mrose Exp $"; ! 5: #endif ! 6: ! 7: /* ! 8: * $Header: /f/osi/ronot/RCS/ronotunbind2.c,v 7.1 90/07/26 14:34:03 mrose Exp $ ! 9: * ! 10: * ! 11: * $Log: ronotunbind2.c,v $ ! 12: * Revision 7.1 90/07/26 14:34:03 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 "tailor.h" ! 31: #include "logger.h" ! 32: #include "ronot.h" ! 33: #include "RONOT-types.h" ! 34: ! 35: ! 36: /* RO-UNBIND.INDICATION */ ! 37: ! 38: /* ARGSUSED */ ! 39: ! 40: int RoUnBindInit (sd, acf, rni) ! 41: int sd; ! 42: struct AcSAPfinish * acf; ! 43: struct RoNOTindication * rni; ! 44: { ! 45: /* ! 46: * What is provided here is in-line handling of the ! 47: * (usually NULL) user data as an unbind argument value. ! 48: * ! 49: * A plausible alternative approach is to add a new finish ! 50: * routine (in place of AcFINISHser) as an element in a ! 51: * new ros-mapping structure so that RoWaitRequest performed ! 52: * this automatically for RO-Notation users. ! 53: */ ! 54: ! 55: PE pe; ! 56: ! 57: if (acf->acf_ninfo == 0) ! 58: return (OK); ! 59: ! 60: if (acf->acf_ninfo != 1) ! 61: return (ronotlose (rni, RBI_DEC_NINFO, NULLCP, NULLCP)); ! 62: ! 63: if (acf->acf_info[0] == NULLPE) ! 64: return (ronotlose (rni, RBI_DEC_NINFO, NULLCP, NULLCP)); ! 65: ! 66: pe = acf->acf_info[0]; ! 67: acf->acf_info[0] = NULLPE; ! 68: if (decode_RONOT_UnBindArgumentValue (pe, 1, NULLIP, NULLVP, &(acf->acf_info[0])) != OK) ! 69: { ! 70: LLOG (rosap_log, LLOG_EXCEPTIONS, ("RO-UNBIND.INDICATION: decode_RONOT_UnBindArgumentValue failed")); ! 71: acf->acf_ninfo = 0; ! 72: pe_free (pe); ! 73: return (ronotlose (rni, RBI_DEC_BIND_ARG, NULLCP, NULLCP)); ! 74: } ! 75: pe_free (pe); ! 76: ! 77: return (OK); ! 78: } ! 79: ! 80: /* RO-UNBIND.RESULT */ ! 81: ! 82: /* ARGSUSED */ ! 83: ! 84: int RoUnBindResult (sd, unbindrespe, rni) ! 85: int sd; ! 86: PE unbindrespe; ! 87: struct RoNOTindication * rni; ! 88: { ! 89: int result; ! 90: PE user_data; ! 91: PE * user_data_p = &(user_data); ! 92: int ndata; ! 93: struct AcSAPindication aci_s; ! 94: struct AcSAPindication * aci = &(aci_s); ! 95: struct AcSAPabort * aca = &(aci->aci_abort); ! 96: ! 97: ! 98: if (unbindrespe != NULLPE) ! 99: { ! 100: if (encode_RONOT_UnBindResultValue (user_data_p, 1, 0, NULLCP, unbindrespe) == NOTOK) ! 101: { ! 102: LLOG (rosap_log, LLOG_EXCEPTIONS, ("RoUnBindResult: encode_RONOT_UnBindResultValue failed")); ! 103: return (ronotlose (rni, RBI_ENC_UNBIND_RES, NULLCP, NULLCP)); ! 104: } ! 105: (*user_data_p)->pe_context = unbindrespe->pe_context; ! 106: ndata = 1; ! 107: } ! 108: else ! 109: { ! 110: (*user_data_p) = NULLPE; ! 111: ndata = 0; ! 112: } ! 113: ! 114: result = AcRelResponse (sd, ACS_ACCEPT, ACF_NORMAL, user_data_p, ndata, aci); ! 115: ! 116: if ((*user_data_p) != NULLPE) ! 117: { ! 118: pe_free ((*user_data_p)); ! 119: } ! 120: ! 121: if (result == NOTOK) ! 122: { ! 123: LLOG (rosap_log, LLOG_EXCEPTIONS, ("RoUnBindResult: AcRelResponse failed")); ! 124: /* Have an AcSAPindication, need to return RoNOTindication */ ! 125: (void) acs2ronotlose (rni, "RO-UNBIND.RESULT", aca); ! 126: ACAFREE (aca); ! 127: return (NOTOK); ! 128: } ! 129: ! 130: return (result); ! 131: } ! 132: ! 133: /* RO-UNBIND.ERROR */ ! 134: ! 135: /* ARGSUSED */ ! 136: ! 137: int RoUnBindError (sd, unbinderrpe, rni) ! 138: int sd; ! 139: PE unbinderrpe; ! 140: struct RoNOTindication * rni; ! 141: { ! 142: int result; ! 143: PE user_data; ! 144: PE * user_data_p = &(user_data); ! 145: int ndata; ! 146: struct AcSAPindication aci_s; ! 147: struct AcSAPindication * aci = &(aci_s); ! 148: struct AcSAPabort * aca = &(aci->aci_abort); ! 149: ! 150: ! 151: if (unbinderrpe != NULLPE) ! 152: { ! 153: if (encode_RONOT_UnBindErrorValue (user_data_p, 1, 0, NULLCP, unbinderrpe) == NOTOK) ! 154: { ! 155: LLOG (rosap_log, LLOG_EXCEPTIONS, ("RoUnBindError: encode_RONOT_UnBindErrorValue failed")); ! 156: return (ronotlose (rni, RBI_ENC_UNBIND_ERR, NULLCP, NULLCP)); ! 157: } ! 158: (*user_data_p)->pe_context = unbinderrpe->pe_context; ! 159: ndata = 1; ! 160: } ! 161: else ! 162: { ! 163: (*user_data_p) = NULLPE; ! 164: ndata = 0; ! 165: } ! 166: ! 167: result = AcRelResponse (sd, ACS_REJECT, ACR_NOTFINISHED, user_data_p, ndata, aci); ! 168: ! 169: if ((*user_data_p) != NULLPE) ! 170: { ! 171: pe_free ((*user_data_p)); ! 172: } ! 173: ! 174: if (result == NOTOK) ! 175: { ! 176: LLOG (rosap_log, LLOG_EXCEPTIONS, ("RoUnBindError: AcRelResponse failed")); ! 177: (void) acs2ronotlose (rni, "RO-UNBIND.ERROR", aca); ! 178: ACAFREE (aca); ! 179: return (NOTOK); ! 180: } ! 181: ! 182: return (result); ! 183: } ! 184: ! 185: /* RO-UNBIND.REJECT */ ! 186: ! 187: /* ARGSUSED */ ! 188: ! 189: int RoUnBindReject (sd, status, reason, rni) ! 190: int sd; ! 191: int status; ! 192: int reason; ! 193: struct RoNOTindication * rni; ! 194: { ! 195: int result; ! 196: struct AcSAPindication aci_s; ! 197: struct AcSAPindication * aci = &(aci_s); ! 198: struct AcSAPabort * aca = &(aci->aci_abort); ! 199: ! 200: LLOG (rosap_log, LLOG_EXCEPTIONS, ("RoUnBindReject: RO-UNBIND.REJECT called on %d", sd)); ! 201: ! 202: result = AcRelResponse (sd, status, reason, NULLPEP, 0, aci); ! 203: ! 204: if (result == NOTOK) ! 205: { ! 206: LLOG (rosap_log, LLOG_EXCEPTIONS, ("RoUnBindReject: AcRelResponse failed")); ! 207: (void) acs2ronotlose (rni, "RO-UNBIND.ERROR", aca); ! 208: ACAFREE (aca); ! 209: return (NOTOK); ! 210: } ! 211: ! 212: return (result); ! 213: } ! 214:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.