[sr-dev] git:master:6b0ea231: auth: exported some functions to kemi
Daniel-Constantin Mierla
miconda at gmail.com
Thu Apr 21 15:43:15 CEST 2016
Module: kamailio
Branch: master
Commit: 6b0ea23166dd567c162b3152167da445f8bd555d
URL: https://github.com/kamailio/kamailio/commit/6b0ea23166dd567c162b3152167da445f8bd555d
Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2016-04-21T15:09:07+02:00
auth: exported some functions to kemi
- consume_credentials()
- auth_challenge(...)
- pv_auth_check(...)
---
Modified: modules/auth/auth_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/6b0ea23166dd567c162b3152167da445f8bd555d.diff
Patch: https://github.com/kamailio/kamailio/commit/6b0ea23166dd567c162b3152167da445f8bd555d.patch
---
diff --git a/modules/auth/auth_mod.c b/modules/auth/auth_mod.c
index bb029fc..c4c9619 100644
--- a/modules/auth/auth_mod.c
+++ b/modules/auth/auth_mod.c
@@ -39,6 +39,7 @@
#include "../../pvapi.h"
#include "../../lvalue.h"
#include "../../mod_fix.h"
+#include "../../kemi.h"
#include "../../modules/sl/sl.h"
#include "auth_mod.h"
#include "challenge.h"
@@ -1171,3 +1172,35 @@ static int fixup_auth_get_www_authenticate(void **param, int param_no)
}
return 0;
}
+
+/**
+ *
+ */
+static sr_kemi_t sr_kemi_auth_exports[] = {
+ { str_init("auth"), str_init("consume_credentials"),
+ SR_KEMIP_INT, consume_credentials,
+ { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
+ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+ },
+ { str_init("auth"), str_init("auth_challenge"),
+ SR_KEMIP_INT, auth_challenge,
+ { SR_KEMIP_STR, SR_KEMIP_INT, SR_KEMIP_NONE,
+ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+ },
+ { str_init("auth"), str_init("pv_auth_check"),
+ SR_KEMIP_INT, pv_auth_check,
+ { SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_INT,
+ SR_KEMIP_INT, SR_KEMIP_NONE, SR_KEMIP_NONE }
+ },
+
+ { {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }
+};
+
+/**
+ *
+ */
+int mod_register(char *path, int *dlflags, void *p1, void *p2)
+{
+ sr_kemi_modules_add(sr_kemi_auth_exports);
+ return 0;
+}
More information about the sr-dev
mailing list