nmsg  1.0.0
fltmod_plugin.h
Go to the documentation of this file.
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 
98 typedef nmsg_res
99 (*nmsg_fltmod_module_init_fp)(const void *param,
100  const size_t len_param,
101  void **mod_data);
102 
110 typedef void
111 (*nmsg_fltmod_module_fini_fp)(void *mod_data);
112 
127 typedef nmsg_res
128 (*nmsg_fltmod_thread_init_fp)(void *mod_data, void **thr_data);
129 
146 typedef nmsg_res
147 (*nmsg_fltmod_thread_fini_fp)(void *mod_data, void *thr_data);
148 
177 typedef nmsg_res
178 (*nmsg_fltmod_filter_message_fp)(nmsg_message_t *msg,
179  void *mod_data,
180  void *thr_data,
182 
184 #define NMSG_FLTMOD_REQUIRED_INIT \
185  .fltmod_version = NMSG_FLTMOD_VERSION
186 
197 
204 
212 
219 
228 
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 */
nmsg_filter_message_verdict
Definition: filter.h:24
void(* nmsg_fltmod_module_fini_fp)(void *mod_data)
Destroy the filter module.
nmsg_res(* nmsg_fltmod_thread_init_fp)(void *mod_data, void **thr_data)
Initialize module-defined, thread-wide state.
nmsg_res(* nmsg_fltmod_module_init_fp)(const void *param, const size_t len_param, void **mod_data)
Initialize the filter module.
Definition: fltmod_plugin.h:99
nmsg_res(* nmsg_fltmod_thread_fini_fp)(void *mod_data, void *thr_data)
Destroy thread-wide state.
nmsg_res(* nmsg_fltmod_filter_message_fp)(nmsg_message_t *msg, void *mod_data, void *thr_data, nmsg_filter_message_verdict *vres)
Filter a message object and return the filter verdict.
Base nmsg support header.
nmsg_res
nmsg result code
Definition: res.h:25
Structure exported by filter modules.
nmsg_fltmod_module_fini_fp module_fini
Module-wide finalization function.
nmsg_fltmod_module_init_fp module_init
Module-wide initialization function.
nmsg_fltmod_thread_fini_fp thread_fini
Per-thread finalization function.
nmsg_fltmod_filter_message_fp filter_message
Message filter function.
nmsg_fltmod_thread_init_fp thread_init
Per-thread initialization function.
long fltmod_version
Module interface version.