[pve-devel] [PATCH v3 conntrack-tool 4/4] add additional bindings

Mira Limbeck m.limbeck at proxmox.com
Tue Feb 16 17:56:42 CET 2021


Signed-off-by: Mira Limbeck <m.limbeck at proxmox.com>
---
v3:
 - unchanged
v2:
 - new addition, can be ignored as it only adds batch and print function
   bindings which are not used in the code currently

 src/mnl.rs | 31 +++++++++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

diff --git a/src/mnl.rs b/src/mnl.rs
index 737f59a..fa2b5fb 100644
--- a/src/mnl.rs
+++ b/src/mnl.rs
@@ -66,6 +66,12 @@ extern "C" {
         size: libc::size_t,
     ) -> *mut libc::c_void;
     pub fn mnl_nlmsg_get_payload(nlh: *const libc::nlmsghdr) -> *mut libc::c_void;
+    pub fn mnl_nlmsg_fprintf(
+        fd: *mut libc::FILE,
+        data: *const libc::c_void,
+        datalen: libc::size_t,
+        extra_header_size: libc::size_t,
+    );
 
     pub fn mnl_cb_run(
         buf: *const libc::c_void,
@@ -76,6 +82,17 @@ extern "C" {
         data: *mut libc::c_void,
     ) -> libc::c_int;
 
+    pub fn mnl_cb_run2(
+        buf: *const libc::c_void,
+        numbytes: libc::size_t,
+        seq: libc::c_uint,
+        portid: libc::c_uint,
+        cb_data: Option<mnl_cb_t>,
+        data: *const libc::c_void,
+        cb_ctl_array: *const *const mnl_cb_t,
+        cb_ctl_array_len: libc::c_uint,
+    ) -> libc::c_int;
+
     pub fn mnl_attr_parse(
         nlh: *const libc::nlmsghdr,
         offset: libc::c_uint,
@@ -85,16 +102,26 @@ extern "C" {
     pub fn mnl_attr_get_type(attr: *const libc::nlattr) -> u16;
     pub fn mnl_attr_type_valid(attr: *const libc::nlattr, maxtype: u16) -> libc::c_int;
 
-    pub fn mnl_nlmsg_batch_start(buf: *mut libc::c_void, limit: libc::size_t) -> *mut mnl_nlmsg_batch;
+    pub fn mnl_nlmsg_batch_start(
+        buf: *mut libc::c_void,
+        limit: libc::size_t,
+    ) -> *mut mnl_nlmsg_batch;
     pub fn mnl_nlmsg_batch_stop(b: *mut mnl_nlmsg_batch);
     pub fn mnl_nlmsg_batch_next(b: *mut mnl_nlmsg_batch) -> bool;
     pub fn mnl_nlmsg_batch_current(b: *mut mnl_nlmsg_batch) -> *mut libc::c_void;
     pub fn mnl_nlmsg_batch_head(b: *mut mnl_nlmsg_batch) -> *mut libc::c_void;
     pub fn mnl_nlmsg_batch_size(b: *mut mnl_nlmsg_batch) -> libc::size_t;
+    pub fn mnl_nlmsg_batch_reset(b: *mut mnl_nlmsg_batch);
+    pub fn mnl_nlmsg_batch_is_empty(b: *mut mnl_nlmsg_batch) -> bool;
+
+    pub fn mnl_nlmsg_ok(nlh: *const libc::nlmsghdr, len: libc::c_int) -> bool;
+    pub fn mnl_nlmsg_next(nlh: *const libc::nlmsghdr, len: *mut libc::c_int)
+        -> *mut libc::nlmsghdr;
 }
 
 #[allow(non_camel_case_types)]
-pub type mnl_cb_t = extern "C" fn(nlh: *const libc::nlmsghdr, data: *mut libc::c_void) -> libc::c_int;
+pub type mnl_cb_t =
+    extern "C" fn(nlh: *const libc::nlmsghdr, data: *mut libc::c_void) -> libc::c_int;
 #[allow(non_camel_case_types)]
 pub type mnl_attr_cb_t =
     extern "C" fn(attr: *const libc::nlattr, data: *mut libc::c_void) -> libc::c_int;
-- 
2.20.1






More information about the pve-devel mailing list