renamed algorithm to proposal

This commit is contained in:
Andreas Steffen
2010-11-30 17:38:49 +01:00
parent f4e5acef3a
commit cbdcca7fd7
8 changed files with 100 additions and 99 deletions
+9 -9
View File
@@ -38,18 +38,18 @@ CREATE TABLE `child_config_traffic_selector` (
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
DROP TABLE IF EXISTS `algorithms`;
CREATE TABLE `algorithms` (
DROP TABLE IF EXISTS `proposals`;
CREATE TABLE `proposals` (
`id` int(10) unsigned NOT NULL auto_increment,
`algorithm` varchar(128) NOT NULL
`proposal` varchar(128) NOT NULL
);
DROP TABLE IF EXISTS `child_config_algorithm`;
CREATE TABLE `child_config_algorithm` (
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,
`alg` int(10) unsigned NOT NULL
`prop` int(10) unsigned NOT NULL
);
@@ -64,11 +64,11 @@ CREATE TABLE `ike_configs` (
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
DROP TABLE IF EXISTS `ike_config_algorithm`;
CREATE TABLE `ike_config_algorithm` (
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,
`alg` int(10) unsigned NOT NULL
`prop` int(10) unsigned NOT NULL
);
+11 -10
View File
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2006-2008 Martin Willi
* Copyright (C) 2010 Andreas Steffen
* Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
@@ -126,19 +127,19 @@ static void add_esp_proposals(private_sql_config_t *this,
{
enumerator_t *e;
proposal_t *proposal;
char *alg;
char *prop;
bool use_default = TRUE;
e = this->db->query(this->db,
"SELECT algorithm "
"FROM algorithms JOIN child_config_algorithm ON id = alg "
"SELECT proposal "
"FROM proposals JOIN child_config_proposal ON id = prop "
"WHERE child_cfg = ? ORDER BY prio",
DB_INT, id, DB_TEXT);
if (e)
{
while (e->enumerate(e, &alg))
while (e->enumerate(e, &prop))
{
proposal = proposal_create_from_string(PROTO_ESP, alg);
proposal = proposal_create_from_string(PROTO_ESP, prop);
child->add_proposal(child, proposal);
use_default = FALSE;
}
@@ -209,19 +210,19 @@ static void add_ike_proposals(private_sql_config_t *this,
{
enumerator_t *e;
proposal_t *proposal;
char *alg;
char *prop;
bool use_default = TRUE;
e = this->db->query(this->db,
"SELECT algorithm "
"FROM algorithms JOIN ike_config_algorithm ON id = alg "
"SELECT proposal "
"FROM proposals JOIN ike_config_proposal ON id = prop "
"WHERE ike_cfg = ? ORDER BY prio",
DB_INT, id, DB_TEXT);
if (e)
{
while (e->enumerate(e, &alg))
while (e->enumerate(e, &prop))
{
proposal = proposal_create_from_string(PROTO_IKE, alg);
proposal = proposal_create_from_string(PROTO_IKE, prop);
ike_cfg->add_proposal(ike_cfg, proposal);
use_default = FALSE;
}
+9 -9
View File
@@ -41,18 +41,18 @@ CREATE INDEX child_config_traffic_selector_all ON child_config_traffic_selector
child_cfg, traffic_selector
);
DROP TABLE IF EXISTS algorithms;
CREATE TABLE algorithms (
DROP TABLE IF EXISTS proposals;
CREATE TABLE proposals (
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
algorithm TEXT NOT NULL
proposal TEXT NOT NULL
);
DROP TABLE IF EXISTS child_config_algorithm;
CREATE TABLE child_config_algorithm (
DROP TABLE IF EXISTS child_config_proposal;
CREATE TABLE child_config_proposal (
child_cfg INTEGER NOT NULL,
prio INTEGER NOT NULL,
alg INTEGER NOT NULL
prop INTEGER NOT NULL
);
@@ -66,11 +66,11 @@ CREATE TABLE ike_configs (
);
DROP TABLE IF EXISTS ike_config_algorithm;
CREATE TABLE ike_config_algorithm (
DROP TABLE IF EXISTS ike_config_proposal;
CREATE TABLE ike_config_proposal (
ike_cfg INTEGER NOT NULL,
prio INTEGER NOT NULL,
alg INTEGER NOT NULL
prop INTEGER NOT NULL
);