Annotation of 43BSDReno/contrib/isode-beta/ftam/ftamrelease2.c, revision 1.1

1.1     ! root        1: /* ftamrelease2.c - FPM: respond to release */
        !             2: 
        !             3: #ifndef        lint
        !             4: static char *rcsid = "$Header: /f/osi/ftam/RCS/ftamrelease2.c,v 7.0 89/11/23 21:53:50 mrose Rel $";
        !             5: #endif
        !             6: 
        !             7: /* 
        !             8:  * $Header: /f/osi/ftam/RCS/ftamrelease2.c,v 7.0 89/11/23 21:53:50 mrose Rel $
        !             9:  *
        !            10:  *
        !            11:  * $Log:       ftamrelease2.c,v $
        !            12:  * Revision 7.0  89/11/23  21:53:50  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 <signal.h>
        !            32: #include "fpkt.h"
        !            33: 
        !            34: /*    F-TERMINATE.RESPONSE */
        !            35: 
        !            36: int    FTerminateResponse (sd, sharedASE, charging, fti)
        !            37: int    sd;
        !            38: PE     sharedASE;
        !            39: struct FTAMcharging *charging;
        !            40: struct FTAMindication *fti;
        !            41: {
        !            42:     SBV            smask;
        !            43:     int     result;
        !            44:     register struct ftamblk *fsb;
        !            45: 
        !            46:     if (charging && charging -> fc_ncharge > NFCHRG)
        !            47:        return ftamlose (fti, FS_GEN_NOREASON, 0, NULLCP,
        !            48:                        "too many charges");
        !            49:     missingP (fti);
        !            50: 
        !            51:     smask = sigioblock ();
        !            52: 
        !            53:     ftamFsig (fsb, sd);
        !            54: 
        !            55:     result = FTerminateResponseAux (fsb, sharedASE, charging, fti);
        !            56: 
        !            57:     (void) sigiomask (smask);
        !            58: 
        !            59:     return result;
        !            60: }
        !            61: 
        !            62: /*  */
        !            63: 
        !            64: static int  FTerminateResponseAux (fsb, sharedASE, charging, fti)
        !            65: register struct ftamblk *fsb;
        !            66: PE     sharedASE;
        !            67: struct FTAMcharging *charging;
        !            68: struct FTAMindication *fti;
        !            69: {
        !            70:     int     result;
        !            71:     PE     pe;
        !            72:     struct AcSAPindication  acis;
        !            73:     register struct AcSAPindication *aci = &acis;
        !            74:     register struct AcSAPabort *aca = &aci -> aci_abort;
        !            75:     register struct type_FTAM_PDU *pdu;
        !            76:     register struct type_FTAM_F__TERMINATE__response *rsp;
        !            77: 
        !            78:     pe = NULLPE;
        !            79:     if ((pdu = (struct type_FTAM_PDU *) calloc (1, sizeof *pdu)) == NULL) {
        !            80: no_mem: ;
        !            81:        (void) ftamlose (fti, FS_GEN (fsb), 1, NULLCP, "out of memory");
        !            82: out: ;
        !            83:        if (pe)
        !            84:            pe_free (pe);
        !            85:        if (pdu)
        !            86:            free_FTAM_PDU (pdu);
        !            87:        if (fti -> fti_abort.fta_action == FACTION_PERM)
        !            88:            freefsblk (fsb);
        !            89:        return NOTOK;
        !            90:     }
        !            91:     pdu -> offset = type_FTAM_PDU_f__terminate__response;
        !            92:     if ((rsp = (struct type_FTAM_F__TERMINATE__response *)
        !            93:                        calloc (1, sizeof *rsp)) == NULL)
        !            94:        goto no_mem;
        !            95:     pdu -> un.f__terminate__response = rsp;
        !            96:     if (sharedASE
        !            97:            && (rsp -> shared__ASE__information =
        !            98:                        shared2fpm (fsb, sharedASE, fti)) == NULL)
        !            99:        goto out;
        !           100:     if (charging
        !           101:            && charging -> fc_ncharge > 0
        !           102:            && (rsp -> charging = chrg2fpm (fsb, charging, fti)) == NULL)
        !           103:        goto out;
        !           104: 
        !           105:     if (encode_FTAM_PDU (&pe, 1, 0, NULLCP, pdu) == NOTOK) {
        !           106:        (void) ftamlose (fti, FS_GEN (fsb), 1, NULLCP,
        !           107:                         "error encoding PDU: %s", PY_pepy);
        !           108:        goto out;
        !           109:     }
        !           110: 
        !           111:     pe -> pe_context = fsb -> fsb_id;
        !           112: 
        !           113:     fsbtrace (fsb, (fsb -> fsb_fd, "A-RELEASE.RESPONSE",
        !           114:                    "F-TERMINATE-response", pe, 0));
        !           115: 
        !           116:     result = AcRelResponse (fsb -> fsb_fd, ACS_ACCEPT, ACR_NORMAL, &pe, 1,
        !           117:                            aci);
        !           118: 
        !           119:     pe_free (pe);
        !           120:     pe = NULLPE;
        !           121:     free_FTAM_PDU (pdu);
        !           122:     pdu = NULL;
        !           123: 
        !           124:     if (result == NOTOK) {
        !           125:        (void) acs2ftamlose (fsb, fti, "AcRelResponse", aca);
        !           126:        goto out;
        !           127:     }
        !           128: 
        !           129:     fsb -> fsb_fd = NOTOK;
        !           130:     freefsblk (fsb);
        !           131: 
        !           132:     return OK;
        !           133: }

unix.superglobalmegacorp.com

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