6 * Copyright (c) 2004, Andreas Tonnesen(andreto@olsr.org)
9 * Redistribution and use in source and binary forms, with or
10 * without modification, are permitted provided that the following
13 * * Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * * Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the
19 * * Neither the name of olsrd, olsr.org nor the names of its
20 * contributors may be used to endorse or promote products derived
21 * from this software without specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE.
38 #include "olsrd_plugin.h"
39 #include "olsrd_secure.h"
43 #define PLUGIN_NAME "OLSRD signature plugin"
44 #define PLUGIN_VERSION "0.5"
45 #define MOD_DESC PLUGIN_NAME " " PLUGIN_VERSION
46 #define PLUGIN_INTERFACE_VERSION 5
48 static void my_init(void) __attribute__ ((constructor));
49 static void my_fini(void) __attribute__ ((destructor));
52 * Defines the version of the plugin interface that is used
53 * THIS IS NOT THE VERSION OF YOUR PLUGIN!
54 * Do not alter unless you know what you are doing!
57 olsrd_plugin_interface_version(void)
59 return PLUGIN_INTERFACE_VERSION;
68 /* Print plugin info to stdout */
69 /* We cannot use olsr_printf yet! */
70 printf("%s\n", MOD_DESC);
71 printf("[ENC]Accepted parameter pairs: (\"Keyfile\" <FILENAME>)\n");
81 /* Calls the destruction function
83 * This function should be present in your
84 * sourcefile and all data destruction
85 * should happen there - NOT HERE!
91 store_string(const char *value, void *data, set_plugin_parameter_addon addon __attribute__ ((unused)))
94 snprintf(str, FILENAME_MAX + 1, "%s", value);
98 static const struct olsrd_plugin_parameters plugin_parameters[] = {
99 {.name = "keyfile",.set_plugin_parameter = &store_string,.data = keyfile},
103 olsrd_get_plugin_parameters(const struct olsrd_plugin_parameters **params, int *size)
105 *params = plugin_parameters;
106 *size = sizeof(plugin_parameters) / sizeof(*plugin_parameters);
110 olsrd_plugin_init(void)
112 /* Calls the initialization function
114 * This function should be present in your
115 * sourcefile and all data initialization
116 * should happen there - NOT HERE!
118 if (!secure_plugin_init()) {
119 fprintf(stderr, "Could not initialize plugin!\n");
123 if (!plugin_ipc_init()) {
124 fprintf(stderr, "Could not initialize plugin IPC!\n");
134 * indent-tabs-mode: nil