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
deleted file mode 100644
... ...
@@ -1,119 +0,0 @@
1
-/* 
2
- * MySQL module interface
3
- *
4
- * Copyright (C) 2001-2003 FhG Fokus
5
- * Copyright (C) 2008 1&1 Internet AG
6
- *
7
- * This file is part of Kamailio, a free SIP server.
8
- *
9
- * Kamailio is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License as published by
11
- * the Free Software Foundation; either version 2 of the License, or
12
- * (at your option) any later version
13
- *
14
- * Kamailio is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
- * GNU General Public License for more details.
18
- *
19
- * You should have received a copy of the GNU General Public License 
20
- * along with this program; if not, write to the Free Software 
21
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22
- */
23
-
24
-/*! \file
25
- *  \brief DB_MYSQL :: Core
26
- *  \ingroup db_mysql
27
- *  Module: \ref db_mysql
28
- */
29
-
30
-/*! \defgroup db_mysql DB_MYSQL :: the MySQL driver for Kamailio
31
- *  \brief The Kamailio database interface to the MySQL database
32
- *  - http://www.mysql.org
33
- *
34
- */
35
-
36
-#include "../../sr_module.h"
37
-#include "../../dprint.h"
38
-#include "km_dbase.h"
39
-#include "km_db_mysql.h"
40
-
41
-#include <mysql.h>
42
-
43
-unsigned int db_mysql_timeout_interval = 2;   /* Default is 6 seconds */
44
-unsigned int db_mysql_auto_reconnect = 1;     /* Default is enabled   */
45
-unsigned int db_mysql_insert_all_delayed = 0; /* Default is off */
46
-unsigned int db_mysql_update_affected_found = 0; /* Default is off */
47
-
48
-/* MODULE_VERSION */
49
-
50
-/*! \brief
51
- * MySQL database module interface
52
- */
53
-static kam_cmd_export_t cmds[] = {
54
-	{"db_bind_api",         (cmd_function)db_mysql_bind_api,      0, 0, 0, 0},
55
-	{0, 0, 0, 0, 0, 0}
56
-};
57
-
58
-/*! \brief
59
- * Exported parameters
60
- */
61
-static param_export_t params[] = {
62
-/*	{"ping_interval",    INT_PARAM, &db_mysql_ping_interval}, */
63
-	{"timeout_interval", INT_PARAM, &db_mysql_timeout_interval},
64
-	{"auto_reconnect",   INT_PARAM, &db_mysql_auto_reconnect},
65
-	{0, 0, 0}
66
-};
67
-
68
-struct kam_module_exports kam_exports = {	
69
-	"db_mysql",
70
-	DEFAULT_DLFLAGS, /* dlopen flags */
71
-	cmds,
72
-	params,          /*  module parameters */
73
-	0,               /* exported statistics */
74
-	0,               /* exported MI functions */
75
-	0,               /* exported pseudo-variables */
76
-	0,               /* extra processes */
77
-	kam_mysql_mod_init,  /* module initialization function */
78
-	0,               /* response function*/
79
-	0,               /* destroy function */
80
-	0                /* per-child init function */
81
-};
82
-
83
-
84
-int kam_mysql_mod_init(void)
85
-{
86
-	LM_DBG("MySQL client version is %s\n", mysql_get_client_info());
87
-	return 0;
88
-}
89
-
90
-int db_mysql_bind_api(db_func_t *dbb)
91
-{
92
-	if(dbb==NULL)
93
-		return -1;
94
-
95
-	memset(dbb, 0, sizeof(db_func_t));
96
-
97
-	dbb->use_table        = db_mysql_use_table;
98
-	dbb->init             = db_mysql_init;
99
-	dbb->close            = db_mysql_close;
100
-	dbb->query            = db_mysql_query;
101
-	dbb->fetch_result     = db_mysql_fetch_result;
102
-	dbb->raw_query        = db_mysql_raw_query;
103
-	dbb->free_result      = (db_free_result_f) db_mysql_free_result;
104
-	dbb->insert           = db_mysql_insert;
105
-	dbb->delete           = db_mysql_delete;
106
-	dbb->update           = db_mysql_update;
107
-	dbb->replace          = db_mysql_replace;
108
-	dbb->last_inserted_id = db_mysql_last_inserted_id;
109
-	dbb->insert_update    = db_mysql_insert_update;
110
-	dbb->insert_delayed   = db_mysql_insert_delayed;
111
-	dbb->affected_rows    = db_mysql_affected_rows;
112
-	dbb->start_transaction= db_mysql_start_transaction;
113
-	dbb->end_transaction  = db_mysql_end_transaction;
114
-	dbb->abort_transaction= db_mysql_abort_transaction;
115
-	dbb->raw_query_async  = db_mysql_raw_query_async;
116
-	dbb->insert_async     = db_mysql_insert_async;
117
-
118
-	return 0;
119
-}
Browse code

db_mysql: updated include paths for libmysqlclient

- direct use of mysql_config, the old substitution done in module
Makefile can break the includes of libmysqlclient files
- reported by Ian Yu-Hsun Lin, GH#419

Daniel-Constantin Mierla authored on 26/11/2015 23:03:26
Showing 1 changed files
... ...
@@ -38,7 +38,7 @@
38 38
 #include "km_dbase.h"
39 39
 #include "km_db_mysql.h"
40 40
 
41
-#include <mysql/mysql.h>
41
+#include <mysql.h>
42 42
 
43 43
 unsigned int db_mysql_timeout_interval = 2;   /* Default is 6 seconds */
44 44
 unsigned int db_mysql_auto_reconnect = 1;     /* Default is enabled   */
Browse code

db_mysql: Remove SVN ID's, remove history sections

Olle E. Johansson authored on 11/03/2015 15:26:21
Showing 1 changed files
... ...
@@ -1,6 +1,4 @@
1 1
 /* 
2
- * $Id$ 
3
- *
4 2
  * MySQL module interface
5 3
  *
6 4
  * Copyright (C) 2001-2003 FhG Fokus
... ...
@@ -22,12 +20,6 @@
22 20
  * along with this program; if not, write to the Free Software 
23 21
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
24 22
  */
25
-/*
26
- * History:
27
- * --------
28
- *  2003-03-11  updated to the new module exports interface (andrei)
29
- *  2003-03-16  flags export parameter added (janakj)
30
- */
31 23
 
32 24
 /*! \file
33 25
  *  \brief DB_MYSQL :: Core
Browse code

modules/db_mysql: added parameter to change affected rows value for UPDATE queries - enabled will return the number of matched/foudn rows as opposed to the number of updated rows

Jason Penton authored on 09/10/2014 15:02:57
Showing 1 changed files
... ...
@@ -51,6 +51,7 @@
51 51
 unsigned int db_mysql_timeout_interval = 2;   /* Default is 6 seconds */
52 52
 unsigned int db_mysql_auto_reconnect = 1;     /* Default is enabled   */
53 53
 unsigned int db_mysql_insert_all_delayed = 0; /* Default is off */
54
+unsigned int db_mysql_update_affected_found = 0; /* Default is off */
54 55
 
55 56
 /* MODULE_VERSION */
56 57
 
Browse code

all: updated FSF address in GPL text

Anthony Messina authored on 04/07/2014 09:36:37 • Daniel-Constantin Mierla committed on 04/07/2014 09:37:36
Showing 1 changed files
... ...
@@ -20,7 +20,7 @@
20 20
  *
21 21
  * You should have received a copy of the GNU General Public License 
22 22
  * along with this program; if not, write to the Free Software 
23
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
24 24
  */
25 25
 /*
26 26
  * History:
Browse code

db_mysql: implemented async raw query and async insert

- both use the core async framework

Daniel-Constantin Mierla authored on 14/04/2014 20:17:51
Showing 1 changed files
... ...
@@ -119,6 +119,8 @@ int db_mysql_bind_api(db_func_t *dbb)
119 119
 	dbb->start_transaction= db_mysql_start_transaction;
120 120
 	dbb->end_transaction  = db_mysql_end_transaction;
121 121
 	dbb->abort_transaction= db_mysql_abort_transaction;
122
+	dbb->raw_query_async  = db_mysql_raw_query_async;
123
+	dbb->insert_async     = db_mysql_insert_async;
122 124
 
123 125
 	return 0;
124 126
 }
Browse code

db_mysql: add cast to remove compile warning

Richard Fuchs authored on 29/04/2013 15:26:18
Showing 1 changed files
... ...
@@ -107,7 +107,7 @@ int db_mysql_bind_api(db_func_t *dbb)
107 107
 	dbb->query            = db_mysql_query;
108 108
 	dbb->fetch_result     = db_mysql_fetch_result;
109 109
 	dbb->raw_query        = db_mysql_raw_query;
110
-	dbb->free_result      = db_mysql_free_result;
110
+	dbb->free_result      = (db_free_result_f) db_mysql_free_result;
111 111
 	dbb->insert           = db_mysql_insert;
112 112
 	dbb->delete           = db_mysql_delete;
113 113
 	dbb->update           = db_mysql_update;
Browse code

db_mysql Add transaction support

Patch contributed via Google+ by Håkon Nassjöen <haakon.nassjoen@gmail.com>

Olle E. Johansson authored on 02/04/2013 12:13:01
Showing 1 changed files
... ...
@@ -116,6 +116,9 @@ int db_mysql_bind_api(db_func_t *dbb)
116 116
 	dbb->insert_update    = db_mysql_insert_update;
117 117
 	dbb->insert_delayed   = db_mysql_insert_delayed;
118 118
 	dbb->affected_rows    = db_mysql_affected_rows;
119
+	dbb->start_transaction= db_mysql_start_transaction;
120
+	dbb->end_transaction  = db_mysql_end_transaction;
121
+	dbb->abort_transaction= db_mysql_abort_transaction;
119 122
 
120 123
 	return 0;
121 124
 }
Browse code

db_mysql: new module parameter - insert_delayed

- if set to 1, then all INSERT API queries will be converted in INSERT
DELAYED (only DB API insert, not for raw queries)

Daniel-Constantin Mierla authored on 24/03/2013 12:07:39
Showing 1 changed files
... ...
@@ -50,6 +50,7 @@
50 50
 
51 51
 unsigned int db_mysql_timeout_interval = 2;   /* Default is 6 seconds */
52 52
 unsigned int db_mysql_auto_reconnect = 1;     /* Default is enabled   */
53
+unsigned int db_mysql_insert_all_delayed = 0; /* Default is off */
53 54
 
54 55
 /* MODULE_VERSION */
55 56
 
Browse code

db_mysql: initialize DB API in mod_register() function

- internal buffer sql_buf initialized in this function
- renamed sql_buf to mysql_sql_buf to avoid potential conflict with
global variable in srdb1 library

Daniel-Constantin Mierla authored on 01/11/2011 19:18:36
Showing 1 changed files
... ...
@@ -90,7 +90,7 @@ struct kam_module_exports kam_exports = {
90 90
 int kam_mysql_mod_init(void)
91 91
 {
92 92
 	LM_DBG("MySQL client version is %s\n", mysql_get_client_info());
93
-	return db_mysql_alloc_buffer();
93
+	return 0;
94 94
 }
95 95
 
96 96
 int db_mysql_bind_api(db_func_t *dbb)
Browse code

modules/db_mysql: Implement affected_rows for mysql

Alex Hermann authored on 09/08/2011 09:58:01
Showing 1 changed files
... ...
@@ -114,7 +114,7 @@ int db_mysql_bind_api(db_func_t *dbb)
114 114
 	dbb->last_inserted_id = db_mysql_last_inserted_id;
115 115
 	dbb->insert_update    = db_mysql_insert_update;
116 116
 	dbb->insert_delayed   = db_mysql_insert_delayed;
117
+	dbb->affected_rows    = db_mysql_affected_rows;
117 118
 
118 119
 	return 0;
119 120
 }
120
-
Browse code

db_mysql: renamed some internal functions

- 'mysql' added in the name of some functions from DB APIv1 to be
consistent with the rest of them

Daniel-Constantin Mierla authored on 17/08/2011 22:35:48
Showing 1 changed files
... ...
@@ -111,8 +111,8 @@ int db_mysql_bind_api(db_func_t *dbb)
111 111
 	dbb->delete           = db_mysql_delete;
112 112
 	dbb->update           = db_mysql_update;
113 113
 	dbb->replace          = db_mysql_replace;
114
-	dbb->last_inserted_id = db_last_inserted_id;
115
-	dbb->insert_update    = db_insert_update;
114
+	dbb->last_inserted_id = db_mysql_last_inserted_id;
115
+	dbb->insert_update    = db_mysql_insert_update;
116 116
 	dbb->insert_delayed   = db_mysql_insert_delayed;
117 117
 
118 118
 	return 0;
Browse code

db_mysql: insert delayed implemented for DB API v1

Daniel-Constantin Mierla authored on 17/08/2011 22:33:51
Showing 1 changed files
... ...
@@ -113,6 +113,7 @@ int db_mysql_bind_api(db_func_t *dbb)
113 113
 	dbb->replace          = db_mysql_replace;
114 114
 	dbb->last_inserted_id = db_last_inserted_id;
115 115
 	dbb->insert_update    = db_insert_update;
116
+	dbb->insert_delayed   = db_mysql_insert_delayed;
116 117
 
117 118
 	return 0;
118 119
 }
Browse code

core, srdb1, modules/db_*, modules_k/db_*: Added support for configuring SQL buffer size and mediumblob/mediumtext in MySQL

- Currently the SQL buffer size is hard-coded to 64k. This isn't
enough in some cases. For example, it is easily possible for
resource lists (which can be Network Address Books) to be larger
than 64k.
- The default buffer size is still 64k, but this can be overriden
with the new "sql_buffer_size" configuration option.
- Support added for mediumblob/mediumtext in MySQL as the blob/text
types that are currently supported are limited to 64k.
- Feature added by Andrew Miller at Crocodile RCS

pd authored on 27/07/2011 10:50:20
Showing 1 changed files
... ...
@@ -90,7 +90,7 @@ struct kam_module_exports kam_exports = {
90 90
 int kam_mysql_mod_init(void)
91 91
 {
92 92
 	LM_DBG("MySQL client version is %s\n", mysql_get_client_info());
93
-	return 0;
93
+	return db_mysql_alloc_buffer();
94 94
 }
95 95
 
96 96
 int db_mysql_bind_api(db_func_t *dbb)
Browse code

mysql: include dprint.h

- several files were missing include of dprint.h
- could be the cause for missing symbol reported by Pratab Ali for
opensuse

Daniel-Constantin Mierla authored on 14/04/2010 08:39:47
Showing 1 changed files
... ...
@@ -42,6 +42,7 @@
42 42
  */
43 43
 
44 44
 #include "../../sr_module.h"
45
+#include "../../dprint.h"
45 46
 #include "km_dbase.h"
46 47
 #include "km_db_mysql.h"
47 48
 
Browse code

Make sure mod_init from kamailio/db_mysql is called.

Changes include:
* mysql_mod_init renamed to kam_mysql_mod_init to avoid conflicts
with sources from ser
* The function is no longer static so that it can be accessed from
mysql_mod.c
* mysql_mod_init modified to call kam_mysql_mod_init at the end.

Jan Janak authored on 17/02/2009 10:12:04
Showing 1 changed files
... ...
@@ -50,8 +50,6 @@
50 50
 unsigned int db_mysql_timeout_interval = 2;   /* Default is 6 seconds */
51 51
 unsigned int db_mysql_auto_reconnect = 1;     /* Default is enabled   */
52 52
 
53
-static int mysql_mod_init(void);
54
-
55 53
 /* MODULE_VERSION */
56 54
 
57 55
 /*! \brief
... ...
@@ -81,14 +79,14 @@ struct kam_module_exports kam_exports = {
81 79
 	0,               /* exported MI functions */
82 80
 	0,               /* exported pseudo-variables */
83 81
 	0,               /* extra processes */
84
-	mysql_mod_init,  /* module initialization function */
82
+	kam_mysql_mod_init,  /* module initialization function */
85 83
 	0,               /* response function*/
86 84
 	0,               /* destroy function */
87 85
 	0                /* per-child init function */
88 86
 };
89 87
 
90 88
 
91
-static int mysql_mod_init(void)
89
+int kam_mysql_mod_init(void)
92 90
 {
93 91
 	LM_DBG("MySQL client version is %s\n", mysql_get_client_info());
94 92
 	return 0;
Browse code

Export kamailio/db_mysql parameters through the module api.

All parameters original exported by kamailio/db_mysql are now exported
thought the api of the merged module in sip-router/modules/db_mysql.

The parameter ping_interval is already present in the sources coming
from ser, so we removed the original parameter from kamailio and used
the one coming from ser.

Jan Janak authored on 17/02/2009 10:04:29
Showing 1 changed files
... ...
@@ -47,7 +47,6 @@
47 47
 
48 48
 #include <mysql/mysql.h>
49 49
 
50
-unsigned int db_mysql_ping_interval = 5 * 60; /* Default is 5 minutes */
51 50
 unsigned int db_mysql_timeout_interval = 2;   /* Default is 6 seconds */
52 51
 unsigned int db_mysql_auto_reconnect = 1;     /* Default is enabled   */
53 52
 
... ...
@@ -67,7 +66,7 @@ static kam_cmd_export_t cmds[] = {
67 66
  * Exported parameters
68 67
  */
69 68
 static param_export_t params[] = {
70
-	{"ping_interval",    INT_PARAM, &db_mysql_ping_interval},
69
+/*	{"ping_interval",    INT_PARAM, &db_mysql_ping_interval}, */
71 70
 	{"timeout_interval", INT_PARAM, &db_mysql_timeout_interval},
72 71
 	{"auto_reconnect",   INT_PARAM, &db_mysql_auto_reconnect},
73 72
 	{0, 0, 0}
Browse code

Export db_bind_api through the module interface.

Jan Janak authored on 17/02/2009 09:49:06
Showing 1 changed files
... ...
@@ -42,7 +42,6 @@
42 42
  */
43 43
 
44 44
 #include "../../sr_module.h"
45
-#include "../../lib/srdb1/db.h"
46 45
 #include "km_dbase.h"
47 46
 #include "km_db_mysql.h"
48 47
 
... ...
@@ -56,8 +55,6 @@ static int mysql_mod_init(void);
56 55
 
57 56
 /* MODULE_VERSION */
58 57
 
59
-int db_mysql_bind_api(db_func_t *dbb);
60
-
61 58
 /*! \brief
62 59
  * MySQL database module interface
63 60
  */
Browse code

Eliminate conflicts with files imported from ser/mysql modules.

* Comment out MODULE_VERSION, this is already used in mysql_mod.c
* Prefix the type name of kamailio module data structures with kam_,
this is how they were renamed in the sip-router repository.
* Rename the exports structure to kam_exports to avoid conflict with
the exports structure defined in mysql_mod.c

Jan Janak authored on 16/02/2009 23:05:25
Showing 1 changed files
... ...
@@ -54,19 +54,18 @@ unsigned int db_mysql_auto_reconnect = 1;     /* Default is enabled   */
54 54
 
55 55
 static int mysql_mod_init(void);
56 56
 
57
-MODULE_VERSION
57
+/* MODULE_VERSION */
58 58
 
59 59
 int db_mysql_bind_api(db_func_t *dbb);
60 60
 
61 61
 /*! \brief
62 62
  * MySQL database module interface
63 63
  */
64
-static cmd_export_t cmds[] = {
64
+static kam_cmd_export_t cmds[] = {
65 65
 	{"db_bind_api",         (cmd_function)db_mysql_bind_api,      0, 0, 0, 0},
66 66
 	{0, 0, 0, 0, 0, 0}
67 67
 };
68 68
 
69
-
70 69
 /*! \brief
71 70
  * Exported parameters
72 71
  */
... ...
@@ -77,8 +76,7 @@ static param_export_t params[] = {
77 76
 	{0, 0, 0}
78 77
 };
79 78
 
80
-
81
-struct module_exports exports = {	
79
+struct kam_module_exports kam_exports = {	
82 80
 	"db_mysql",
83 81
 	DEFAULT_DLFLAGS, /* dlopen flags */
84 82
 	cmds,
Browse code

Integration of both modules, first step.

* Defines protecting header files from double inclusion fixed to match
filenames.
* Linked the module also with srdb1
* Fixed path to header files in lib/srdb1.
* Filenames of local included header files prefixed with km_ to match
their real filenames

Jan Janak authored on 16/02/2009 21:58:33
Showing 1 changed files
... ...
@@ -42,9 +42,9 @@
42 42
  */
43 43
 
44 44
 #include "../../sr_module.h"
45
-#include "../../db/db.h"
46
-#include "dbase.h"
47
-#include "db_mysql.h"
45
+#include "../../lib/srdb1/db.h"
46
+#include "km_dbase.h"
47
+#include "km_db_mysql.h"
48 48
 
49 49
 #include <mysql/mysql.h>
50 50
 
Browse code

- fix one DBG msg (still using module prefix), two small indention fixes

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@5425 689a6050-402a-0410-94f2-e92a70836424

Henning Westerholt authored on 07/01/2009 08:43:22
Showing 1 changed files
... ...
@@ -96,7 +96,7 @@ struct module_exports exports = {
96 96
 
97 97
 static int mysql_mod_init(void)
98 98
 {
99
-	LM_DBG("mysql: MySQL client version is %s\n", mysql_get_client_info());
99
+	LM_DBG("MySQL client version is %s\n", mysql_get_client_info());
100 100
 	return 0;
101 101
 }
102 102
 
... ...
@@ -115,7 +115,7 @@ int db_mysql_bind_api(db_func_t *dbb)
115 115
 	dbb->raw_query        = db_mysql_raw_query;
116 116
 	dbb->free_result      = db_mysql_free_result;
117 117
 	dbb->insert           = db_mysql_insert;
118
-	dbb->delete           = db_mysql_delete; 
118
+	dbb->delete           = db_mysql_delete;
119 119
 	dbb->update           = db_mysql_update;
120 120
 	dbb->replace          = db_mysql_replace;
121 121
 	dbb->last_inserted_id = db_last_inserted_id;
Browse code

- renaming: openser -> kamailio

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@4585 689a6050-402a-0410-94f2-e92a70836424

Klaus Darilion authored on 06/08/2008 08:20:30
Showing 1 changed files
... ...
@@ -35,8 +35,8 @@
35 35
  *  Module: \ref db_mysql
36 36
  */
37 37
 
38
-/*! \defgroup db_mysql DB_MYSQL :: the MySQL driver for OpenSER
39
- *  \brief The OpenSER database interface to the MySQL database
38
+/*! \defgroup db_mysql DB_MYSQL :: the MySQL driver for Kamailio
39
+ *  \brief The Kamailio database interface to the MySQL database
40 40
  *  - http://www.mysql.org
41 41
  *
42 42
  */
Browse code

- change name in copyright headers

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@4518 689a6050-402a-0410-94f2-e92a70836424

Henning Westerholt authored on 28/07/2008 15:39:28
Showing 1 changed files
... ...
@@ -6,14 +6,14 @@
6 6
  * Copyright (C) 2001-2003 FhG Fokus
7 7
  * Copyright (C) 2008 1&1 Internet AG
8 8
  *
9
- * This file is part of openser, a free SIP server.
9
+ * This file is part of Kamailio, a free SIP server.
10 10
  *
11
- * openser is free software; you can redistribute it and/or modify
11
+ * Kamailio is free software; you can redistribute it and/or modify
12 12
  * it under the terms of the GNU General Public License as published by
13 13
  * the Free Software Foundation; either version 2 of the License, or
14 14
  * (at your option) any later version
15 15
  *
16
- * openser is distributed in the hope that it will be useful,
16
+ * Kamailio is distributed in the hope that it will be useful,
17 17
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 18
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 19
  * GNU General Public License for more details.
Browse code

- small doxygen updates (group, syntax), small docs update - patch provided from Olle E. Johansson, closes #2025079

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@4505 689a6050-402a-0410-94f2-e92a70836424

Henning Westerholt authored on 24/07/2008 15:20:11
Showing 1 changed files
... ...
@@ -29,6 +29,18 @@
29 29
  *  2003-03-16  flags export parameter added (janakj)
30 30
  */
31 31
 
32
+/*! \file
33
+ *  \brief DB_MYSQL :: Core
34
+ *  \ingroup db_mysql
35
+ *  Module: \ref db_mysql
36
+ */
37
+
38
+/*! \defgroup db_mysql DB_MYSQL :: the MySQL driver for OpenSER
39
+ *  \brief The OpenSER database interface to the MySQL database
40
+ *  - http://www.mysql.org
41
+ *
42
+ */
43
+
32 44
 #include "../../sr_module.h"
33 45
 #include "../../db/db.h"
34 46
 #include "dbase.h"
... ...
@@ -46,7 +58,7 @@ MODULE_VERSION
46 58
 
47 59
 int db_mysql_bind_api(db_func_t *dbb);
48 60
 
49
-/*
61
+/*! \brief
50 62
  * MySQL database module interface
51 63
  */
52 64
 static cmd_export_t cmds[] = {
... ...
@@ -55,7 +67,7 @@ static cmd_export_t cmds[] = {
55 67
 };
56 68
 
57 69
 
58
-/*
70
+/*! \brief
59 71
  * Exported parameters
60 72
  */
61 73
 static param_export_t params[] = {
Browse code

- mysql module exports db_bind_api()

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@3813 689a6050-402a-0410-94f2-e92a70836424

Daniel-Constantin Mierla authored on 29/02/2008 20:38:56
Showing 1 changed files
... ...
@@ -30,6 +30,7 @@
30 30
  */
31 31
 
32 32
 #include "../../sr_module.h"
33
+#include "../../db/db.h"
33 34
 #include "dbase.h"
34 35
 #include "db_mysql.h"
35 36
 
... ...
@@ -43,24 +44,13 @@ static int mysql_mod_init(void);
43 44
 
44 45
 MODULE_VERSION
45 46
 
47
+int db_mysql_bind_api(db_func_t *dbb);
46 48
 
47 49
 /*
48 50
  * MySQL database module interface
49 51
  */
50 52
 static cmd_export_t cmds[] = {
51
-	{"db_use_table",        (cmd_function)db_mysql_use_table,     2, 0, 0, 0},
52
-	{"db_init",             (cmd_function)db_mysql_init,          1, 0, 0, 0},
53
-	{"db_close",            (cmd_function)db_mysql_close,         2, 0, 0, 0},
54
-	{"db_query",            (cmd_function)db_mysql_query,         2, 0, 0, 0},
55
-	{"db_fetch_result",     (cmd_function)db_mysql_fetch_result,  2, 0, 0, 0},
56
-	{"db_raw_query",        (cmd_function)db_mysql_raw_query,     2, 0, 0, 0},
57
-	{"db_free_result",      (cmd_function)db_mysql_free_result,   2, 0, 0, 0},
58
-	{"db_insert",           (cmd_function)db_mysql_insert,        2, 0, 0, 0},
59
-	{"db_delete",           (cmd_function)db_mysql_delete,        2, 0, 0, 0},
60
-	{"db_update",           (cmd_function)db_mysql_update,        2, 0, 0, 0},
61
-	{"db_replace",          (cmd_function)db_mysql_replace,       2, 0, 0, 0},
62
-	{"db_last_inserted_id", (cmd_function)db_last_inserted_id,    1, 0, 0, 0},
63
-	{"db_insert_update",    (cmd_function)db_insert_update,       2, 0, 0, 0},
53
+	{"db_bind_api",         (cmd_function)db_mysql_bind_api,      0, 0, 0, 0},
64 54
 	{0, 0, 0, 0, 0, 0}
65 55
 };
66 56
 
... ...
@@ -97,3 +87,28 @@ static int mysql_mod_init(void)
97 87
 	LM_DBG("mysql: MySQL client version is %s\n", mysql_get_client_info());
98 88
 	return 0;
99 89
 }
90
+
91
+int db_mysql_bind_api(db_func_t *dbb)
92
+{
93
+	if(dbb==NULL)
94
+		return -1;
95
+
96
+	memset(dbb, 0, sizeof(db_func_t));
97
+
98
+	dbb->use_table        = db_mysql_use_table;
99
+	dbb->init             = db_mysql_init;
100
+	dbb->close            = db_mysql_close;
101
+	dbb->query            = db_mysql_query;
102
+	dbb->fetch_result     = db_mysql_fetch_result;
103
+	dbb->raw_query        = db_mysql_raw_query;
104
+	dbb->free_result      = db_mysql_free_result;
105
+	dbb->insert           = db_mysql_insert;
106
+	dbb->delete           = db_mysql_delete; 
107
+	dbb->update           = db_mysql_update;
108
+	dbb->replace          = db_mysql_replace;
109
+	dbb->last_inserted_id = db_last_inserted_id;
110
+	dbb->insert_update    = db_insert_update;
111
+
112
+	return 0;
113
+}
114
+
Browse code

- rename db_mod.* files - rename my_con.* files in db_unixodbc - fix includes in modules

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@3666 689a6050-402a-0410-94f2-e92a70836424

Henning Westerholt authored on 08/02/2008 11:39:46
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,99 @@
1
+/* 
2
+ * $Id$ 
3
+ *
4
+ * MySQL module interface
5
+ *
6
+ * Copyright (C) 2001-2003 FhG Fokus
7
+ * Copyright (C) 2008 1&1 Internet AG
8
+ *
9
+ * This file is part of openser, a free SIP server.
10
+ *
11
+ * openser is free software; you can redistribute it and/or modify
12
+ * it under the terms of the GNU General Public License as published by
13
+ * the Free Software Foundation; either version 2 of the License, or
14
+ * (at your option) any later version
15
+ *
16
+ * openser is distributed in the hope that it will be useful,
17
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
+ * GNU General Public License for more details.
20
+ *
21
+ * You should have received a copy of the GNU General Public License 
22
+ * along with this program; if not, write to the Free Software 
23
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
24
+ */
25
+/*
26
+ * History:
27
+ * --------
28
+ *  2003-03-11  updated to the new module exports interface (andrei)
29
+ *  2003-03-16  flags export parameter added (janakj)
30
+ */
31
+
32
+#include "../../sr_module.h"
33
+#include "dbase.h"
34
+#include "db_mysql.h"
35
+
36
+#include <mysql/mysql.h>
37
+
38
+unsigned int db_mysql_ping_interval = 5 * 60; /* Default is 5 minutes */
39
+unsigned int db_mysql_timeout_interval = 2;   /* Default is 6 seconds */
40
+unsigned int db_mysql_auto_reconnect = 1;     /* Default is enabled   */
41
+
42
+static int mysql_mod_init(void);
43
+
44
+MODULE_VERSION
45
+
46
+
47
+/*
48
+ * MySQL database module interface
49
+ */
50
+static cmd_export_t cmds[] = {
51
+	{"db_use_table",        (cmd_function)db_mysql_use_table,     2, 0, 0, 0},
52
+	{"db_init",             (cmd_function)db_mysql_init,          1, 0, 0, 0},
53
+	{"db_close",            (cmd_function)db_mysql_close,         2, 0, 0, 0},
54
+	{"db_query",            (cmd_function)db_mysql_query,         2, 0, 0, 0},
55
+	{"db_fetch_result",     (cmd_function)db_mysql_fetch_result,  2, 0, 0, 0},
56
+	{"db_raw_query",        (cmd_function)db_mysql_raw_query,     2, 0, 0, 0},
57
+	{"db_free_result",      (cmd_function)db_mysql_free_result,   2, 0, 0, 0},
58
+	{"db_insert",           (cmd_function)db_mysql_insert,        2, 0, 0, 0},
59
+	{"db_delete",           (cmd_function)db_mysql_delete,        2, 0, 0, 0},
60
+	{"db_update",           (cmd_function)db_mysql_update,        2, 0, 0, 0},
61
+	{"db_replace",          (cmd_function)db_mysql_replace,       2, 0, 0, 0},
62
+	{"db_last_inserted_id", (cmd_function)db_last_inserted_id,    1, 0, 0, 0},
63
+	{"db_insert_update",    (cmd_function)db_insert_update,       2, 0, 0, 0},
64
+	{0, 0, 0, 0, 0, 0}
65
+};
66
+
67
+
68
+/*
69
+ * Exported parameters
70
+ */
71
+static param_export_t params[] = {
72
+	{"ping_interval",    INT_PARAM, &db_mysql_ping_interval},
73
+	{"timeout_interval", INT_PARAM, &db_mysql_timeout_interval},
74
+	{"auto_reconnect",   INT_PARAM, &db_mysql_auto_reconnect},
75
+	{0, 0, 0}
76
+};
77
+
78
+
79
+struct module_exports exports = {	
80
+	"db_mysql",
81
+	DEFAULT_DLFLAGS, /* dlopen flags */
82
+	cmds,
83
+	params,          /*  module parameters */
84
+	0,               /* exported statistics */
85
+	0,               /* exported MI functions */
86
+	0,               /* exported pseudo-variables */
87
+	0,               /* extra processes */
88
+	mysql_mod_init,  /* module initialization function */
89
+	0,               /* response function*/
90
+	0,               /* destroy function */
91
+	0                /* per-child init function */
92
+};
93
+
94
+
95
+static int mysql_mod_init(void)
96
+{
97
+	LM_DBG("mysql: MySQL client version is %s\n", mysql_get_client_info());
98
+	return 0;
99
+}