From 84fc84c32e62e3d2c5fe7ab6c35b5d05f890e8a6 Mon Sep 17 00:00:00 2001 From: Simon THOBY Date: Tue, 8 Nov 2022 22:07:45 +0100 Subject: Improved parsing with even more macros --- examples/add-rules.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'examples/add-rules.rs') 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, 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. -- cgit v1.2.3