From eb0f8a028cf7ddb1b708ee97e6a9c777b45d4d4f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C5=99emysl=20Janouch?=
Date: Sun, 18 Jan 2015 04:07:05 +0100
Subject: 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.
---
plugin-api.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
(limited to 'plugin-api.h')
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);
--
cgit v1.2.3