BSD 4_3_Net_2 development
[unix-history] / usr / src / contrib / isode / ssap / ssapactchk.c
CommitLineData
9319b3c3
C
1/* ssapactchk.c - SPM: check activity constraints */
2
3#ifndef lint
4static char *rcsid = "$Header: /f/osi/ssap/RCS/ssapactchk.c,v 7.1 91/02/22 09:45:40 mrose Interim $";
5#endif
6
7/*
8 * $Header: /f/osi/ssap/RCS/ssapactchk.c,v 7.1 91/02/22 09:45:40 mrose Interim $
9 *
10 *
11 * $Log: ssapactchk.c,v $
12 * Revision 7.1 91/02/22 09:45:40 mrose
13 * Interim 6.8
14 *
15 * Revision 7.0 89/11/23 22:25:21 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 "spkt.h"
35
36/* \f */
37
38int SDoActivityAux (sb, si, act, rls)
39register struct ssapblk *sb;
40register struct SSAPindication *si;
41int act,
42 rls;
43{
44 if (act) {
45 if (!(sb -> sb_requirements & SR_ACT_EXISTS))
46 return ssaplose (si, SC_OPERATION, NULLCP,
47 "activity management service unavailable");
48
49 if (sb -> sb_flags & SB_Vact)
50 return ssaplose (si, SC_OPERATION, NULLCP, "activity in progress");
51 }
52 else
53 if (!(sb -> sb_requirements & SR_MAJ_EXISTS))
54 return ssaplose (si, SC_OPERATION, NULLCP,
55 "major synchronize service unavailable");
56
57 if ((sb -> sb_requirements & SR_DAT_EXISTS)
58 && !(sb -> sb_owned & ST_DAT_TOKEN))
59 return ssaplose (si, SC_OPERATION, NULLCP,
60 "data token not owned by you");
61
62 if ((sb -> sb_requirements & SR_MIN_EXISTS)
63 && !(sb -> sb_owned & ST_MIN_TOKEN))
64 return ssaplose (si, SC_OPERATION, NULLCP,
65 "minorsync not owned by you");
66
67 if (act) {
68 if (!(sb -> sb_owned & ST_ACT_TOKEN))
69 return ssaplose (si, SC_OPERATION, NULLCP,
70 "activity token not owned by you");
71 }
72 else
73 if (!(sb -> sb_owned & ST_MAJ_TOKEN))
74 return ssaplose (si, SC_OPERATION, NULLCP,
75 "majorsync token not owned by you");
76
77 if (rls)
78 if ((sb -> sb_requirements & SR_RLS_EXISTS)
79 && !(sb -> sb_owned & ST_RLS_TOKEN))
80 return ssaplose (si, SC_OPERATION, NULLCP,
81 "release token not owned by you");
82
83 return OK;
84}