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

1.1     ! root        1: /* ftamabort.c - FPM: user abort */
        !             2: 
        !             3: #ifndef        lint
        !             4: static char *rcsid = "$Header: /f/osi/ftam/RCS/ftamabort.c,v 7.0 89/11/23 21:53:19 mrose Rel $";
        !             5: #endif
        !             6: 
        !             7: /* 
        !             8:  * $Header: /f/osi/ftam/RCS/ftamabort.c,v 7.0 89/11/23 21:53:19 mrose Rel $
        !             9:  *
        !            10:  *
        !            11:  * $Log:       ftamabort.c,v $
        !            12:  * Revision 7.0  89/11/23  21:53:19  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-U-ABORT.REQUEST */
        !            35: 
        !            36: int    FUAbortRequest (sd, action, diag, ndiag, fti)
        !            37: int    sd;
        !            38: int    action;
        !            39: struct FTAMdiagnostic diag[];
        !            40: int    ndiag;
        !            41: struct FTAMindication *fti;
        !            42: {
        !            43:     SBV            smask;
        !            44:     int     result;
        !            45:     register struct ftamblk *fsb;
        !            46: 
        !            47:     switch (action) {
        !            48:        case FACTION_SUCCESS: 
        !            49:        case FACTION_TRANS: 
        !            50:        case FACTION_PERM: 
        !            51:            break;
        !            52: 
        !            53:        default: 
        !            54:            return ftamlose (fti, FS_GEN_NOREASON, 0, NULLCP,
        !            55:                    "bad value for action parameter");
        !            56:     }
        !            57:     toomuchP (diag, ndiag, NFDIAG, "diagnostic");
        !            58: 
        !            59:     smask = sigioblock ();
        !            60: 
        !            61:     ftamPsig (fsb, sd);
        !            62: 
        !            63:     result = FAbortRequestAux (fsb, type_FTAM_PDU_f__u__abort__request, action,
        !            64:                               diag, ndiag, fti);
        !            65: 
        !            66:     (void) sigiomask (smask);
        !            67: 
        !            68:     return result;
        !            69: }
        !            70: 
        !            71: /*  */
        !            72: 
        !            73: int    FAbortRequestAux (fsb, id, action, diag, ndiag, fti)
        !            74: register struct ftamblk *fsb;
        !            75: int    id,
        !            76:        action;
        !            77: struct FTAMdiagnostic diag[];
        !            78: int    ndiag;
        !            79: struct FTAMindication *fti;
        !            80: {
        !            81:     int     result;
        !            82:     PE     pe;
        !            83:     struct AcSAPindication  acis;
        !            84:     register struct AcSAPindication *aci = &acis;
        !            85:     register struct AcSAPabort *aca = &aci -> aci_abort;
        !            86:     register struct type_FTAM_PDU *pdu;
        !            87:     register struct type_FTAM_F__U__ABORT__request *req;
        !            88: 
        !            89:     if ((pdu = (struct type_FTAM_PDU *) calloc (1, sizeof *pdu)) == NULL)
        !            90:        goto carry_on;
        !            91:     pdu -> offset = id;        /* F-P-ABORT-request is identical... */
        !            92:     if ((req = (struct type_FTAM_F__U__ABORT__request *)
        !            93:                        calloc (1, sizeof *req)) == NULL)
        !            94:        goto carry_on;
        !            95:     pdu -> un.f__u__abort__request = req;
        !            96:     if ((req -> action__result =
        !            97:                        (struct type_FTAM_Action__Result *)
        !            98:                                   calloc (1, sizeof *req -> action__result))
        !            99:                    == NULL)
        !           100:        goto carry_on;
        !           101:     req -> action__result -> parm = action;
        !           102:     if (ndiag > 0
        !           103:            && (req -> diagnostic =
        !           104:                        diag2fpm (fsb,
        !           105:                                  id == type_FTAM_PDU_f__p__abort__request,
        !           106:                                  diag, ndiag, fti)) == NULL) {
        !           107:        free_FTAM_PDU (pdu);
        !           108:        if (fti -> fti_abort.fta_action == FACTION_TRANS)
        !           109:            return NOTOK;
        !           110:        pdu = NULL;
        !           111:     }
        !           112: carry_on: ;
        !           113: 
        !           114:     pe = NULLPE;
        !           115:     if (pdu) {
        !           116:        result = encode_FTAM_PDU (&pe, 1, 0, NULLCP, pdu);
        !           117: 
        !           118:        if (result == NOTOK) {
        !           119:            if (pe)
        !           120:                pe_free (pe), pe = NULLPE;
        !           121:        }
        !           122:        else
        !           123:            if (pe)
        !           124:                pe -> pe_context = fsb -> fsb_id;
        !           125:     }
        !           126: 
        !           127:     fsbtrace (fsb,
        !           128:        (fsb -> fsb_fd, "A-ABORT.REQUEST",
        !           129:         id != type_FTAM_PDU_f__p__abort__request ? "F-U-ABORT-request"
        !           130:                                                  : "F-P-ABORT-request",
        !           131:         pe, 0));
        !           132: 
        !           133:     result = AcUAbortRequest (fsb -> fsb_fd, pe ? &pe : NULLPEP, pe ? 1 : 0,
        !           134:            aci);
        !           135: 
        !           136:     if (pe)
        !           137:        pe_free (pe);
        !           138:     if (pdu)
        !           139:        free_FTAM_PDU (pdu);
        !           140: 
        !           141:     if (result == NOTOK)
        !           142:        (void) acs2ftamlose (fsb, fti, "AcUAbortRequest", aca);
        !           143:     else {
        !           144:        fsb -> fsb_fd = NOTOK;
        !           145:        result = OK;
        !           146:     }
        !           147: 
        !           148:     if (id != type_FTAM_PDU_f__p__abort__request)
        !           149:        freefsblk (fsb);
        !           150:     else
        !           151:        if (result == OK)
        !           152:            fsb -> fsb_fd = NOTOK;
        !           153: 
        !           154:     return result;
        !           155: }

unix.superglobalmegacorp.com

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