Browse code

core, lib, modules: updated include paths for header files

Daniel-Constantin Mierla authored on 07/12/2016 11:07:22
Showing 1 changed files
... ...
@@ -24,8 +24,8 @@
24 24
 #ifndef _AUTH_DB_API_H_
25 25
 #define _AUTH_DB_API_H_
26 26
 
27
-#include "../../sr_module.h"
28
-#include "../../parser/msg_parser.h"
27
+#include "../../core/sr_module.h"
28
+#include "../../core/parser/msg_parser.h"
29 29
 
30 30
 typedef int (*digest_authenticate_f)(struct sip_msg* msg, str *realm,
31 31
 				str *table, hdr_types_t hftype, str *method);
Browse code

core, lib, modules: restructured source code tree

- new folder src/ to hold the source code for main project applications
- main.c is in src/
- all core files are subfolder are in src/core/
- modules are in src/modules/
- libs are in src/lib/
- application Makefiles are in src/
- application binary is built in src/ (src/kamailio)

Daniel-Constantin Mierla authored on 07/12/2016 11:03:51
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,61 @@
1
+/*
2
+ * Digest Authentication - Database support
3
+ *
4
+ * Copyright (C) 2001-2003 FhG Fokus
5
+ *
6
+ * This file is part of Kamailio, a free SIP server.
7
+ *
8
+ * Kamailio is free software; you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation; either version 2 of the License, or
11
+ * (at your option) any later version
12
+ *
13
+ * Kamailio is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License 
19
+ * along with this program; if not, write to the Free Software 
20
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
21
+ */
22
+
23
+
24
+#ifndef _AUTH_DB_API_H_
25
+#define _AUTH_DB_API_H_
26
+
27
+#include "../../sr_module.h"
28
+#include "../../parser/msg_parser.h"
29
+
30
+typedef int (*digest_authenticate_f)(struct sip_msg* msg, str *realm,
31
+				str *table, hdr_types_t hftype, str *method);
32
+/**
33
+ * @brief AUTH_DB API structure
34
+ */
35
+typedef struct auth_db_api {
36
+	digest_authenticate_f digest_authenticate;
37
+} auth_db_api_t;
38
+
39
+typedef int (*bind_auth_db_f)(auth_db_api_t* api);
40
+
41
+/**
42
+ * @brief Load the SL API
43
+ */
44
+static inline int auth_db_load_api(auth_db_api_t *api)
45
+{
46
+	bind_auth_db_f bindauthdb;
47
+
48
+	bindauthdb = (bind_auth_db_f)find_export("bind_auth_db", 0, 0);
49
+	if(bindauthdb == 0) {
50
+		LM_ERR("cannot find bind_auth_db\n");
51
+		return -1;
52
+	}
53
+	if (bindauthdb(api)==-1)
54
+	{
55
+		LM_ERR("cannot bind authdb api\n");
56
+		return -1;
57
+	}
58
+	return 0;
59
+}
60
+
61
+#endif /* _AUTH_DB_API_H_ */