rust/ffi: move conf_get_bool helper to ffi crate

Ticket: 7666
pull/15265/head
Philippe Antoine 3 months ago committed by Victor Julien
parent be2d80a8e7
commit 54b6885166

@ -42,3 +42,9 @@ pub fn conf_get(key: &str) -> Option<&str> {
Some(value)
}
// Return the value of key as a boolean. A value that is not set is
// the same as having it set to false.
pub fn conf_get_bool(key: &str) -> bool {
matches!(conf_get(key), Some("1" | "yes" | "true" | "on"))
}

@ -53,13 +53,7 @@ pub fn conf_get_node(key: &str) -> Option<ConfNode> {
}
}
pub use suricata_ffi::conf::conf_get;
// Return the value of key as a boolean. A value that is not set is
// the same as having it set to false.
pub fn conf_get_bool(key: &str) -> bool {
matches!(conf_get(key), Some("1" | "yes" | "true" | "on"))
}
pub use suricata_ffi::conf::{conf_get, conf_get_bool};
/// Wrap a Suricata ConfNode and expose some of its methods with a
/// Rust friendly interface.

Loading…
Cancel
Save