Annotation of 43BSDReno/contrib/isode-beta/ronot/ronotunbind1.c, revision 1.1

1.1     ! root        1: /* ronotunbind1.c - RONOT: Maps ABSTRACT-UNBIND onto A-RELEASE.REQUEST */
        !             2: 
        !             3: #ifndef        lint
        !             4: static char *rcsid = "$Header: /f/osi/ronot/RCS/ronotunbind1.c,v 7.1 90/07/26 14:34:01 mrose Exp $";
        !             5: #endif
        !             6: 
        !             7: /* 
        !             8:  * $Header: /f/osi/ronot/RCS/ronotunbind1.c,v 7.1 90/07/26 14:34:01 mrose Exp $
        !             9:  *
        !            10:  *
        !            11:  * $Log:       ronotunbind1.c,v $
        !            12:  * Revision 7.1  90/07/26  14:34:01  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.REQUEST */
        !            37: 
        !            38: /* ARGSUSED */
        !            39: 
        !            40: int      RoUnBindRequest (sd, unbindargpe, secs, acr, rni)
        !            41: int                      sd;
        !            42: PE                       unbindargpe;
        !            43: int                      secs;
        !            44: struct AcSAPrelease    * acr;
        !            45: struct RoNOTindication * rni;
        !            46: {
        !            47:        int                       result;
        !            48:        PE                        user_data;
        !            49:        PE                      * user_data_p = &(user_data);
        !            50:        int                       ndata;
        !            51:        struct AcSAPindication    aci_s;
        !            52:        struct AcSAPindication  * aci = &aci_s;
        !            53:        struct AcSAPabort       * aca = &(aci->aci_abort);
        !            54: 
        !            55: 
        !            56:        if (unbindargpe != NULLPE)
        !            57:        {
        !            58:                if (encode_RONOT_UnBindArgumentValue (user_data_p, 1, 0, NULLCP, unbindargpe) == NOTOK)
        !            59:                { 
        !            60:                        LLOG (rosap_log, LLOG_EXCEPTIONS, ("RoUnbindRequest: encode_RONOT_UnBindArgumentValue failed"));
        !            61:                        return (ronotlose (rni, RBI_ENC_UNBIND_ARG, NULLCP, NULLCP));
        !            62:                }
        !            63:                (*user_data_p)->pe_context = unbindargpe->pe_context;
        !            64:                ndata = 1;
        !            65:        }
        !            66:        else
        !            67:        {
        !            68:                (*user_data_p) = NULLPE;
        !            69:                ndata = 0;
        !            70:        }
        !            71: 
        !            72:        result = AcRelRequest (sd, ACF_NORMAL, user_data_p, ndata, secs, acr, aci);
        !            73: 
        !            74:        if ((*user_data_p) != NULLPE)
        !            75:        {
        !            76:                pe_free ((*user_data_p));
        !            77:        }
        !            78: 
        !            79:        if (result == NOTOK)
        !            80:        {
        !            81:                if (aci->aci_abort.aca_reason == ACS_TIMER)
        !            82:                {
        !            83:                        /* ADT: Watch this !! */
        !            84:                        /* more work needed !!! */
        !            85:                        ACAFREE (aca);
        !            86:                        return (DONE);
        !            87:                }
        !            88:                else
        !            89:                {
        !            90:                        LLOG (rosap_log, LLOG_EXCEPTIONS, ("RoUnbindRequest: AcRelRequest failed"));
        !            91:                        (void) acs2ronotlose (rni, "RO-UNBIND.REQUEST", aca);
        !            92:                        ACAFREE (aca);
        !            93:                        return (NOTOK);
        !            94:                }
        !            95:        }
        !            96:        else
        !            97:        {
        !            98:                if (ParseRoUnBindResponse (acr, rni) != OK)
        !            99:                {
        !           100:                        LLOG (rosap_log, LLOG_EXCEPTIONS, ("RoUnbindRequest: ParseRoUnBindResponse failed"));
        !           101:                        ACRFREE (acr);
        !           102:                        return (NOTOK);
        !           103:                }
        !           104:        }
        !           105: 
        !           106:        return (result);
        !           107: }
        !           108: 
        !           109: /*    RO-UNBIND.RETRY */
        !           110: 
        !           111: /* ARGSUSED */
        !           112: 
        !           113: int      RoUnBindRetry (sd, secs, acr, rni)
        !           114: int                      sd;
        !           115: int                      secs;
        !           116: struct AcSAPrelease    * acr;
        !           117: struct RoNOTindication * rni;
        !           118: {
        !           119:        int                       result;
        !           120:        struct AcSAPindication    aci_s;
        !           121:        struct AcSAPindication  * aci = &(aci_s);
        !           122:        struct AcSAPabort       * aca = &(aci->aci_abort);
        !           123: 
        !           124:        result = AcRelRetryRequest (sd, secs, acr, aci);
        !           125: 
        !           126:        if (result == NOTOK)
        !           127:        {
        !           128:                if (aci->aci_abort.aca_reason == ACS_TIMER)
        !           129:                {
        !           130:                        /* ADT: Watch out for this */
        !           131:                        /* more work needed !!! */
        !           132:                        ACAFREE (aca);
        !           133:                        return (DONE);
        !           134:                }
        !           135:                else
        !           136:                {
        !           137:                        LLOG (rosap_log, LLOG_EXCEPTIONS, ("RoUnbindRetry: AcRelRetryRequest failed"));
        !           138:                        (void) acs2ronotlose (rni, "RO-UNBIND.RETRY", aca);
        !           139:                        ACAFREE (aca);
        !           140:                        return (NOTOK);
        !           141:                }
        !           142:        }
        !           143:        else
        !           144:        {
        !           145:                if (ParseRoUnBindResponse (acr, rni) != OK)
        !           146:                {
        !           147:                        LLOG (rosap_log, LLOG_EXCEPTIONS, ("RoUnbindRetry: ParseRoUnBindResponse failed"));
        !           148:                        ACRFREE (acr);
        !           149:                        return (NOTOK);
        !           150:                }
        !           151:        }
        !           152: 
        !           153:        return (result);
        !           154: }
        !           155: 
        !           156: int      ParseRoUnBindResponse (acr, rni)
        !           157: struct AcSAPrelease    * acr;
        !           158: struct RoNOTindication * rni;
        !           159: {
        !           160:        PE        pe;
        !           161: 
        !           162:        if (acr->acr_ninfo == 0)
        !           163:                return (OK);
        !           164: 
        !           165:        if (acr->acr_ninfo != 1)
        !           166:                return (ronotlose (rni, RBI_DEC_NINFO, NULLCP, NULLCP));
        !           167: 
        !           168:        if (acr->acr_info[0] == NULLPE)
        !           169:                return (ronotlose (rni, RBI_DEC_NINFO, NULLCP, NULLCP));
        !           170: 
        !           171:        /* ADT: Can we get rid of this copy? */
        !           172:        pe = acr->acr_info[0];
        !           173:        acr->acr_info[0] = NULLPE;
        !           174:        if (acr->acr_affirmative == ACS_ACCEPT)
        !           175:        {
        !           176:                if (decode_RONOT_UnBindResultValue (pe, 1, NULLIP, NULLVP, &acr->acr_info[0]) != OK)
        !           177:                {
        !           178:                        LLOG (rosap_log, LLOG_EXCEPTIONS, ("ParseRoUnBindResponse: decode_RONOT_UnBindResultValue failed"));
        !           179:                        acr->acr_ninfo = 0;
        !           180:                        pe_free (pe);
        !           181:                        return (ronotlose (rni, RBI_DEC_UNBIND_RES, NULLCP, NULLCP));
        !           182:                }
        !           183:        }
        !           184:        else
        !           185:        {
        !           186:                if (decode_RONOT_UnBindErrorValue (pe, 1, NULLIP, NULLVP, &acr->acr_info[0]) != OK)
        !           187:                {
        !           188:                        LLOG (rosap_log, LLOG_EXCEPTIONS, ("ParseRoUnBindResponse: decode_RONOT_UnBindErrorValue failed"));
        !           189:                        acr->acr_ninfo = 0;
        !           190:                        pe_free (pe);
        !           191:                        return (ronotlose (rni, RBI_DEC_UNBIND_RES, NULLCP, NULLCP));
        !           192:                }
        !           193:        }
        !           194:        pe_free (pe);
        !           195: 
        !           196:        return (OK);
        !           197: }
        !           198: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.