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 /plugin-api.h | |
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 'plugin-api.h')
-rw-r--r-- | plugin-api.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/plugin-api.h b/plugin-api.h index f74b069..109f729 100644 --- a/plugin-api.h +++ b/plugin-api.h @@ -38,11 +38,12 @@ struct service { const char *name; ///< Name of the service int flags; ///< Service flags + void *user_data; ///< User data // scan_init -> on_data* -> [on_eof/on_error] -> on_aborted -> scan_free /// Initialize a scan, returning a handle to it - void *(*scan_init) (struct unit *u); + void *(*scan_init) (struct service *self, struct unit *u); /// Destroy the handle created for the scan void (*scan_free) (void *handle); @@ -67,6 +68,9 @@ struct plugin_api /// Register the plugin for a service void (*register_service) (void *ctx, struct service *info); + /// Retrieve an item from the configuration + const char *(*get_config) (void *ctx, const char *key); + /// Get the IP address of the target as a string const char *(*unit_get_address) (struct unit *u); |