1655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng/****************************************************************************
2655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng ****************************************************************************
3655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng ***
4655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng ***   This header was automatically generated from a Linux kernel header
5655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng ***   of the same name, to make information necessary for userspace to
6655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng ***   call into the kernel available to libc.  It contains only constants,
7655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng ***   structures, and macros generated from the original header, and thus,
8655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng ***   contains no copyrightable information.
9655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng ***
10655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng ***   To edit the content of this header, modify the corresponding
11655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng ***   source file (e.g. under external/kernel-headers/original/) then
12655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng ***   run bionic/libc/kernel/tools/update_all.py
13655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng ***
14655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng ***   Any manual change here will be lost the next time this script will
15655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng ***   be run. You've been warned!
16655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng ***
17655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng ****************************************************************************
18655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng ****************************************************************************/
19655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#ifndef _NFNETLINK_COMPAT_H
20655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define _NFNETLINK_COMPAT_H
21655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#include <linux/types.h>
22655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define NF_NETLINK_CONNTRACK_NEW 0x00000001
23655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define NF_NETLINK_CONNTRACK_UPDATE 0x00000002
25655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define NF_NETLINK_CONNTRACK_DESTROY 0x00000004
26655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define NF_NETLINK_CONNTRACK_EXP_NEW 0x00000008
27655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define NF_NETLINK_CONNTRACK_EXP_UPDATE 0x00000010
28655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define NF_NETLINK_CONNTRACK_EXP_DESTROY 0x00000020
30655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct nfattr {
31d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u16 nfa_len;
32d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u16 nfa_type;
33655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng};
35655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define NFNL_NFA_NEST 0x8000
36655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define NFA_TYPE(attr) ((attr)->nfa_type & 0x7fff)
37655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define NFA_ALIGNTO 4
38655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define NFA_ALIGN(len) (((len) + NFA_ALIGNTO - 1) & ~(NFA_ALIGNTO - 1))
40d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define NFA_OK(nfa,len) ((len) > 0 && (nfa)->nfa_len >= sizeof(struct nfattr) && (nfa)->nfa_len <= (len))
41d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define NFA_NEXT(nfa,attrlen) ((attrlen) -= NFA_ALIGN((nfa)->nfa_len), (struct nfattr *) (((char *) (nfa)) + NFA_ALIGN((nfa)->nfa_len)))
42655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define NFA_LENGTH(len) (NFA_ALIGN(sizeof(struct nfattr)) + (len))
43655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define NFA_SPACE(len) NFA_ALIGN(NFA_LENGTH(len))
45d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define NFA_DATA(nfa) ((void *) (((char *) (nfa)) + NFA_LENGTH(0)))
46d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define NFA_PAYLOAD(nfa) ((int) ((nfa)->nfa_len) - NFA_LENGTH(0))
47d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define NFA_NEST(skb,type) \
48d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao({ struct nfattr * __start = (struct nfattr *) skb_tail_pointer(skb); NFA_PUT(skb, (NFNL_NFA_NEST | type), 0, NULL); __start; })
49655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
50d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define NFA_NEST_END(skb,start) \
51d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao({ (start)->nfa_len = skb_tail_pointer(skb) - (unsigned char *) (start); (skb)->len; })
52d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define NFA_NEST_CANCEL(skb,start) \
53d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao({ if(start) skb_trim(skb, (unsigned char *) (start) - (skb)->data); - 1; })
54d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define NFM_NFA(n) ((struct nfattr *) (((char *) (n)) + NLMSG_ALIGN(sizeof(struct nfgenmsg))))
55655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define NFM_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct nfgenmsg))
56655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
57655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#endif
58