aboutsummaryrefslogtreecommitdiff
path: root/rustables/src/expr/bitwise.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rustables/src/expr/bitwise.rs')
-rw-r--r--rustables/src/expr/bitwise.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/rustables/src/expr/bitwise.rs b/rustables/src/expr/bitwise.rs
index 1eb81ab..0c6c33c 100644
--- a/rustables/src/expr/bitwise.rs
+++ b/rustables/src/expr/bitwise.rs
@@ -19,11 +19,13 @@ impl<M: ToSlice, X: ToSlice> Bitwise<M, X> {
}
impl<M: ToSlice, X: ToSlice> Expression for Bitwise<M, X> {
+ fn get_raw_name() -> *const c_char {
+ b"bitwise\0" as *const _ as *const c_char
+ }
+
fn to_expr(&self, _rule: &Rule) -> *mut sys::nftnl_expr {
unsafe {
- let expr = try_alloc!(sys::nftnl_expr_alloc(
- b"bitwise\0" as *const _ as *const c_char
- ));
+ let expr = try_alloc!(sys::nftnl_expr_alloc(Self::get_raw_name()));
let mask = self.mask.to_slice();
let xor = self.xor.to_slice();