386BSD 0.1 development
[unix-history] / usr / othersrc / contrib / isode / dsap / net / dapunbind.c
CommitLineData
04c6839a
WJ
1/* dapunbind.c - DAP unbind operation */
2
3#ifndef lint
4static char *rcsid = "$Header: /f/osi/dsap/net/RCS/dapunbind.c,v 7.1 91/02/22 09:21:08 mrose Interim $";
5#endif
6
7/*
8 * $Header: /f/osi/dsap/net/RCS/dapunbind.c,v 7.1 91/02/22 09:21:08 mrose Interim $
9 *
10 *
11 * $Log: dapunbind.c,v $
12 * Revision 7.1 91/02/22 09:21:08 mrose
13 * Interim 6.8
14 *
15 * Revision 7.0 90/07/26 14:45:30 mrose
16 * *** empty log message ***
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 "logger.h"
34#include "quipu/util.h"
35#include "quipu/dap.h"
36#include "quipu/dap2.h"
37
38extern LLog * log_dsap;
39
40/*
41* Seems that this should be a #define
42*/
43
44ds_unbind ()
45{
46 return(dap_unbind(dsap_ad));
47}
48
49dap_unbind (ad)
50int ad;
51{
52 int ret;
53 struct DAPrelease dr_s;
54 struct DAPrelease *dr = &dr_s;
55 struct DAPindication di_s;
56 struct DAPindication *di = &di_s;
57
58 DLOG(log_dsap, LLOG_NOTICE, ("dap_unbind: <%d, normal, nullpe>",
59 ad));
60
61 ret = DapUnBindRequest (ad, NOTOK, dr, di);
62
63 if (ret != OK)
64 {
65 LLOG (log_dsap, LLOG_EXCEPTIONS, ("DapUnBindRequest() failed"));
66 return (DS_ERROR_LOCAL);
67 }
68
69 if (!dr->dr_affirmative) {
70 LLOG(log_dsap, LLOG_EXCEPTIONS, ("DapUnBindRequest failed"));
71 return(DS_ERROR_PROVIDER);
72 }
73
74 return(DS_OK);
75}
76
77/* ARGSUSED */
78
79int DapUnBindRequest (sd, secs, dr, di)
80int sd;
81int secs;
82struct DAPrelease * dr;
83struct DAPindication * di;
84{
85 int result;
86 struct AcSAPrelease acr_s;
87 struct AcSAPrelease * acr = &(acr_s);
88 struct RoNOTindication rni_s;
89 struct RoNOTindication * rni = &(rni_s);
90
91
92 result = RoUnBindRequest (sd, NULLPE, secs, acr, rni);
93
94 if (result == OK)
95 {
96 dr->dr_affirmative = acr->acr_affirmative;
97 dr->dr_reason = acr->acr_reason;
98 ACRFREE(acr);
99 return (OK);
100 }
101
102 if (result == NOTOK)
103 {
104 return (ronot2daplose (di, "D-UNBIND.REQUEST", rni));
105 }
106
107 return (result);
108}
109
110/* \f D-UNBIND.RETRY */
111
112/* ARGSUSED */
113
114int DapUnBindRetry (sd, secs, dr, di)
115int sd;
116int secs;
117struct DAPrelease * dr;
118struct DAPindication * di;
119{
120 int result;
121 struct AcSAPrelease acr_s;
122 struct AcSAPrelease * acr = &(acr_s);
123 struct RoNOTindication rni_s;
124 struct RoNOTindication * rni = &(rni_s);
125
126 result = RoUnBindRetry (sd, secs, acr, rni);
127
128 if (result == OK)
129 {
130 dr->dr_affirmative = acr->acr_affirmative;
131 dr->dr_reason = acr->acr_reason;
132 ACRFREE (acr);
133 return (OK);
134 }
135
136 if (result == NOTOK)
137 {
138 return (ronot2daplose (di, "D-UNBIND.RETRY", rni));
139 }
140
141 return (result);
142}
143