mirror of https://github.com/OISF/suricata
rust: plugin bootstrap function
Functions written in Rust will need to suricata::plugin::init() to bootstrap themselves. This bootstrap process sets the log level within the Rust address space, and hooks up function pointers that are expected to be set during normal runs of Suricata.pull/5356/head
parent
3de98b3595
commit
bac8016d17
@ -0,0 +1,26 @@
|
||||
/* Copyright (C) 2020 Open Information Security Foundation
|
||||
*
|
||||
* You can copy, redistribute or modify this Program under the terms of
|
||||
* the GNU General Public License version 2 as published by the Free
|
||||
* Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* version 2 along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301, USA.
|
||||
*/
|
||||
|
||||
pub fn init() {
|
||||
unsafe {
|
||||
let context = super::core::SCGetContext();
|
||||
super::core::init_ffi(context);
|
||||
|
||||
let level = super::core::SCLogGetLogLevel();
|
||||
super::log::log_set_level(level);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue