Annotation of 43BSDReno/contrib/isode-beta/rosap/rosapureject.c, revision 1.1.1.1

1.1       root        1: /* rosapureject.c - ROPM: user reject */
                      2: 
                      3: #ifndef        lint
                      4: static char *rcsid = "$Header: /f/osi/rosap/RCS/rosapureject.c,v 6.0 89/03/18 23:42:32 mrose Rel $";
                      5: #endif
                      6: 
                      7: /* 
                      8:  * $Header: /f/osi/rosap/RCS/rosapureject.c,v 6.0 89/03/18 23:42:32 mrose Rel $
                      9:  *
                     10:  * Based on an TCP-based implementation by George Michaelson of University
                     11:  * College London.
                     12:  *
                     13:  *
                     14:  * $Log:       rosapureject.c,v $
                     15:  * Revision 6.0  89/03/18  23:42:32  mrose
                     16:  * Release 5.0
                     17:  * 
                     18:  */
                     19: 
                     20: /*
                     21:  *                               NOTICE
                     22:  *
                     23:  *    Acquisition, use, and distribution of this module and related
                     24:  *    materials are subject to the restrictions of a license agreement.
                     25:  *    Consult the Preface in the User's Manual for the full terms of
                     26:  *    this agreement.
                     27:  *
                     28:  */
                     29: 
                     30: 
                     31: /* LINTLIBRARY */
                     32: 
                     33: #include <stdio.h>
                     34: #include <signal.h>
                     35: #include "ropkt.h"
                     36: 
                     37: /*    RO-U-REJECT.REQUEST */
                     38: 
                     39: int    RoURejectRequest (sd, invokeID, reason, priority, roi)
                     40: int    sd;
                     41: int    *invokeID,
                     42:        reason,
                     43:        priority;
                     44: struct RoSAPindication *roi;
                     45: {
                     46:     SBV            smask;
                     47:     int     result;
                     48:     PElementID id;
                     49:     register struct assocblk   *acb;
                     50: 
                     51:     switch (reason) {
                     52:        case ROS_IP_DUP:        /* Invoke Problem */
                     53:        case ROS_IP_UNRECOG: 
                     54:        case ROS_IP_MISTYPED: 
                     55:        case ROS_IP_LIMIT: 
                     56:            id = REJECT_INVOKE;
                     57:            reason -= REJECT_INVOKE_BASE;
                     58:            break;
                     59: 
                     60:        case ROS_IP_RELEASE:
                     61:        case ROS_IP_UNLINKED:
                     62:        case ROS_IP_LINKED:
                     63:        case ROS_IP_CHILD:
                     64:            id = REJECT_COMPLETE;
                     65:            reason -= REJECT_INVOKE_BASE;
                     66:            break;
                     67: 
                     68:        case ROS_RRP_UNRECOG:   /* Return Result Problem */
                     69:        case ROS_RRP_UNEXP: 
                     70:        case ROS_RRP_MISTYPED: 
                     71:            id = REJECT_RESULT;
                     72:            reason -= REJECT_RESULT_BASE;
                     73:            break;
                     74: 
                     75:        case ROS_REP_UNRECOG:   /* Return Error Problem */
                     76:        case ROS_REP_UNEXP: 
                     77:        case ROS_REP_RECERR: 
                     78:        case ROS_REP_UNEXPERR: 
                     79:        case ROS_REP_MISTYPED: 
                     80:            id = REJECT_ERROR;
                     81:            reason -= REJECT_ERROR_BASE;
                     82:            break;
                     83: 
                     84:        default: 
                     85:            return rosaplose (roi, ROS_PARAMETER, NULLCP,
                     86:                    "bad value for reason parameter");
                     87:     }
                     88:     missingP (roi);
                     89: 
                     90:     smask = sigioblock ();
                     91: 
                     92:     rosapPsig (acb, sd);
                     93: 
                     94:     result = RoURejectRequestAux (acb, invokeID, reason, id, priority, roi);
                     95: 
                     96:     (void) sigiomask (smask);
                     97: 
                     98:     return result;
                     99: }
                    100: 
                    101: /*  */
                    102: 
                    103: int    RoURejectRequestAux (acb, invokeID, reason, id, priority, roi)
                    104: register struct assocblk   *acb;
                    105: int    *invokeID,
                    106:        reason,
                    107:        priority;
                    108: PElementID id;
                    109: struct RoSAPindication *roi;
                    110: {
                    111:     register PE pe,
                    112:                p;
                    113: 
                    114:     if (id == REJECT_COMPLETE)
                    115:        if (acb -> acb_flags & ACB_ACS)
                    116:            id = REJECT_INVOKE;
                    117:        else
                    118:            return rosaplose (roi, ROS_PARAMETER, NULLCP,
                    119:                        "bad value for reason parameter");
                    120: 
                    121:     if (acb -> acb_ready
                    122:            && !(acb -> acb_flags & ACB_TURN)
                    123:            && (*acb -> acb_ready) (acb, priority, roi) == NOTOK)
                    124:        return NOTOK;
                    125: 
                    126: /* begin Reject APDU */
                    127:     if ((pe = pe_alloc (PE_CLASS_CONT, PE_FORM_CONS, APDU_REJECT)) == NULLPE
                    128:            || ((acb -> acb_flags & ACB_ACS)
                    129:                    ? (p = pe, 0)
                    130:                    : set_add (pe, p = pe_alloc (PE_CLASS_UNIV, PE_FORM_CONS,
                    131:                        PE_CONS_SEQ)) == NOTOK)
                    132:            || seq_add (p, invokeID ? int2prim (*invokeID)
                    133:                                  : pe_alloc (PE_CLASS_UNIV, PE_FORM_PRIM,
                    134:                                                PE_PRIM_NULL), -1) == NOTOK
                    135:            || seq_add (p, num2prim (reason, PE_CLASS_CONT, id), -1)
                    136:                    == NOTOK) {
                    137:        if (pe)
                    138:            pe_free (pe);
                    139:        freeacblk (acb);
                    140:        return rosaplose (roi, ROS_CONGEST, NULLCP, "out of memory");
                    141:     }
                    142: /* end Reject APDU */
                    143: 
                    144:     return (*acb -> acb_putosdu) (acb, pe, NULLPE, priority, roi);
                    145: }

unix.superglobalmegacorp.com

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