summaryrefslogtreecommitdiff
path: root/src/checksum/checksum_builder.c
diff options
context:
space:
mode:
authorRene Mayrhofer <rene@mayrhofer.eu.org>2010-05-25 19:09:13 +0000
committerRene Mayrhofer <rene@mayrhofer.eu.org>2010-05-25 19:09:13 +0000
commit4e55071879aae604b7b61c93dc815a357571cd88 (patch)
tree4be73b1dfa1bf0df8368023010f530954ed3ff7c /src/checksum/checksum_builder.c
parenta1c93c13ae14bf12110f9a5d5813a22668d69bfe (diff)
downloadvyos-strongswan-4e55071879aae604b7b61c93dc815a357571cd88.tar.gz
vyos-strongswan-4e55071879aae604b7b61c93dc815a357571cd88.zip
New upstream release.
Diffstat (limited to 'src/checksum/checksum_builder.c')
-rw-r--r--src/checksum/checksum_builder.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/src/checksum/checksum_builder.c b/src/checksum/checksum_builder.c
index 54f4539ff..b68a25a19 100644
--- a/src/checksum/checksum_builder.c
+++ b/src/checksum/checksum_builder.c
@@ -13,17 +13,13 @@
* for more details.
*/
+#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <dlfcn.h>
#include <library.h>
-/* we need to fake some charon symbols to dlopen() its plugins */
-void *charon, *eap_type_names, *auth_class_names, *protocol_id_names,
-*action_names, *ipsec_mode_names, *ike_sa_state_names, *child_sa_state_names,
-*policy_dir_names, *ipcomp_transform_names, *debug_names, *controller_cb_empty;
-
int main(int argc, char* argv[])
{
int i;
@@ -62,12 +58,30 @@ int main(int argc, char* argv[])
name[strlen(name) - 3] = '"';
name[strlen(name) - 2] = ',';
name[strlen(name) - 1] = '\0';
- sname = "plugin_create";
+ if (asprintf(&sname, "%.*s_plugin_create", strlen(name) - 2,
+ name) < 0)
+ {
+ fprintf(stderr, "failed to format plugin constructor "
+ "for '%s', ignored", path);
+ free(name);
+ continue;
+ }
+ translate(sname, "-", "_");
}
else if (strstr(path, "libstrongswan.so"))
{
name = strdup("libstrongswan\",");
- sname = "library_init";
+ sname = strdup("library_init");
+ }
+ else if (strstr(path, "libhydra.so"))
+ {
+ name = strdup("libhydra\",");
+ sname = strdup("libhydra_init");
+ }
+ else if (strstr(path, "libcharon.so"))
+ {
+ name = strdup("libcharon\",");
+ sname = strdup("libcharon_init");
}
else if (strstr(path, "pool"))
{
@@ -126,6 +140,7 @@ int main(int argc, char* argv[])
name, fsize, fsum, ssize, ssum);
fprintf(stderr, "\"%-20s%7u / 0x%08x %6u / 0x%08x\n",
name, fsize, fsum, ssize, ssum);
+ free(sname);
free(name);
}
printf("};\n");