|
|
1.1 root 1: /* ssapmajor2.c - SPM: respond to majorsyncs */
2:
3: #ifndef lint
4: static char *rcsid = "$Header: /f/osi/ssap/RCS/ssapmajor2.c,v 7.0 89/11/23 22:25:31 mrose Rel $";
5: #endif
6:
7: /*
8: * $Header: /f/osi/ssap/RCS/ssapmajor2.c,v 7.0 89/11/23 22:25:31 mrose Rel $
9: *
10: *
11: * $Log: ssapmajor2.c,v $
12: * Revision 7.0 89/11/23 22:25:31 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-MAJOR-SYNC.RESPONSE */
35:
36: int SMajSyncResponse (sd, data, cc, si)
37: int sd;
38: char *data;
39: int cc;
40: struct SSAPindication *si;
41: {
42: SBV smask;
43: int result;
44: register struct ssapblk *sb;
45:
46: missingP (si);
47:
48: smask = sigioblock ();
49:
50: ssapPsig (sb, sd);
51: toomuchP (sb, data, cc, SN_SIZE, "majorsync");
52:
53: result = SMajSyncResponseAux (sb, data, cc, si);
54:
55: (void) sigiomask (smask);
56:
57: return result;
58: }
59:
60: /* */
61:
62: int SMajSyncResponseAux (sb, data, cc, si)
63: register struct ssapblk *sb;
64: char *data;
65: int cc;
66: register struct SSAPindication *si;
67: {
68: int result;
69:
70: if (!(sb -> sb_requirements & SR_MAJORSYNC)
71: && !(sb -> sb_requirements & SR_ACTIVITY)
72: && !(sb -> sb_flags & SB_Vact))
73: return ssaplose (si, SC_OPERATION, NULLCP,
74: "major synchronize service unavailable");
75: if (!(sb -> sb_flags & SB_MAA))
76: return ssaplose (si, SC_OPERATION, NULLCP,
77: "no majorsync in progress");
78:
79: if ((result = SWriteRequestAux (sb, SPDU_MAA, data, cc, 0,
80: sb -> sb_V_M - 1, 0, NULLSD, NULLSD, NULLSR, si)) == NOTOK)
81: freesblk (sb);
82: else {
83: sb -> sb_V_A = sb -> sb_V_R = sb -> sb_V_M;
84: if (sb -> sb_requirements & SR_ACTIVITY)
85: if (sb -> sb_flags & SB_Vnextact)
86: sb -> sb_flags |= SB_Vact;
87: else
88: sb -> sb_flags &= ~SB_Vact;
89:
90: sb -> sb_flags &= ~(SB_MAA | SB_AE);
91: }
92:
93: return result;
94: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.