Annotation of 43BSDReno/contrib/isode-beta/acsap/acsapreleas3.c, revision 1.1.1.1

1.1       root        1: /* acsapreleas3.c - ACPM: interpret release */
                      2: 
                      3: #ifndef        lint
                      4: static char *rcsid = "$Header: /f/osi/acsap/RCS/acsapreleas3.c,v 7.1 90/07/01 21:02:06 mrose Exp $";
                      5: #endif
                      6: 
                      7: /* 
                      8:  * $Header: /f/osi/acsap/RCS/acsapreleas3.c,v 7.1 90/07/01 21:02:06 mrose Exp $
                      9:  *
                     10:  *
                     11:  * $Log:       acsapreleas3.c,v $
                     12:  * Revision 7.1  90/07/01  21:02:06  mrose
                     13:  * pepsy
                     14:  * 
                     15:  * Revision 7.0  89/11/23  21:21:56  mrose
                     16:  * Release 6.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 "ACS-types.h"
                     36: #define        ACSE
                     37: #include "acpkt.h"
                     38: #ifdef DEBUG
                     39: #include "tailor.h"
                     40: #endif
                     41: 
                     42: /*    handle P-RELEASE.INDICATION */
                     43: 
                     44: int    AcFINISHser (sd, pf, aci)
                     45: int    sd;
                     46: register struct PSAPfinish *pf;
                     47: register struct AcSAPindication *aci;
                     48: {
                     49:     SBV            smask;
                     50:     int            result;
                     51:     PE     pe;
                     52:     register struct assocblk *acb;
                     53:     register struct AcSAPfinish *acf;
                     54:     struct type_ACS_ACSE__apdu *pdu;
                     55:     register struct type_ACS_RLRQ__apdu *rlrq;
                     56: 
                     57:     missingP (pf);
                     58:     missingP (aci);
                     59: 
                     60:     smask = sigioblock ();
                     61:     
                     62:     acsapPsig (acb, sd);
                     63: 
                     64:     bzero ((char *) aci, sizeof *aci);
                     65:     aci -> aci_type = ACI_FINISH;
                     66:     acf = &aci -> aci_finish;
                     67:     
                     68:     pdu = NULL;
                     69: 
                     70:     if (pf -> pf_ninfo < 1) {
                     71:        result = acsaplose (aci, ACS_PROTOCOL, NULLCP,
                     72:                            "no user-data on P-RELEASE");
                     73:        goto out;
                     74:     }
                     75: 
                     76:     result = decode_ACS_ACSE__apdu (pe = pf -> pf_info[0], 1, NULLIP, NULLVP,
                     77:                                    &pdu);
                     78: 
                     79: #ifdef DEBUG
                     80:     if (result == OK && (acsap_log -> ll_events & LLOG_PDUS))
                     81:        pvpdu (acsap_log, print_ACS_ACSE__apdu_P, pe, "ACSE-apdu", 1);
                     82: #endif
                     83: 
                     84:     pe_free (pe);
                     85:     pe = pf -> pf_info[0] = NULLPE;
                     86:     
                     87:     if (result == NOTOK) {
                     88:        result = acsaplose (aci, ACS_PROTOCOL, NULLCP, "%s", PY_pepy);
                     89:        goto out;
                     90:     }
                     91: 
                     92:     if (pdu -> offset != type_ACS_ACSE__apdu_rlrq) {
                     93:        result = acsaplose (aci, ACS_PROTOCOL, NULLCP,
                     94:                            "unexpected PDU %d on P-RELEASE", pdu -> offset);
                     95:        goto out;
                     96:     }
                     97: 
                     98:     rlrq = pdu -> un.rlrq;
                     99:     if (rlrq -> optionals & opt_ACS_RLRQ__apdu_reason)
                    100:        acf -> acf_reason = rlrq -> reason;
                    101:     else
                    102:        acf -> acf_reason = int_ACS_reason_normal;
                    103:     result = apdu2info (acb, aci, rlrq -> user__information, acf -> acf_info,
                    104:                   &acf -> acf_ninfo);
                    105: 
                    106: out: ;
                    107:     if (result == NOTOK)
                    108:        freeacblk (acb);
                    109:     else
                    110:        acb -> acb_flags |= ACB_FINN;
                    111: 
                    112:     PFFREE (pf);
                    113:     if (pdu)
                    114:        free_ACS_ACSE__apdu (pdu);
                    115: 
                    116:     (void) sigiomask (smask);
                    117: 
                    118:     return result;
                    119: }

unix.superglobalmegacorp.com

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