sync_with_kernel_headers.patch 3.4 KB

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