From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 17E396A3FB for ; Tue, 16 Feb 2021 17:57:16 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0F66F188AC for ; Tue, 16 Feb 2021 17:56:46 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id E1E3C18891 for ; Tue, 16 Feb 2021 17:56:44 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id B0209461CE for ; Tue, 16 Feb 2021 17:56:44 +0100 (CET) From: Mira Limbeck To: pve-devel@lists.proxmox.com Date: Tue, 16 Feb 2021 17:56:42 +0100 Message-Id: <20210216165642.16600-4-m.limbeck@proxmox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210216165642.16600-1-m.limbeck@proxmox.com> References: <20210216165642.16600-1-m.limbeck@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.248 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods NO_DNS_FOR_FROM 0.379 Envelope sender has no MX or A DNS records RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [mnl.rs] Subject: [pve-devel] [PATCH v3 conntrack-tool 4/4] add additional bindings X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2021 16:57:16 -0000 Signed-off-by: Mira Limbeck --- 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, + 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