Browse code

auth: converted to the new module interface

Federico Cabiddu authored on 27/09/2018 15:09:10 • Victor Seva committed on 28/09/2018 11:03:26
Showing 2 changed files
... ...
@@ -13,8 +13,6 @@ LIBS=
13 13
 #       -DUSE_OT_NONCE - compile with one-time nonces support
14 14
 DEFS+=-DUSE_NC -DUSE_OT_NONCE
15 15
 
16
-DEFS+=-DSER_MOD_INTERFACE
17
-
18 16
 SERLIBPATH=../../lib
19 17
 SER_LIBS+=$(SERLIBPATH)/srutils/srutils
20 18
 include ../../Makefile.modules
... ...
@@ -152,31 +152,31 @@ sl_api_t slb;
152 152
  */
153 153
 static cmd_export_t cmds[] = {
154 154
 	{"consume_credentials",    w_consume_credentials,                0,
155
-		0, REQUEST_ROUTE},
155
+		0, 0, REQUEST_ROUTE},
156 156
 	{"www_challenge",          (cmd_function)www_challenge,          2,
157
-		fixup_auth_challenge, REQUEST_ROUTE | FAILURE_ROUTE | ONREPLY_ROUTE},
157
+		fixup_auth_challenge, 0, REQUEST_ROUTE | FAILURE_ROUTE | ONREPLY_ROUTE},
158 158
 	{"proxy_challenge",        (cmd_function)proxy_challenge,        2,
159
-		fixup_auth_challenge, REQUEST_ROUTE | FAILURE_ROUTE | ONREPLY_ROUTE},
159
+		fixup_auth_challenge, 0, REQUEST_ROUTE | FAILURE_ROUTE | ONREPLY_ROUTE},
160 160
 	{"auth_challenge",         (cmd_function)w_auth_challenge,       2,
161
-		fixup_auth_challenge, REQUEST_ROUTE | FAILURE_ROUTE | ONREPLY_ROUTE},
161
+		fixup_auth_challenge, 0, REQUEST_ROUTE | FAILURE_ROUTE | ONREPLY_ROUTE},
162 162
 	{"pv_www_authorize",       (cmd_function)pv_www_authenticate,    3,
163
-		fixup_pv_auth, REQUEST_ROUTE},
163
+		fixup_pv_auth, 0, REQUEST_ROUTE},
164 164
 	{"pv_www_authenticate",    (cmd_function)pv_www_authenticate,    3,
165
-		fixup_pv_auth, REQUEST_ROUTE},
165
+		fixup_pv_auth, 0, REQUEST_ROUTE},
166 166
 	{"pv_www_authenticate",    (cmd_function)pv_www_authenticate2,   4,
167
-		fixup_pv_auth, REQUEST_ROUTE},
167
+		fixup_pv_auth, 0, REQUEST_ROUTE},
168 168
 	{"pv_proxy_authorize",     (cmd_function)pv_proxy_authenticate,  3,
169
-		fixup_pv_auth, REQUEST_ROUTE},
169
+		fixup_pv_auth, 0, REQUEST_ROUTE},
170 170
 	{"pv_proxy_authenticate",  (cmd_function)pv_proxy_authenticate,  3,
171
-		fixup_pv_auth, REQUEST_ROUTE},
171
+		fixup_pv_auth, 0, REQUEST_ROUTE},
172 172
 	{"auth_get_www_authenticate",  (cmd_function)w_auth_get_www_authenticate,  3,
173
-		fixup_auth_get_www_authenticate, REQUEST_ROUTE},
173
+		fixup_auth_get_www_authenticate, 0, REQUEST_ROUTE},
174 174
 	{"has_credentials",        w_has_credentials,                    1,
175
-		fixup_spve_null, REQUEST_ROUTE},
175
+		fixup_spve_null, 0, REQUEST_ROUTE},
176 176
 	{"pv_auth_check",         (cmd_function)w_pv_auth_check,           4,
177
-		fixup_pv_auth_check, REQUEST_ROUTE},
177
+		fixup_pv_auth_check, 0, REQUEST_ROUTE},
178 178
 	{"bind_auth_s",           (cmd_function)bind_auth_s, 0, 0, 0        },
179
-	{0, 0, 0, 0, 0}
179
+	{0, 0, 0, 0, 0, 0}
180 180
 };
181 181
 
182 182
 
... ...
@@ -216,14 +216,15 @@ static param_export_t params[] = {
216 216
  */
217 217
 struct module_exports exports = {
218 218
 	"auth",
219
+	DEFAULT_DLFLAGS, /* dlopen flags */
219 220
 	cmds,
220
-	0,          /* RPC methods */
221 221
 	params,
222
-	mod_init,   /* module initialization function */
222
+	0,          /* RPC methods */
223
+        0,          /* pseudo-variables exports */
223 224
 	0,          /* response function */
224
-	destroy,    /* destroy function */
225
-	0,          /* oncancel function */
226
-	0           /* child initialization function */
225
+	mod_init,   /* module initialization function */
226
+	0,          /* child initialization function */
227
+	destroy     /* destroy function */
227 228
 };
228 229
 
229 230