linux/include/uapi/linux/netfilter_ipv4/ip_tables.h

/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
 * 25-Jul-1998 Major changes to allow for ip chain table
 *
 * 3-Jan-2000 Named tables to allow packet selection for different uses.
 */

/*
 * 	Format of an IP firewall descriptor
 *
 * 	src, dst, src_mask, dst_mask are always stored in network byte order.
 * 	flags are stored in host byte order (of course).
 * 	Port numbers are stored in HOST byte order.
 */

#ifndef _UAPI_IPTABLES_H
#define _UAPI_IPTABLES_H

#include <linux/types.h>
#include <linux/compiler.h>
#include <linux/if.h>
#include <linux/netfilter_ipv4.h>

#include <linux/netfilter/x_tables.h>

#ifndef __KERNEL__
#define IPT_FUNCTION_MAXNAMELEN
#define IPT_TABLE_MAXNAMELEN
#define ipt_match
#define ipt_target
#define ipt_table
#define ipt_get_revision
#define ipt_entry_match
#define ipt_entry_target
#define ipt_standard_target
#define ipt_error_target
#define ipt_counters
#define IPT_CONTINUE
#define IPT_RETURN

/* This group is older than old (iptables < v1.4.0-rc1~89) */
#include <linux/netfilter/xt_tcpudp.h>
#define ipt_udp
#define ipt_tcp
#define IPT_TCP_INV_SRCPT
#define IPT_TCP_INV_DSTPT
#define IPT_TCP_INV_FLAGS
#define IPT_TCP_INV_OPTION
#define IPT_TCP_INV_MASK
#define IPT_UDP_INV_SRCPT
#define IPT_UDP_INV_DSTPT
#define IPT_UDP_INV_MASK

/* The argument to IPT_SO_ADD_COUNTERS. */
#define ipt_counters_info
/* Standard return verdict, or do jump. */
#define IPT_STANDARD_TARGET
/* Error verdict. */
#define IPT_ERROR_TARGET

/* fn returns 0 to continue iteration */
#define IPT_MATCH_ITERATE

/* fn returns 0 to continue iteration */
#define IPT_ENTRY_ITERATE
#endif

/* Yes, Virginia, you have to zero the padding. */
struct ipt_ip {};

/* Values for "flag" field in struct ipt_ip (general ip structure). */
#define IPT_F_FRAG
#define IPT_F_GOTO
#define IPT_F_MASK

/* Values for "inv" field in struct ipt_ip. */
#define IPT_INV_VIA_IN
#define IPT_INV_VIA_OUT
#define IPT_INV_TOS
#define IPT_INV_SRCIP
#define IPT_INV_DSTIP
#define IPT_INV_FRAG
#define IPT_INV_PROTO
#define IPT_INV_MASK

/* This structure defines each of the firewall rules.  Consists of 3
   parts which are 1) general IP header stuff 2) match specific
   stuff 3) the target to perform if the rule matches */
struct ipt_entry {};

/*
 * New IP firewall options for [gs]etsockopt at the RAW IP level.
 * Unlike BSD Linux inherits IP options so you don't have to use a raw
 * socket for this. Instead we check rights in the calls.
 *
 * ATTENTION: check linux/in.h before adding new number here.
 */
#define IPT_BASE_CTL

#define IPT_SO_SET_REPLACE
#define IPT_SO_SET_ADD_COUNTERS
#define IPT_SO_SET_MAX

#define IPT_SO_GET_INFO
#define IPT_SO_GET_ENTRIES
#define IPT_SO_GET_REVISION_MATCH
#define IPT_SO_GET_REVISION_TARGET
#define IPT_SO_GET_MAX

/* ICMP matching stuff */
struct ipt_icmp {};

/* Values for "inv" field for struct ipt_icmp. */
#define IPT_ICMP_INV

/* The argument to IPT_SO_GET_INFO */
struct ipt_getinfo {};

/* The argument to IPT_SO_SET_REPLACE. */
struct ipt_replace {};

/* The argument to IPT_SO_GET_ENTRIES. */
struct ipt_get_entries {};

/* Helper functions */
static __inline__ struct xt_entry_target *
ipt_get_target(struct ipt_entry *e)
{}

/*
 *	Main firewall chains definitions and global var's definitions.
 */
#endif /* _UAPI_IPTABLES_H */