nmsg 1.1.1
fltmod_plugin.h
1/*
2 * Copyright (c) 2015 by Farsight Security, Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef NMSG_FLTMOD_PLUGIN_H
18#define NMSG_FLTMOD_PLUGIN_H
19
71#include <nmsg.h>
72
74#define NMSG_FLTMOD_VERSION 1
75
98typedef nmsg_res
99(*nmsg_fltmod_module_init_fp)(const void *param,
100 const size_t len_param,
101 void **mod_data);
102
110typedef void
111(*nmsg_fltmod_module_fini_fp)(void *mod_data);
112
127typedef nmsg_res
128(*nmsg_fltmod_thread_init_fp)(void *mod_data, void **thr_data);
129
146typedef nmsg_res
147(*nmsg_fltmod_thread_fini_fp)(void *mod_data, void *thr_data);
148
177typedef nmsg_res
178(*nmsg_fltmod_filter_message_fp)(nmsg_message_t *msg,
179 void *mod_data,
180 void *thr_data,
181 nmsg_filter_message_verdict *vres);
182
184#define NMSG_FLTMOD_REQUIRED_INIT \
185 .fltmod_version = NMSG_FLTMOD_VERSION
186
190struct nmsg_fltmod_plugin {
196 long fltmod_version;
197
203 nmsg_fltmod_module_init_fp module_init;
204
211 nmsg_fltmod_module_fini_fp module_fini;
212
218 nmsg_fltmod_thread_init_fp thread_init;
219
227 nmsg_fltmod_thread_fini_fp thread_fini;
228
233 nmsg_fltmod_filter_message_fp filter_message;
234
238 void *_reserved15;
239 void *_reserved14;
240 void *_reserved13;
241 void *_reserved12;
242 void *_reserved11;
243 void *_reserved10;
244 void *_reserved9;
245 void *_reserved8;
246 void *_reserved7;
247 void *_reserved6;
248 void *_reserved5;
249 void *_reserved4;
250 void *_reserved3;
251 void *_reserved2;
252 void *_reserved1;
253 void *_reserved0;
254};
255
256#endif /* NMSG_FLTMOD_PLUGIN_H */