2
0
Эх сурвалжийг харах

ipmatch table added to database schema definition
DB scripts are re-generated

Miklos Tirpak 19 жил өмнө
parent
commit
f01674659d

+ 54 - 0
db/schema/ipmatch.xml

@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE table PUBLIC "-//iptel.org//DTD DBSchema V1.0//EN"
+  "http://iptel.org/dbschema/dtd/1.0/dbschema.dtd" [
+
+<!ENTITY % entities SYSTEM "entities.xml">
+%entities;
+
+]>
+
+<table role="permissions"
+	xmlns:db="http://docbook.org/ns/docbook"
+	xmlns:my="http://iptel.org/dbschema/mysql"
+	xmlns:pg="http://iptel.org/dbschema/postgres"
+	xmlns:dt="http://iptel.org/dbschema/dbtext">
+	<name>ipmatch</name>
+	<version>1</version>
+
+	<column id="ipmatch.ip">
+	    <name>ip</name>
+	    <type>string</type>
+	    <size>50</size>
+	    <default></default>
+	</column>
+
+	<column id="ipmatch.avp_val">
+	    <name>avp_val</name>
+	    <type>string</type>
+	    <size>30</size>
+	    <default><null/></default>
+	    <null/>
+	</column>
+
+	<column id="ipmatch.mark">
+	    <name>mark</name>
+	    <type>unsigned int</type>
+	    <size>10</size>
+	    <default>1</default>
+	</column>
+
+	<column id="ipmatch.flags">
+	    <name>flags</name>
+	    <type>unsigned int</type>
+	    <size>10</size>
+	    <default>0</default>
+	</column>
+
+	<index>
+	    <unique/>
+	    <name>ipmatch_idx</name>
+	    <colref linkend="ipmatch.ip"/>
+	    <colref linkend="ipmatch.mark"/>
+	</index>
+
+</table>

+ 2 - 1
db/schema/ser.xml

@@ -42,8 +42,9 @@
     <!-- User location database -->
     <!-- User location database -->
     <xi:include href="location.xml"/>
     <xi:include href="location.xml"/>
 
 
-    <!-- Table containing list of trusted peers -->
+    <!-- Permissions module -->
     <xi:include href="trusted.xml"/>
     <xi:include href="trusted.xml"/>
+    <xi:include href="ipmatch.xml"/>
 
 
     <!-- Table containing phonebook (used by serweb -->
     <!-- Table containing phonebook (used by serweb -->
     <xi:include href="phonebook.xml"/>
     <xi:include href="phonebook.xml"/>

+ 1 - 1
scripts/dbtext/ser_db/rls_subscription

@@ -1 +1 @@
-id(str) doc_version(int) dialog(str) expires(int) status(int) contact(str) uri(str) package(str) w_uri(str) xcap_root(str) 
+id(str) doc_version(int) dialog(str) expires(int) status(int) contact(str) uri(str) package(str) w_uri(str) xcap_params(str) 

+ 1 - 1
scripts/dbtext/ser_db/uri

@@ -1 +1 @@
-uid(str) did(str) username(str) flags(int) 
+uid(str) did(str) username(str) flags(int) scheme(int) 

+ 1 - 1
scripts/dbtext/ser_db/uri_attrs

@@ -1 +1 @@
-username(str) did(str) name(str) value(str,null) type(int) flags(int) 
+username(str) did(str) name(str) value(str,null) type(int) flags(int) scheme(int) 

+ 14 - 3
scripts/mysql/my_create.sql

@@ -68,7 +68,7 @@ CREATE TABLE missed_calls (
 INSERT INTO version (table_name, table_version) values ('credentials','7');
 INSERT INTO version (table_name, table_version) values ('credentials','7');
 CREATE TABLE credentials (
 CREATE TABLE credentials (
     auth_username VARCHAR(64) NOT NULL,
     auth_username VARCHAR(64) NOT NULL,
-    did VARCHAR(64) NOT NULL default '_none',
+    did VARCHAR(64) NOT NULL DEFAULT '_none',
     realm VARCHAR(64) NOT NULL,
     realm VARCHAR(64) NOT NULL,
     password VARCHAR(28) NOT NULL DEFAULT '',
     password VARCHAR(28) NOT NULL DEFAULT '',
     flags INT NOT NULL DEFAULT '0',
     flags INT NOT NULL DEFAULT '0',
@@ -132,6 +132,7 @@ CREATE TABLE uri_attrs (
     value VARCHAR(255),
     value VARCHAR(255),
     type INT NOT NULL DEFAULT '0',
     type INT NOT NULL DEFAULT '0',
     flags INT UNSIGNED NOT NULL DEFAULT '0',
     flags INT UNSIGNED NOT NULL DEFAULT '0',
+    scheme INT NOT NULL DEFAULT '0',
     UNIQUE KEY uriattrs_idx (username, did, name, value)
     UNIQUE KEY uriattrs_idx (username, did, name, value)
 );
 );
 
 
@@ -180,6 +181,15 @@ CREATE TABLE trusted (
     UNIQUE KEY trusted_idx (src_ip, proto, from_pattern)
     UNIQUE KEY trusted_idx (src_ip, proto, from_pattern)
 );
 );
 
 
+INSERT INTO version (table_name, table_version) values ('ipmatch','1');
+CREATE TABLE ipmatch (
+    ip VARCHAR(50) NOT NULL DEFAULT '',
+    avp_val VARCHAR(30) DEFAULT NULL,
+    mark INT(10) UNSIGNED NOT NULL DEFAULT '1',
+    flags INT(10) UNSIGNED NOT NULL DEFAULT '0',
+    UNIQUE KEY ipmatch_idx (ip, mark)
+);
+
 INSERT INTO version (table_name, table_version) values ('phonebook','1');
 INSERT INTO version (table_name, table_version) values ('phonebook','1');
 CREATE TABLE phonebook (
 CREATE TABLE phonebook (
     id INT AUTO_INCREMENT NOT NULL,
     id INT AUTO_INCREMENT NOT NULL,
@@ -249,6 +259,7 @@ CREATE TABLE uri (
     did VARCHAR(64) NOT NULL,
     did VARCHAR(64) NOT NULL,
     username VARCHAR(64) NOT NULL,
     username VARCHAR(64) NOT NULL,
     flags INT UNSIGNED NOT NULL DEFAULT '0',
     flags INT UNSIGNED NOT NULL DEFAULT '0',
+    scheme INT NOT NULL DEFAULT '0',
     KEY uri_idx1 (username, did),
     KEY uri_idx1 (username, did),
     KEY uri_uid (uid)
     KEY uri_uid (uid)
 );
 );
@@ -380,7 +391,7 @@ CREATE TABLE rls_subscription (
     uri VARCHAR(255) NOT NULL,
     uri VARCHAR(255) NOT NULL,
     package VARCHAR(128) NOT NULL,
     package VARCHAR(128) NOT NULL,
     w_uri VARCHAR(255) NOT NULL,
     w_uri VARCHAR(255) NOT NULL,
-    xcap_root VARCHAR(255) NOT NULL,
+    xcap_params BLOB NOT NULL,
     UNIQUE KEY rls_subscription_key (id)
     UNIQUE KEY rls_subscription_key (id)
 );
 );
 
 
@@ -434,4 +445,4 @@ CREATE TABLE customers (
     UNIQUE KEY cu_idx (cid)
     UNIQUE KEY cu_idx (cid)
 );
 );
 
 
- 
+ 

+ 15 - 4
scripts/oracle/or_create.sql

@@ -68,7 +68,7 @@ CREATE TABLE missed_calls (
 INSERT INTO version (table_name, table_version) values ('credentials','7');
 INSERT INTO version (table_name, table_version) values ('credentials','7');
 CREATE TABLE credentials (
 CREATE TABLE credentials (
     auth_username string(64) NOT NULL,
     auth_username string(64) NOT NULL,
-    did string(64) NOT NULL,
+    did string(64) NOT NULL DEFAULT '_none',
     realm string(64) NOT NULL,
     realm string(64) NOT NULL,
     password string(28) NOT NULL DEFAULT '',
     password string(28) NOT NULL DEFAULT '',
     flags int NOT NULL DEFAULT '0',
     flags int NOT NULL DEFAULT '0',
@@ -130,6 +130,7 @@ CREATE TABLE uri_attrs (
     value string(255),
     value string(255),
     type int NOT NULL DEFAULT '0',
     type int NOT NULL DEFAULT '0',
     flags int NOT NULL DEFAULT '0',
     flags int NOT NULL DEFAULT '0',
+    scheme int NOT NULL DEFAULT '0',
     uriattrs_idx UNIQUE (username, did, name, value, )
     uriattrs_idx UNIQUE (username, did, name, value, )
 );
 );
 
 
@@ -178,6 +179,15 @@ CREATE TABLE trusted (
     trusted_idx UNIQUE (src_ip, proto, from_pattern, )
     trusted_idx UNIQUE (src_ip, proto, from_pattern, )
 );
 );
 
 
+INSERT INTO version (table_name, table_version) values ('ipmatch','1');
+CREATE TABLE ipmatch (
+    ip string(50) NOT NULL DEFAULT '',
+    avp_val string(30) DEFAULT NULL,
+    mark int(10) NOT NULL DEFAULT '1',
+    flags int(10) NOT NULL DEFAULT '0',
+    ipmatch_idx UNIQUE (ip, mark, )
+);
+
 INSERT INTO version (table_name, table_version) values ('phonebook','1');
 INSERT INTO version (table_name, table_version) values ('phonebook','1');
 CREATE TABLE phonebook (
 CREATE TABLE phonebook (
     id int NOT NULL,
     id int NOT NULL,
@@ -242,7 +252,8 @@ CREATE TABLE uri (
     uid string(64) NOT NULL,
     uid string(64) NOT NULL,
     did string(64) NOT NULL,
     did string(64) NOT NULL,
     username string(64) NOT NULL,
     username string(64) NOT NULL,
-    flags int NOT NULL DEFAULT '0'
+    flags int NOT NULL DEFAULT '0',
+    scheme int NOT NULL DEFAULT '0'
 );
 );
 
 
 INSERT INTO version (table_name, table_version) values ('speed_dial','2');
 INSERT INTO version (table_name, table_version) values ('speed_dial','2');
@@ -368,7 +379,7 @@ CREATE TABLE rls_subscription (
     uri string(255) NOT NULL,
     uri string(255) NOT NULL,
     package string(128) NOT NULL,
     package string(128) NOT NULL,
     w_uri string(255) NOT NULL,
     w_uri string(255) NOT NULL,
-    xcap_root string(255) NOT NULL,
+    xcap_params binary NOT NULL,
     rls_subscription_key UNIQUE (id, )
     rls_subscription_key UNIQUE (id, )
 );
 );
 
 
@@ -420,4 +431,4 @@ CREATE TABLE customers (
     cu_idx UNIQUE (cid, )
     cu_idx UNIQUE (cid, )
 );
 );
 
 
- 
+ 

+ 14 - 4
scripts/postgres/pg_create.sql

@@ -68,7 +68,7 @@ CREATE INDEX mc_cid_key ON missed_calls (sip_callid);
 
 
 CREATE TABLE credentials (
 CREATE TABLE credentials (
     auth_username VARCHAR(64) NOT NULL,
     auth_username VARCHAR(64) NOT NULL,
-    did VARCHAR(64) NOT NULL,
+    did VARCHAR(64) NOT NULL DEFAULT '_none',
     realm VARCHAR(64) NOT NULL,
     realm VARCHAR(64) NOT NULL,
     password VARCHAR(28) NOT NULL DEFAULT '',
     password VARCHAR(28) NOT NULL DEFAULT '',
     flags INTEGER NOT NULL DEFAULT '0',
     flags INTEGER NOT NULL DEFAULT '0',
@@ -129,6 +129,7 @@ CREATE TABLE uri_attrs (
     value VARCHAR(255),
     value VARCHAR(255),
     type INTEGER NOT NULL DEFAULT '0',
     type INTEGER NOT NULL DEFAULT '0',
     flags INTEGER NOT NULL DEFAULT '0',
     flags INTEGER NOT NULL DEFAULT '0',
+    scheme INTEGER NOT NULL DEFAULT '0',
     CONSTRAINT uriattrs_idx UNIQUE (username, did, name, value)
     CONSTRAINT uriattrs_idx UNIQUE (username, did, name, value)
 );
 );
 
 
@@ -175,6 +176,14 @@ CREATE TABLE trusted (
     CONSTRAINT trusted_idx UNIQUE (src_ip, proto, from_pattern)
     CONSTRAINT trusted_idx UNIQUE (src_ip, proto, from_pattern)
 );
 );
 
 
+CREATE TABLE ipmatch (
+    ip VARCHAR(50) NOT NULL DEFAULT '',
+    avp_val VARCHAR(30) DEFAULT NULL,
+    mark INTEGER NOT NULL DEFAULT '1',
+    flags INTEGER NOT NULL DEFAULT '0',
+    CONSTRAINT ipmatch_idx UNIQUE (ip, mark)
+);
+
 CREATE TABLE phonebook (
 CREATE TABLE phonebook (
     id SERIAL NOT NULL,
     id SERIAL NOT NULL,
     uid VARCHAR(64) NOT NULL,
     uid VARCHAR(64) NOT NULL,
@@ -240,7 +249,8 @@ CREATE TABLE uri (
     uid VARCHAR(64) NOT NULL,
     uid VARCHAR(64) NOT NULL,
     did VARCHAR(64) NOT NULL,
     did VARCHAR(64) NOT NULL,
     username VARCHAR(64) NOT NULL,
     username VARCHAR(64) NOT NULL,
-    flags INTEGER NOT NULL DEFAULT '0'
+    flags INTEGER NOT NULL DEFAULT '0',
+    scheme INTEGER NOT NULL DEFAULT '0'
 );
 );
 
 
 CREATE INDEX uri_idx1 ON uri (username, did);
 CREATE INDEX uri_idx1 ON uri (username, did);
@@ -368,7 +378,7 @@ CREATE TABLE rls_subscription (
     uri VARCHAR(255) NOT NULL,
     uri VARCHAR(255) NOT NULL,
     package VARCHAR(128) NOT NULL,
     package VARCHAR(128) NOT NULL,
     w_uri VARCHAR(255) NOT NULL,
     w_uri VARCHAR(255) NOT NULL,
-    xcap_root VARCHAR(255) NOT NULL,
+    xcap_params BYTEA NOT NULL,
     CONSTRAINT rls_subscription_key UNIQUE (id)
     CONSTRAINT rls_subscription_key UNIQUE (id)
 );
 );
 
 
@@ -418,4 +428,4 @@ CREATE TABLE customers (
 );
 );
 
 
 
 
- 
+