summaryrefslogtreecommitdiff
path: root/libnfnetlink/0005-include-Sync-with-kernel-headers.patch
blob: 383f0e8b3dd69b2dcc2c89060eb2b293b6479f4a (plain)
    1 From b10c90a61a5fc46f2be5aeecb9c96e84178f7717 Mon Sep 17 00:00:00 2001
    2 From: Felix Janda <felix.janda@posteo.de>
    3 Date: Sat, 16 May 2015 14:49:07 +0200
    4 Subject: [PATCH 5/6] include: Sync with kernel headers
    5 
    6 Signed-off-by: Felix Janda <felix.janda@posteo.de>
    7 Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    8 ---
    9  include/libnfnetlink/linux_nfnetlink.h        | 44 ++++-----------------------
   10  include/libnfnetlink/linux_nfnetlink_compat.h | 12 ++++----
   11  2 files changed, 12 insertions(+), 44 deletions(-)
   12 
   13 diff --git a/include/libnfnetlink/linux_nfnetlink.h b/include/libnfnetlink/linux_nfnetlink.h
   14 index 76a8550..44a38d6 100644
   15 --- a/include/libnfnetlink/linux_nfnetlink.h
   16 +++ b/include/libnfnetlink/linux_nfnetlink.h
   17 @@ -25,9 +25,9 @@ enum nfnetlink_groups {
   18  /* General form of address family dependent message.
   19   */
   20  struct nfgenmsg {
   21 -	u_int8_t  nfgen_family;		/* AF_xxx */
   22 -	u_int8_t  version;		/* nfnetlink version */
   23 -	u_int16_t    res_id;		/* resource id */
   24 +	__u8  nfgen_family;		/* AF_xxx */
   25 +	__u8  version;		/* nfnetlink version */
   26 +	__be16    res_id;		/* resource id */
   27  };
   28  
   29  #define NFNETLINK_V0	0
   30 @@ -46,40 +46,8 @@ struct nfgenmsg {
   31  #define NFNL_SUBSYS_CTNETLINK_EXP	2
   32  #define NFNL_SUBSYS_QUEUE		3
   33  #define NFNL_SUBSYS_ULOG		4
   34 -#define NFNL_SUBSYS_COUNT		5
   35 +#define NFNL_SUBSYS_OSF			5
   36 +#define NFNL_SUBSYS_IPSET		6
   37 +#define NFNL_SUBSYS_COUNT		7
   38  
   39 -#ifdef __KERNEL__
   40 -
   41 -#include <linux/netlink.h>
   42 -#include <linux/capability.h>
   43 -#include <net/netlink.h>
   44 -
   45 -struct nfnl_callback
   46 -{
   47 -	int (*call)(struct sock *nl, struct sk_buff *skb, 
   48 -		struct nlmsghdr *nlh, struct nlattr *cda[]);
   49 -	const struct nla_policy *policy;	/* netlink attribute policy */
   50 -	const u_int16_t attr_count;		/* number of nlattr's */
   51 -};
   52 -
   53 -struct nfnetlink_subsystem
   54 -{
   55 -	const char *name;
   56 -	__u8 subsys_id;			/* nfnetlink subsystem ID */
   57 -	__u8 cb_count;			/* number of callbacks */
   58 -	const struct nfnl_callback *cb;	/* callback for individual types */
   59 -};
   60 -
   61 -extern int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n);
   62 -extern int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n);
   63 -
   64 -extern int nfnetlink_has_listeners(unsigned int group);
   65 -extern int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, 
   66 -			  int echo);
   67 -extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags);
   68 -
   69 -#define MODULE_ALIAS_NFNL_SUBSYS(subsys) \
   70 -	MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys))
   71 -
   72 -#endif	/* __KERNEL__ */
   73  #endif	/* _NFNETLINK_H */
   74 diff --git a/include/libnfnetlink/linux_nfnetlink_compat.h b/include/libnfnetlink/linux_nfnetlink_compat.h
   75 index e145176..74b9e55 100644
   76 --- a/include/libnfnetlink/linux_nfnetlink_compat.h
   77 +++ b/include/libnfnetlink/linux_nfnetlink_compat.h
   78 @@ -1,6 +1,8 @@
   79  #ifndef _NFNETLINK_COMPAT_H
   80  #define _NFNETLINK_COMPAT_H
   81 -#ifndef __KERNEL__
   82 +
   83 +#include <linux/types.h>
   84 +
   85  /* Old nfnetlink macros for userspace */
   86  
   87  /* nfnetlink groups: Up to 32 maximum */
   88 @@ -18,10 +20,9 @@
   89   * ! nfnetlink use the same attributes methods. - J. Schulist.
   90   */
   91  
   92 -struct nfattr
   93 -{
   94 -	u_int16_t nfa_len;
   95 -	u_int16_t nfa_type;	/* we use 15 bits for the type, and the highest
   96 +struct nfattr {
   97 +	__u16 nfa_len;
   98 +	__u16 nfa_type;	/* we use 15 bits for the type, and the highest
   99  				 * bit to indicate whether the payload is nested */
  100  };
  101  
  102 @@ -57,5 +58,4 @@ struct nfattr
  103          + NLMSG_ALIGN(sizeof(struct nfgenmsg))))
  104  #define NFM_PAYLOAD(n)  NLMSG_PAYLOAD(n, sizeof(struct nfgenmsg))
  105  
  106 -#endif /* ! __KERNEL__ */
  107  #endif /* _NFNETLINK_COMPAT_H */
  108 -- 
  109 2.12.1

Generated by cgit