aboutsummaryrefslogtreecommitdiff
path: root/examples/add-rules.rs
diff options
context:
space:
mode:
authorSimon THOBY <git@nightmared.fr>2022-11-08 22:07:45 +0100
committerSimon THOBY <git@nightmared.fr>2022-11-11 15:56:57 +0100
commit84fc84c32e62e3d2c5fe7ab6c35b5d05f890e8a6 (patch)
treeb3017222a52aec640d225cf2e49d62748e1eaedf /examples/add-rules.rs
parent771b6a1879a96353c737bac0886d80444d27dff8 (diff)
Improved parsing with even more macros
Diffstat (limited to 'examples/add-rules.rs')
-rw-r--r--examples/add-rules.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/add-rules.rs b/examples/add-rules.rs
index 11e7b6f..812721c 100644
--- a/examples/add-rules.rs
+++ b/examples/add-rules.rs
@@ -37,7 +37,7 @@
//! ```
use ipnetwork::{IpNetwork, Ipv4Network};
-use rustables::{Batch, ProtoFamily, Table};
+use rustables::{table::list_tables, Batch, ProtoFamily, Table};
//use rustables::{nft_expr, query::send_batch, sys::libc, Batch, Chain, ProtoFamily, Rule, Table};
use std::{ffi::CString, io, net::Ipv4Addr, rc::Rc};
@@ -46,6 +46,7 @@ const OUT_CHAIN_NAME: &str = "chain-for-outgoing-packets";
const IN_CHAIN_NAME: &str = "chain-for-incoming-packets";
fn main() -> Result<(), Error> {
+ /*
// Create a batch. This is used to store all the netlink messages we will later send.
// Creating a new batch also automatically writes the initial batch begin message needed
// to tell netlink this is a single transaction that might arrive over multiple netlink packets.
@@ -175,6 +176,10 @@ fn main() -> Result<(), Error> {
// netfilter the we reached the end of the transaction message. It's also converted to a
// Vec<u8>, containing the raw netlink data so it can be sent over a netlink socket to netfilter.
Ok(batch.send()?)
+ */
+
+ println!("{:?}", list_tables());
+ Ok(())
}
// Look up the interface index for a given interface name.