--- /dev/null
+<?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>
<!-- User location database -->
<xi:include href="location.xml"/>
- <!-- Table containing list of trusted peers -->
+ <!-- Permissions module -->
<xi:include href="trusted.xml"/>
+ <xi:include href="ipmatch.xml"/>
<!-- Table containing phonebook (used by serweb -->
<xi:include href="phonebook.xml"/>
-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)
-uid(str) did(str) username(str) flags(int)
+uid(str) did(str) username(str) flags(int) scheme(int)
-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)
INSERT INTO version (table_name, table_version) values ('credentials','7');
CREATE TABLE credentials (
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,
password VARCHAR(28) NOT NULL DEFAULT '',
flags INT NOT NULL DEFAULT '0',
value VARCHAR(255),
type INT 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 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');
CREATE TABLE phonebook (
id INT AUTO_INCREMENT NOT NULL,
did VARCHAR(64) NOT NULL,
username VARCHAR(64) NOT NULL,
flags INT UNSIGNED NOT NULL DEFAULT '0',
+ scheme INT NOT NULL DEFAULT '0',
KEY uri_idx1 (username, did),
KEY uri_uid (uid)
);
uri VARCHAR(255) NOT NULL,
package VARCHAR(128) 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 cu_idx (cid)
);
-
+
\ No newline at end of file
INSERT INTO version (table_name, table_version) values ('credentials','7');
CREATE TABLE credentials (
auth_username string(64) NOT NULL,
- did string(64) NOT NULL,
+ did string(64) NOT NULL DEFAULT '_none',
realm string(64) NOT NULL,
password string(28) NOT NULL DEFAULT '',
flags int NOT NULL DEFAULT '0',
value string(255),
type int NOT NULL DEFAULT '0',
flags int NOT NULL DEFAULT '0',
+ scheme int NOT NULL DEFAULT '0',
uriattrs_idx UNIQUE (username, did, name, value, )
);
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');
CREATE TABLE phonebook (
id int NOT NULL,
uid string(64) NOT NULL,
did 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');
uri string(255) NOT NULL,
package string(128) NOT NULL,
w_uri string(255) NOT NULL,
- xcap_root string(255) NOT NULL,
+ xcap_params binary NOT NULL,
rls_subscription_key UNIQUE (id, )
);
cu_idx UNIQUE (cid, )
);
-
+
\ No newline at end of file
CREATE TABLE credentials (
auth_username VARCHAR(64) NOT NULL,
- did VARCHAR(64) NOT NULL,
+ did VARCHAR(64) NOT NULL DEFAULT '_none',
realm VARCHAR(64) NOT NULL,
password VARCHAR(28) NOT NULL DEFAULT '',
flags INTEGER NOT NULL DEFAULT '0',
value VARCHAR(255),
type 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 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 (
id SERIAL NOT NULL,
uid VARCHAR(64) NOT NULL,
uid VARCHAR(64) NOT NULL,
did 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);
uri VARCHAR(255) NOT NULL,
package VARCHAR(128) 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)
);
);
-
+
\ No newline at end of file