logging to SQL database
[strongswan.git] / src / charon / plugins / sql / sqlite.sql
1
2 DROP TABLE IF EXISTS child_configs;
3 CREATE TABLE child_configs (
4 id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
5 name TEXT NOT NULL,
6 lifetime INTEGER NOT NULL default '1500',
7 rekeytime INTEGER NOT NULL default '1200',
8 jitter INTEGER NOT NULL default '60',
9 updown TEXT default NULL,
10 hostaccess INTEGER NOT NULL default '1',
11 mode INTEGER NOT NULL default '1'
12 );
13
14
15 DROP TABLE IF EXISTS child_config_traffic_selector;
16 CREATE TABLE child_config_traffic_selector (
17 child_cfg INTEGER NOT NULL,
18 traffic_selector INTEGER NOT NULL,
19 kind INTEGER NOT NULL
20 );
21
22
23 DROP TABLE IF EXISTS ike_configs;
24 CREATE TABLE ike_configs (
25 id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
26 certreq INTEGER NOT NULL default '1',
27 force_encap INTEGER NOT NULL default '0',
28 local TEXT NOT NULL,
29 remote TEXT NOT NULL
30 );
31
32 DROP TABLE IF EXISTS peer_configs;
33 CREATE TABLE peer_configs (
34 id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
35 name TEXT NOT NULL,
36 ike_version INTEGER NOT NULL default '2',
37 ike_cfg INTEGER NOT NULL,
38 local_id TEXT NOT NULL,
39 remote_id TEXT NOT NULL,
40 cert_policy INTEGER NOT NULL default '1',
41 auth_method INTEGER NOT NULL default '1',
42 eap_type INTEGER NOT NULL default '0',
43 eap_vendor INTEGER NOT NULL default '0',
44 keyingtries INTEGER NOT NULL default '3',
45 rekeytime INTEGER NOT NULL default '7200',
46 reauthtime INTEGER NOT NULL default '0',
47 jitter INTEGER NOT NULL default '180',
48 overtime INTEGER NOT NULL default '300',
49 mobike INTEGER NOT NULL default '1',
50 dpd_delay INTEGER NOT NULL default '120',
51 dpd_action INTEGER NOT NULL default '1',
52 local_vip TEXT default NULL,
53 remote_vip TEXT default NULL,
54 mediation INTEGER NOT NULL default '0',
55 mediated_by INTEGER NOT NULL default '0',
56 peer_id TEXT default NULL
57 );
58
59 DROP TABLE IF EXISTS peer_config_child_config;
60 CREATE TABLE peer_config_child_config (
61 peer_cfg INTEGER NOT NULL,
62 child_cfg INTEGER NOT NULL
63 );
64
65 DROP TABLE IF EXISTS traffic_selectors;
66 CREATE TABLE traffic_selectors (
67 id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
68 type INTEGER NOT NULL default '7',
69 protocol INTEGER NOT NULL default '0',
70 start_addr TEXT default NULL,
71 end_addr TEXT default NULL,
72 start_port INTEGER NOT NULL default '0',
73 end_port INTEGER NOT NULL default '65535'
74 );
75
76 DROP TABLE IF EXISTS shared_secrets;
77 CREATE TABLE shared_secrets (
78 id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
79 type INTEGER NOT NULL,
80 local TEXT default NULL,
81 remote TEXT default NULL,
82 data BLOB NOT NULL
83 );
84
85 DROP TABLE IF EXISTS certificates;
86 CREATE TABLE certificates (
87 id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
88 type INTEGER NOT NULL,
89 keytype INTEGER NOT NULL,
90 keyid BLOB NOT NULL,
91 subject TEXT default NULL,
92 data BLOB NOT NULL
93 );
94
95 DROP TABLE IF EXISTS private_keys;
96 CREATE TABLE private_keys (
97 id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
98 type INTEGER NOT NULL,
99 keyid BLOB NOT NULL,
100 data BLOB NOT NULL
101 );
102
103 DROP TABLE IF EXISTS ike_sas;
104 CREATE TABLE ike_sas (
105 local_spi BLOB NOT NULL PRIMARY KEY,
106 remote_spi BLOB NOT NULL,
107 id INTEGER NOT NULL,
108 initiator INTEGER NOT NULL,
109 local_id TEXT NOT NULL,
110 remote_id TEXT NOT NULL,
111 local TEXT NOT NULL,
112 remote TEXT NOT NULL
113 );
114
115 DROP TABLE IF EXISTS logs;
116 CREATE TABLE logs (
117 id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
118 local_spi BLOB NOT NULL,
119 signal INTEGER NOT NULL,
120 level INTEGER NOT NULL,
121 msg TEXT NOT NULL
122 );
123
124
125