1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
|
/* 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',
dpd_action INTEGER NOT NULL DEFAULT '0',
close_action INTEGER NOT NULL DEFAULT '0',
ipcomp 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 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 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 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
);
|