aboutsummaryrefslogtreecommitdiff
path: root/rustables/src/batch.rs
diff options
context:
space:
mode:
authorSimon THOBY <git@nightmared.fr>2021-11-05 06:23:45 +0000
committerSimon THOBY <git@nightmared.fr>2021-11-05 06:23:45 +0000
commit46b22d88c36863851e4b27efa767d28c8aeecfe0 (patch)
treeab1a638de7587e7b73fe64093428218e1c545004 /rustables/src/batch.rs
parent3f61ea42bd291c208d07006d8019c25d588f9183 (diff)
parent1bec5a5c30541e47e9c7cff839ac0e7dd3fb6215 (diff)
Merge branch 'manipulate-exprs' into 'master'
Add functions to iterate over the expressions of existing rules See merge request rustwall/rustables!3
Diffstat (limited to 'rustables/src/batch.rs')
-rw-r--r--rustables/src/batch.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/rustables/src/batch.rs b/rustables/src/batch.rs
index 2af1a7c..3cdd52b 100644
--- a/rustables/src/batch.rs
+++ b/rustables/src/batch.rs
@@ -10,6 +10,7 @@ use thiserror::Error;
#[error("Error while communicating with netlink")]
pub struct NetlinkError(());
+#[cfg(feature = "query")]
/// Check if the kernel supports batched netlink messages to netfilter.
pub fn batch_is_supported() -> std::result::Result<bool, NetlinkError> {
match unsafe { sys::nftnl_batch_is_supported() } {
@@ -22,9 +23,9 @@ pub fn batch_is_supported() -> std::result::Result<bool, NetlinkError> {
/// A batch of netfilter messages to be performed in one atomic operation. Corresponds to
/// `nftnl_batch` in libnftnl.
pub struct Batch {
- batch: *mut sys::nftnl_batch,
- seq: u32,
- is_empty: bool,
+ pub(crate) batch: *mut sys::nftnl_batch,
+ pub(crate) seq: u32,
+ pub(crate) is_empty: bool,
}
impl Batch {