provide attributes from SQL database
This commit is contained in:
@@ -187,6 +187,12 @@ CREATE TABLE leases (
|
||||
PRIMARY KEY (`id`)
|
||||
);
|
||||
|
||||
DROP TABLE IF EXISTS attributes;
|
||||
CREATE TABLE attributes (
|
||||
`id` int(10) unsigned NOT NULL auto_increment,
|
||||
`type` int(10) unsigned NOT NULL,
|
||||
`value` varbinary(16) NOT NULL
|
||||
);
|
||||
|
||||
DROP TABLE IF EXISTS ike_sas;
|
||||
CREATE TABLE ike_sas (
|
||||
|
||||
@@ -192,6 +192,12 @@ CREATE TABLE leases (
|
||||
released INTEGER NOT NULL
|
||||
);
|
||||
|
||||
DROP TABLE IF EXISTS attributes;
|
||||
CREATE TABLE attributes (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
type INTEGER NOT NULL,
|
||||
value BLOB NOT NULL
|
||||
);
|
||||
|
||||
DROP TABLE IF EXISTS ike_sas;
|
||||
CREATE TABLE ike_sas (
|
||||
|
||||
@@ -207,7 +207,7 @@ static void process_payloads(private_ike_config_t *this, message_t *message)
|
||||
attributes = cp->create_attribute_enumerator(cp);
|
||||
while (attributes->enumerate(attributes, &ca))
|
||||
{
|
||||
DBG2(DBG_IKE, "processing %N config attribute",
|
||||
DBG2(DBG_IKE, "processing %N attribute",
|
||||
configuration_attribute_type_names, ca->get_type(ca));
|
||||
process_attribute(this, ca);
|
||||
}
|
||||
@@ -260,7 +260,7 @@ static status_t build_i(private_ike_config_t *this, message_t *message)
|
||||
entry_t *entry;
|
||||
|
||||
/* create configuration attribute */
|
||||
DBG2(DBG_IKE, "building %N config attribute",
|
||||
DBG2(DBG_IKE, "building %N attribute",
|
||||
configuration_attribute_type_names, type);
|
||||
ca = configuration_attribute_create_value(type, data);
|
||||
if (!cp)
|
||||
@@ -380,6 +380,8 @@ static status_t build_r(private_ike_config_t *this, message_t *message)
|
||||
{
|
||||
cp = cp_payload_create_type(CFG_REPLY);
|
||||
}
|
||||
DBG2(DBG_IKE, "building %N attribute",
|
||||
configuration_attribute_type_names, type);
|
||||
cp->add_attribute(cp,
|
||||
configuration_attribute_create_value(type, value));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user