00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _AUTH_DB_API_H_
00027 #define _AUTH_DB_API_H_
00028
00029 #include "../../sr_module.h"
00030 #include "../../parser/msg_parser.h"
00031
00032 typedef int (*digest_authenticate_f)(struct sip_msg* msg, str *realm,
00033 str *table, hdr_types_t hftype);
00037 typedef struct auth_db_api {
00038 digest_authenticate_f digest_authenticate;
00039 } auth_db_api_t;
00040
00041 typedef int (*bind_auth_db_f)(auth_db_api_t* api);
00042
00046 static inline int auth_db_load_api(auth_db_api_t *api)
00047 {
00048 bind_auth_db_f bindauthdb;
00049
00050 bindauthdb = (bind_auth_db_f)find_export("bind_auth_db", 0, 0);
00051 if(bindauthdb == 0) {
00052 LM_ERR("cannot find bind_auth_db\n");
00053 return -1;
00054 }
00055 if (bindauthdb(api)==-1)
00056 {
00057 LM_ERR("cannot bind authdb api\n");
00058 return -1;
00059 }
00060 return 0;
00061 }
00062
00063 #endif