|
|
1.1 root 1: /* ssapminor2.c - SPM: respond to minorsyncs */
2:
3: #ifndef lint
4: static char *rcsid = "$Header: /f/osi/ssap/RCS/ssapminor2.c,v 7.0 89/11/23 22:25:33 mrose Rel $";
5: #endif
6:
7: /*
8: * $Header: /f/osi/ssap/RCS/ssapminor2.c,v 7.0 89/11/23 22:25:33 mrose Rel $
9: *
10: *
11: * $Log: ssapminor2.c,v $
12: * Revision 7.0 89/11/23 22:25:33 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.RESPONSE */
35:
36: int SMinSyncResponse (sd, ssn, data, cc, si)
37: int sd;
38: long ssn;
39: char *data;
40: int cc;
41: struct SSAPindication *si;
42: {
43: SBV smask;
44: int result;
45: register struct ssapblk *sb;
46:
47: if (SERIAL_MIN > ssn || ssn > SERIAL_MAX)
48: return ssaplose (si, SC_PARAMETER, NULLCP, "invalid serial number");
49: missingP (si);
50:
51: smask = sigioblock ();
52:
53: ssapPsig (sb, sd);
54: toomuchP (sb, data, cc, SN_SIZE, "minorsync");
55:
56: result = SMinSyncResponseAux (sb, ssn, data, cc, si);
57:
58: (void) sigiomask (smask);
59:
60: return result;
61: }
62:
63: /* */
64:
65: static int SMinSyncResponseAux (sb, ssn, data, cc, si)
66: register struct ssapblk *sb;
67: long ssn;
68: char *data;
69: int cc;
70: register struct SSAPindication *si;
71: {
72: int result;
73:
74: if (!(sb -> sb_requirements & SR_MINORSYNC))
75: return ssaplose (si, SC_OPERATION, NULLCP,
76: "minor synchronize service unavailable");
77: if (!(sb -> sb_flags & SB_Vsc))
78: return ssaplose (si, SC_OPERATION, NULLCP,
79: "no minorsync in progress");
80: if (ssn < sb -> sb_V_A)
81: return ssaplose (si, SC_OPERATION, NULLCP,
82: "bad choice for minor ssn, should be >= %ld", sb -> sb_V_A);
83:
84: if ((result = SWriteRequestAux (sb, SPDU_MIA, data, cc, 0, ssn, 0, NULLSD,
85: NULLSD, NULLSR, si)) == NOTOK)
86: freesblk (sb);
87: else
88: sb -> sb_V_A = ssn + 1;
89:
90: return result;
91: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.