From patchwork Sat Dec 7 15:08:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ken-ichirou MATSUZAWA X-Patchwork-Id: 298688 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 936AB2C00CB for ; Sun, 8 Dec 2013 02:09:04 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754859Ab3LGPJD (ORCPT ); Sat, 7 Dec 2013 10:09:03 -0500 Received: from mail-pb0-f50.google.com ([209.85.160.50]:47525 "EHLO mail-pb0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754816Ab3LGPJB (ORCPT ); Sat, 7 Dec 2013 10:09:01 -0500 Received: by mail-pb0-f50.google.com with SMTP id rr13so2753748pbb.9 for ; Sat, 07 Dec 2013 07:09:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:message-id:from:to:subject:user-agent:mime-version :content-type; bh=nq+I3eVKXfYN4STTFG96b2Nc9/7DHFpLbtkqY4TFDvM=; b=BAbUXeJZ2oitbKx3NWtxnZ75k0dlR/ZVg4zg9XVtkutLpHo4MNWGaJXSGBYgnLzkim qFAreckGctFAJpOsHjjpSIPJVIV9enL4NF8H3XOZz9qmC4/ST90t5ThQPTfe9URdk7XB rwugTvsioPhy2QkS0jFfzXGSW5Anm4GR3R+KdFsx3PlnKBC6/9KQHvjz9/ExRGD92H2e /8wgEZw0v9IajYGBVCtUq1QAOewm3TJ2cCoGp1LBvCXeU3+IQjm5HnZD6Ks8gm7sNlJv A76dDzV3YuFwjngQsYfYiFm95Pe1Znp7mxh3Mb3oL50eePmZ1DnBa3HBe1tezIH4/ye2 RIFg== X-Received: by 10.66.168.12 with SMTP id zs12mr10776835pab.122.1386428940545; Sat, 07 Dec 2013 07:09:00 -0800 (PST) Received: from milth.gmail.com (KD106159154146.ppp-bb.dion.ne.jp. [106.159.154.146]) by mx.google.com with ESMTPSA id g6sm6966925pat.2.2013.12.07.07.08.57 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 07 Dec 2013 07:08:59 -0800 (PST) Date: Sun, 08 Dec 2013 00:08:47 +0900 Message-ID: <87siu48zr4.wl%chamaken@gmail.com> From: Ken-ichirou MATSUZAWA To: Pablo Neira Ayuso , netfilter-devel@vger.kernel.org Subject: [libmnl PATCH 1/9] headers: update netlink.h to 3.12 User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.8 Emacs/23.4 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Signed-off-by: Ken-ichirou MATSUZAWA --- include/linux/netlink.h | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/include/linux/netlink.h b/include/linux/netlink.h index ced0e1a..1a85940 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h @@ -1,6 +1,7 @@ -#ifndef __LINUX_NETLINK_H -#define __LINUX_NETLINK_H +#ifndef _UAPI__LINUX_NETLINK_H +#define _UAPI__LINUX_NETLINK_H +#include #include /* for __kernel_sa_family_t */ #include @@ -78,7 +79,7 @@ struct nlmsghdr { #define NLMSG_ALIGNTO 4U #define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) ) #define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr))) -#define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(NLMSG_HDRLEN)) +#define NLMSG_LENGTH(len) ((len) + NLMSG_HDRLEN) #define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len)) #define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0))) #define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \ @@ -105,11 +106,42 @@ struct nlmsgerr { #define NETLINK_PKTINFO 3 #define NETLINK_BROADCAST_ERROR 4 #define NETLINK_NO_ENOBUFS 5 +#define NETLINK_RX_RING 6 +#define NETLINK_TX_RING 7 struct nl_pktinfo { __u32 group; }; +struct nl_mmap_req { + unsigned int nm_block_size; + unsigned int nm_block_nr; + unsigned int nm_frame_size; + unsigned int nm_frame_nr; +}; + +struct nl_mmap_hdr { + unsigned int nm_status; + unsigned int nm_len; + __u32 nm_group; + /* credentials */ + __u32 nm_pid; + __u32 nm_uid; + __u32 nm_gid; +}; + +enum nl_mmap_status { + NL_MMAP_STATUS_UNUSED, + NL_MMAP_STATUS_RESERVED, + NL_MMAP_STATUS_VALID, + NL_MMAP_STATUS_COPY, + NL_MMAP_STATUS_SKIP, +}; + +#define NL_MMAP_MSG_ALIGNMENT NLMSG_ALIGNTO +#define NL_MMAP_MSG_ALIGN(sz) __ALIGN_KERNEL(sz, NL_MMAP_MSG_ALIGNMENT) +#define NL_MMAP_HDRLEN NL_MMAP_MSG_ALIGN(sizeof(struct nl_mmap_hdr)) + #define NET_MAJOR 36 /* Major 36 is reserved for networking */ enum { @@ -150,4 +182,4 @@ struct nlattr { #define NLA_HDRLEN ((int) NLA_ALIGN(sizeof(struct nlattr))) -#endif /* __LINUX_NETLINK_H */ +#endif /* _UAPI__LINUX_NETLINK_H */