arp_tables.h revision 96c1db7b9d601c31d103389cac074a6cce0d7633
1/****************************************************************************
2 ****************************************************************************
3 ***
4 ***   This header was automatically generated from a Linux kernel header
5 ***   of the same name, to make information necessary for userspace to
6 ***   call into the kernel available to libc.  It contains only constants,
7 ***   structures, and macros generated from the original header, and thus,
8 ***   contains no copyrightable information.
9 ***
10 ***   To edit the content of this header, modify the corresponding
11 ***   source file (e.g. under external/kernel-headers/original/) then
12 ***   run bionic/libc/kernel/tools/update_all.py
13 ***
14 ***   Any manual change here will be lost the next time this script will
15 ***   be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI_ARPTABLES_H
20#define _UAPI_ARPTABLES_H
21#include <linux/types.h>
22#include <linux/compiler.h>
23#include <linux/if.h>
24#include <linux/netfilter_arp.h>
25#include <linux/netfilter/x_tables.h>
26#define ARPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
27#define ARPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
28#define arpt_entry_target xt_entry_target
29#define arpt_standard_target xt_standard_target
30#define arpt_error_target xt_error_target
31#define ARPT_CONTINUE XT_CONTINUE
32#define ARPT_RETURN XT_RETURN
33#define arpt_counters_info xt_counters_info
34#define arpt_counters xt_counters
35#define ARPT_STANDARD_TARGET XT_STANDARD_TARGET
36#define ARPT_ERROR_TARGET XT_ERROR_TARGET
37#define ARPT_ENTRY_ITERATE(entries,size,fn,args...) XT_ENTRY_ITERATE(struct arpt_entry, entries, size, fn, ##args)
38#define ARPT_DEV_ADDR_LEN_MAX 16
39struct arpt_devaddr_info {
40  char addr[ARPT_DEV_ADDR_LEN_MAX];
41  char mask[ARPT_DEV_ADDR_LEN_MAX];
42};
43struct arpt_arp {
44  struct in_addr src, tgt;
45  struct in_addr smsk, tmsk;
46  __u8 arhln, arhln_mask;
47  struct arpt_devaddr_info src_devaddr;
48  struct arpt_devaddr_info tgt_devaddr;
49  __be16 arpop, arpop_mask;
50  __be16 arhrd, arhrd_mask;
51  __be16 arpro, arpro_mask;
52  char iniface[IFNAMSIZ], outiface[IFNAMSIZ];
53  unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
54  __u8 flags;
55  __u16 invflags;
56};
57#define ARPT_F_MASK 0x00
58#define ARPT_INV_VIA_IN 0x0001
59#define ARPT_INV_VIA_OUT 0x0002
60#define ARPT_INV_SRCIP 0x0004
61#define ARPT_INV_TGTIP 0x0008
62#define ARPT_INV_SRCDEVADDR 0x0010
63#define ARPT_INV_TGTDEVADDR 0x0020
64#define ARPT_INV_ARPOP 0x0040
65#define ARPT_INV_ARPHRD 0x0080
66#define ARPT_INV_ARPPRO 0x0100
67#define ARPT_INV_ARPHLN 0x0200
68#define ARPT_INV_MASK 0x03FF
69struct arpt_entry {
70  struct arpt_arp arp;
71  __u16 target_offset;
72  __u16 next_offset;
73  unsigned int comefrom;
74  struct xt_counters counters;
75  unsigned char elems[0];
76};
77#define ARPT_BASE_CTL 96
78#define ARPT_SO_SET_REPLACE (ARPT_BASE_CTL)
79#define ARPT_SO_SET_ADD_COUNTERS (ARPT_BASE_CTL + 1)
80#define ARPT_SO_SET_MAX ARPT_SO_SET_ADD_COUNTERS
81#define ARPT_SO_GET_INFO (ARPT_BASE_CTL)
82#define ARPT_SO_GET_ENTRIES (ARPT_BASE_CTL + 1)
83#define ARPT_SO_GET_REVISION_TARGET (ARPT_BASE_CTL + 3)
84#define ARPT_SO_GET_MAX (ARPT_SO_GET_REVISION_TARGET)
85struct arpt_getinfo {
86  char name[XT_TABLE_MAXNAMELEN];
87  unsigned int valid_hooks;
88  unsigned int hook_entry[NF_ARP_NUMHOOKS];
89  unsigned int underflow[NF_ARP_NUMHOOKS];
90  unsigned int num_entries;
91  unsigned int size;
92};
93struct arpt_replace {
94  char name[XT_TABLE_MAXNAMELEN];
95  unsigned int valid_hooks;
96  unsigned int num_entries;
97  unsigned int size;
98  unsigned int hook_entry[NF_ARP_NUMHOOKS];
99  unsigned int underflow[NF_ARP_NUMHOOKS];
100  unsigned int num_counters;
101  struct xt_counters __user * counters;
102  struct arpt_entry entries[0];
103};
104struct arpt_get_entries {
105  char name[XT_TABLE_MAXNAMELEN];
106  unsigned int size;
107  struct arpt_entry entrytable[0];
108};
109#endif
110