if USE_ATTR_SQL
SUBDIRS += pool
+else
+if USE_SQL
+ SUBDIRS += pool
+endif
endif
if USE_TKM
+++ /dev/null
-
-DROP TABLE IF EXISTS shared_secrets;
-CREATE TABLE shared_secrets (
- id INTEGER PRIMARY KEY AUTOINCREMENT,
- type INTEGER,
- local TEXT,
- remote TEXT
-);
-
-DROP TABLE IF EXISTS certificates;
-CREATE TABLE certificates (
- id INTEGER PRIMARY KEY AUTOINCREMENT,
- type INTEGER,
- subject TEXT,
- data BLOB,
-);
-
-DROP TABLE IF EXISTS private_keys;
-CREATE TABLE private_keys (
- id INTEGER PRIMARY KEY AUTOINCREMENT,
- type INTEGER,
- keyid BLOB,
- data BLOB,
-);
+++ /dev/null
-
-DROP TABLE IF EXISTS `identities`;
-CREATE TABLE `identities` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `type` tinyint(4) unsigned NOT NULL,
- `data` varbinary(64) NOT NULL,
- PRIMARY KEY (`id`),
- UNIQUE (`type`, `data`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-
-
-DROP TABLE IF EXISTS `child_configs`;
-CREATE TABLE `child_configs` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `name` varchar(32) collate utf8_unicode_ci NOT NULL,
- `lifetime` mediumint(8) unsigned NOT NULL default '1500',
- `rekeytime` mediumint(8) unsigned NOT NULL default '1200',
- `jitter` mediumint(8) unsigned NOT NULL default '60',
- `updown` varchar(128) collate utf8_unicode_ci default NULL,
- `hostaccess` tinyint(1) unsigned NOT NULL default '0',
- `mode` tinyint(4) unsigned NOT NULL default '2',
- `start_action` tinyint(4) unsigned NOT NULL default '0',
- `dpd_action` tinyint(4) unsigned NOT NULL default '0',
- `close_action` tinyint(4) unsigned NOT NULL default '0',
- `ipcomp` tinyint(4) unsigned NOT NULL default '0',
- `reqid` mediumint(8) unsigned NOT NULL default '0',
- PRIMARY KEY (`id`),
- INDEX (`name`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-
-
-DROP TABLE IF EXISTS `child_config_traffic_selector`;
-CREATE TABLE `child_config_traffic_selector` (
- `child_cfg` int(10) unsigned NOT NULL,
- `traffic_selector` int(10) unsigned NOT NULL,
- `kind` tinyint(3) unsigned NOT NULL,
- INDEX (`child_cfg`, `traffic_selector`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-
-
-DROP TABLE IF EXISTS `proposals`;
-CREATE TABLE `proposals` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `proposal` varchar(128) NOT NULL,
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-
-
-DROP TABLE IF EXISTS `child_config_proposal`;
-CREATE TABLE `child_config_proposal` (
- `child_cfg` int(10) unsigned NOT NULL,
- `prio` smallint(5) unsigned NOT NULL,
- `prop` int(10) unsigned NOT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-
-
-DROP TABLE IF EXISTS `ike_configs`;
-CREATE TABLE `ike_configs` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `certreq` tinyint(3) unsigned NOT NULL default '1',
- `force_encap` tinyint(1) NOT NULL default '0',
- `local` varchar(128) collate utf8_unicode_ci NOT NULL,
- `remote` varchar(128) collate utf8_unicode_ci NOT NULL,
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-
-
-DROP TABLE IF EXISTS `ike_config_proposal`;
-CREATE TABLE `ike_config_proposal` (
- `ike_cfg` int(10) unsigned NOT NULL,
- `prio` smallint(5) unsigned NOT NULL,
- `prop` int(10) unsigned NOT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-
-
-DROP TABLE IF EXISTS `peer_configs`;
-CREATE TABLE `peer_configs` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `name` varchar(32) collate utf8_unicode_ci NOT NULL,
- `ike_version` tinyint(3) unsigned NOT NULL default '2',
- `ike_cfg` int(10) unsigned NOT NULL,
- `local_id` varchar(64) collate utf8_unicode_ci NOT NULL,
- `remote_id` varchar(64) collate utf8_unicode_ci NOT NULL,
- `cert_policy` tinyint(3) unsigned NOT NULL default '1',
- `uniqueid` tinyint(3) unsigned NOT NULL default '0',
- `auth_method` tinyint(3) unsigned NOT NULL default '1',
- `eap_type` tinyint(3) unsigned NOT NULL default '0',
- `eap_vendor` smallint(5) unsigned NOT NULL default '0',
- `keyingtries` tinyint(3) unsigned NOT NULL default '3',
- `rekeytime` mediumint(8) unsigned NOT NULL default '7200',
- `reauthtime` mediumint(8) unsigned NOT NULL default '0',
- `jitter` mediumint(8) unsigned NOT NULL default '180',
- `overtime` mediumint(8) unsigned NOT NULL default '300',
- `mobike` tinyint(1) NOT NULL default '1',
- `dpd_delay` mediumint(8) unsigned NOT NULL default '120',
- `virtual` varchar(40) default NULL,
- `pool` varchar(32) default NULL,
- `mediation` tinyint(1) NOT NULL default '0',
- `mediated_by` int(10) unsigned NOT NULL default '0',
- `peer_id` int(10) unsigned NOT NULL default '0',
- PRIMARY KEY (`id`),
- INDEX (`name`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-
-
-DROP TABLE IF EXISTS `peer_config_child_config`;
-CREATE TABLE `peer_config_child_config` (
- `peer_cfg` int(10) unsigned NOT NULL,
- `child_cfg` int(10) unsigned NOT NULL,
- PRIMARY KEY (`peer_cfg`, `child_cfg`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-
-
-DROP TABLE IF EXISTS `traffic_selectors`;
-CREATE TABLE `traffic_selectors` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `type` tinyint(3) unsigned NOT NULL default '7',
- `protocol` smallint(5) unsigned NOT NULL default '0',
- `start_addr` varbinary(16) default NULL,
- `end_addr` varbinary(16) default NULL,
- `start_port` smallint(5) unsigned NOT NULL default '0',
- `end_port` smallint(5) unsigned NOT NULL default '65535',
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-
-
-DROP TABLE IF EXISTS certificates;
-CREATE TABLE certificates (
- `id` int(10) unsigned NOT NULL auto_increment,
- `type` tinyint(3) unsigned NOT NULL,
- `keytype` tinyint(3) unsigned NOT NULL,
- `data` BLOB NOT NULL,
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-
-
-DROP TABLE IF EXISTS certificate_identity;
-CREATE TABLE certificate_identity (
- `certificate` int(10) unsigned NOT NULL,
- `identity` int(10) unsigned NOT NULL,
- PRIMARY KEY (`certificate`, `identity`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-
-
-DROP TABLE IF EXISTS private_keys;
-CREATE TABLE private_keys (
- `id` int(10) unsigned NOT NULL auto_increment,
- `type` tinyint(3) unsigned NOT NULL,
- `data` BLOB NOT NULL,
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-
-
-DROP TABLE IF EXISTS private_key_identity;
-CREATE TABLE private_key_identity (
- `private_key` int(10) unsigned NOT NULL,
- `identity` int(10) unsigned NOT NULL,
- PRIMARY KEY (`private_key`, `identity`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-
-
-DROP TABLE IF EXISTS shared_secrets;
-CREATE TABLE shared_secrets (
- `id` int(10) unsigned NOT NULL auto_increment,
- `type` tinyint(3) unsigned NOT NULL,
- `data` varbinary(256) NOT NULL,
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-
-
-DROP TABLE IF EXISTS shared_secret_identity;
-CREATE TABLE shared_secret_identity (
- `shared_secret` int(10) unsigned NOT NULL,
- `identity` int(10) unsigned NOT NULL,
- PRIMARY KEY (`shared_secret`, `identity`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-
-
-DROP TABLE IF EXISTS certificate_authorities;
-CREATE TABLE certificate_authorities (
- `id` int(10) unsigned NOT NULL auto_increment,
- `certificate` int(10) unsigned NOT NULL,
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-
-
-DROP TABLE IF EXISTS certificate_distribution_points;
-CREATE TABLE certificate_distribution_points (
- `id` int(10) unsigned NOT NULL auto_increment,
- `ca` int(10) unsigned NOT NULL,
- `type` tinyint(3) unsigned NOT NULL,
- `uri` varchar(256) NOT NULL,
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-
-
-DROP TABLE IF EXISTS pools;
-CREATE TABLE pools (
- `id` int(10) unsigned NOT NULL auto_increment,
- `name` varchar(32) NOT NULL,
- `start` varbinary(16) NOT NULL,
- `end` varbinary(16) NOT NULL,
- `timeout` int(10) unsigned NOT NULL,
- PRIMARY KEY (`id`),
- UNIQUE (`name`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-
-
-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,
- `identity` int(10) unsigned NOT NULL,
- `acquired` int(10) unsigned NOT NULL,
- `released` int(10) unsigned DEFAULT NULL,
- PRIMARY KEY (`id`),
- INDEX (`pool`),
- INDEX (`identity`),
- INDEX (`address`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-
-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`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-
-DROP TABLE IF EXISTS attribute_pools;
-CREATE TABLE attribute_pools (
- `id` int(10) unsigned NOT NULL auto_increment,
- `name` varchar(32) NOT NULL,
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-
-DROP TABLE IF EXISTS attributes;
-CREATE TABLE attributes (
- `id` int(10) unsigned NOT NULL auto_increment,
- `identity` int(10) unsigned NOT NULL default '0',
- `pool` int(10) unsigned NOT NULL default '0',
- `type` int(10) unsigned NOT NULL,
- `value` varbinary(16) NOT NULL,
- PRIMARY KEY (`id`),
- INDEX (`identity`),
- INDEX (`pool`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-
-DROP TABLE IF EXISTS ike_sas;
-CREATE TABLE ike_sas (
- `local_spi` varbinary(8) NOT NULL,
- `remote_spi` varbinary(8) NOT NULL,
- `id` int(10) unsigned NOT NULL,
- `initiator` tinyint(1) NOT NULL,
- `local_id_type` tinyint(3) NOT NULL,
- `local_id_data` varbinary(64) DEFAULT NULL,
- `remote_id_type` tinyint(3) NOT NULL,
- `remote_id_data` varbinary(64) DEFAULT NULL,
- `host_family` tinyint(3) NOT NULL,
- `local_host_data` varbinary(16) NOT NULL,
- `remote_host_data` varbinary(16) NOT NULL,
- `lastuse` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
- PRIMARY KEY (`local_spi`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-
-
-DROP TABLE IF EXISTS logs;
-CREATE TABLE logs (
- `id` int(10) unsigned NOT NULL auto_increment,
- `local_spi` varbinary(8) NOT NULL,
- `signal` tinyint(3) NOT NULL,
- `level` tinyint(3) NOT NULL,
- `msg` varchar(256) NOT NULL,
- `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-
-
+++ /dev/null
-
-
-DROP TABLE IF EXISTS identities;
-CREATE TABLE identities (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- type INTEGER NOT NULL,
- data BLOB NOT NULL,
- UNIQUE (type, data)
-);
-
-
-DROP TABLE IF EXISTS child_configs;
-CREATE TABLE child_configs (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- name TEXT NOT NULL,
- lifetime INTEGER NOT NULL DEFAULT '1500',
- rekeytime INTEGER NOT NULL DEFAULT '1200',
- jitter INTEGER NOT NULL DEFAULT '60',
- updown TEXT DEFAULT NULL,
- hostaccess INTEGER NOT NULL DEFAULT '0',
- mode INTEGER NOT NULL DEFAULT '2',
- start_action INTEGER NOT NULL DEFAULT '0',
- dpd_action INTEGER NOT NULL DEFAULT '0',
- close_action INTEGER NOT NULL DEFAULT '0',
- ipcomp INTEGER NOT NULL DEFAULT '0',
- reqid INTEGER NOT NULL DEFAULT '0'
-);
-DROP INDEX IF EXISTS child_configs_name;
-CREATE INDEX child_configs_name ON child_configs (
- name
-);
-
-
-DROP TABLE IF EXISTS child_config_traffic_selector;
-CREATE TABLE child_config_traffic_selector (
- child_cfg INTEGER NOT NULL,
- traffic_selector INTEGER NOT NULL,
- kind INTEGER NOT NULL
-);
-DROP INDEX IF EXISTS child_config_traffic_selector;
-CREATE INDEX child_config_traffic_selector_all ON child_config_traffic_selector (
- child_cfg, traffic_selector
-);
-
-DROP TABLE IF EXISTS proposals;
-CREATE TABLE proposals (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- proposal TEXT NOT NULL
-);
-
-
-DROP TABLE IF EXISTS child_config_proposal;
-CREATE TABLE child_config_proposal (
- child_cfg INTEGER NOT NULL,
- prio INTEGER NOT NULL,
- prop INTEGER NOT NULL
-);
-
-
-DROP TABLE IF EXISTS ike_configs;
-CREATE TABLE ike_configs (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- certreq INTEGER NOT NULL DEFAULT '1',
- force_encap INTEGER NOT NULL DEFAULT '0',
- local TEXT NOT NULL,
- remote TEXT NOT NULL
-);
-
-
-DROP TABLE IF EXISTS ike_config_proposal;
-CREATE TABLE ike_config_proposal (
- ike_cfg INTEGER NOT NULL,
- prio INTEGER NOT NULL,
- prop INTEGER NOT NULL
-);
-
-
-DROP TABLE IF EXISTS peer_configs;
-CREATE TABLE peer_configs (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- name TEXT NOT NULL,
- ike_version INTEGER NOT NULL DEFAULT '2',
- ike_cfg INTEGER NOT NULL,
- local_id TEXT NOT NULL,
- remote_id TEXT NOT NULL,
- cert_policy INTEGER NOT NULL DEFAULT '1',
- uniqueid INTEGER NOT NULL DEFAULT '0',
- auth_method INTEGER NOT NULL DEFAULT '1',
- eap_type INTEGER NOT NULL DEFAULT '0',
- eap_vendor INTEGER NOT NULL DEFAULT '0',
- keyingtries INTEGER NOT NULL DEFAULT '3',
- rekeytime INTEGER NOT NULL DEFAULT '7200',
- reauthtime INTEGER NOT NULL DEFAULT '0',
- jitter INTEGER NOT NULL DEFAULT '180',
- overtime INTEGER NOT NULL DEFAULT '300',
- mobike INTEGER NOT NULL DEFAULT '1',
- dpd_delay INTEGER NOT NULL DEFAULT '120',
- virtual TEXT DEFAULT NULL,
- pool TEXT DEFAULT NULL,
- mediation INTEGER NOT NULL DEFAULT '0',
- mediated_by INTEGER NOT NULL DEFAULT '0',
- peer_id INTEGER NOT NULL DEFAULT '0'
-);
-DROP INDEX IF EXISTS peer_configs_name;
-CREATE INDEX peer_configs_name ON peer_configs (
- name
-);
-
-
-DROP TABLE IF EXISTS peer_config_child_config;
-CREATE TABLE peer_config_child_config (
- peer_cfg INTEGER NOT NULL,
- child_cfg INTEGER NOT NULL,
- PRIMARY KEY (peer_cfg, child_cfg)
-);
-
-
-DROP TABLE IF EXISTS traffic_selectors;
-CREATE TABLE traffic_selectors (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- type INTEGER NOT NULL DEFAULT '7',
- protocol INTEGER NOT NULL DEFAULT '0',
- start_addr BLOB DEFAULT NULL,
- end_addr BLOB DEFAULT NULL,
- start_port INTEGER NOT NULL DEFAULT '0',
- end_port INTEGER NOT NULL DEFAULT '65535'
-);
-
-
-DROP TABLE IF EXISTS certificates;
-CREATE TABLE certificates (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- type INTEGER NOT NULL,
- keytype INTEGER NOT NULL,
- data BLOB NOT NULL
-);
-
-
-DROP TABLE IF EXISTS certificate_identity;
-CREATE TABLE certificate_identity (
- certificate INTEGER NOT NULL,
- identity INTEGER NOT NULL,
- PRIMARY KEY (certificate, identity)
-);
-
-
-DROP TABLE IF EXISTS private_keys;
-CREATE TABLE private_keys (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- type INTEGER NOT NULL,
- data BLOB NOT NULL
-);
-
-
-DROP TABLE IF EXISTS private_key_identity;
-CREATE TABLE private_key_identity (
- private_key INTEGER NOT NULL,
- identity INTEGER NOT NULL,
- PRIMARY KEY (private_key, identity)
-);
-
-
-DROP TABLE IF EXISTS shared_secrets;
-CREATE TABLE shared_secrets (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- type INTEGER NOT NULL,
- data BLOB NOT NULL
-);
-
-
-DROP TABLE IF EXISTS shared_secret_identity;
-CREATE TABLE shared_secret_identity (
- shared_secret INTEGER NOT NULL,
- identity INTEGER NOT NULL,
- PRIMARY KEY (shared_secret, identity)
-);
-
-
-DROP TABLE IF EXISTS certificate_authorities;
-CREATE TABLE certificate_authorities (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- certificate INTEGER NOT NULL
-);
-
-
-DROP TABLE IF EXISTS certificate_distribution_points;
-CREATE TABLE certificate_distribution_points (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- ca INTEGER NOT NULL,
- type INTEGER NOT NULL,
- uri TEXT NOT NULL
-);
-
-
-DROP TABLE IF EXISTS pools;
-CREATE TABLE pools (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- name TEXT NOT NULL UNIQUE,
- start BLOB NOT NULL,
- end BLOB NOT NULL,
- timeout INTEGER NOT NULL
-);
-
-DROP TABLE IF EXISTS addresses;
-CREATE TABLE addresses (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- pool INTEGER NOT NULL,
- address BLOB NOT NULL,
- identity INTEGER NOT NULL,
- acquired INTEGER NOT NULL,
- released INTEGER NOT NULL
-);
-DROP INDEX IF EXISTS addresses_pool;
-CREATE INDEX addresses_pool ON addresses (
- pool
-);
-DROP INDEX IF EXISTS addresses_address;
-CREATE INDEX addresses_address ON addresses (
- address
-);
-DROP INDEX IF EXISTS addresses_identity;
-CREATE INDEX addresses_identity ON addresses (
- identity
-);
-
-DROP TABLE IF EXISTS leases;
-CREATE TABLE leases (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- address INTEGER NOT NULL,
- identity INTEGER NOT NULL,
- acquired INTEGER NOT NULL,
- released INTEGER NOT NULL
-);
-
-DROP TABLE IF EXISTS attribute_pools;
-CREATE TABLE attribute_pools (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- name TEXT NOT NULL
-);
-
-DROP TABLE IF EXISTS attributes;
-CREATE TABLE attributes (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- identity INTEGER NOT NULL DEFAULT 0,
- pool INTEGER NOT NULL DEFAULT 0,
- type INTEGER NOT NULL,
- value BLOB NOT NULL
-);
-DROP INDEX IF EXISTS attributes_identity;
-CREATE INDEX attributes_identity ON attributes (
- identity
-);
-DROP INDEX IF EXISTS attributes_pool;
-CREATE INDEX attributes_pool ON attributes (
- pool
-);
-
-DROP TABLE IF EXISTS ike_sas;
-CREATE TABLE ike_sas (
- local_spi BLOB NOT NULL PRIMARY KEY,
- remote_spi BLOB NOT NULL,
- id INTEGER NOT NULL,
- initiator INTEGER NOT NULL,
- local_id_type INTEGER NOT NULL,
- local_id_data BLOB DEFAULT NULL,
- remote_id_type INTEGER NOT NULL,
- remote_id_data BLOB DEFAULT NULL,
- host_family INTEGER NOT NULL,
- local_host_data BLOB NOT NULL,
- remote_host_data BLOB NOT NULL,
- created INTEGER NOT NULL DEFAULT CURRENT_TIMESTAMP
-);
-
-DROP TABLE IF EXISTS logs;
-CREATE TABLE logs (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- local_spi BLOB NOT NULL,
- signal INTEGER NOT NULL,
- level INTEGER NOT NULL,
- msg TEXT NOT NULL,
- time INTEGER NOT NULL DEFAULT CURRENT_TIMESTAMP
-);
-
imv/imv_remediation_string.h imv/imv_remediation_string.c \
imv/imv_session.h imv/imv_session.c \
imv/imv_workitem.h imv/imv_workitem.c \
- imv/tables.sql imv/data.sql \
ietf/ietf_attr.h ietf/ietf_attr.c \
ietf/ietf_attr_assess_result.h ietf/ietf_attr_assess_result.c \
ietf/ietf_attr_attr_request.h ietf/ietf_attr_attr_request.c \
imv/imv_remediation_string.h imv/imv_remediation_string.c \
imv/imv_session.h imv/imv_session.c \
imv/imv_workitem.h imv/imv_workitem.c \
- imv/tables.sql imv/data.sql \
ietf/ietf_attr.h ietf/ietf_attr.c \
ietf/ietf_attr_assess_result.h ietf/ietf_attr_assess_result.c \
ietf/ietf_attr_attr_request.h ietf/ietf_attr_attr_request.c \
ipsec_SCRIPTS = imv/_imv_policy
EXTRA_DIST = imv/_imv_policy
+templatesdir = $(pkgdatadir)/templates/database/imv
+dist_templates_DATA = imv/tables.sql imv/data.sql
+
ipsec_PROGRAMS = imv_policy_manager
imv_policy_manager_SOURCES = \
imv/imv_policy_manager.c \
+if USE_ATTR_SQL
+
ipsec_PROGRAMS = pool
pool_SOURCES = \
pool_LDADD = \
$(top_builddir)/src/libstrongswan/libstrongswan.la \
$(top_builddir)/src/libhydra/libhydra.la
+
+endif !USE_ATTR_SQL
+
+templatesdir = $(pkgdatadir)/templates/database/sql
+dist_templates_DATA = mysql.sql sqlite.sql
--- /dev/null
+
+DROP TABLE IF EXISTS `identities`;
+CREATE TABLE `identities` (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `type` tinyint(4) unsigned NOT NULL,
+ `data` varbinary(64) NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE (`type`, `data`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+
+DROP TABLE IF EXISTS `child_configs`;
+CREATE TABLE `child_configs` (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `name` varchar(32) collate utf8_unicode_ci NOT NULL,
+ `lifetime` mediumint(8) unsigned NOT NULL default '1500',
+ `rekeytime` mediumint(8) unsigned NOT NULL default '1200',
+ `jitter` mediumint(8) unsigned NOT NULL default '60',
+ `updown` varchar(128) collate utf8_unicode_ci default NULL,
+ `hostaccess` tinyint(1) unsigned NOT NULL default '0',
+ `mode` tinyint(4) unsigned NOT NULL default '2',
+ `start_action` tinyint(4) unsigned NOT NULL default '0',
+ `dpd_action` tinyint(4) unsigned NOT NULL default '0',
+ `close_action` tinyint(4) unsigned NOT NULL default '0',
+ `ipcomp` tinyint(4) unsigned NOT NULL default '0',
+ `reqid` mediumint(8) unsigned NOT NULL default '0',
+ PRIMARY KEY (`id`),
+ INDEX (`name`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+
+DROP TABLE IF EXISTS `child_config_traffic_selector`;
+CREATE TABLE `child_config_traffic_selector` (
+ `child_cfg` int(10) unsigned NOT NULL,
+ `traffic_selector` int(10) unsigned NOT NULL,
+ `kind` tinyint(3) unsigned NOT NULL,
+ INDEX (`child_cfg`, `traffic_selector`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+
+DROP TABLE IF EXISTS `proposals`;
+CREATE TABLE `proposals` (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `proposal` varchar(128) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+
+DROP TABLE IF EXISTS `child_config_proposal`;
+CREATE TABLE `child_config_proposal` (
+ `child_cfg` int(10) unsigned NOT NULL,
+ `prio` smallint(5) unsigned NOT NULL,
+ `prop` int(10) unsigned NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+
+DROP TABLE IF EXISTS `ike_configs`;
+CREATE TABLE `ike_configs` (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `certreq` tinyint(3) unsigned NOT NULL default '1',
+ `force_encap` tinyint(1) NOT NULL default '0',
+ `local` varchar(128) collate utf8_unicode_ci NOT NULL,
+ `remote` varchar(128) collate utf8_unicode_ci NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+
+DROP TABLE IF EXISTS `ike_config_proposal`;
+CREATE TABLE `ike_config_proposal` (
+ `ike_cfg` int(10) unsigned NOT NULL,
+ `prio` smallint(5) unsigned NOT NULL,
+ `prop` int(10) unsigned NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+
+DROP TABLE IF EXISTS `peer_configs`;
+CREATE TABLE `peer_configs` (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `name` varchar(32) collate utf8_unicode_ci NOT NULL,
+ `ike_version` tinyint(3) unsigned NOT NULL default '2',
+ `ike_cfg` int(10) unsigned NOT NULL,
+ `local_id` varchar(64) collate utf8_unicode_ci NOT NULL,
+ `remote_id` varchar(64) collate utf8_unicode_ci NOT NULL,
+ `cert_policy` tinyint(3) unsigned NOT NULL default '1',
+ `uniqueid` tinyint(3) unsigned NOT NULL default '0',
+ `auth_method` tinyint(3) unsigned NOT NULL default '1',
+ `eap_type` tinyint(3) unsigned NOT NULL default '0',
+ `eap_vendor` smallint(5) unsigned NOT NULL default '0',
+ `keyingtries` tinyint(3) unsigned NOT NULL default '3',
+ `rekeytime` mediumint(8) unsigned NOT NULL default '7200',
+ `reauthtime` mediumint(8) unsigned NOT NULL default '0',
+ `jitter` mediumint(8) unsigned NOT NULL default '180',
+ `overtime` mediumint(8) unsigned NOT NULL default '300',
+ `mobike` tinyint(1) NOT NULL default '1',
+ `dpd_delay` mediumint(8) unsigned NOT NULL default '120',
+ `virtual` varchar(40) default NULL,
+ `pool` varchar(32) default NULL,
+ `mediation` tinyint(1) NOT NULL default '0',
+ `mediated_by` int(10) unsigned NOT NULL default '0',
+ `peer_id` int(10) unsigned NOT NULL default '0',
+ PRIMARY KEY (`id`),
+ INDEX (`name`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+
+DROP TABLE IF EXISTS `peer_config_child_config`;
+CREATE TABLE `peer_config_child_config` (
+ `peer_cfg` int(10) unsigned NOT NULL,
+ `child_cfg` int(10) unsigned NOT NULL,
+ PRIMARY KEY (`peer_cfg`, `child_cfg`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+
+DROP TABLE IF EXISTS `traffic_selectors`;
+CREATE TABLE `traffic_selectors` (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `type` tinyint(3) unsigned NOT NULL default '7',
+ `protocol` smallint(5) unsigned NOT NULL default '0',
+ `start_addr` varbinary(16) default NULL,
+ `end_addr` varbinary(16) default NULL,
+ `start_port` smallint(5) unsigned NOT NULL default '0',
+ `end_port` smallint(5) unsigned NOT NULL default '65535',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+
+DROP TABLE IF EXISTS certificates;
+CREATE TABLE certificates (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `type` tinyint(3) unsigned NOT NULL,
+ `keytype` tinyint(3) unsigned NOT NULL,
+ `data` BLOB NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+
+DROP TABLE IF EXISTS certificate_identity;
+CREATE TABLE certificate_identity (
+ `certificate` int(10) unsigned NOT NULL,
+ `identity` int(10) unsigned NOT NULL,
+ PRIMARY KEY (`certificate`, `identity`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+
+DROP TABLE IF EXISTS private_keys;
+CREATE TABLE private_keys (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `type` tinyint(3) unsigned NOT NULL,
+ `data` BLOB NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+
+DROP TABLE IF EXISTS private_key_identity;
+CREATE TABLE private_key_identity (
+ `private_key` int(10) unsigned NOT NULL,
+ `identity` int(10) unsigned NOT NULL,
+ PRIMARY KEY (`private_key`, `identity`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+
+DROP TABLE IF EXISTS shared_secrets;
+CREATE TABLE shared_secrets (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `type` tinyint(3) unsigned NOT NULL,
+ `data` varbinary(256) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+
+DROP TABLE IF EXISTS shared_secret_identity;
+CREATE TABLE shared_secret_identity (
+ `shared_secret` int(10) unsigned NOT NULL,
+ `identity` int(10) unsigned NOT NULL,
+ PRIMARY KEY (`shared_secret`, `identity`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+
+DROP TABLE IF EXISTS certificate_authorities;
+CREATE TABLE certificate_authorities (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `certificate` int(10) unsigned NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+
+DROP TABLE IF EXISTS certificate_distribution_points;
+CREATE TABLE certificate_distribution_points (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `ca` int(10) unsigned NOT NULL,
+ `type` tinyint(3) unsigned NOT NULL,
+ `uri` varchar(256) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+
+DROP TABLE IF EXISTS pools;
+CREATE TABLE pools (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `name` varchar(32) NOT NULL,
+ `start` varbinary(16) NOT NULL,
+ `end` varbinary(16) NOT NULL,
+ `timeout` int(10) unsigned NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE (`name`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+
+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,
+ `identity` int(10) unsigned NOT NULL DEFAULT 0,
+ `acquired` int(10) unsigned NOT NULL DEFAULT 0,
+ `released` int(10) unsigned NOT NULL DEFAULT 1,
+ PRIMARY KEY (`id`),
+ INDEX (`pool`),
+ INDEX (`identity`),
+ INDEX (`address`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+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`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS attribute_pools;
+CREATE TABLE attribute_pools (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `name` varchar(32) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS attributes;
+CREATE TABLE attributes (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `identity` int(10) unsigned NOT NULL default '0',
+ `pool` int(10) unsigned NOT NULL default '0',
+ `type` int(10) unsigned NOT NULL,
+ `value` varbinary(16) NOT NULL,
+ PRIMARY KEY (`id`),
+ INDEX (`identity`),
+ INDEX (`pool`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS ike_sas;
+CREATE TABLE ike_sas (
+ `local_spi` varbinary(8) NOT NULL,
+ `remote_spi` varbinary(8) NOT NULL,
+ `id` int(10) unsigned NOT NULL,
+ `initiator` tinyint(1) NOT NULL,
+ `local_id_type` tinyint(3) NOT NULL,
+ `local_id_data` varbinary(64) DEFAULT NULL,
+ `remote_id_type` tinyint(3) NOT NULL,
+ `remote_id_data` varbinary(64) DEFAULT NULL,
+ `host_family` tinyint(3) NOT NULL,
+ `local_host_data` varbinary(16) NOT NULL,
+ `remote_host_data` varbinary(16) NOT NULL,
+ `lastuse` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ PRIMARY KEY (`local_spi`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+
+DROP TABLE IF EXISTS logs;
+CREATE TABLE logs (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `local_spi` varbinary(8) NOT NULL,
+ `signal` tinyint(3) NOT NULL,
+ `level` tinyint(3) NOT NULL,
+ `msg` varchar(256) NOT NULL,
+ `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+
--- /dev/null
+
+
+DROP TABLE IF EXISTS identities;
+CREATE TABLE identities (
+ id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+ type INTEGER NOT NULL,
+ data BLOB NOT NULL,
+ UNIQUE (type, data)
+);
+
+
+DROP TABLE IF EXISTS child_configs;
+CREATE TABLE child_configs (
+ id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+ name TEXT NOT NULL,
+ lifetime INTEGER NOT NULL DEFAULT '1500',
+ rekeytime INTEGER NOT NULL DEFAULT '1200',
+ jitter INTEGER NOT NULL DEFAULT '60',
+ updown TEXT DEFAULT NULL,
+ hostaccess INTEGER NOT NULL DEFAULT '0',
+ mode INTEGER NOT NULL DEFAULT '2',
+ start_action INTEGER NOT NULL DEFAULT '0',
+ dpd_action INTEGER NOT NULL DEFAULT '0',
+ close_action INTEGER NOT NULL DEFAULT '0',
+ ipcomp INTEGER NOT NULL DEFAULT '0',
+ reqid INTEGER NOT NULL DEFAULT '0'
+);
+DROP INDEX IF EXISTS child_configs_name;
+CREATE INDEX child_configs_name ON child_configs (
+ name
+);
+
+
+DROP TABLE IF EXISTS child_config_traffic_selector;
+CREATE TABLE child_config_traffic_selector (
+ child_cfg INTEGER NOT NULL,
+ traffic_selector INTEGER NOT NULL,
+ kind INTEGER NOT NULL
+);
+DROP INDEX IF EXISTS child_config_traffic_selector;
+CREATE INDEX child_config_traffic_selector_all ON child_config_traffic_selector (
+ child_cfg, traffic_selector
+);
+
+DROP TABLE IF EXISTS proposals;
+CREATE TABLE proposals (
+ id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+ proposal TEXT NOT NULL
+);
+
+
+DROP TABLE IF EXISTS child_config_proposal;
+CREATE TABLE child_config_proposal (
+ child_cfg INTEGER NOT NULL,
+ prio INTEGER NOT NULL,
+ prop INTEGER NOT NULL
+);
+
+
+DROP TABLE IF EXISTS ike_configs;
+CREATE TABLE ike_configs (
+ id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+ certreq INTEGER NOT NULL DEFAULT '1',
+ force_encap INTEGER NOT NULL DEFAULT '0',
+ local TEXT NOT NULL,
+ remote TEXT NOT NULL
+);
+
+
+DROP TABLE IF EXISTS ike_config_proposal;
+CREATE TABLE ike_config_proposal (
+ ike_cfg INTEGER NOT NULL,
+ prio INTEGER NOT NULL,
+ prop INTEGER NOT NULL
+);
+
+
+DROP TABLE IF EXISTS peer_configs;
+CREATE TABLE peer_configs (
+ id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+ name TEXT NOT NULL,
+ ike_version INTEGER NOT NULL DEFAULT '2',
+ ike_cfg INTEGER NOT NULL,
+ local_id TEXT NOT NULL,
+ remote_id TEXT NOT NULL,
+ cert_policy INTEGER NOT NULL DEFAULT '1',
+ uniqueid INTEGER NOT NULL DEFAULT '0',
+ auth_method INTEGER NOT NULL DEFAULT '1',
+ eap_type INTEGER NOT NULL DEFAULT '0',
+ eap_vendor INTEGER NOT NULL DEFAULT '0',
+ keyingtries INTEGER NOT NULL DEFAULT '3',
+ rekeytime INTEGER NOT NULL DEFAULT '7200',
+ reauthtime INTEGER NOT NULL DEFAULT '0',
+ jitter INTEGER NOT NULL DEFAULT '180',
+ overtime INTEGER NOT NULL DEFAULT '300',
+ mobike INTEGER NOT NULL DEFAULT '1',
+ dpd_delay INTEGER NOT NULL DEFAULT '120',
+ virtual TEXT DEFAULT NULL,
+ pool TEXT DEFAULT NULL,
+ mediation INTEGER NOT NULL DEFAULT '0',
+ mediated_by INTEGER NOT NULL DEFAULT '0',
+ peer_id INTEGER NOT NULL DEFAULT '0'
+);
+DROP INDEX IF EXISTS peer_configs_name;
+CREATE INDEX peer_configs_name ON peer_configs (
+ name
+);
+
+
+DROP TABLE IF EXISTS peer_config_child_config;
+CREATE TABLE peer_config_child_config (
+ peer_cfg INTEGER NOT NULL,
+ child_cfg INTEGER NOT NULL,
+ PRIMARY KEY (peer_cfg, child_cfg)
+);
+
+
+DROP TABLE IF EXISTS traffic_selectors;
+CREATE TABLE traffic_selectors (
+ id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+ type INTEGER NOT NULL DEFAULT '7',
+ protocol INTEGER NOT NULL DEFAULT '0',
+ start_addr BLOB DEFAULT NULL,
+ end_addr BLOB DEFAULT NULL,
+ start_port INTEGER NOT NULL DEFAULT '0',
+ end_port INTEGER NOT NULL DEFAULT '65535'
+);
+
+
+DROP TABLE IF EXISTS certificates;
+CREATE TABLE certificates (
+ id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+ type INTEGER NOT NULL,
+ keytype INTEGER NOT NULL,
+ data BLOB NOT NULL
+);
+
+
+DROP TABLE IF EXISTS certificate_identity;
+CREATE TABLE certificate_identity (
+ certificate INTEGER NOT NULL,
+ identity INTEGER NOT NULL,
+ PRIMARY KEY (certificate, identity)
+);
+
+
+DROP TABLE IF EXISTS private_keys;
+CREATE TABLE private_keys (
+ id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+ type INTEGER NOT NULL,
+ data BLOB NOT NULL
+);
+
+
+DROP TABLE IF EXISTS private_key_identity;
+CREATE TABLE private_key_identity (
+ private_key INTEGER NOT NULL,
+ identity INTEGER NOT NULL,
+ PRIMARY KEY (private_key, identity)
+);
+
+
+DROP TABLE IF EXISTS shared_secrets;
+CREATE TABLE shared_secrets (
+ id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+ type INTEGER NOT NULL,
+ data BLOB NOT NULL
+);
+
+
+DROP TABLE IF EXISTS shared_secret_identity;
+CREATE TABLE shared_secret_identity (
+ shared_secret INTEGER NOT NULL,
+ identity INTEGER NOT NULL,
+ PRIMARY KEY (shared_secret, identity)
+);
+
+
+DROP TABLE IF EXISTS certificate_authorities;
+CREATE TABLE certificate_authorities (
+ id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+ certificate INTEGER NOT NULL
+);
+
+
+DROP TABLE IF EXISTS certificate_distribution_points;
+CREATE TABLE certificate_distribution_points (
+ id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+ ca INTEGER NOT NULL,
+ type INTEGER NOT NULL,
+ uri TEXT NOT NULL
+);
+
+
+DROP TABLE IF EXISTS pools;
+CREATE TABLE pools (
+ id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+ name TEXT NOT NULL UNIQUE,
+ start BLOB NOT NULL,
+ end BLOB NOT NULL,
+ timeout INTEGER NOT NULL
+);
+
+DROP TABLE IF EXISTS addresses;
+CREATE TABLE addresses (
+ id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+ pool INTEGER NOT NULL,
+ address BLOB NOT NULL,
+ identity INTEGER NOT NULL DEFAULT 0,
+ acquired INTEGER NOT NULL DEFAULT 0,
+ released INTEGER NOT NULL DEFAULT 1
+);
+DROP INDEX IF EXISTS addresses_pool;
+CREATE INDEX addresses_pool ON addresses (
+ pool
+);
+DROP INDEX IF EXISTS addresses_address;
+CREATE INDEX addresses_address ON addresses (
+ address
+);
+DROP INDEX IF EXISTS addresses_identity;
+CREATE INDEX addresses_identity ON addresses (
+ identity
+);
+
+DROP TABLE IF EXISTS leases;
+CREATE TABLE leases (
+ id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+ address INTEGER NOT NULL,
+ identity INTEGER NOT NULL,
+ acquired INTEGER NOT NULL,
+ released INTEGER NOT NULL
+);
+
+DROP TABLE IF EXISTS attribute_pools;
+CREATE TABLE attribute_pools (
+ id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+ name TEXT NOT NULL
+);
+
+DROP TABLE IF EXISTS attributes;
+CREATE TABLE attributes (
+ id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+ identity INTEGER NOT NULL DEFAULT 0,
+ pool INTEGER NOT NULL DEFAULT 0,
+ type INTEGER NOT NULL,
+ value BLOB NOT NULL
+);
+DROP INDEX IF EXISTS attributes_identity;
+CREATE INDEX attributes_identity ON attributes (
+ identity
+);
+DROP INDEX IF EXISTS attributes_pool;
+CREATE INDEX attributes_pool ON attributes (
+ pool
+);
+
+DROP TABLE IF EXISTS ike_sas;
+CREATE TABLE ike_sas (
+ local_spi BLOB NOT NULL PRIMARY KEY,
+ remote_spi BLOB NOT NULL,
+ id INTEGER NOT NULL,
+ initiator INTEGER NOT NULL,
+ local_id_type INTEGER NOT NULL,
+ local_id_data BLOB DEFAULT NULL,
+ remote_id_type INTEGER NOT NULL,
+ remote_id_data BLOB DEFAULT NULL,
+ host_family INTEGER NOT NULL,
+ local_host_data BLOB NOT NULL,
+ remote_host_data BLOB NOT NULL,
+ created INTEGER NOT NULL DEFAULT CURRENT_TIMESTAMP
+);
+
+DROP TABLE IF EXISTS logs;
+CREATE TABLE logs (
+ id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+ local_spi BLOB NOT NULL,
+ signal INTEGER NOT NULL,
+ level INTEGER NOT NULL,
+ msg TEXT NOT NULL,
+ time INTEGER NOT NULL DEFAULT CURRENT_TIMESTAMP
+);
+
+++ /dev/null
-/* strongSwan SQLite database */
-
-DROP TABLE IF EXISTS identities;
-CREATE TABLE identities (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- type INTEGER NOT NULL,
- data BLOB NOT NULL,
- UNIQUE (type, data)
-);
-
-DROP TABLE IF EXISTS child_configs;
-CREATE TABLE child_configs (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- name TEXT NOT NULL,
- lifetime INTEGER NOT NULL DEFAULT '1200',
- rekeytime INTEGER NOT NULL DEFAULT '1020',
- jitter INTEGER NOT NULL DEFAULT '180',
- updown TEXT DEFAULT NULL,
- hostaccess INTEGER NOT NULL DEFAULT '0',
- mode INTEGER NOT NULL DEFAULT '2',
- start_action INTEGER NOT NULL DEFAULT '0',
- dpd_action INTEGER NOT NULL DEFAULT '0',
- close_action INTEGER NOT NULL DEFAULT '0',
- ipcomp INTEGER NOT NULL DEFAULT '0',
- reqid INTEGER NOT NULL DEFAULT '0'
-);
-DROP INDEX IF EXISTS child_configs_name;
-CREATE INDEX child_configs_name ON child_configs (
- name
-);
-
-DROP TABLE IF EXISTS child_config_traffic_selector;
-CREATE TABLE child_config_traffic_selector (
- child_cfg INTEGER NOT NULL,
- traffic_selector INTEGER NOT NULL,
- kind INTEGER NOT NULL
-);
-DROP INDEX IF EXISTS child_config_traffic_selector;
-CREATE INDEX child_config_traffic_selector_all ON child_config_traffic_selector (
- child_cfg, traffic_selector
-);
-
-DROP TABLE IF EXISTS proposals;
-CREATE TABLE proposals (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- proposal TEXT NOT NULL
-);
-
-DROP TABLE IF EXISTS child_config_proposal;
-CREATE TABLE child_config_proposal (
- child_cfg INTEGER NOT NULL,
- prio INTEGER NOT NULL,
- prop INTEGER NOT NULL
-);
-
-DROP TABLE IF EXISTS ike_configs;
-CREATE TABLE ike_configs (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- certreq INTEGER NOT NULL DEFAULT '1',
- force_encap INTEGER NOT NULL DEFAULT '0',
- local TEXT NOT NULL,
- remote TEXT NOT NULL
-);
-
-DROP TABLE IF EXISTS ike_config_proposal;
-CREATE TABLE ike_config_proposal (
- ike_cfg INTEGER NOT NULL,
- prio INTEGER NOT NULL,
- prop INTEGER NOT NULL
-);
-
-DROP TABLE IF EXISTS peer_configs;
-CREATE TABLE peer_configs (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- name TEXT NOT NULL,
- ike_version INTEGER NOT NULL DEFAULT '2',
- ike_cfg INTEGER NOT NULL,
- local_id TEXT NOT NULL,
- remote_id TEXT NOT NULL,
- cert_policy INTEGER NOT NULL DEFAULT '1',
- uniqueid INTEGER NOT NULL DEFAULT '0',
- auth_method INTEGER NOT NULL DEFAULT '1',
- eap_type INTEGER NOT NULL DEFAULT '0',
- eap_vendor INTEGER NOT NULL DEFAULT '0',
- keyingtries INTEGER NOT NULL DEFAULT '1',
- rekeytime INTEGER NOT NULL DEFAULT '0',
- reauthtime INTEGER NOT NULL DEFAULT '3600',
- jitter INTEGER NOT NULL DEFAULT '180',
- overtime INTEGER NOT NULL DEFAULT '300',
- mobike INTEGER NOT NULL DEFAULT '1',
- dpd_delay INTEGER NOT NULL DEFAULT '120',
- virtual TEXT DEFAULT NULL,
- pool TEXT DEFAULT NULL,
- mediation INTEGER NOT NULL DEFAULT '0',
- mediated_by INTEGER NOT NULL DEFAULT '0',
- peer_id INTEGER NOT NULL DEFAULT '0'
-);
-DROP INDEX IF EXISTS peer_configs_name;
-CREATE INDEX peer_configs_name ON peer_configs (
- name
-);
-
-DROP TABLE IF EXISTS peer_config_child_config;
-CREATE TABLE peer_config_child_config (
- peer_cfg INTEGER NOT NULL,
- child_cfg INTEGER NOT NULL,
- PRIMARY KEY (peer_cfg, child_cfg)
-);
-
-DROP TABLE IF EXISTS traffic_selectors;
-CREATE TABLE traffic_selectors (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- type INTEGER NOT NULL DEFAULT '7',
- protocol INTEGER NOT NULL DEFAULT '0',
- start_addr BLOB DEFAULT NULL,
- end_addr BLOB DEFAULT NULL,
- start_port INTEGER NOT NULL DEFAULT '0',
- end_port INTEGER NOT NULL DEFAULT '65535'
-);
-
-DROP TABLE IF EXISTS certificates;
-CREATE TABLE certificates (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- type INTEGER NOT NULL,
- keytype INTEGER NOT NULL,
- data BLOB NOT NULL
-);
-
-DROP TABLE IF EXISTS certificate_identity;
-CREATE TABLE certificate_identity (
- certificate INTEGER NOT NULL,
- identity INTEGER NOT NULL,
- PRIMARY KEY (certificate, identity)
-);
-
-DROP TABLE IF EXISTS private_keys;
-CREATE TABLE private_keys (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- type INTEGER NOT NULL,
- data BLOB NOT NULL
-);
-
-DROP TABLE IF EXISTS private_key_identity;
-CREATE TABLE private_key_identity (
- private_key INTEGER NOT NULL,
- identity INTEGER NOT NULL,
- PRIMARY KEY (private_key, identity)
-);
-
-DROP TABLE IF EXISTS shared_secrets;
-CREATE TABLE shared_secrets (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- type INTEGER NOT NULL,
- data BLOB NOT NULL
-);
-
-DROP TABLE IF EXISTS shared_secret_identity;
-CREATE TABLE shared_secret_identity (
- shared_secret INTEGER NOT NULL,
- identity INTEGER NOT NULL,
- PRIMARY KEY (shared_secret, identity)
-);
-
-DROP TABLE IF EXISTS certificate_authorities;
-CREATE TABLE certificate_authorities (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- certificate INTEGER NOT NULL
-);
-
-DROP TABLE IF EXISTS certificate_distribution_points;
-CREATE TABLE certificate_distribution_points (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- ca INTEGER NOT NULL,
- type INTEGER NOT NULL,
- uri TEXT NOT NULL
-);
-
-DROP TABLE IF EXISTS pools;
-CREATE TABLE pools (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- name TEXT NOT NULL,
- start BLOB NOT NULL,
- end BLOB NOT NULL,
- timeout INTEGER NOT NULL
-);
-DROP INDEX IF EXISTS pools_name;
-CREATE INDEX pools_name ON pools (
- name
-);
-
-DROP TABLE IF EXISTS addresses;
-CREATE TABLE addresses (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- pool INTEGER NOT NULL,
- address BLOB NOT NULL,
- identity INTEGER NOT NULL DEFAULT 0,
- acquired INTEGER NOT NULL DEFAULT 0,
- released INTEGER NOT NULL DEFAULT 1
-);
-DROP INDEX IF EXISTS addresses_pool;
-CREATE INDEX addresses_pool ON addresses (
- pool
-);
-DROP INDEX IF EXISTS addresses_address;
-CREATE INDEX addresses_address ON addresses (
- address
-);
-DROP INDEX IF EXISTS addresses_identity;
-CREATE INDEX addresses_identity ON addresses (
- identity
-);
-
-DROP TABLE IF EXISTS leases;
-CREATE TABLE leases (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- address INTEGER NOT NULL,
- identity INTEGER NOT NULL,
- acquired INTEGER NOT NULL,
- released INTEGER NOT NULL
-);
-
-DROP TABLE IF EXISTS attribute_pools;
-CREATE TABLE attribute_pools (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- name TEXT NOT NULL
-);
-
-DROP TABLE IF EXISTS attributes;
-CREATE TABLE attributes (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- identity INTEGER NOT NULL DEFAULT 0,
- pool INTEGER NOT NULL DEFAULT 0,
- type INTEGER NOT NULL,
- value BLOB NOT NULL
-);
-DROP INDEX IF EXISTS attributes_identity;
-CREATE INDEX attributes_identity ON attributes (
- identity
-);
-DROP INDEX IF EXISTS attributes_pool;
-CREATE INDEX attributes_pool ON attributes (
- pool
-);
-
-DROP TABLE IF EXISTS ike_sas;
-CREATE TABLE ike_sas (
- local_spi BLOB NOT NULL PRIMARY KEY,
- remote_spi BLOB NOT NULL,
- id INTEGER NOT NULL,
- initiator INTEGER NOT NULL,
- local_id_type INTEGER NOT NULL,
- local_id_data BLOB DEFAULT NULL,
- remote_id_type INTEGER NOT NULL,
- remote_id_data BLOB DEFAULT NULL,
- host_family INTEGER NOT NULL,
- local_host_data BLOB NOT NULL,
- remote_host_data BLOB NOT NULL,
- created INTEGER NOT NULL DEFAULT CURRENT_TIMESTAMP
-);
-
-DROP TABLE IF EXISTS logs;
-CREATE TABLE logs (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- local_spi BLOB NOT NULL,
- signal INTEGER NOT NULL,
- level INTEGER NOT NULL,
- msg TEXT NOT NULL,
- time INTEGER NOT NULL DEFAULT CURRENT_TIMESTAMP
-);
-
+++ /dev/null
-/* Products */
-
-INSERT INTO products ( /* 1 */
- name
-) VALUES (
- 'Debian 6.0 i686'
-);
-
-INSERT INTO products ( /* 2 */
- name
-) VALUES (
- 'Debian 6.0 x86_64'
-);
-
-INSERT INTO products ( /* 3 */
- name
-) VALUES (
- 'Debian 7.0 i686'
-);
-
-INSERT INTO products ( /* 4 */
- name
-) VALUES (
- 'Debian 7.0 x86_64'
-);
-
-INSERT INTO products ( /* 5 */
- name
-) VALUES (
- 'Debian 8.0 i686'
-);
-
-INSERT INTO products ( /* 6 */
- name
-) VALUES (
- 'Debian 8.0 x86_64'
-);
-
-INSERT INTO products ( /* 7 */
- name
-) VALUES (
- 'Ubuntu 10.04 i686'
-);
-
-INSERT INTO products ( /* 8 */
- name
-) VALUES (
- 'Ubuntu 10.04 x86_64'
-);
-
-INSERT INTO products ( /* 9 */
- name
-) VALUES (
- 'Ubuntu 10.10 i686'
-);
-
-INSERT INTO products ( /* 10 */
- name
-) VALUES (
- 'Ubuntu 10.10 x86_64'
-);
-
-INSERT INTO products ( /* 11 */
- name
-) VALUES (
- 'Ubuntu 11.04 i686'
-);
-
-INSERT INTO products ( /* 12 */
- name
-) VALUES (
- 'Ubuntu 11.04 x86_64'
-);
-
-INSERT INTO products ( /* 13 */
- name
-) VALUES (
- 'Ubuntu 11.10 i686'
-);
-
-INSERT INTO products ( /* 14 */
- name
-) VALUES (
- 'Ubuntu 11.10 x86_64'
-);
-
-INSERT INTO products ( /* 15 */
- name
-) VALUES (
- 'Ubuntu 12.04 i686'
-);
-
-INSERT INTO products ( /* 16 */
- name
-) VALUES (
- 'Ubuntu 12.04 x86_64'
-);
-
-INSERT INTO products ( /* 17 */
- name
-) VALUES (
- 'Ubuntu 12.10 i686'
-);
-
-INSERT INTO products ( /* 18 */
- name
-) VALUES (
- 'Ubuntu 12.10 x86_64'
-);
-
-INSERT INTO products ( /* 19 */
- name
-) VALUES (
- 'Ubuntu 13.04 i686'
-);
-
-INSERT INTO products ( /* 20 */
- name
-) VALUES (
- 'Ubuntu 13.04 x86_64'
-);
-
-INSERT INTO products ( /* 21 */
- name
-) VALUES (
- 'Android 4.1.1'
-);
-
-INSERT INTO products ( /* 22 */
- name
-) VALUES (
- 'Android 4.2.1'
-);
-
-INSERT INTO products ( /* 23 */
- name
-) VALUES (
- 'Ubuntu 13.10 i686'
-);
-
-INSERT INTO products ( /* 24 */
- name
-) VALUES (
- 'Ubuntu 13.10 x86_64'
-);
-
-INSERT INTO products ( /* 25 */
- name
-) VALUES (
- 'Debian 7.1 i686'
-);
-
-INSERT INTO products ( /* 26 */
- name
-) VALUES (
- 'Debian 7.1 x86_64'
-);
-
-INSERT INTO products ( /* 27 */
- name
-) VALUES (
- 'Debian 7.2 i686'
-);
-
-INSERT INTO products ( /* 28 */
- name
-) VALUES (
- 'Debian 7.2 x86_64'
-);
-
-INSERT INTO products ( /* 29 */
- name
-) VALUES (
- 'Android 4.1.2'
-);
-
-INSERT INTO products ( /* 30 */
- name
-) VALUES (
- 'Android 4.2.2'
-);
-
-INSERT INTO products ( /* 31 */
- name
-) VALUES (
- 'Android 4.3.1'
-);
-
-INSERT INTO products ( /* 32 */
- name
-) VALUES (
- 'Android 4.4'
-);
-
-INSERT INTO products ( /* 33 */
- name
-) VALUES (
- 'Android 4.4.1'
-);
-
-INSERT INTO products ( /* 34 */
- name
-) VALUES (
- 'Android 4.4.2'
-);
-
-/* Directories */
-
-INSERT INTO directories ( /* 1 */
- path
-) VALUES (
- '/bin'
-);
-
-INSERT INTO directories ( /* 2 */
- path
-) VALUES (
- '/etc'
-);
-
-INSERT INTO directories ( /* 3 */
- path
-) VALUES (
- '/lib'
-);
-
-INSERT INTO directories ( /* 4 */
- path
-) VALUES (
- '/lib/i386-linux-gnu'
-);
-
-INSERT INTO directories ( /* 5 */
- path
-) VALUES (
- '/lib/x86_64-linux-gnu'
-);
-
-INSERT INTO directories ( /* 6 */
- path
-) VALUES (
- '/lib/xtables'
-);
-
-INSERT INTO directories ( /* 7 */
- path
-) VALUES (
- '/sbin'
-);
-
-INSERT INTO directories ( /* 8 */
- path
-) VALUES (
- '/usr/bin'
-);
-
-INSERT INTO directories ( /* 9 */
- path
-) VALUES (
- '/usr/lib'
-);
-
-INSERT INTO directories ( /* 10 */
- path
-) VALUES (
- '/usr/lib/i386-linux-gnu'
-);
-
-INSERT INTO directories ( /* 11 */
- path
-) VALUES (
- '/usr/lib/x86_64-linux-gnu'
-);
-
-INSERT INTO directories ( /* 12 */
- path
-) VALUES (
- '/usr/sbin'
-);
-
-INSERT INTO directories ( /* 13 */
- path
-) VALUES (
- '/system/bin'
-);
-
-INSERT INTO directories ( /* 14 */
- path
-) VALUES (
- '/system/lib'
-);
-
-/* Files */
-
-INSERT INTO files ( /* 1 */
- name, dir
-) VALUES (
- 'libcrypto.so.1.0.0', 5
-);
-
-INSERT INTO files ( /* 2 */
- name, dir
-) VALUES (
- 'libcrypto.so.1.0.0', 11
-);
-
-INSERT INTO files ( /* 3 */
- name, dir
-) VALUES (
- 'libssl.so.1.0.0', 5
-);
-
-INSERT INTO files ( /* 4 */
- name, dir
-) VALUES (
- 'libssl.so.1.0.0', 11
-);
-
-INSERT INTO files ( /* 5 */
- name, dir
-) VALUES (
- 'openssl', 8
-);
-
-INSERT INTO files ( /* 6 */
- name, dir
-) VALUES (
- 'tnc_config', 2
-);
-
-/* Algorithms */
-
-INSERT INTO algorithms (
- id, name
-) VALUES (
- 65536, 'SHA1-IMA'
-);
-
-INSERT INTO algorithms (
- id, name
-) VALUES (
- 32768, 'SHA1'
-);
-
-INSERT INTO algorithms (
- id, name
-) VALUES (
- 16384, 'SHA256'
-);
-
-INSERT INTO algorithms (
- id, name
-) VALUES (
- 8192, 'SHA384'
-);
-
-/* File Hashes */
-
-INSERT INTO file_hashes (
- product, file, algo, hash
-) VALUES (
- 28, 2, 32768, X'6c6f8e12f6cbfba612e780374c4cdcd40f20968a'
-);
-
-INSERT INTO file_hashes (
- product, file, algo, hash
-) VALUES (
- 28, 2, 16384, X'dbcecd19d59310183cf5c31ddee29e8d7bec64d3f9583aad074330a1b3024b07'
-);
-
-INSERT INTO file_hashes (
- product, file, algo, hash
-) VALUES (
- 28, 2, 8192, X'197c5385e5853003188833d4f991136c1b0875fa416a60b1159f64e57e457b3184762c884a802a2bda194c058e3bd953'
-);
-
-INSERT INTO file_hashes (
- product, file, algo, hash
-) VALUES (
- 28, 4, 32768, X'3ad204f99eb7262efab79cfca02628870ea76361'
-);
-
-INSERT INTO file_hashes (
- product, file, algo, hash
-) VALUES (
- 28, 4, 16384, X'3a2170aad92fdd58b55e0e199822bc873cf587b2d1eb1ed7ed8dcea97ae86376'
-);
-
-INSERT INTO file_hashes (
- product, file, algo, hash
-) VALUES (
- 28, 4, 8192, X'f778076baa876b5e4b502494a3db081fb09dd870dee6991d54104a74b7e009c58fe261db5ffd13c11e08ef0cefcfa59f'
-);
-
-INSERT INTO file_hashes (
- product, file, algo, hash
-) VALUES (
- 28, 5, 32768, X'ecd9c7076cc0572724c7a67db7f19c2831e0445f'
-);
-
-INSERT INTO file_hashes (
- product, file, algo, hash
-) VALUES (
- 28, 5, 16384, X'28f3ea5afd34444c8232ea75003131e294a0c9b847de300e4b205d38c1a41305'
-);
-
-INSERT INTO file_hashes (
- product, file, algo, hash
-) VALUES (
- 28, 5, 8192, X'51921a8b9322f2d3f06d55002ff40a79da67e70cb563b2a50977642d603dfac2ccbb68b3d32a8bb350769b75d6254208'
-);
-
-INSERT INTO file_hashes (
- product, file, algo, hash
-) VALUES (
- 18, 1, 32768, X'd9309b9e45928239d7a7b18711e690792632cce4'
-);
-
-INSERT INTO file_hashes (
- product, file, algo, hash
-) VALUES (
- 18, 1, 16384, X'dbfa1856d278d8707c4989b30dd065b4bcd309908f0f2e6e66ff2aa83ff93f59'
-);
-
-INSERT INTO file_hashes (
- product, file, algo, hash
-) VALUES (
- 18, 1, 8192, X'fb8d027f03bb5ebb47741ed247eb9e174127b714d20229885feb37e0979aeb14a1b74020cded891d680441093625729c'
-);
-
-INSERT INTO file_hashes (
- product, file, algo, hash
-) VALUES (
- 18, 3, 32768, X'3715f2f94016a91fab5bbc503f0f1d43c5a9fc2b'
-);
-
-INSERT INTO file_hashes (
- product, file, algo, hash
-) VALUES (
- 18, 3, 16384, X'c03a5296b5decb87b01517f9927a8b2349dfb29ff9f5ba084f994c155ca5d4be'
-);
-
-INSERT INTO file_hashes (
- product, file, algo, hash
-) VALUES (
- 18, 3, 8192, X'b8bc345f56115235cc6091f61e312ce43ea54a5b99e7295002ae7b415fd35e06ec4c731ab70ad00d784bb53a318a2fa0'
-);
-
-INSERT INTO file_hashes (
- product, file, algo, hash
-) VALUES (
- 18, 5, 32768, X'e59602f4edf24c1b36199588886d06665d4adcd7'
-);
-
-INSERT INTO file_hashes (
- product, file, algo, hash
-) VALUES (
- 18, 5, 16384, X'090e1b77bda7fe665e498c6b5e09dbb7ddc5cfe57f213de48f4fb6736484f500'
-);
-
-INSERT INTO file_hashes (
- product, file, algo, hash
-) VALUES (
- 18, 5, 8192, X'7cbdb4612a13443dba910ecdef5161f2213e52c9b4a2eef14bcee5d287e9df931cd022e9e9715518ad9c9b6e3384a668'
-);
-
-/* Packages */
-
-INSERT INTO packages ( /* 1 */
- name
-) VALUES (
- 'libssl-dev'
-);
-
-INSERT INTO packages ( /* 2 */
- name
-) VALUES (
- 'libssl1.0.0'
-);
-
-INSERT INTO packages ( /* 3 */
- name
-) VALUES (
- 'libssl1.0.0-dbg'
-);
-
-INSERT INTO packages ( /* 4 */
- name
-) VALUES (
- 'openssl'
-);
-
-/* Versions */
-
-INSERT INTO versions (
- package, product, release, time
-) VALUES (
- 1, 28, '1.0.1e-2', 1366531494
-);
-
-INSERT INTO versions (
- package, product, release, time
-) VALUES (
- 2, 28, '1.0.1e-2', 1366531494
-);
-
-INSERT INTO versions (
- package, product, release, time
-) VALUES (
- 3, 28, '1.0.1e-2', 1366531494
-);
-
-INSERT INTO versions (
- package, product, release, time
-) VALUES (
- 4, 28, '1.0.1e-2', 1366531494
-);
-
-/* Components */
-
-INSERT INTO components (
- vendor_id, name, qualifier
-) VALUES (
- 36906, 1, 33 /* ITA TGRUB */
-);
-
-INSERT INTO components (
- vendor_id, name, qualifier
-) VALUES (
- 36906, 2, 33 /* ITA TBOOT */
-);
-
-INSERT INTO components (
- vendor_id, name, qualifier
-) VALUES (
- 36906, 3, 33 /* ITA IMA - Trusted Platform */
-);
-
-INSERT INTO components (
- vendor_id, name, qualifier
-) VALUES (
- 36906, 3, 34 /* ITA IMA - Operating System */
-);
-
-/* Groups */
-
-INSERT INTO groups ( /* 1 */
- name
-) VALUES (
- 'Default'
-);
-
-INSERT INTO groups ( /* 2 */
- name, parent
-) VALUES (
- 'Linux', 1
-);
-
-INSERT INTO groups ( /* 3 */
- name, parent
-) VALUES (
- 'Android', 1
-);
-
-INSERT INTO groups ( /* 4 */
- name, parent
-) VALUES (
- 'Debian i686', 2
-);
-
-INSERT INTO groups ( /* 5 */
- name, parent
-) VALUES (
- 'Debian x86_64', 2
-);
-
-INSERT INTO groups ( /* 6 */
- name, parent
-) VALUES (
- 'Ubuntu i686', 2
-);
-
-INSERT INTO groups ( /* 7 */
- name, parent
-) VALUES (
- 'Ubuntu x86_64', 2
-);
-
-INSERT INTO groups ( /* 8 */
- name
-) VALUES (
- 'Reference'
-);
-
-INSERT INTO groups ( /* 9 */
- name, parent
-) VALUES (
- 'Ref. Android', 8
-);
-
-INSERT INTO groups ( /* 10 */
- name, parent
-) VALUES (
- 'Ref. Linux', 8
-);
-
-INSERT INTO groups ( /* 11 */
- name
-) VALUES (
- 'TPM BIOS'
-);
-
-INSERT INTO groups ( /* 12 */
- name
-) VALUES (
- 'TPM IMA'
-);
-
-INSERT INTO groups ( /* 13 */
- name
-) VALUES (
- 'TPM BIOS/IMA'
-);
-
-/* Default Product Groups */
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 4, 1
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 4, 3
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 4, 5
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 4, 25
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 4, 27
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 5, 2
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 5, 4
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 5, 6
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 5, 26
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 5, 28
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 6, 9
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 6, 11
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 6, 13
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 6, 15
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 6, 17
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 6, 19
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 6, 23
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 7, 8
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 7, 10
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 7, 12
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 7, 14
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 7, 16
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 7, 18
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 7, 20
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 7, 24
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 3, 21
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 3, 22
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 3, 29
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 3, 30
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 3, 31
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 3, 32
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 3, 33
-);
-
-INSERT INTO groups_product_defaults (
- group_id, product_id
-) VALUES (
- 3, 34
-);
-
-/* Policies */
-
-INSERT INTO policies ( /* 1 */
- type, name, rec_fail, rec_noresult
-) VALUES (
- 1, 'Installed Packages', 2, 2
-);
-
-INSERT INTO policies ( /* 2 */
- type, name, rec_fail, rec_noresult
-) VALUES (
- 2, 'Unknown Source', 2, 2
-);
-
-INSERT INTO policies ( /* 3 */
- type, name, rec_fail, rec_noresult
-) VALUES (
- 3, 'IP Forwarding Enabled', 1, 1
-);
-
-INSERT INTO policies ( /* 4 */
- type, name, rec_fail, rec_noresult
-) VALUES (
- 4, 'Default Factory Password Enabled', 1, 1
-);
-
-INSERT INTO policies ( /* 5 */
- type, name, file, rec_fail, rec_noresult
-) VALUES (
- 6, 'Measure /lib/x86_64-linux-gnu/libcrypto.so.1.0.0', 1, 2, 2
-);
-
-INSERT INTO policies ( /* 6 */
- type, name, file, rec_fail, rec_noresult
-) VALUES (
- 6, 'Measure /lib/x86_64-linux-gnu/libssl.so.1.0.0', 3, 2, 2
-);
-
-INSERT INTO policies ( /* 7 */
- type, name, file, rec_fail, rec_noresult
-) VALUES (
- 6, 'Measure /usr/bin/openssl', 5, 2, 2
-);
-
-INSERT INTO policies ( /* 8 */
- type, name, rec_fail, rec_noresult
-) VALUES (
- 11, 'No Open TCP Ports', 1, 1
-);
-
-INSERT INTO policies ( /* 9 */
- type, name, argument, rec_fail, rec_noresult
-) VALUES (
- 13, 'Open UDP Ports', '500 4500 10000-65000', 1, 1
-);
-
-INSERT INTO policies ( /* 10 */
- type, name, file, rec_fail, rec_noresult
-) VALUES (
- 7, 'Metadata of /etc/tnc_config', 6, 0, 0
-);
-
-INSERT INTO policies ( /* 11 */
- type, name, dir, rec_fail, rec_noresult
-) VALUES (
- 8, 'Get /bin', 1, 0, 0
-);
-
-INSERT INTO policies ( /* 12 */
- type, name, file, rec_fail, rec_noresult
-) VALUES (
- 6, 'Measure /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0', 2, 2, 2
-);
-
-INSERT INTO policies ( /* 13 */
- type, name, file, rec_fail, rec_noresult
-) VALUES (
- 6, 'Measure /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0', 4, 2, 2
-);
-
-INSERT INTO policies ( /* 14 */
- type, name, dir, rec_fail, rec_noresult
-) VALUES (
- 8, 'Get /system/bin', 13, 0, 0
-);
-
-INSERT INTO policies ( /* 15 */
- type, name, dir, rec_fail, rec_noresult
-) VALUES (
- 8, 'Get /system/lib', 14, 0, 0
-);
-
-INSERT INTO policies ( /* 16 */
- type, name, dir, rec_fail, rec_noresult
-) VALUES (
- 9, 'Measure /bin', 1, 2, 2
-);
-
-INSERT INTO policies ( /* 17 */
- type, name, argument, rec_fail, rec_noresult
-) VALUES (
- 15, 'SWID Tag IDs', 'R', 2, 2
-);
-
-INSERT INTO policies ( /* 18 */
- type, name, argument, rec_fail, rec_noresult
-) VALUES (
- 15, 'SWID Tags', '', 2, 2
-);
-
-INSERT INTO policies ( /* 19 */
- type, name, argument, rec_fail, rec_noresult
-) VALUES (
- 16, 'TPM BIOS Measurements', 'B', 2, 2
-);
-
-INSERT INTO policies ( /* 20 */
- type, name, argument, rec_fail, rec_noresult
-) VALUES (
- 16, 'TPM IMA Measurements', 'I', 2, 2
-);
-
-INSERT INTO policies ( /* 21 */
- type, name, argument, rec_fail, rec_noresult
-) VALUES (
- 16, 'TPM BIOS/IMA Measurements', 'BI', 2, 2
-);
-
-/* Enforcements */
-
-INSERT INTO enforcements ( /* 1 */
- policy, group_id, max_age
-) VALUES (
- 1, 1, 86400
-);
-
-INSERT INTO enforcements ( /* 2 */
- policy, group_id, max_age
-) VALUES (
- 2, 3, 0
-);
-
-INSERT INTO enforcements ( /* 3 */
- policy, group_id, max_age
-) VALUES (
- 3, 2, 0
-);
-
-INSERT INTO enforcements ( /* 4 */
- policy, group_id, max_age
-) VALUES (
- 5, 7, 86400
-);
-
-INSERT INTO enforcements ( /* 5 */
- policy, group_id, max_age
-) VALUES (
- 6, 7, 86400
-);
-
-INSERT INTO enforcements ( /* 6 */
- policy, group_id, max_age
-) VALUES (
- 7, 2, 86400
-);
-
-INSERT INTO enforcements ( /* 7 */
- policy, group_id, max_age
-) VALUES (
- 8, 1, 60
-);
-
-INSERT INTO enforcements ( /* 8 */
- policy, group_id, max_age
-) VALUES (
- 9, 1, 60
-);
-
-INSERT INTO enforcements ( /* 9 */
- policy, group_id, max_age
-) VALUES (
- 10, 2, 60
-);
-
-INSERT INTO enforcements ( /* 10 */
- policy, group_id, max_age
-) VALUES (
- 11, 10, 86400
-);
-
-INSERT INTO enforcements ( /* 11 */
- policy, group_id, max_age
-) VALUES (
- 12, 5, 86400
-);
-
-INSERT INTO enforcements ( /* 12 */
- policy, group_id, max_age
-) VALUES (
- 13, 5, 86400
-);
-
-INSERT INTO enforcements ( /* 13 */
- policy, group_id, max_age
-) VALUES (
- 14, 9, 0
-);
-
-INSERT INTO enforcements ( /* 14 */
- policy, group_id, max_age
-) VALUES (
- 15, 9, 0
-);
-
-INSERT INTO enforcements ( /* 15 */
- policy, group_id, max_age
-) VALUES (
- 19, 11, 60
-);
-
-INSERT INTO enforcements ( /* 16 */
- policy, group_id, max_age
-) VALUES (
- 20, 12, 60
-);
-
-INSERT INTO enforcements ( /* 17 */
- policy, group_id, max_age
-) VALUES (
- 21, 13, 60
-);
-
-/* regids */
-
-INSERT INTO regids ( /* 1 */
- name
-) VALUES (
- 'regid.1986-12.com.adobe'
-);
-
-INSERT INTO regids ( /* 2 */
- name
-) VALUES (
- 'regid.1991-06.com.microsoft'
-);
-
-INSERT INTO regids ( /* 3 */
- name
-) VALUES (
- 'regid.2004-05.com.ubuntu'
-);
-
-INSERT INTO regids ( /* 4 */
- name
-) VALUES (
- 'regid.1995-04.org.apache'
-);
-
-INSERT INTO regids ( /* 5 */
- name
-) VALUES (
- 'regid.1999-03.org.debian'
-);
-
-INSERT INTO regids ( /* 6 */
- name
-) VALUES (
- 'regid.1994-04.org.isc'
-);
-
-INSERT INTO regids ( /* 7 */
- name
-) VALUES (
- 'regid.1998-12.org.openssl'
-);
-
-INSERT INTO regids ( /* 8 */
- name
-) VALUES (
- 'regid.1998-01.org.samba'
-);
-
-INSERT INTO regids ( /* 9 */
- name
-) VALUES (
- 'regid.2002-08.org.sqlite'
-);
-
-INSERT INTO regids ( /* 10 */
- name
-) VALUES (
- 'regid.2004-03.org.strongswan'
-);
-
-/* Tags */
-
-INSERT INTO tags (
- regid, unique_sw_id
-) VALUES (
- 2, 'Windows-8-Pro'
-);
-
-INSERT INTO tags (
- regid, unique_sw_id
-) VALUES (
- 5, 'apache-2-2-22-13'
-);
-
-INSERT INTO tags (
- regid, unique_sw_id
-) VALUES (
- 5, 'bind-9-8-4-dfsg'
-);
-
-INSERT INTO tags (
- regid, unique_sw_id
-) VALUES (
- 5, 'libsqlite-3-7-13-1'
-);
-
-INSERT INTO tags (
- regid, unique_sw_id
-) VALUES (
- 5, 'libssl-1-0-1e-2'
-);
-
-INSERT INTO tags (
- regid, unique_sw_id
-) VALUES (
- 5, 'libssl-dev-1-0-1e-2'
-);
-
-INSERT INTO tags (
- regid, unique_sw_id
-) VALUES (
- 5, 'libssl-doc-1-0-1e-2'
-);
-
-INSERT INTO tags (
- regid, unique_sw_id
-) VALUES (
- 5, 'openssl-1-0-1e-2'
-);
-
-INSERT INTO tags (
- regid, unique_sw_id
-) VALUES (
- 5, 'smbclient-3-6-6-6'
-);
-
-INSERT INTO tags (
- regid, unique_sw_id
-) VALUES (
- 5, 'sqlite-3-7-13-1'
-);
-
-INSERT INTO tags (
- regid, unique_sw_id
-) VALUES (
- 10, 'strongSwan-5-1-1'
-);
-
-INSERT INTO tags (
- regid, unique_sw_id
-) VALUES (
- 10, 'strongSwan-5-1-2'
-);
-
+++ /dev/null
-/* IMV PTS SQLite database */
-
-DROP TABLE IF EXISTS directories;
-CREATE TABLE directories (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- path TEXT NOT NULL
-);
-DROP INDEX IF EXISTS directories_path;
-CREATE INDEX directories_path ON directories (
- path
-);
-
-DROP TABLE IF EXISTS files;
-CREATE TABLE files (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- dir INTEGER DEFAULT 0 REFERENCES directories(id),
- name TEXT NOT NULL
-);
-DROP INDEX IF EXISTS files_name;
-CREATE INDEX files_name ON files (
- name
-);
-
-DROP TABLE IF EXISTS products;
-CREATE TABLE products (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- name TEXT NOT NULL
-);
-DROP INDEX IF EXISTS products_name;
-CREATE INDEX products_name ON products (
- name
-);
-
-DROP TABLE IF EXISTS algorithms;
-CREATE TABLE algorithms (
- id INTEGER PRIMARY KEY,
- name VARCHAR(20) not NULL
-);
-
-DROP TABLE IF EXISTS file_hashes;
-CREATE TABLE file_hashes (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- file INTEGER NOT NULL REFERENCES files(id),
- product INTEGER NOT NULL REFERENCES products(id),
- device INTEGER DEFAULT 0,
- key INTEGER DEFAULT 0 REFERENCES keys(id),
- algo INTEGER NOT NULL REFERENCES algorithms(id),
- hash BLOB NOT NULL
-);
-
-DROP TABLE IF EXISTS keys;
-CREATE TABLE keys (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- keyid BLOB NOT NULL,
- owner TEXT NOT NULL
-);
-DROP INDEX IF EXISTS keys_keyid;
-CREATE INDEX keys_keyid ON keys (
- keyid
-);
-DROP INDEX IF EXISTS keys_owner;
-CREATE INDEX keys_owner ON keys (
- owner
-);
-
-DROP TABLE IF EXISTS groups;
-CREATE TABLE groups (
- id INTEGER NOT NULL PRIMARY KEY,
- name VARCHAR(50) NOT NULL UNIQUE,
- parent INTEGER
-);
-
-DROP TABLE IF EXISTS groups_members;
-CREATE TABLE groups_members (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- group_id INTEGER NOT NULL REFERENCES groups(id),
- device_id INTEGER NOT NULL REFERENCES devices(id),
- UNIQUE (group_id, device_id)
-);
-
-DROP TABLE IF EXISTS groups_product_defaults;
-CREATE TABLE groups_product_defaults (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- group_id INTEGER NOT NULL REFERENCES groups(id),
- product_id INTEGER NOT NULL REFERENCES products(id),
- UNIQUE (group_id, product_id)
-);
-
-DROP TABLE IF EXISTS policies;
-CREATE TABLE policies (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- type INTEGER NOT NULL,
- name VARCHAR(100) NOT NULL UNIQUE,
- argument TEXT DEFAULT '' NOT NULL,
- rec_fail INTEGER NOT NULL,
- rec_noresult INTEGER NOT NULL,
- file INTEGER DEFAULT 0 REFERENCES files(id),
- dir INTEGER DEFAULT 0 REFERENCES directories(id)
-);
-
-DROP TABLE IF EXISTS enforcements;
-CREATE TABLE enforcements (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- policy INTEGER NOT NULL REFERENCES policies(id),
- group_id INTEGER NOT NULL REFERENCES groups(id),
- rec_fail INTEGER,
- rec_noresult INTEGER,
- max_age INTEGER NOT NULL,
- UNIQUE (policy, group_id)
-);
-
-DROP TABLE IF EXISTS sessions;
-CREATE TABLE sessions (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- time INTEGER NOT NULL,
- connection INTEGER NOT NULL,
- identity INTEGER DEFAULT 0 REFERENCES identities(id),
- device INTEGER DEFAULT 0 REFERENCES devices(id),
- product INTEGER DEFAULT 0 REFERENCES products(id),
- rec INTEGER DEFAULT 3
-);
-
-DROP TABLE IF EXISTS workitems;
-CREATE TABLE workitems (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- session INTEGER NOT NULL REFERENCES sessions(id),
- enforcement INTEGER NOT NULL REFERENCES enforcements(id),
- type INTEGER NOT NULL,
- arg_str TEXT,
- arg_int INTEGER DEFAULT 0,
- rec_fail INTEGER NOT NULL,
- rec_noresult INTEGER NOT NULL,
- rec_final INTEGER,
- result TEXT
-);
-DROP INDEX IF EXISTS workitems_session;
-CREATE INDEX workitems_sessions ON workitems (
- session
-);
-
-DROP TABLE IF EXISTS results;
-CREATE TABLE results (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- session INTEGER NOT NULL REFERENCES measurements(id),
- policy INTEGER NOT NULL REFERENCES policies(id),
- rec INTEGER NOT NULL,
- result TEXT NOT NULL
-);
-DROP INDEX IF EXISTS results_session;
-CREATE INDEX results_session ON results (
- session
-);
-
-DROP TABLE IF EXISTS components;
-CREATE TABLE components (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- vendor_id INTEGER NOT NULL,
- name INTEGER NOT NULL,
- qualifier INTEGER DEFAULT 0
-);
-
-
-DROP TABLE IF EXISTS key_component;
-CREATE TABLE key_component (
- key INTEGER NOT NULL,
- component INTEGER NOT NULL,
- depth INTEGER DEFAULT 0,
- seq_no INTEGER DEFAULT 0,
- PRIMARY KEY (key, component)
-);
-
-
-DROP TABLE IF EXISTS component_hashes;
-CREATE TABLE component_hashes (
- component INTEGER NOT NULL,
- key INTEGER NOT NULL,
- seq_no INTEGER NOT NULL,
- pcr INTEGER NOT NULL,
- algo INTEGER NOT NULL,
- hash BLOB NOT NULL,
- PRIMARY KEY(component, key, seq_no, algo)
-);
-
-DROP TABLE IF EXISTS packages;
-CREATE TABLE packages (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- name TEXT NOT NULL,
- blacklist INTEGER DEFAULT 0
-);
-DROP INDEX IF EXISTS packages_name;
-CREATE INDEX packages_name ON packages (
- name
-);
-
-DROP TABLE IF EXISTS versions;
-CREATE TABLE versions (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- package INTEGER NOT NULL REFERENCES packages(id),
- product INTEGER NOT NULL REFERENCES products(id),
- release TEXT NOT NULL,
- security INTEGER DEFAULT 0,
- blacklist INTEGER DEFAULT 0,
- time INTEGER DEFAULT 0
-);
-DROP INDEX IF EXISTS versions_release;
-CREATE INDEX versions_release ON versions (
- release
-);
-DROP INDEX IF EXISTS versions_package_product;
-CREATE INDEX versions_package_product ON versions (
- package, product
-);
-
-DROP TABLE IF EXISTS devices;
-CREATE TABLE devices (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- description TEXT DEFAULT '',
- value TEXT NOT NULL,
- product INTEGER REFERENCES products(id),
- created INTEGER
-);
-DROP INDEX IF EXISTS devices_id;
-CREATE INDEX devices_value ON devices (
- value
-);
-
-DROP TABLE IF EXISTS identities;
-CREATE TABLE identities (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- type INTEGER NOT NULL,
- value BLOB NOT NULL,
- UNIQUE (type, value)
-);
-
-DROP TABLE IF EXISTS regids;
-CREATE TABLE regids (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- name TEXT NOT NULL
-);
-DROP INDEX IF EXISTS regids_name;
-CREATE INDEX regids_name ON regids (
- name
-);
-
-DROP TABLE IF EXISTS tags;
-CREATE TABLE tags (
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
- regid INTEGER NOT NULL REFERENCES regids(id),
- unique_sw_id TEXT NOT NULL,
- value TEXT
-);
-DROP INDEX IF EXISTS tags_name;
-CREATE INDEX tags_unique_sw_id ON tags (
- unique_sw_id
-);
-
-moon::cat /etc/ipsec.d/tables.sql > /etc/ipsec.d/ipsec.sql
+moon::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql > /etc/ipsec.d/ipsec.sql
moon::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
moon::ipsec pool --add bigpool --start 10.3.0.1 --end 10.3.3.232 --timeout 0 2> /dev/null
moon::ipsec pool --addattr dns --server PH_IP_WINNETOU 2> /dev/null
carol::ipsec start
dave::ipsec start
moon::ipsec start
-carol::sleep 2
+carol::sleep 2
carol::ipsec up home
dave::ipsec up home
carol::sleep 1
-moon::cat /etc/ipsec.d/tables.sql > /etc/ipsec.d/ipsec.sql
+moon::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql > /etc/ipsec.d/ipsec.sql
moon::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
moon::ipsec pool --add bigpool --start 10.3.0.1 --end 10.3.3.232 --timeout 0 2> /dev/null
moon::ipsec pool --addattr dns --server PH_IP_WINNETOU 2> /dev/null
carol::ipsec start
dave::ipsec start
moon::ipsec start
-carol::sleep 2
+carol::sleep 2
carol::ipsec up home
dave::ipsec up home
carol::sleep 1
-moon::cat /etc/ipsec.d/tables.sql > /etc/ipsec.d/ipsec.sql
+moon::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql > /etc/ipsec.d/ipsec.sql
moon::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
moon::ipsec pool --add pool0 --start 10.3.0.1 --end 10.3.0.1 --timeout 48 2> /dev/null
moon::ipsec pool --add pool1 --start 10.3.1.1 --end 10.3.1.1 --timeout 48 2> /dev/null
carol::ipsec start
dave::ipsec start
moon::ipsec start
-carol::sleep 2
+carol::sleep 2
carol::ipsec up home
dave::ipsec up home
carol::sleep 1
-moon::cat /etc/ipsec.d/tables.sql > /etc/ipsec.d/ipsec.sql
+moon::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql > /etc/ipsec.d/ipsec.sql
moon::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
-moon::ipsec pool --add extpool --start 10.3.0.1 --end 10.3.1.244 --timeout 48 2> /dev/null
+moon::ipsec pool --add extpool --start 10.3.0.1 --end 10.3.1.244 --timeout 48 2> /dev/null
moon::ipsec pool --add intpool --start 10.4.0.1 --end 10.4.1.244 --timeout 0 2> /dev/null
moon::ipsec pool --addattr dns --server PH_IP_VENUS --pool intpool --identity venus.strongswan.org 2> /dev/null
moon::ipsec pool --addattr dns --server PH_IP_ALICE --pool intpool --identity alice@strongswan.org 2> /dev/null
carol::ipsec start
dave::ipsec start
moon::ipsec start
-carol::sleep 2
+carol::sleep 2
carol::ipsec up home
dave::ipsec up home
alice::ipsec up home
-moon::cat /etc/ipsec.d/tables.sql > /etc/ipsec.d/ipsec.sql
+moon::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql > /etc/ipsec.d/ipsec.sql
moon::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
moon::ipsec pool --add intpool --start 10.4.0.1 --end 10.4.1.244 --timeout 0 2> /dev/null
moon::iptables-restore < /etc/iptables.rules
carol::ipsec start
moon::ipsec start
alice::ipsec start
-carol::sleep 2
+carol::sleep 2
carol::ipsec up home
alice::ipsec up home
alice::sleep 1
-moon::cat /etc/ipsec.d/tables.sql > /etc/ipsec.d/ipsec.sql
+moon::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql > /etc/ipsec.d/ipsec.sql
moon::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
-moon::ipsec pool --add v4_pool --start 10.3.0.1 --end 10.3.1.244 --timeout 48 2> /dev/null
+moon::ipsec pool --add v4_pool --start 10.3.0.1 --end 10.3.1.244 --timeout 48 2> /dev/null
moon::ipsec pool --add v6_pool --start fec3:\:1 --end fec3:\:fe --timeout 48 2> /dev/null
alice::ip -6 route add default via fec1:\:1
moon::ipsec start
moon::rm /etc/ipsec.d/cacerts/*
carol::rm /etc/ipsec.d/cacerts/*
dave::rm /etc/ipsec.d/cacerts/*
-moon::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
-carol::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
-dave::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+moon::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+carol::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+dave::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
moon::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
carol::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
dave::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
moon::rm /etc/ipsec.d/cacerts/*
carol::rm /etc/ipsec.d/cacerts/*
dave::rm /etc/ipsec.d/cacerts/*
-moon::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
-carol::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
-dave::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+moon::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+carol::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+dave::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
moon::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
carol::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
dave::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
moon::rm /etc/ipsec.d/cacerts/*
carol::rm /etc/ipsec.d/cacerts/*
dave::rm /etc/ipsec.d/cacerts/*
-moon::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
-carol::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
-dave::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+moon::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+carol::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+dave::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
moon::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
carol::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
dave::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
moon::rm /etc/ipsec.d/cacerts/*
carol::rm /etc/ipsec.d/cacerts/*
dave::rm /etc/ipsec.d/cacerts/*
-moon::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
-carol::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
-dave::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+moon::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+carol::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+dave::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
moon::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
carol::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
dave::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
moon::rm /etc/ipsec.d/cacerts/*
carol::rm /etc/ipsec.d/cacerts/*
dave::rm /etc/ipsec.d/cacerts/*
-moon::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
-carol::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
-dave::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+moon::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+carol::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+dave::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
moon::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
carol::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
dave::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
moon::rm /etc/ipsec.d/cacerts/*
carol::rm /etc/ipsec.d/cacerts/*
dave::rm /etc/ipsec.d/cacerts/*
-moon::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
-carol::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
-dave::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+moon::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+carol::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+dave::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
moon::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
carol::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
dave::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
moon::rm /etc/ipsec.d/cacerts/*
sun::rm /etc/ipsec.d/cacerts/*
-moon::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
-sun::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+moon::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+sun::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
moon::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
sun::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
moon::iptables-restore < /etc/iptables.rules
sun::iptables-restore < /etc/iptables.rules
moon::ipsec start
sun::ipsec start
-moon::sleep 1
+moon::sleep 1
moon::ipsec up net-net
moon::rm /etc/ipsec.d/cacerts/*
sun::rm /etc/ipsec.d/cacerts/*
-moon::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
-sun::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+moon::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+sun::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
moon::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
sun::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
moon::iptables-restore < /etc/iptables.rules
sun::iptables-restore < /etc/iptables.rules
moon::ipsec start
sun::ipsec start
-moon::sleep 1
+moon::sleep 1
moon::ipsec up net-net
moon::rm /etc/ipsec.d/cacerts/*
sun::rm /etc/ipsec.d/cacerts/*
-moon::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
-sun::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+moon::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+sun::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
moon::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
sun::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
moon::iptables-restore < /etc/iptables.rules
moon::rm /etc/ipsec.d/cacerts/*
sun::rm /etc/ipsec.d/cacerts/*
-moon::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
-sun::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+moon::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+sun::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
moon::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
sun::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
moon::iptables-restore < /etc/iptables.rules
moon::rm /etc/ipsec.d/cacerts/*
carol::rm /etc/ipsec.d/cacerts/*
dave::rm /etc/ipsec.d/cacerts/*
-moon::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
-carol::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
-dave::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+moon::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+carol::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+dave::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
moon::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
carol::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
dave::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
moon::rm /etc/ipsec.d/cacerts/*
carol::rm /etc/ipsec.d/cacerts/*
-moon::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
-carol::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+moon::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+carol::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
moon::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
carol::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
moon::iptables-restore < /etc/iptables.rules
moon::rm /etc/ipsec.d/cacerts/*
carol::rm /etc/ipsec.d/cacerts/*
dave::rm /etc/ipsec.d/cacerts/*
-moon::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
-carol::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
-dave::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+moon::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+carol::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+dave::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
moon::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
carol::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
dave::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
moon::rm /etc/ipsec.d/cacerts/*
carol::rm /etc/ipsec.d/cacerts/*
dave::rm /etc/ipsec.d/cacerts/*
-moon::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
-carol::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
-dave::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+moon::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+carol::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+dave::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
moon::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
carol::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
dave::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
moon::rm /etc/ipsec.d/cacerts/*
carol::rm /etc/ipsec.d/cacerts/*
dave::rm /etc/ipsec.d/cacerts/*
-moon::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
-carol::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
-dave::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+moon::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+carol::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+dave::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
moon::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
carol::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
dave::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
moon::rm /etc/ipsec.d/cacerts/*
carol::rm /etc/ipsec.d/cacerts/*
dave::rm /etc/ipsec.d/cacerts/*
-moon::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
-carol::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
-dave::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+moon::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+carol::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+dave::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
moon::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
carol::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
dave::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
moon::rm /etc/ipsec.d/cacerts/*
carol::rm /etc/ipsec.d/cacerts/*
dave::rm /etc/ipsec.d/cacerts/*
-moon::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
-carol::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
-dave::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+moon::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+carol::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+dave::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
moon::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
carol::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
dave::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
moon::rm /etc/ipsec.d/cacerts/*
sun::rm /etc/ipsec.d/cacerts/*
-moon::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
-sun::cat /etc/ipsec.d/tables.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+moon::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
+sun::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql /etc/ipsec.d/data.sql > /etc/ipsec.d/ipsec.sql
moon::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
sun::cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db
moon::iptables-restore < /etc/iptables.rules
sun::iptables-restore < /etc/iptables.rules
moon::ipsec start
sun::ipsec start
-moon::sleep 1
+moon::sleep 1
moon::ipsec up net-net
dave::echo aabbccddeeff11223344556677889900 > /var/lib/dbus/machine-id
alice::ln -s /etc/freeradius/sites-available/inner-tunnel-second /etc/freeradius/sites-enabled/inner-tunnel-second
alice::cat /etc/freeradius/sites-enabled/inner-tunnel-second
-alice::cd /etc/pts; cat tables.sql data.sql data1.sql | sqlite3 config.db
+alice::cd /usr/local/share/strongswan/templates/database/imv; cat tables.sql data.sql /etc/pts/data1.sql | sqlite3 /etc/pts/config.db
alice::LEAK_DETECTIVE_DISABLE=1 LOG4CXX_CONFIGURATION=/etc/tnc/log4cxx.properties radiusd
alice::cat /etc/tnc_config
carol::cat /etc/tnc_config
carol::echo 0 > /proc/sys/net/ipv4/ip_forward
dave::echo aabbccddeeff11223344556677889900 > /var/lib/dbus/machine-id
moon::sed -i "s/NOW/`date +%s`/g" /etc/pts/data1.sql
-moon::cd /etc/pts; cat tables.sql data.sql data1.sql | sqlite3 config.db
+moon::cd /usr/local/share/strongswan/templates/database/imv; cat tables.sql data.sql /etc/pts/data1.sql | sqlite3 /etc/pts/config.db
moon::cat /etc/tnc_config
carol::cat /etc/tnc_config
dave::cat /etc/tnc_config
moon::ipsec start
-carol::ipsec start
-dave::ipsec start
+carol::ipsec start
+dave::ipsec start
carol::sleep 1
carol::ipsec up home
dave::ipsec up home
dave::echo aabbccddeeff11223344556677889900 > /var/lib/dbus/machine-id
dave::cat /etc/tnc_config
alice::sed -i "s/NOW/`date +%s`/g" /etc/pts/data.sql
-alice::cd /etc/pts; cat tables.sql data.sql data1.sql | sqlite3 config.db
+alice::cd /usr/local/share/strongswan/templates/database/imv; cat tables.sql data.sql /etc/pts/data1.sql | sqlite3 /etc/pts/config.db
alice::ipsec start
winnetou::ip route add 10.1.0.0/16 via 192.168.0.1
carol::ip route add 10.1.0.0/16 via 192.168.0.1
dave::iptables-restore < /etc/iptables.rules
carol::echo 0 > /proc/sys/net/ipv4/ip_forward
dave::echo aabbccddeeff11223344556677889900 > /var/lib/dbus/machine-id
-moon::cd /etc/pts; cat tables.sql data.sql data1.sql | sqlite3 config.db
+moon::cd /usr/local/share/strongswan/templates/database/imv; cat tables.sql data.sql /etc/pts/data1.sql | sqlite3 /etc/pts/config.db
moon::cat /etc/tnc_config
carol::cat /etc/tnc_config
dave::cat /etc/tnc_config
moon::ipsec start
-dave::ipsec start
-carol::ipsec start
+dave::ipsec start
+carol::ipsec start
dave::sleep 1
dave::ipsec up home
carol::ipsec up home