|
|
1.1 root 1: /* ssapminor1.c - SPM: initiate minorsyncs */
2:
3: #ifndef lint
4: static char *rcsid = "$Header: /f/osi/ssap/RCS/ssapminor1.c,v 7.0 89/11/23 22:25:32 mrose Rel $";
5: #endif
6:
7: /*
8: * $Header: /f/osi/ssap/RCS/ssapminor1.c,v 7.0 89/11/23 22:25:32 mrose Rel $
9: *
10: *
11: * $Log: ssapminor1.c,v $
12: * Revision 7.0 89/11/23 22:25:32 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-MINOR-SYNC.REQUEST */
35:
36: int SMinSyncRequest (sd, type, ssn, data, cc, si)
37: int sd;
38: int type;
39: long *ssn;
40: char *data;
41: int cc;
42: struct SSAPindication *si;
43: {
44: SBV smask;
45: int result;
46: register struct ssapblk *sb;
47:
48: switch (type) {
49: case SYNC_CONFIRM:
50: case SYNC_NOCONFIRM:
51: break;
52:
53: default:
54: return ssaplose (si, SC_PARAMETER, NULLCP,
55: "improper choice of type setting");
56: }
57: missingP (ssn);
58: missingP (si);
59:
60: smask = sigioblock ();
61:
62: ssapPsig (sb, sd);
63: toomuchP (sb, data, cc, SN_SIZE, "minorsync");
64:
65: result = SMinSyncRequestAux (sb, type, ssn, data, cc, si);
66:
67: (void) sigiomask (smask);
68:
69: return result;
70: }
71:
72: /* */
73:
74: static int SMinSyncRequestAux (sb, type, ssn, data, cc, si)
75: register struct ssapblk *sb;
76: int type;
77: long *ssn;
78: char *data;
79: int cc;
80: register struct SSAPindication *si;
81: {
82: int result;
83:
84: if (!(sb -> sb_requirements & SR_MINORSYNC))
85: return ssaplose (si, SC_OPERATION, NULLCP,
86: "minor synchronize service unavailable");
87:
88: if ((sb -> sb_requirements & SR_DAT_EXISTS)
89: && !(sb -> sb_owned & ST_DAT_TOKEN))
90: return ssaplose (si, SC_OPERATION, NULLCP,
91: "data token not owned by you");
92:
93: if (!(sb -> sb_owned & ST_MIN_TOKEN))
94: return ssaplose (si, SC_OPERATION, NULLCP,
95: "minorsync token not owned by you");
96:
97: if ((sb -> sb_requirements & SR_ACTIVITY)
98: && !(sb -> sb_flags & SB_Vact))
99: return ssaplose (si, SC_OPERATION, NULLCP, "no activity in progress");
100:
101: if (sb -> sb_flags & SB_MAA)
102: return ssaplose (si, SC_OPERATION, "awaiting your majorsync response");
103:
104: if ((result = SWriteRequestAux (sb, SPDU_MIP, data, cc, type,
105: *ssn = sb -> sb_V_M, 0, NULLSD, NULLSD, NULLSR, si)) == NOTOK)
106: freesblk (sb);
107: else {
108: if (sb -> sb_flags & SB_Vsc) {
109: sb -> sb_V_A = sb -> sb_V_M;
110: sb -> sb_flags &= ~SB_Vsc;
111: }
112: sb -> sb_V_M++;
113: }
114:
115: return result;
116: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.