Annotation of 43BSDReno/contrib/isode-beta/ssap/ssapabort.c, revision 1.1

1.1     ! root        1: /* ssapabort.c - SPM: user abort */
        !             2: 
        !             3: #ifndef        lint
        !             4: static char *rcsid = "$Header: /f/osi/ssap/RCS/ssapabort.c,v 7.0 89/11/23 22:25:20 mrose Rel $";
        !             5: #endif
        !             6: 
        !             7: /* 
        !             8:  * $Header: /f/osi/ssap/RCS/ssapabort.c,v 7.0 89/11/23 22:25:20 mrose Rel $
        !             9:  *
        !            10:  *
        !            11:  * $Log:       ssapabort.c,v $
        !            12:  * Revision 7.0  89/11/23  22:25:20  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 "spkt.h"
        !            33: 
        !            34: /*    S-U-ABORT.REQUEST */
        !            35: 
        !            36: int    SUAbortRequest (sd, data, cc, si)
        !            37: int    sd;
        !            38: char   *data;
        !            39: int    cc;
        !            40: struct SSAPindication *si;
        !            41: {
        !            42:     SBV            smask;
        !            43:     int     result;
        !            44:     register struct ssapblk *sb;
        !            45: 
        !            46:     missingP (si);
        !            47: 
        !            48:     smask = sigioblock ();
        !            49: 
        !            50:     if ((sb = findsblk (sd)) == NULL) {
        !            51:        (void) sigiomask (smask);
        !            52:        return ssaplose (si, SC_PARAMETER, NULLCP, "invalid session descriptor");
        !            53:     }
        !            54:     toomuchP (sb, data, cc, SA_SIZE, "abort");
        !            55: 
        !            56:     result = SUAbortRequestAux (sb, data, cc, si);
        !            57: 
        !            58:     (void) sigiomask (smask);
        !            59: 
        !            60:     return result;
        !            61: }
        !            62: 
        !            63: /*  */
        !            64: 
        !            65: static int  SUAbortRequestAux (sb, data, cc, si)
        !            66: register struct ssapblk *sb;
        !            67: char   *data;
        !            68: int    cc;
        !            69: struct SSAPindication *si;
        !            70: {
        !            71:     int     result;
        !            72:     register struct ssapkt *s;
        !            73: #ifdef notdef          /* only if transport connection is to be re-used */
        !            74:     struct TSAPdata txs;
        !            75:     register struct TSAPdata   *tx = &txs;
        !            76:     struct TSAPdisconnect   tds;
        !            77:     register struct TSAPdisconnect *td = &tds;
        !            78: #endif
        !            79: 
        !            80:     sb -> sb_flags &= ~(SB_ED | SB_EDACK | SB_ERACK);
        !            81: 
        !            82:     if ((sb -> sb_flags & SB_EXPD)
        !            83:            && sb -> sb_version >= SB_VRSN2
        !            84:            && cc > 9) {
        !            85:        register struct ssapkt *p;
        !            86: 
        !            87:        if (p = newspkt (SPDU_PR)) {
        !            88:            p -> s_mask |= SMASK_PR_TYPE;
        !            89:            p -> s_pr_type = PR_AB;
        !            90:            result = spkt2sd (p, sb -> sb_fd, 1, si);
        !            91:            freespkt (p);
        !            92:            if (result == NOTOK)
        !            93:                goto out1;
        !            94:        }
        !            95:     }
        !            96:        
        !            97:     if ((s = newspkt (SPDU_AB)) == NULL) {
        !            98:        result = ssaplose (si, SC_CONGEST, NULLCP, "out of memory");
        !            99:        goto out1;
        !           100:     }
        !           101: 
        !           102:     s -> s_mask |= SMASK_SPDU_AB | SMASK_AB_DISC;
        !           103:     s -> s_ab_disconnect = AB_DISC_RELEASE | AB_DISC_USER;
        !           104: 
        !           105:     if (cc > 0) {
        !           106:        s -> s_mask |= SMASK_UDATA_PGI;
        !           107:        s -> s_udata = data, s -> s_ulen = cc;
        !           108:     }
        !           109:     else
        !           110:        s -> s_udata = NULL, s -> s_ulen = 0;
        !           111:     result = spkt2sd (s, sb -> sb_fd, sb -> sb_flags & SB_EXPD ? 1 : 0, si);
        !           112:     s -> s_mask &= ~SMASK_UDATA_PGI;
        !           113:     s -> s_udata = NULL, s -> s_ulen = 0;
        !           114: 
        !           115:     freespkt (s);
        !           116:     if (result == NOTOK)
        !           117:        goto out1;
        !           118: 
        !           119: #ifdef notdef          /* only if transport connection is to be re-used */
        !           120:     switch (TReadRequest (sb -> sb_fd, tx, AB_TIM, td)) {
        !           121:        case OK: 
        !           122:        default:                /* should be an ABORT ACCEPT, but who cares? */
        !           123:            TXFREE (tx);
        !           124:            break;
        !           125: 
        !           126:        case NOTOK: 
        !           127:            sb -> sb_fd = NOTOK;
        !           128:            break;
        !           129:     }
        !           130: #endif
        !           131:     result = OK;
        !           132: 
        !           133: out1: ;
        !           134:     freesblk (sb);
        !           135:     
        !           136:     return result;
        !           137: }

unix.superglobalmegacorp.com

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