|
|
1.1 root 1: /* ssapreport.c - SPM: exception reports */
2:
3: #ifndef lint
4: static char *rcsid = "$Header: /f/osi/ssap/RCS/ssapreport.c,v 7.0 89/11/23 22:25:37 mrose Rel $";
5: #endif
6:
7: /*
8: * $Header: /f/osi/ssap/RCS/ssapreport.c,v 7.0 89/11/23 22:25:37 mrose Rel $
9: *
10: *
11: * $Log: ssapreport.c,v $
12: * Revision 7.0 89/11/23 22:25:37 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-U-EXCEPTION-REPORT.REQUEST */
35:
36: int SUReportRequest (sd, reason, data, cc, si)
37: int sd;
38: int reason;
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 (!(SP_OK (reason)))
48: return ssaplose (si, SC_PARAMETER, NULLCP, "invalid reason");
49: missingP (si);
50:
51: smask = sigioblock ();
52:
53: ssapPsig (sb, sd);
54: toomuchP (sb, data, cc, SP_SIZE, "report");
55:
56: result = SUReportRequestAux (sb, reason, data, cc, si);
57:
58: (void) sigiomask (smask);
59:
60: return result;
61: }
62:
63: /* */
64:
65: static int SUReportRequestAux (sb, reason, data, cc, si)
66: register struct ssapblk *sb;
67: int reason;
68: char *data;
69: int cc;
70: register struct SSAPindication *si;
71: {
72: int result;
73:
74: if (!(sb -> sb_requirements & SR_EXCEPTIONS))
75: return ssaplose (si, SC_OPERATION, NULLCP,
76: "exceptions service unavailable");
77: if (!(sb -> sb_requirements & SR_DAT_EXISTS))
78: return ssaplose (si, SC_OPERATION, NULLCP,
79: "data token not available");
80: if (sb -> sb_owned & ST_DAT_TOKEN)
81: return ssaplose (si, SC_OPERATION, NULLCP,
82: "data token owned by you");
83: if ((sb -> sb_requirements & SR_ACTIVITY)
84: && !(sb -> sb_flags & SB_Vact))
85: return ssaplose (si, SC_OPERATION, NULLCP,
86: "no activity in progress");
87:
88: if ((result = SWriteRequestAux (sb, SPDU_ED, data, cc, reason, 0L, 0,
89: NULLSD, NULLSD, NULLSR, si)) == NOTOK)
90: freesblk (sb);
91: else
92: sb -> sb_flags |= SB_ED;
93:
94: return result;
95: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.