summaryrefslogtreecommitdiff
path: root/src/libcharon/plugins/sql
diff options
context:
space:
mode:
authorRené Mayrhofer <rene@mayrhofer.eu.org>2011-05-19 13:41:58 +0200
committerRené Mayrhofer <rene@mayrhofer.eu.org>2011-05-19 13:41:58 +0200
commitb590992f735393c97489fce191e7810eaae4f6d7 (patch)
tree286595c4aa43dbf3d616d816e5fade6ac364771a /src/libcharon/plugins/sql
parent2fce29055b7b5bc2860d503d1ae822931f80b7aa (diff)
parent0a9d51a49042a68daa15b0c74a2b7f152f52606b (diff)
downloadvyos-strongswan-b590992f735393c97489fce191e7810eaae4f6d7.tar.gz
vyos-strongswan-b590992f735393c97489fce191e7810eaae4f6d7.zip
Merge upstream version 4.5.2
Diffstat (limited to 'src/libcharon/plugins/sql')
-rw-r--r--src/libcharon/plugins/sql/Makefile.in12
-rw-r--r--src/libcharon/plugins/sql/sql_config.c119
-rw-r--r--src/libcharon/plugins/sql/sql_cred.c146
-rw-r--r--src/libcharon/plugins/sql/sql_plugin.c23
4 files changed, 11 insertions, 289 deletions
diff --git a/src/libcharon/plugins/sql/Makefile.in b/src/libcharon/plugins/sql/Makefile.in
index 2446e257d..d7b43dcc9 100644
--- a/src/libcharon/plugins/sql/Makefile.in
+++ b/src/libcharon/plugins/sql/Makefile.in
@@ -220,13 +220,7 @@ includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
ipsecdir = @ipsecdir@
-<<<<<<< HEAD
-ipsecgid = @ipsecgid@
ipsecgroup = @ipsecgroup@
-ipsecuid = @ipsecuid@
-=======
-ipsecgroup = @ipsecgroup@
->>>>>>> upstream/4.5.1
ipsecuser = @ipsecuser@
libcharon_plugins = @libcharon_plugins@
libdir = @libdir@
@@ -247,6 +241,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -265,14 +261,12 @@ sbindir = @sbindir@
scepclient_plugins = @scepclient_plugins@
scripts_plugins = @scripts_plugins@
sharedstatedir = @sharedstatedir@
-<<<<<<< HEAD
-=======
soup_CFLAGS = @soup_CFLAGS@
soup_LIBS = @soup_LIBS@
->>>>>>> upstream/4.5.1
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libcharon/plugins/sql/sql_config.c b/src/libcharon/plugins/sql/sql_config.c
index 0ca481bb9..dc016012c 100644
--- a/src/libcharon/plugins/sql/sql_config.c
+++ b/src/libcharon/plugins/sql/sql_config.c
@@ -1,9 +1,6 @@
/*
* Copyright (C) 2006-2008 Martin Willi
-<<<<<<< HEAD
-=======
* Copyright (C) 2010 Andreas Steffen
->>>>>>> upstream/4.5.1
* Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
@@ -42,21 +39,13 @@ struct private_sql_config_t {
};
/**
-<<<<<<< HEAD
- * forward declaration
-=======
* Forward declaration
->>>>>>> upstream/4.5.1
*/
static peer_cfg_t *build_peer_cfg(private_sql_config_t *this, enumerator_t *e,
identification_t *me, identification_t *other);
/**
-<<<<<<< HEAD
- * build a traffic selector from a SQL query
-=======
* Build a traffic selector from an SQL query
->>>>>>> upstream/4.5.1
*/
static traffic_selector_t *build_traffic_selector(private_sql_config_t *this,
enumerator_t *e, bool *local)
@@ -131,18 +120,6 @@ static void add_traffic_selectors(private_sql_config_t *this,
}
/**
-<<<<<<< HEAD
- * build a Child configuration from a SQL query
- */
-static child_cfg_t *build_child_cfg(private_sql_config_t *this, enumerator_t *e)
-{
- int id, lifetime, rekeytime, jitter, hostaccess, mode, dpd, close, ipcomp;
- char *name, *updown;
- child_cfg_t *child_cfg;
-
- if (e->enumerate(e, &id, &name, &lifetime, &rekeytime, &jitter,
- &updown, &hostaccess, &mode, &dpd, &close, &ipcomp))
-=======
* Add ESP proposals to a child config
*/
static void add_esp_proposals(private_sql_config_t *this,
@@ -191,21 +168,14 @@ static child_cfg_t *build_child_cfg(private_sql_config_t *this, enumerator_t *e)
if (e->enumerate(e, &id, &name, &lifetime, &rekeytime, &jitter, &updown,
&hostaccess, &mode, &start, &dpd, &close, &ipcomp, &reqid))
->>>>>>> upstream/4.5.1
{
lifetime_cfg_t lft = {
.time = { .life = lifetime, .rekey = rekeytime, .jitter = jitter }
};
child_cfg = child_cfg_create(name, &lft, updown, hostaccess, mode,
-<<<<<<< HEAD
- dpd, close, ipcomp, 0, 0, NULL, NULL);
- /* TODO: read proposal from db */
- child_cfg->add_proposal(child_cfg, proposal_create_default(PROTO_ESP));
-=======
start, dpd, close, ipcomp, 0, reqid,
NULL, NULL, 0);
add_esp_proposals(this, child_cfg, id);
->>>>>>> upstream/4.5.1
add_traffic_selectors(this, child_cfg, id);
return child_cfg;
}
@@ -221,15 +191,6 @@ 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,
-<<<<<<< HEAD
- "SELECT id, name, lifetime, rekeytime, jitter, "
- "updown, hostaccess, mode, dpd_action, close_action, ipcomp "
- "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_INT, DB_INT, DB_INT, DB_INT);
-=======
"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 "
@@ -237,7 +198,6 @@ static void add_child_cfgs(private_sql_config_t *this, peer_cfg_t *peer, int id)
DB_INT, id,
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);
->>>>>>> upstream/4.5.1
if (e)
{
while ((child_cfg = build_child_cfg(this, e)))
@@ -249,9 +209,6 @@ static void add_child_cfgs(private_sql_config_t *this, peer_cfg_t *peer, int id)
}
/**
-<<<<<<< HEAD
- * build a ike configuration from a SQL query
-=======
* Add IKE proposals to an IKE config
*/
static void add_ike_proposals(private_sql_config_t *this,
@@ -290,44 +247,27 @@ static void add_ike_proposals(private_sql_config_t *this,
/**
* Build an IKE config from an SQL query
->>>>>>> upstream/4.5.1
*/
static ike_cfg_t *build_ike_cfg(private_sql_config_t *this, enumerator_t *e,
host_t *my_host, host_t *other_host)
{
-<<<<<<< HEAD
- int certreq, force_encap;
- char *local, *remote;
-
- while (e->enumerate(e, &certreq, &force_encap, &local, &remote))
-=======
int id, certreq, force_encap;
char *local, *remote;
while (e->enumerate(e, &id, &certreq, &force_encap, &local, &remote))
->>>>>>> upstream/4.5.1
{
ike_cfg_t *ike_cfg;
ike_cfg = ike_cfg_create(certreq, force_encap,
local, IKEV2_UDP_PORT, remote, IKEV2_UDP_PORT);
-<<<<<<< HEAD
- /* TODO: read proposal from db */
- ike_cfg->add_proposal(ike_cfg, proposal_create_default(PROTO_IKE));
-=======
add_ike_proposals(this, ike_cfg, id);
->>>>>>> upstream/4.5.1
return ike_cfg;
}
return NULL;
}
/**
-<<<<<<< HEAD
- * Query a IKE config by its id
-=======
* Query an IKE config by its id
->>>>>>> upstream/4.5.1
*/
static ike_cfg_t* get_ike_cfg_by_id(private_sql_config_t *this, int id)
{
@@ -335,17 +275,10 @@ static ike_cfg_t* get_ike_cfg_by_id(private_sql_config_t *this, int id)
ike_cfg_t *ike_cfg = NULL;
e = this->db->query(this->db,
-<<<<<<< HEAD
- "SELECT certreq, force_encap, local, remote "
- "FROM ike_configs WHERE id = ?",
- DB_INT, id,
- DB_INT, DB_INT, DB_TEXT, DB_TEXT);
-=======
"SELECT id, certreq, force_encap, local, remote "
"FROM ike_configs WHERE id = ?",
DB_INT, id,
DB_INT, DB_INT, DB_INT, DB_TEXT, DB_TEXT);
->>>>>>> upstream/4.5.1
if (e)
{
ike_cfg = build_ike_cfg(this, e, NULL, NULL);
@@ -388,11 +321,7 @@ static peer_cfg_t *get_peer_cfg_by_id(private_sql_config_t *this, int id)
}
/**
-<<<<<<< HEAD
- * build a peer configuration from a SQL query
-=======
* Build a peer config from an SQL query
->>>>>>> upstream/4.5.1
*/
static peer_cfg_t *build_peer_cfg(private_sql_config_t *this, enumerator_t *e,
identification_t *me, identification_t *other)
@@ -471,15 +400,8 @@ static peer_cfg_t *build_peer_cfg(private_sql_config_t *this, enumerator_t *e,
return NULL;
}
-<<<<<<< HEAD
-/**
- * implements backend_t.get_peer_cfg_by_name.
- */
-static peer_cfg_t *get_peer_cfg_by_name(private_sql_config_t *this, char *name)
-=======
METHOD(backend_t, get_peer_cfg_by_name, peer_cfg_t*,
private_sql_config_t *this, char *name)
->>>>>>> upstream/4.5.1
{
enumerator_t *e;
peer_cfg_t *peer_cfg = NULL;
@@ -549,16 +471,8 @@ static void ike_enumerator_destroy(ike_enumerator_t *this)
free(this);
}
-<<<<<<< HEAD
-/**
- * Implementation of backend_t.create_ike_cfg_enumerator.
- */
-static enumerator_t* create_ike_cfg_enumerator(private_sql_config_t *this,
- host_t *me, host_t *other)
-=======
METHOD(backend_t, create_ike_cfg_enumerator, enumerator_t*,
private_sql_config_t *this, host_t *me, host_t *other)
->>>>>>> upstream/4.5.1
{
ike_enumerator_t *e = malloc_thing(ike_enumerator_t);
@@ -570,15 +484,9 @@ METHOD(backend_t, create_ike_cfg_enumerator, enumerator_t*,
e->public.destroy = (void*)ike_enumerator_destroy;
e->inner = this->db->query(this->db,
-<<<<<<< HEAD
- "SELECT certreq, force_encap, local, remote "
- "FROM ike_configs",
- DB_INT, DB_INT, DB_TEXT, DB_TEXT);
-=======
"SELECT id, certreq, force_encap, local, remote "
"FROM ike_configs",
DB_INT, DB_INT, DB_INT, DB_TEXT, DB_TEXT);
->>>>>>> upstream/4.5.1
if (!e->inner)
{
free(e);
@@ -628,17 +536,8 @@ static void peer_enumerator_destroy(peer_enumerator_t *this)
free(this);
}
-<<<<<<< HEAD
-/**
- * Implementation of backend_t.create_peer_cfg_enumerator.
- */
-static enumerator_t* create_peer_cfg_enumerator(private_sql_config_t *this,
- identification_t *me,
- identification_t *other)
-=======
METHOD(backend_t, create_peer_cfg_enumerator, enumerator_t*,
private_sql_config_t *this, identification_t *me, identification_t *other)
->>>>>>> upstream/4.5.1
{
peer_enumerator_t *e = malloc_thing(peer_enumerator_t);
@@ -675,15 +574,8 @@ METHOD(backend_t, create_peer_cfg_enumerator, enumerator_t*,
return &e->public;
}
-<<<<<<< HEAD
-/**
- * Implementation of sql_config_t.destroy.
- */
-static void destroy(private_sql_config_t *this)
-=======
METHOD(sql_config_t, destroy, void,
private_sql_config_t *this)
->>>>>>> upstream/4.5.1
{
free(this);
}
@@ -693,16 +585,6 @@ METHOD(sql_config_t, destroy, void,
*/
sql_config_t *sql_config_create(database_t *db)
{
-<<<<<<< HEAD
- private_sql_config_t *this = malloc_thing(private_sql_config_t);
-
- this->public.backend.create_peer_cfg_enumerator = (enumerator_t*(*)(backend_t*, identification_t *me, identification_t *other))create_peer_cfg_enumerator;
- this->public.backend.create_ike_cfg_enumerator = (enumerator_t*(*)(backend_t*, host_t *me, host_t *other))create_ike_cfg_enumerator;
- this->public.backend.get_peer_cfg_by_name = (peer_cfg_t* (*)(backend_t*,char*))get_peer_cfg_by_name;
- this->public.destroy = (void(*)(sql_config_t*))destroy;
-
- this->db = db;
-=======
private_sql_config_t *this;
INIT(this,
@@ -716,7 +598,6 @@ sql_config_t *sql_config_create(database_t *db)
},
.db = db
);
->>>>>>> upstream/4.5.1
return &this->public;
}
diff --git a/src/libcharon/plugins/sql/sql_cred.c b/src/libcharon/plugins/sql/sql_cred.c
index a72450f27..117eec921 100644
--- a/src/libcharon/plugins/sql/sql_cred.c
+++ b/src/libcharon/plugins/sql/sql_cred.c
@@ -1,8 +1,5 @@
/*
-<<<<<<< HEAD
-=======
* Copyright (C) 2010 Tobias Brunner
->>>>>>> upstream/4.5.1
* Copyright (C) 2008 Martin Willi
* Hochschule fuer Technik Rapperswil
*
@@ -41,10 +38,7 @@ struct private_sql_cred_t {
database_t *db;
};
-<<<<<<< HEAD
-=======
->>>>>>> upstream/4.5.1
/**
* enumerator over private keys
*/
@@ -57,16 +51,8 @@ typedef struct {
private_key_t *current;
} private_enumerator_t;
-<<<<<<< HEAD
-/**
- * Implementation of private_enumerator_t.public.enumerate
- */
-static bool private_enumerator_enumerate(private_enumerator_t *this,
- private_key_t **key)
-=======
METHOD(enumerator_t, private_enumerator_enumerate, bool,
private_enumerator_t *this, private_key_t **key)
->>>>>>> upstream/4.5.1
{
chunk_t blob;
int type;
@@ -75,11 +61,7 @@ METHOD(enumerator_t, private_enumerator_enumerate, bool,
while (this->inner->enumerate(this->inner, &type, &blob))
{
this->current = lib->creds->create(lib->creds, CRED_PRIVATE_KEY, type,
-<<<<<<< HEAD
- BUILD_BLOB_ASN1_DER, blob,
-=======
BUILD_BLOB_PEM, blob,
->>>>>>> upstream/4.5.1
BUILD_END);
if (this->current)
{
@@ -91,36 +73,14 @@ METHOD(enumerator_t, private_enumerator_enumerate, bool,
return FALSE;
}
-<<<<<<< HEAD
-/**
- * Implementation of private_enumerator_t.public.destroy
- */
-static void private_enumerator_destroy(private_enumerator_t *this)
-=======
METHOD(enumerator_t, private_enumerator_destroy, void,
private_enumerator_t *this)
->>>>>>> upstream/4.5.1
{
DESTROY_IF(this->current);
this->inner->destroy(this->inner);
free(this);
}
-<<<<<<< HEAD
-/**
- * Implementation of credential_set_t.create_private_enumerator.
- */
-static enumerator_t* create_private_enumerator(private_sql_cred_t *this,
- key_type_t type,
- identification_t *id)
-{
- private_enumerator_t *e;
-
- e = malloc_thing(private_enumerator_t);
- e->current = NULL;
- e->public.enumerate = (void*)private_enumerator_enumerate;
- e->public.destroy = (void*)private_enumerator_destroy;
-=======
METHOD(credential_set_t, create_private_enumerator, enumerator_t*,
private_sql_cred_t *this, key_type_t type, identification_t *id)
{
@@ -132,7 +92,6 @@ METHOD(credential_set_t, create_private_enumerator, enumerator_t*,
.destroy = _private_enumerator_destroy,
},
);
->>>>>>> upstream/4.5.1
if (id && id->get_type(id) != ID_ANY)
{
e->inner = this->db->query(this->db,
@@ -159,10 +118,7 @@ METHOD(credential_set_t, create_private_enumerator, enumerator_t*,
return &e->public;
}
-<<<<<<< HEAD
-=======
->>>>>>> upstream/4.5.1
/**
* enumerator over certificates
*/
@@ -175,16 +131,8 @@ typedef struct {
certificate_t *current;
} cert_enumerator_t;
-<<<<<<< HEAD
-/**
- * Implementation of cert_enumerator_t.public.enumerate
- */
-static bool cert_enumerator_enumerate(cert_enumerator_t *this,
- certificate_t **cert)
-=======
METHOD(enumerator_t, cert_enumerator_enumerate, bool,
cert_enumerator_t *this, certificate_t **cert)
->>>>>>> upstream/4.5.1
{
chunk_t blob;
int type;
@@ -193,11 +141,7 @@ METHOD(enumerator_t, cert_enumerator_enumerate, bool,
while (this->inner->enumerate(this->inner, &type, &blob))
{
this->current = lib->creds->create(lib->creds, CRED_CERTIFICATE, type,
-<<<<<<< HEAD
- BUILD_BLOB_ASN1_DER, blob,
-=======
BUILD_BLOB_PEM, blob,
->>>>>>> upstream/4.5.1
BUILD_END);
if (this->current)
{
@@ -209,36 +153,14 @@ METHOD(enumerator_t, cert_enumerator_enumerate, bool,
return FALSE;
}
-<<<<<<< HEAD
-/**
- * Implementation of cert_enumerator_t.public.destroy
- */
-static void cert_enumerator_destroy(cert_enumerator_t *this)
-=======
METHOD(enumerator_t, cert_enumerator_destroy, void,
cert_enumerator_t *this)
->>>>>>> upstream/4.5.1
{
DESTROY_IF(this->current);
this->inner->destroy(this->inner);
free(this);
}
-<<<<<<< HEAD
-/**
- * Implementation of credential_set_t.create_cert_enumerator.
- */
-static enumerator_t* create_cert_enumerator(private_sql_cred_t *this,
- certificate_type_t cert, key_type_t key,
- identification_t *id, bool trusted)
-{
- cert_enumerator_t *e;
-
- e = malloc_thing(cert_enumerator_t);
- e->current = NULL;
- e->public.enumerate = (void*)cert_enumerator_enumerate;
- e->public.destroy = (void*)cert_enumerator_destroy;
-=======
METHOD(credential_set_t, create_cert_enumerator, enumerator_t*,
private_sql_cred_t *this, certificate_type_t cert, key_type_t key,
identification_t *id, bool trusted)
@@ -251,7 +173,6 @@ METHOD(credential_set_t, create_cert_enumerator, enumerator_t*,
.destroy = _cert_enumerator_destroy,
},
);
->>>>>>> upstream/4.5.1
if (id && id->get_type(id) != ID_ANY)
{
e->inner = this->db->query(this->db,
@@ -282,10 +203,7 @@ METHOD(credential_set_t, create_cert_enumerator, enumerator_t*,
return &e->public;
}
-<<<<<<< HEAD
-=======
->>>>>>> upstream/4.5.1
/**
* enumerator over shared keys
*/
@@ -302,18 +220,9 @@ typedef struct {
shared_key_t *current;
} shared_enumerator_t;
-<<<<<<< HEAD
-/**
- * Implementation of shared_enumerator_t.public.enumerate
- */
-static bool shared_enumerator_enumerate(shared_enumerator_t *this,
- shared_key_t **shared,
- id_match_t *me, id_match_t *other)
-=======
METHOD(enumerator_t, shared_enumerator_enumerate, bool,
shared_enumerator_t *this, shared_key_t **shared,
id_match_t *me, id_match_t *other)
->>>>>>> upstream/4.5.1
{
chunk_t blob;
int type;
@@ -340,38 +249,14 @@ METHOD(enumerator_t, shared_enumerator_enumerate, bool,
return FALSE;
}
-<<<<<<< HEAD
-/**
- * Implementation of shared_enumerator_t.public.destroy
- */
-static void shared_enumerator_destroy(shared_enumerator_t *this)
-=======
METHOD(enumerator_t, shared_enumerator_destroy, void,
shared_enumerator_t *this)
->>>>>>> upstream/4.5.1
{
DESTROY_IF(this->current);
this->inner->destroy(this->inner);
free(this);
}
-<<<<<<< HEAD
-/**
- * Implementation of credential_set_t.create_shared_enumerator.
- */
-static enumerator_t* create_shared_enumerator(private_sql_cred_t *this,
- shared_key_type_t type,
- identification_t *me, identification_t *other)
-{
- shared_enumerator_t *e;
-
- e = malloc_thing(shared_enumerator_t);
- e->me = me;
- e->other = other;
- e->current = NULL;
- e->public.enumerate = (void*)shared_enumerator_enumerate;
- e->public.destroy = (void*)shared_enumerator_destroy;
-=======
METHOD(credential_set_t, create_shared_enumerator, enumerator_t*,
private_sql_cred_t *this, shared_key_type_t type,
identification_t *me, identification_t *other)
@@ -386,7 +271,6 @@ METHOD(credential_set_t, create_shared_enumerator, enumerator_t*,
.me = me,
.other = other,
);
->>>>>>> upstream/4.5.1
if (!me && !other)
{
e->inner = this->db->query(this->db,
@@ -430,12 +314,6 @@ METHOD(credential_set_t, create_shared_enumerator, enumerator_t*,
return &e->public;
}
-<<<<<<< HEAD
-/**
- * Implementation of credential_set_t.cache_cert.
- */
-static void cache_cert(private_sql_cred_t *this, certificate_t *cert)
-=======
/**
* enumerator over CDPs
@@ -541,44 +419,21 @@ METHOD(credential_set_t, create_cdp_enumerator, enumerator_t*,
METHOD(credential_set_t, cache_cert, void,
private_sql_cred_t *this, certificate_t *cert)
->>>>>>> upstream/4.5.1
{
/* TODO: implement CRL caching to database */
}
-<<<<<<< HEAD
-/**
- * Implementation of sql_cred_t.destroy.
- */
-static void destroy(private_sql_cred_t *this)
-{
- free(this);
-}
-=======
METHOD(sql_cred_t, destroy, void,
private_sql_cred_t *this)
{
free(this);
}
->>>>>>> upstream/4.5.1
/**
* Described in header.
*/
sql_cred_t *sql_cred_create(database_t *db)
{
-<<<<<<< HEAD
- private_sql_cred_t *this = malloc_thing(private_sql_cred_t);
-
- this->public.set.create_private_enumerator = (void*)create_private_enumerator;
- this->public.set.create_cert_enumerator = (void*)create_cert_enumerator;
- this->public.set.create_shared_enumerator = (void*)create_shared_enumerator;
- this->public.set.create_cdp_enumerator = (void*)return_null;
- this->public.set.cache_cert = (void*)cache_cert;
- this->public.destroy = (void(*)(sql_cred_t*))destroy;
-
- this->db = db;
-=======
private_sql_cred_t *this;
INIT(this,
@@ -594,7 +449,6 @@ sql_cred_t *sql_cred_create(database_t *db)
},
.db = db,
);
->>>>>>> upstream/4.5.1
return &this->public;
}
diff --git a/src/libcharon/plugins/sql/sql_plugin.c b/src/libcharon/plugins/sql/sql_plugin.c
index 49b48c7f4..d915d4696 100644
--- a/src/libcharon/plugins/sql/sql_plugin.c
+++ b/src/libcharon/plugins/sql/sql_plugin.c
@@ -53,15 +53,14 @@ struct private_sql_plugin_t {
sql_logger_t *logger;
};
-<<<<<<< HEAD
-/**
- * Implementation of plugin_t.destroy
- */
-static void destroy(private_sql_plugin_t *this)
-=======
+METHOD(plugin_t, get_name, char*,
+ private_sql_plugin_t *this)
+{
+ return "sql";
+}
+
METHOD(plugin_t, destroy, void,
private_sql_plugin_t *this)
->>>>>>> upstream/4.5.1
{
charon->backends->remove_backend(charon->backends, &this->config->backend);
lib->credmgr->remove_set(lib->credmgr, &this->cred->set);
@@ -88,23 +87,17 @@ plugin_t *sql_plugin_create()
return NULL;
}
-<<<<<<< HEAD
- this = malloc_thing(private_sql_plugin_t);
-
- this->public.plugin.destroy = (void(*)(plugin_t*))destroy;
-
- this->db = lib->db->create(lib->db, uri);
-=======
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
.db = lib->db->create(lib->db, uri),
);
->>>>>>> upstream/4.5.1
if (!this->db)
{
DBG1(DBG_CFG, "sql plugin failed to connect to database");