|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T s
Length: 2524 (0x9dc) Types: TextFile Names: »ssaprelease2.c«
└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0 └─⟦35176feda⟧ »EurOpenD22/isode/isode-6.tar.Z« └─⟦de7628f85⟧ └─⟦this⟧ »isode-6.0/ssap/ssaprelease2.c«
/* ssaprelease2.c - SPM: respond to release */ #ifndef lint static char *rcsid = "$Header: /f/osi/ssap/RCS/ssaprelease2.c,v 7.0 89/11/23 22:25:36 mrose Rel $"; #endif /* * $Header: /f/osi/ssap/RCS/ssaprelease2.c,v 7.0 89/11/23 22:25:36 mrose Rel $ * * * $Log: ssaprelease2.c,v $ * Revision 7.0 89/11/23 22:25:36 mrose * Release 6.0 * */ /* * NOTICE * * Acquisition, use, and distribution of this module and related * materials are subject to the restrictions of a license agreement. * Consult the Preface in the User's Manual for the full terms of * this agreement. * */ /* LINTLIBRARY */ #include <stdio.h> #include <signal.h> #include "spkt.h" /* \f S-RELEASE.RESPONSE */ int SRelResponse (sd, status, data, cc, si) int sd; int status, cc; char *data; struct SSAPindication *si; { SBV smask; int result; register struct ssapblk *sb; missingP (si); smask = sigioblock (); ssapFsig (sb, sd); toomuchP (sb, data, cc, SR_SIZE, "release"); result = SRelResponseAux (sb, status, data, cc, si); (void) sigiomask (smask); return result; } /* \f S-RELEASE.RESPONSE */ static int SRelResponseAux (sb, status, data, cc, si) register struct ssapblk *sb; int status, cc; char *data; struct SSAPindication *si; { int code, result; register struct ssapkt *s; switch (status) { case SC_ACCEPT: code = SPDU_DN; break; case SC_REJECTED: if (!(sb -> sb_requirements & SR_NEGOTIATED)) return ssaplose (si, SC_OPERATION, NULLCP, "negotiated release service unavailable"); if (!(sb -> sb_requirements & SR_RLS_EXISTS)) return ssaplose (si, SC_OPERATION, NULLCP, "release token unavailable"); if (sb -> sb_owned & ST_RLS_TOKEN) return ssaplose (si, SC_OPERATION, NULLCP, "release token owned by you"); code = SPDU_NF; break; default: return ssaplose (si, SC_PARAMETER, NULLCP, "invalid value for status parameter"); } if ((s = newspkt (code)) == NULL) return ssaplose (si, SC_CONGEST, NULLCP, "out of memory"); if (cc > 0) { s -> s_mask |= SMASK_UDATA_PGI; s -> s_udata = data, s -> s_ulen = cc; } else s -> s_udata = NULL, s -> s_ulen = 0; result = spkt2sd (s, sb -> sb_fd, 0, si); s -> s_mask &= ~SMASK_UDATA_PGI; s -> s_udata = NULL, s -> s_ulen = 0; freespkt (s); if (result == NOTOK || code == SPDU_DN) freesblk (sb); else sb -> sb_flags &= ~SB_FINN; return result; }