Commit | Line | Data |
---|---|---|
04c6839a WJ |
1 | /* dapunbind.c - DAP unbind operation */ |
2 | ||
3 | #ifndef lint | |
4 | static 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 | ||
38 | extern LLog * log_dsap; | |
39 | ||
40 | /* | |
41 | * Seems that this should be a #define | |
42 | */ | |
43 | ||
44 | ds_unbind () | |
45 | { | |
46 | return(dap_unbind(dsap_ad)); | |
47 | } | |
48 | ||
49 | dap_unbind (ad) | |
50 | int 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 | ||
79 | int DapUnBindRequest (sd, secs, dr, di) | |
80 | int sd; | |
81 | int secs; | |
82 | struct DAPrelease * dr; | |
83 | struct 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 | ||
114 | int DapUnBindRetry (sd, secs, dr, di) | |
115 | int sd; | |
116 | int secs; | |
117 | struct DAPrelease * dr; | |
118 | struct 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 |