diff options
author | Martin Willi <martin@strongswan.org> | 2008-07-22 14:56:15 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2008-07-22 14:56:15 +0000 |
commit | f7198e7e8c648546d2d335dd9dc80333905028eb (patch) | |
tree | bf516e21c38bab88c447e31534752b4aa5525bbe /src/charon/plugins/sql/mysql.sql | |
parent | 32f5ee159e52d38c370ecb4a641b9280c49372cb (diff) | |
download | strongswan-f7198e7e8c648546d2d335dd9dc80333905028eb.tar.bz2 strongswan-f7198e7e8c648546d2d335dd9dc80333905028eb.tar.xz |
experimental and untested reimplementation of sql based IP pool
uses address preallocation and separate address/lease tables for linear lookup time
Diffstat (limited to 'src/charon/plugins/sql/mysql.sql')
-rw-r--r-- | src/charon/plugins/sql/mysql.sql | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/charon/plugins/sql/mysql.sql b/src/charon/plugins/sql/mysql.sql index f98fe71e2..412abc715 100644 --- a/src/charon/plugins/sql/mysql.sql +++ b/src/charon/plugins/sql/mysql.sql @@ -157,15 +157,14 @@ CREATE TABLE pools ( `name` varchar(32) NOT NULL, `start` varbinary(16) NOT NULL, `end` varbinary(16) NOT NULL, - `next` varbinary(16) NOT NULL, `timeout` int(10) unsigned NOT NULL, PRIMARY KEY (`id`), UNIQUE (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -DROP TABLE IF EXISTS leases; -CREATE TABLE leases ( +DROP TABLE IF EXISTS addresses; +CREATE TABLE addresses ( `id` int(10) unsigned NOT NULL auto_increment, `pool` int(10) unsigned NOT NULL, `address` varbinary(16) NOT NULL, @@ -175,7 +174,17 @@ CREATE TABLE leases ( PRIMARY KEY (`id`), INDEX (`pool`), INDEX (`identity`), - INDEX (`released`) + INDEX (`address`) +); + +DROP TABLE IF EXISTS leases; +CREATE TABLE leases ( + `id` int(10) unsigned NOT NULL auto_increment, + `address` int(10) unsigned NOT NULL, + `identity` int(10) unsigned NOT NULL, + `acquired` int(10) unsigned NOT NULL, + `released` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`id`) ); |