浏览代码

- fix error in previous commit, i accidently added the wrong file

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@4688 689a6050-402a-0410-94f2-e92a70836424
Henning Westerholt 17 年之前
父节点
当前提交
468c304299
共有 2 个文件被更改,包括 148 次插入136 次删除
  1. 148 0
      lib/srdb1/module/db_auth_db.h
  2. 0 136
      lib/srdb1/module/db_uri_db.h

+ 148 - 0
lib/srdb1/module/db_auth_db.h

@@ -0,0 +1,148 @@
+
+/*!
+ * \file
+ * \ingroup db
+ * \brief Database support for modules.
+ *
+ * Database support functions for modules.
+ *
+ * @cond
+ * WARNING:
+ * This file was autogenerated from the XML source file
+ * ../../db/module/kamailio-auth_db.xml.
+ * It can be regenerated by running 'make dbschema' in the top level
+ * directory of the source code. You need to have xsltproc and
+ * docbook-xsl stylesheets installed.
+ * ALL CHANGES DONE HERE WILL BE LOST IF THE FILE IS REGENERATED
+ * @endcond
+ */
+#ifndef db_auth_db_h
+#define db_auth_db_h
+
+
+/* necessary includes */
+#include "../../db/db.h"
+#include "../../str.h"
+
+#include <string.h>
+
+
+/* database variables */
+
+/* assign the read-only or read-write URL in mod_init */
+extern str auth_db_db_url;
+db_con_t * auth_db_dbh;
+db_func_t auth_db_dbf;
+
+str subscriber_table;
+
+/* column names */
+str subscriber_id_col;
+str subscriber_username_col;
+str subscriber_domain_col;
+str subscriber_password_col;
+str subscriber_email_address_col;
+str subscriber_ha1_col;
+str subscriber_ha1b_col;
+str subscriber_rpid_col;
+
+/* table version */
+static const unsigned int subscriber_version = 6;
+
+
+/*
+ * Closes the DB connection.
+ */
+static void auth_db_db_close(void) {
+	if (auth_db_dbh) {
+		auth_db_dbf.close(auth_db_dbh);
+		auth_db_dbh = NULL;
+	}
+}
+
+
+/*!
+ * Initialises the DB API, check the table version and closes the connection.
+ * This should be called from the mod_init function.
+ *
+ * \return 0 means ok, -1 means an error occured.
+ */
+static int auth_db_db_init(void) {
+	if (!auth_db_db_url.s || !auth_db_db_url.len) {
+		LM_ERR("you have to set the db_url module parameter.\n");
+		return -1;
+	}
+	if (db_bind_mod(&auth_db_db_url, &auth_db_dbf) < 0) {
+		LM_ERR("can't bind database module.\n");
+		return -1;
+	}
+	if ((auth_db_dbh = auth_db_dbf.init(&auth_db_db_url)) == NULL) {
+		LM_ERR("can't connect to database.\n");
+		return -1;
+	}
+	if (
+	(db_check_table_version(&auth_db_dbf, auth_db_dbh, &subscriber_table, subscriber_version) < 0)
+	) {
+		LM_ERR("during table version check.\n");
+		auth_db_db_close();
+		return -1;
+	}
+	auth_db_db_close();
+	return 0;
+}
+
+
+/*!
+ * Initialize the DB connection without checking the table version and DB URL.
+ * This should be called from child_init. An already existing database
+ * connection will be closed, and a new one created.
+ *
+ * \return 0 means ok, -1 means an error occured.
+ */
+static int auth_db_db_open(void) {
+	if (auth_db_dbh) {
+		auth_db_dbf.close(auth_db_dbh);
+	}
+	if ((auth_db_dbh = auth_db_dbf.init(&auth_db_db_url)) == NULL) {
+		LM_ERR("can't connect to database.\n");
+		return -1;
+	}
+	return 0;
+}
+
+
+/*!
+ * Update the variable length after eventual assignments from the config script.
+ * This is necessary because we're using the 'str' type.
+ */
+static void auth_db_db_vars(void) {
+	if (! subscriber_table.s)
+		subscriber_table.s = "subscriber";
+	subscriber_table.len = strlen(subscriber_table.s);
+	if (! subscriber_id_col.s)
+		subscriber_id_col.s = "id";
+	subscriber_id_col.len = strlen(subscriber_id_col.s);
+	if (! subscriber_username_col.s)
+		subscriber_username_col.s = "username";
+	subscriber_username_col.len = strlen(subscriber_username_col.s);
+	if (! subscriber_domain_col.s)
+		subscriber_domain_col.s = "domain";
+	subscriber_domain_col.len = strlen(subscriber_domain_col.s);
+	if (! subscriber_password_col.s)
+		subscriber_password_col.s = "password";
+	subscriber_password_col.len = strlen(subscriber_password_col.s);
+	if (! subscriber_email_address_col.s)
+		subscriber_email_address_col.s = "email_address";
+	subscriber_email_address_col.len = strlen(subscriber_email_address_col.s);
+	if (! subscriber_ha1_col.s)
+		subscriber_ha1_col.s = "ha1";
+	subscriber_ha1_col.len = strlen(subscriber_ha1_col.s);
+	if (! subscriber_ha1b_col.s)
+		subscriber_ha1b_col.s = "ha1b";
+	subscriber_ha1b_col.len = strlen(subscriber_ha1b_col.s);
+	if (! subscriber_rpid_col.s)
+		subscriber_rpid_col.s = "rpid";
+	subscriber_rpid_col.len = strlen(subscriber_rpid_col.s);
+}
+
+#endif

+ 0 - 136
lib/srdb1/module/db_uri_db.h

@@ -1,136 +0,0 @@
-
-/*!
- * \file
- * \ingroup db
- * \brief Database support for modules.
- *
- * Database support functions for modules.
- *
- * @cond
- * WARNING:
- * This file was autogenerated from the XML source file
- * ../../db/module/kamailio-uri_db.xml.
- * It can be regenerated by running 'make dbschema' in the top level
- * directory of the source code. You need to have xsltproc and
- * docbook-xsl stylesheets installed.
- * ALL CHANGES DONE HERE WILL BE LOST IF THE FILE IS REGENERATED
- * @endcond
- */
-#ifndef db_uri_db_h
-#define db_uri_db_h
-
-
-/* necessary includes */
-#include "../../db/db.h"
-#include "../../str.h"
-
-#include <string.h>
-
-
-/* database variables */
-
-/* assign the read-only or read-write URL in mod_init */
-extern str uri_db_db_url;
-db_con_t * uri_db_dbh;
-db_func_t uri_db_dbf;
-
-str uri_table;
-
-/* column names */
-str uri_id_col;
-str uri_username_col;
-str uri_domain_col;
-str uri_uri_user_col;
-str uri_last_modified_col;
-
-/* table version */
-static const unsigned int uri_version = 1;
-
-
-/*
- * Closes the DB connection.
- */
-static void uri_db_db_close(void) {
-	if (uri_db_dbh) {
-		uri_db_dbf.close(uri_db_dbh);
-		uri_db_dbh = NULL;
-	}
-}
-
-
-/*!
- * Initialises the DB API, check the table version and closes the connection.
- * This should be called from the mod_init function.
- *
- * \return 0 means ok, -1 means an error occured.
- */
-static int uri_db_db_init(void) {
-	if (!uri_db_db_url.s || !uri_db_db_url.len) {
-		LM_ERR("you have to set the db_url module parameter.\n");
-		return -1;
-	}
-	if (db_bind_mod(&uri_db_db_url, &uri_db_dbf) < 0) {
-		LM_ERR("can't bind database module.\n");
-		return -1;
-	}
-	if ((uri_db_dbh = uri_db_dbf.init(&uri_db_db_url)) == NULL) {
-		LM_ERR("can't connect to database.\n");
-		return -1;
-	}
-	if (
-	(db_check_table_version(&uri_db_dbf, uri_db_dbh, &uri_table, uri_version) < 0)
-	) {
-		LM_ERR("during table version check.\n");
-		uri_db_db_close();
-		return -1;
-	}
-	uri_db_db_close();
-	return 0;
-}
-
-
-/*!
- * Initialize the DB connection without checking the table version and DB URL.
- * This should be called from child_init. An already existing database
- * connection will be closed, and a new one created.
- *
- * \return 0 means ok, -1 means an error occured.
- */
-static int uri_db_db_open(void) {
-	if (uri_db_dbh) {
-		uri_db_dbf.close(uri_db_dbh);
-	}
-	if ((uri_db_dbh = uri_db_dbf.init(&uri_db_db_url)) == NULL) {
-		LM_ERR("can't connect to database.\n");
-		return -1;
-	}
-	return 0;
-}
-
-
-/*!
- * Update the variable length after eventual assignments from the config script.
- * This is necessary because we're using the 'str' type.
- */
-static void uri_db_db_vars(void) {
-	if (! uri_table.s)
-		uri_table.s = "uri";
-	uri_table.len = strlen(uri_table.s);
-	if (! uri_id_col.s)
-		uri_id_col.s = "id";
-	uri_id_col.len = strlen(uri_id_col.s);
-	if (! uri_username_col.s)
-		uri_username_col.s = "username";
-	uri_username_col.len = strlen(uri_username_col.s);
-	if (! uri_domain_col.s)
-		uri_domain_col.s = "domain";
-	uri_domain_col.len = strlen(uri_domain_col.s);
-	if (! uri_uri_user_col.s)
-		uri_uri_user_col.s = "uri_user";
-	uri_uri_user_col.len = strlen(uri_uri_user_col.s);
-	if (! uri_last_modified_col.s)
-		uri_last_modified_col.s = "last_modified";
-	uri_last_modified_col.len = strlen(uri_last_modified_col.s);
-}
-
-#endif