public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Mira Limbeck <m.limbeck@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH conntrack-tool v2 4/5] add additional bindings
Date: Wed,  3 Feb 2021 15:25:34 +0100	[thread overview]
Message-ID: <20210203142536.28480-4-m.limbeck@proxmox.com> (raw)
In-Reply-To: <20210203142536.28480-1-m.limbeck@proxmox.com>

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
---
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 a23313e..dc897f9 100644
--- a/src/mnl.rs
+++ b/src/mnl.rs
@@ -56,6 +56,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,
@@ -66,6 +72,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,
@@ -75,16 +92,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





  parent reply	other threads:[~2021-02-03 14:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-03 14:25 [pve-devel] [PATCH conntrack-tool v2 1/5] initial commit Mira Limbeck
2021-02-03 14:25 ` [pve-devel] [PATCH conntrack-tool v2 2/5] add packaging support Mira Limbeck
2021-02-04  7:08   ` Thomas Lamprecht
2021-02-04  9:55     ` Mira Limbeck
2021-02-03 14:25 ` [pve-devel] [PATCH conntrack-tool v2 3/5] add expectation support Mira Limbeck
2021-02-03 14:25 ` Mira Limbeck [this message]
2021-02-03 14:25 ` [pve-devel] [PATCH conntrack-tool v2 5/5] replace C callback with closures Mira Limbeck
2021-02-03 14:25 ` [pve-devel] [PATCH qemu-server v2] copy conntrack information on migration Mira Limbeck
2021-02-05  8:11   ` Fabian Ebner
2021-02-05  9:51     ` Mira Limbeck
2021-02-04  8:07 ` [pve-devel] [PATCH conntrack-tool v2 1/5] initial commit Thomas Lamprecht
2021-02-04 10:15   ` Mira Limbeck
2021-02-04 10:20     ` Thomas Lamprecht
2021-02-04 10:16 ` Mira Limbeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210203142536.28480-4-m.limbeck@proxmox.com \
    --to=m.limbeck@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal