diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2015-01-18 04:07:05 +0100 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2015-01-18 04:14:45 +0100 |
commit | eb0f8a028cf7ddb1b708ee97e6a9c777b45d4d4f (patch) | |
tree | d923be9e25130cec96209be2fb6db4668c7b16a6 /ponymap.c | |
parent | 7cb6fcdaff2237cd24cf22fbc739192704838b6d (diff) | |
download | ponymap-eb0f8a028cf7ddb1b708ee97e6a9c777b45d4d4f.tar.gz ponymap-eb0f8a028cf7ddb1b708ee97e6a9c777b45d4d4f.tar.xz ponymap-eb0f8a028cf7ddb1b708ee97e6a9c777b45d4d4f.zip |
Implement a Lua 5.3 plugin loader plugin
Also implemented SOCKS detection in said language.
There are probably going to be some bugs.
The program is no longer Valgrind-clean, as that would require plugin
deinitialization, in which there is very little point.
Diffstat (limited to 'ponymap.c')
-rw-r--r-- | ponymap.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -623,7 +623,7 @@ unit_start_scan (struct unit *u) u->scan_started = true; poller_timer_set (&u->timeout_event, u->target->ctx->scan_timeout * 1000); - u->service_data = u->service->scan_init (u); + u->service_data = u->service->scan_init (u->service, u); u->fd_event.dispatcher = (poller_fd_fn) on_unit_ready; unit_update_poller (u, NULL); } @@ -792,6 +792,13 @@ plugin_api_register_service (void *app_context, struct service *info) } static const char * +plugin_api_get_config (void *app_context, const char *key) +{ + struct app_context *ctx = app_context; + return str_map_find (&ctx->config, key); +} + +static const char * plugin_api_unit_get_address (struct unit *u) { return u->target->ip_string; @@ -828,6 +835,7 @@ plugin_api_unit_abort (struct unit *u) static struct plugin_api g_plugin_vtable = { .register_service = plugin_api_register_service, + .get_config = plugin_api_get_config, .unit_get_address = plugin_api_unit_get_address, .unit_write = plugin_api_unit_write, .unit_set_success = plugin_api_unit_set_success, |