386BSD 0.1 development
[unix-history] / usr / othersrc / contrib / isode / ssap / ssapcapd2.c
CommitLineData
a0be6343
WJ
1/* ssapcapd2.c - SPM: read capability data */
2
3#ifndef lint
4static char *rcsid = "$Header: /f/osi/ssap/RCS/ssapcapd2.c,v 7.1 91/02/22 09:45:44 mrose Interim $";
5#endif
6
7/*
8 * $Header: /f/osi/ssap/RCS/ssapcapd2.c,v 7.1 91/02/22 09:45:44 mrose Interim $
9 *
10 *
11 * $Log: ssapcapd2.c,v $
12 * Revision 7.1 91/02/22 09:45:44 mrose
13 * Interim 6.8
14 *
15 * Revision 7.0 89/11/23 22:25:24 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 <signal.h>
35#include "spkt.h"
36
37/* \f S-CAPABILITY-DATA.RESPONSE */
38
39int SCapdResponse (sd, data, cc, si)
40int sd;
41char *data;
42int cc;
43struct SSAPindication *si;
44{
45 SBV smask;
46 int result;
47 register struct ssapblk *sb;
48
49 missingP (si);
50
51 smask = sigioblock ();
52
53 ssapPsig (sb, sd);
54 toomuchP (sb, data, cc, SX_CDASIZE, "capability");
55
56 result = SCapdResponseAux (sb, data, cc, si);
57
58 (void) sigiomask (smask);
59
60 return result;
61}
62
63/* \f */
64
65static int SCapdResponseAux (sb, data, cc, si)
66register struct ssapblk *sb;
67char *data;
68int cc;
69struct SSAPindication *si;
70{
71 int result;
72
73 if (!(sb -> sb_requirements & SR_CAPABILITY))
74 return ssaplose (si, SC_OPERATION, NULLCP,
75 "capability data exchange service unavailable");
76 if (!(sb -> sb_flags & SB_CDA))
77 return ssaplose (si, SC_OPERATION, NULLCP,
78 "no capability data response in progress");
79
80 if ((result = SWriteRequestAux (sb, SPDU_CDA, data, cc, 0, 0L, 0, NULLSD,
81 NULLSD, NULLSR, si)) == NOTOK)
82 freesblk (sb);
83 else
84 sb -> sb_flags &= ~SB_CDA;
85
86 return result;
87}