strongswan.org
Wiki/Project Management
Downloads
Gitweb
projects
/
strongswan.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e150442
)
support of reqid field in SQL database
author
Andreas Steffen
<andreas.steffen@strongswan.org>
Sun, 5 Dec 2010 10:21:40 +0000
(11:21 +0100)
committer
Andreas Steffen
<andreas.steffen@strongswan.org>
Sun, 5 Dec 2010 10:21:40 +0000
(11:21 +0100)
src/libcharon/plugins/sql/mysql.sql
patch
|
blob
|
history
src/libcharon/plugins/sql/sql_config.c
patch
|
blob
|
history
src/libcharon/plugins/sql/sqlite.sql
patch
|
blob
|
history
testing/hosts/default/etc/ipsec.d/tables.sql
patch
|
blob
|
history
diff --git
a/src/libcharon/plugins/sql/mysql.sql
b/src/libcharon/plugins/sql/mysql.sql
index
a09cbea
..
721e5a2
100644
(file)
--- a/
src/libcharon/plugins/sql/mysql.sql
+++ b/
src/libcharon/plugins/sql/mysql.sql
@@
-24,6
+24,7
@@
CREATE TABLE `child_configs` (
`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',
`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=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
PRIMARY KEY (`id`),
INDEX (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
diff --git
a/src/libcharon/plugins/sql/sql_config.c
b/src/libcharon/plugins/sql/sql_config.c
index
a4e718f
..
9de3daa
100644
(file)
--- a/
src/libcharon/plugins/sql/sql_config.c
+++ b/
src/libcharon/plugins/sql/sql_config.c
@@
-161,19
+161,20
@@
static void add_esp_proposals(private_sql_config_t *this,
*/
static child_cfg_t *build_child_cfg(private_sql_config_t *this, enumerator_t *e)
{
*/
static child_cfg_t *build_child_cfg(private_sql_config_t *this, enumerator_t *e)
{
- int id, lifetime, rekeytime, jitter, hostaccess, mode, ipcomp;
+ int id, lifetime, rekeytime, jitter, hostaccess, mode, ipcomp
, reqid
;
int start, dpd, close;
char *name, *updown;
child_cfg_t *child_cfg;
if (e->enumerate(e, &id, &name, &lifetime, &rekeytime, &jitter, &updown,
int start, dpd, close;
char *name, *updown;
child_cfg_t *child_cfg;
if (e->enumerate(e, &id, &name, &lifetime, &rekeytime, &jitter, &updown,
- &hostaccess, &mode, &start, &dpd, &close, &ipcomp))
+ &hostaccess, &mode, &start, &dpd, &close, &ipcomp
, %reqid
))
{
lifetime_cfg_t lft = {
.time = { .life = lifetime, .rekey = rekeytime, .jitter = jitter }
};
child_cfg = child_cfg_create(name, &lft, updown, hostaccess, mode,
{
lifetime_cfg_t lft = {
.time = { .life = lifetime, .rekey = rekeytime, .jitter = jitter }
};
child_cfg = child_cfg_create(name, &lft, updown, hostaccess, mode,
- start, dpd, close, ipcomp, 0, 0, NULL, NULL);
+ start, dpd, close, ipcomp, 0, reqid,
+ NULL, NULL);
add_esp_proposals(this, child_cfg, id);
add_traffic_selectors(this, child_cfg, id);
return child_cfg;
add_esp_proposals(this, child_cfg, id);
add_traffic_selectors(this, child_cfg, id);
return child_cfg;
@@
-190,12
+191,12
@@
static void add_child_cfgs(private_sql_config_t *this, peer_cfg_t *peer, int id)
child_cfg_t *child_cfg;
e = this->db->query(this->db,
child_cfg_t *child_cfg;
e = this->db->query(this->db,
- "SELECT id, name, lifetime, rekeytime, jitter, updown, "
- "
hostaccess, mode, start_action, dpd_action, close_action, ipcomp
"
+ "SELECT id, name, lifetime, rekeytime, jitter, updown,
hostaccess,
"
+ "
mode, start_action, dpd_action, close_action, ipcomp, reqid
"
"FROM child_configs JOIN peer_config_child_config ON id = child_cfg "
"WHERE peer_cfg = ?",
DB_INT, id,
"FROM child_configs JOIN peer_config_child_config ON id = child_cfg "
"WHERE peer_cfg = ?",
DB_INT, id,
- DB_INT, DB_TEXT, DB_INT, DB_INT, DB_INT, DB_TEXT,
+ DB_INT, DB_TEXT, DB_INT, DB_INT, DB_INT, DB_TEXT,
DB_INT,
DB_INT, DB_INT, DB_INT, DB_INT, DB_INT, DB_INT);
if (e)
{
DB_INT, DB_INT, DB_INT, DB_INT, DB_INT, DB_INT);
if (e)
{
diff --git
a/src/libcharon/plugins/sql/sqlite.sql
b/src/libcharon/plugins/sql/sqlite.sql
index
2cb0c23
..
3d10635
100644
(file)
--- a/
src/libcharon/plugins/sql/sqlite.sql
+++ b/
src/libcharon/plugins/sql/sqlite.sql
@@
-23,6
+23,7
@@
CREATE TABLE child_configs (
dpd_action INTEGER NOT NULL DEFAULT '0',
close_action INTEGER NOT NULL DEFAULT '0',
ipcomp 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 (
);
DROP INDEX IF EXISTS child_configs_name;
CREATE INDEX child_configs_name ON child_configs (
diff --git
a/testing/hosts/default/etc/ipsec.d/tables.sql
b/testing/hosts/default/etc/ipsec.d/tables.sql
index
3a777da
..
9d045e0
100644
(file)
--- a/
testing/hosts/default/etc/ipsec.d/tables.sql
+++ b/
testing/hosts/default/etc/ipsec.d/tables.sql
@@
-21,7
+21,8
@@
CREATE TABLE child_configs (
start_action INTEGER NOT NULL DEFAULT '0',
dpd_action INTEGER NOT NULL DEFAULT '0',
close_action INTEGER NOT NULL DEFAULT '0',
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'
+ 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 (
);
DROP INDEX IF EXISTS child_configs_name;
CREATE INDEX child_configs_name ON child_configs (