diff --git a/configure.ac b/configure.ac index 0f558161e..66cbfa987 100644 --- a/configure.ac +++ b/configure.ac @@ -1478,6 +1478,7 @@ AC_CONFIG_FILES([ src/scepclient/Makefile src/pki/Makefile src/pki/man/Makefile + src/pool/Makefile src/dumm/Makefile src/dumm/ext/extconf.rb src/libfast/Makefile diff --git a/src/Makefile.am b/src/Makefile.am index 8ed45acc9..218c9434c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -100,6 +100,10 @@ if USE_INTEGRITY_TEST SUBDIRS += checksum endif +if USE_ATTR_SQL + SUBDIRS += pool +endif + if USE_TKM SUBDIRS += charon-tkm endif diff --git a/src/libhydra/plugins/attr_sql/Makefile.am b/src/libhydra/plugins/attr_sql/Makefile.am index 4c369a2bd..d126bb035 100644 --- a/src/libhydra/plugins/attr_sql/Makefile.am +++ b/src/libhydra/plugins/attr_sql/Makefile.am @@ -1,7 +1,6 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src/libstrongswan \ - -I$(top_srcdir)/src/libhydra \ - -DPLUGINS=\""${pool_plugins}\"" + -I$(top_srcdir)/src/libhydra AM_CFLAGS = \ -rdynamic @@ -17,10 +16,3 @@ libstrongswan_attr_sql_la_SOURCES = \ sql_attribute.h sql_attribute.c libstrongswan_attr_sql_la_LDFLAGS = -module -avoid-version - -ipsec_PROGRAMS = pool -pool_SOURCES = pool.c pool_attributes.c pool_attributes.h \ - pool_usage.h pool_usage.c -pool_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la \ - $(top_builddir)/src/libhydra/libhydra.la -pool.o : $(top_builddir)/config.status diff --git a/src/libhydra/plugins/attr_sql/.gitignore b/src/pool/.gitignore similarity index 100% rename from src/libhydra/plugins/attr_sql/.gitignore rename to src/pool/.gitignore diff --git a/src/pool/Makefile.am b/src/pool/Makefile.am new file mode 100644 index 000000000..8b429a4ba --- /dev/null +++ b/src/pool/Makefile.am @@ -0,0 +1,16 @@ +ipsec_PROGRAMS = pool + +pool_SOURCES = \ + pool.c pool_attributes.c pool_attributes.h \ + pool_usage.h pool_usage.c + +pool.o : $(top_builddir)/config.status + +AM_CPPFLAGS = \ + -I$(top_srcdir)/src/libstrongswan \ + -I$(top_srcdir)/src/libhydra \ + -DPLUGINS=\""${pool_plugins}\"" + +pool_LDADD = \ + $(top_builddir)/src/libstrongswan/libstrongswan.la \ + $(top_builddir)/src/libhydra/libhydra.la diff --git a/src/libhydra/plugins/attr_sql/pool.c b/src/pool/pool.c similarity index 99% rename from src/libhydra/plugins/attr_sql/pool.c rename to src/pool/pool.c index 4e7c48e23..831b3c439 100644 --- a/src/libhydra/plugins/attr_sql/pool.c +++ b/src/pool/pool.c @@ -1284,4 +1284,3 @@ int main(int argc, char *argv[]) exit(EXIT_SUCCESS); } - diff --git a/src/libhydra/plugins/attr_sql/pool_attributes.c b/src/pool/pool_attributes.c similarity index 98% rename from src/libhydra/plugins/attr_sql/pool_attributes.c rename to src/pool/pool_attributes.c index 1d1ba8f58..72af4f494 100644 --- a/src/libhydra/plugins/attr_sql/pool_attributes.c +++ b/src/pool/pool_attributes.c @@ -49,7 +49,7 @@ static const attr_info_t attr_info[] = { { "internal_ip4_netmask", VALUE_ADDR, INTERNAL_IP4_NETMASK, 0 }, { "internal_ip6_netmask", VALUE_ADDR, INTERNAL_IP6_NETMASK, 0 }, { "netmask", VALUE_ADDR, INTERNAL_IP4_NETMASK, - INTERNAL_IP6_NETMASK }, + INTERNAL_IP6_NETMASK }, { "internal_ip4_dns", VALUE_ADDR, INTERNAL_IP4_DNS, 0 }, { "internal_ip6_dns", VALUE_ADDR, INTERNAL_IP6_DNS, 0 }, { "dns", VALUE_ADDR, INTERNAL_IP4_DNS, @@ -57,7 +57,7 @@ static const attr_info_t attr_info[] = { { "internal_ip4_nbns", VALUE_ADDR, INTERNAL_IP4_NBNS, 0 }, { "internal_ip6_nbns", VALUE_ADDR, INTERNAL_IP6_NBNS, 0 }, { "nbns", VALUE_ADDR, INTERNAL_IP4_NBNS, - INTERNAL_IP6_NBNS }, + INTERNAL_IP6_NBNS }, { "wins", VALUE_ADDR, INTERNAL_IP4_NBNS, INTERNAL_IP6_NBNS }, { "internal_ip4_dhcp", VALUE_ADDR, INTERNAL_IP4_DHCP, 0 }, @@ -214,7 +214,7 @@ static bool parse_attributes(char *name, char *value, value_type_t *value_type, if (*value_type == VALUE_ADDR) { *type = (addr->get_family(addr) == AF_INET) ? - attr_info[i].type : attr_info[i].type_ip6; + attr_info[i].type : attr_info[i].type_ip6; addr->destroy(addr); } else if (*value_type == VALUE_HEX) @@ -493,14 +493,14 @@ void del_attr(char *name, char *pool, char *identity, else if (value_type == VALUE_STRING) { fprintf(stderr, "deleting %s attribute (%N) with value '%.*s'%s failed.\n", - name, configuration_attribute_type_names, type, + name, configuration_attribute_type_names, type, (int)blob_db.len, blob_db.ptr, id_pool_str); } else { fprintf(stderr, "deleting %s attribute (%N) with value %#B%s failed.\n", - name, configuration_attribute_type_names, type, + name, configuration_attribute_type_names, type, &blob_db, id_pool_str); } query->destroy(query); @@ -529,7 +529,7 @@ void del_attr(char *name, char *pool, char *identity, if (!found) { - if (blob.len == 0) + if (blob.len == 0) { if (type_ip6 == 0) { @@ -714,4 +714,3 @@ void show_attr(void) } } } - diff --git a/src/libhydra/plugins/attr_sql/pool_attributes.h b/src/pool/pool_attributes.h similarity index 99% rename from src/libhydra/plugins/attr_sql/pool_attributes.h rename to src/pool/pool_attributes.h index a42291f57..6a5af3349 100644 --- a/src/libhydra/plugins/attr_sql/pool_attributes.h +++ b/src/pool/pool_attributes.h @@ -61,5 +61,3 @@ void status_attr(bool hexout); void show_attr(void); #endif /* POOL_ATTRIBUTES_H_ */ - - diff --git a/src/libhydra/plugins/attr_sql/pool_usage.c b/src/pool/pool_usage.c similarity index 99% rename from src/libhydra/plugins/attr_sql/pool_usage.c rename to src/pool/pool_usage.c index 985bc3ae8..7622cfa86 100644 --- a/src/libhydra/plugins/attr_sql/pool_usage.c +++ b/src/pool/pool_usage.c @@ -124,4 +124,3 @@ Usage:\n\ lines are ignored. The file may not contain a --batch command.\n\ \n"); } - diff --git a/src/libhydra/plugins/attr_sql/pool_usage.h b/src/pool/pool_usage.h similarity index 99% rename from src/libhydra/plugins/attr_sql/pool_usage.h rename to src/pool/pool_usage.h index a98b0d680..0082ef6f2 100644 --- a/src/libhydra/plugins/attr_sql/pool_usage.h +++ b/src/pool/pool_usage.h @@ -22,5 +22,4 @@ */ void usage(void); - #endif /* POOL_USAGE_H_ */