netfilter
firewalling, NAT, and packet mangling for linux
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
xtables.h File Reference
#include <sys/socket.h>
#include <sys/types.h>
#include <limits.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <netinet/in.h>
#include <net/if.h>
#include <linux/types.h>
#include <linux/netfilter.h>
#include <linux/netfilter/x_tables.h>
#include <xtables-version.h>
Include dependency graph for xtables.h:

Data Structures

struct  xt_option_entry
 
struct  xt_option_call
 
struct  xt_fcheck_call
 : name of extension currently being processed : per-extension (kernel) data block : per-extension private scratch area (cf. More...
 
struct  xtables_lmap
 A "linear"/linked-list based name<->id map, for files similar to /etc/iproute2/. More...
 
struct  xtables_match
 
struct  xtables_target
 
struct  xtables_rule_match
 
struct  xtables_pprot
 struct xtables_pprot - More...
 
struct  xtables_globals
 

Macros

#define IPPROTO_SCTP   132
 
#define IPPROTO_DCCP   33
 
#define IPPROTO_MH   135
 
#define IPPROTO_UDPLITE   136
 
#define XTOPT_POINTER(stype, member)
 
#define XTOPT_TABLEEND   {.name = NULL}
 

Enumerations

enum  xt_option_type {
  XTTYPE_NONE,
  XTTYPE_UINT8,
  XTTYPE_UINT16,
  XTTYPE_UINT32,
  XTTYPE_UINT64,
  XTTYPE_UINT8RC,
  XTTYPE_UINT16RC,
  XTTYPE_UINT32RC,
  XTTYPE_UINT64RC,
  XTTYPE_DOUBLE,
  XTTYPE_STRING,
  XTTYPE_TOSMASK,
  XTTYPE_MARKMASK32,
  XTTYPE_SYSLOGLEVEL,
  XTTYPE_HOST,
  XTTYPE_HOSTMASK,
  XTTYPE_PROTOCOL,
  XTTYPE_PORT,
  XTTYPE_PORTRC,
  XTTYPE_PLEN,
  XTTYPE_PLENMASK,
  XTTYPE_ETHERMAC
}
 Select the format the input has to conform to, as well as the target type (area pointed to with XTOPT_POINTER). More...
 
enum  xt_option_flags {
  XTOPT_INVERT = 1 << 0,
  XTOPT_MAND = 1 << 1,
  XTOPT_MULTI = 1 << 2,
  XTOPT_PUT = 1 << 3,
  XTOPT_NBO = 1 << 4
}
 XTOPT_INVERT: option is invertible (usable with !) XTOPT_MAND: option is mandatory XTOPT_MULTI: option may be specified multiple times XTOPT_PUT: store value into memory at XTOPT_NBO: store value in network-byte order (only certain XTTYPEs recognize this) More...
 

: name of option

: type of input and validation method, see XTTYPE_* : unique number (within extension) for option, 0-31 : bitmask of flags that cannot be used with this option : bitmask of flags that must be used with this option : bitmask of option flags, see XTOPT_* : offset into private structure for member : size of the item pointed to by ; this is a safeguard : lowest allowed value (for singular integral types) : highest allowed value (for singular integral types)

#define XT_GETOPT_TABLEEND   {.name = NULL, .has_arg = false}
 
#define aligned_u64   u_int64_t __attribute__((aligned(8)))
 
#define xtables_error   (xt_params->exit_err)
 
#define FMT_NUMERIC   0x0001
 
#define FMT_NOCOUNTS   0x0002
 
#define FMT_KILOMEGAGIGA   0x0004
 
#define FMT_OPTIONS   0x0008
 
#define FMT_NOTABLE   0x0010
 
#define FMT_NOTARGET   0x0020
 
#define FMT_VIA   0x0040
 
#define FMT_NONEWLINE   0x0080
 
#define FMT_LINENUMBERS   0x0100
 
#define FMT_PRINT_RULE
 
#define FMT(tab, notab)   ((format) & FMT_NOTABLE ? (notab) : (tab))
 
#define _init   __attribute__((constructor)) _INIT
 
#define LINUX_VERSION(x, y, z)   (0x10000*(x) + 0x100*(y) + z)
 
#define LINUX_VERSION_MAJOR(x)   (((x)>>16) & 0xFF)
 
#define LINUX_VERSION_MINOR(x)   (((x)>> 8) & 0xFF)
 
#define LINUX_VERSION_PATCH(x)   ( (x) & 0xFF)
 
enum  xtables_ext_flags { XTABLES_EXT_ALIAS = 1 << 0 }
 
enum  xtables_tryload {
  XTF_DONT_LOAD,
  XTF_DURING_LOAD,
  XTF_TRY_LOAD,
  XTF_LOAD_MUST_SUCCEED
}
 
enum  xtables_exittype {
  OTHER_PROBLEM = 1,
  PARAMETER_PROBLEM,
  VERSION_PROBLEM,
  RESOURCE_PROBLEM,
  XTF_ONLY_ONCE,
  XTF_NO_INVERT,
  XTF_BAD_VALUE,
  XTF_ONE_ACTION
}
 
const char * xtables_modprobe_program
 
struct xtables_matchxtables_matches
 
struct xtables_targetxtables_targets
 
struct xtables_globalsxt_params
 
const struct xtables_pprot xtables_chain_protos []
 
int kernel_version
 
void xtables_init (void)
 
void xtables_set_nfproto (uint8_t)
 
void * xtables_calloc (size_t, size_t)
 xtables_*alloc - wrappers that exit on failure More...
 
void * xtables_malloc (size_t)
 
void * xtables_realloc (void *, size_t)
 
int xtables_insmod (const char *, const char *, bool)
 
int xtables_load_ko (const char *, bool)
 
int xtables_set_params (struct xtables_globals *xtp)
 xtables_set_params - set the global parameters used by xtables : input xtables_globals structure More...
 
void xtables_free_opts (int reset_offset)
 
struct option * xtables_merge_options (struct option *origopts, struct option *oldopts, const struct option *newopts, unsigned int *option_offset)
 
int xtables_init_all (struct xtables_globals *xtp, uint8_t nfproto)
 
struct xtables_matchxtables_find_match (const char *name, enum xtables_tryload, struct xtables_rule_match **match)
 
struct xtables_targetxtables_find_target (const char *name, enum xtables_tryload)
 
int xtables_compatible_revision (const char *name, uint8_t revision, int opt)
 
void xtables_rule_matches_free (struct xtables_rule_match **matches)
 
void xtables_register_match (struct xtables_match *me)
 
void xtables_register_matches (struct xtables_match *, unsigned int)
 
void xtables_register_target (struct xtables_target *me)
 
void xtables_register_targets (struct xtables_target *, unsigned int)
 
bool xtables_strtoul (const char *, char **, uintmax_t *, uintmax_t, uintmax_t)
 xtables_strtou{i,l} - string to number conversion : input string : like strtoul's "end" pointer : pointer for result : minimum accepted value : maximum accepted value More...
 
bool xtables_strtoui (const char *, char **, unsigned int *, unsigned int, unsigned int)
 
int xtables_service_to_port (const char *name, const char *proto)
 
u_int16_t xtables_parse_port (const char *port, const char *proto)
 
void xtables_parse_interface (const char *arg, char *vianame, unsigned char *mask)
 
void xtables_param_act (unsigned int, const char *,...)
 xtables_param_act - act on condition : a constant from enum xtables_exittype More...
 
const char * xtables_ipaddr_to_numeric (const struct in_addr *)
 
const char * xtables_ipaddr_to_anyname (const struct in_addr *)
 
const char * xtables_ipmask_to_numeric (const struct in_addr *)
 
struct in_addr * xtables_numeric_to_ipaddr (const char *)
 
struct in_addr * xtables_numeric_to_ipmask (const char *)
 
int xtables_ipmask_to_cidr (const struct in_addr *)
 
void xtables_ipparse_any (const char *, struct in_addr **, struct in_addr *, unsigned int *)
 xtables_ipparse_any - transform arbitrary name to in_addr More...
 
void xtables_ipparse_multiple (const char *, struct in_addr **, struct in_addr **, unsigned int *)
 
struct in6_addr * xtables_numeric_to_ip6addr (const char *)
 
const char * xtables_ip6addr_to_numeric (const struct in6_addr *)
 
const char * xtables_ip6addr_to_anyname (const struct in6_addr *)
 
const char * xtables_ip6mask_to_numeric (const struct in6_addr *)
 
int xtables_ip6mask_to_cidr (const struct in6_addr *)
 
void xtables_ip6parse_any (const char *, struct in6_addr **, struct in6_addr *, unsigned int *)
 
void xtables_ip6parse_multiple (const char *, struct in6_addr **, struct in6_addr **, unsigned int *)
 
void xtables_save_string (const char *value)
 Print the specified value to standard output, quoting dangerous characters if required. More...
 
void xtables_print_num (uint64_t number, unsigned int format)
 
u_int16_t xtables_parse_protocol (const char *s)
 
void get_kernel_version (void)
 
void xtables_option_metavalidate (const char *, const struct xt_option_entry *)
 Verifies that an extension's option map descriptor is valid, and ought to be called right after the extension has been loaded, and before option merging/xfrm. More...
 
struct option * xtables_options_xfrm (struct option *, struct option *, const struct xt_option_entry *, unsigned int *)
 Creates getopt options from the x6-style option map, and assigns each a getopt id. More...
 
void xtables_option_parse (struct xt_option_call *)
 The master option parsing routine. More...
 
void xtables_option_tpcall (unsigned int, char **, bool, struct xtables_target *, void *)
 : getopt id (i.e. More...
 
void xtables_option_mpcall (unsigned int, char **, bool, struct xtables_match *, void *)
 : getopt id (i.e. More...
 
void xtables_option_tfcall (struct xtables_target *)
 Dispatch arguments to the appropriate final_check function, based upon the extension's choice of API. More...
 
void xtables_option_mfcall (struct xtables_match *)
 Dispatch arguments to the appropriate final_check function, based upon the extension's choice of API. More...
 
void xtables_options_fcheck (const char *, unsigned int, const struct xt_option_entry *)
 
struct xtables_lmapxtables_lmap_init (const char *)
 
void xtables_lmap_free (struct xtables_lmap *)
 
int xtables_lmap_name2id (const struct xtables_lmap *, const char *)
 
const char * xtables_lmap_id2name (const struct xtables_lmap *, int)
 

Macro Definition Documentation

#define _init   __attribute__((constructor)) _INIT
#define aligned_u64   u_int64_t __attribute__((aligned(8)))
#define FMT (   tab,
  notab 
)    ((format) & FMT_NOTABLE ? (notab) : (tab))
#define FMT_KILOMEGAGIGA   0x0004
#define FMT_LINENUMBERS   0x0100
#define FMT_NOCOUNTS   0x0002
#define FMT_NONEWLINE   0x0080
#define FMT_NOTABLE   0x0010
#define FMT_NOTARGET   0x0020
#define FMT_NUMERIC   0x0001
#define FMT_OPTIONS   0x0008
#define FMT_PRINT_RULE
Value:
#define FMT_NUMERIC
Definition: xtables.h:491
#define FMT_NOTABLE
Definition: xtables.h:495
#define FMT_VIA
Definition: xtables.h:497
#define FMT_NOCOUNTS
Definition: xtables.h:492
#define FMT_OPTIONS
Definition: xtables.h:494
#define FMT_VIA   0x0040
#define IPPROTO_DCCP   33
#define IPPROTO_MH   135
#define IPPROTO_SCTP   132
#define IPPROTO_UDPLITE   136
#define LINUX_VERSION (   x,
  y,
 
)    (0x10000*(x) + 0x100*(y) + z)

Referenced by get_kernel_version().

#define LINUX_VERSION_MAJOR (   x)    (((x)>>16) & 0xFF)
#define LINUX_VERSION_MINOR (   x)    (((x)>> 8) & 0xFF)
#define LINUX_VERSION_PATCH (   x)    ( (x) & 0xFF)
#define XT_GETOPT_TABLEEND   {.name = NULL, .has_arg = false}
#define XTOPT_POINTER (   stype,
  member 
)
Value:
.ptroff = offsetof(stype, member), \
.size = sizeof(((stype *)NULL)->member)
#define NULL
Definition: linux_stddef.h:8
#define offsetof(TYPE, MEMBER)
Definition: linux_list.h:7
#define XTOPT_TABLEEND   {.name = NULL}

Enumeration Type Documentation

XTOPT_INVERT: option is invertible (usable with !) XTOPT_MAND: option is mandatory XTOPT_MULTI: option may be specified multiple times XTOPT_PUT: store value into memory at XTOPT_NBO: store value in network-byte order (only certain XTTYPEs recognize this)

Enumerator
XTOPT_INVERT 
XTOPT_MAND 
XTOPT_MULTI 
XTOPT_PUT 
XTOPT_NBO 

Select the format the input has to conform to, as well as the target type (area pointed to with XTOPT_POINTER).

Note that the storing is not always uniform. ->val will be populated with as much as there is space, i.e. exactly 2 items for ranges, but the target area can receive more values (e.g. in case of ranges), or less values (e.g. XTTYPE_HOSTMASK).

XTTYPE_NONE: option takes no argument XTTYPE_UINT*: standard integer XTTYPE_UINT*RC: colon-separated range of standard integers XTTYPE_DOUBLE: double-precision floating point number XTTYPE_STRING: arbitrary string XTTYPE_TOSMASK: 8-bit TOS value with optional mask XTTYPE_MARKMASK32: 32-bit mark with optional mask XTTYPE_SYSLOGLEVEL: syslog level by name or number XTTYPE_HOST: one host or address (ptr: union nf_inet_addr) XTTYPE_HOSTMASK: one host or address, with an optional prefix length (ptr: union nf_inet_addr; only host portion is stored) XTTYPE_PROTOCOL: protocol number/name from /etc/protocols (ptr: uint8_t) XTTYPE_PORT: 16-bit port name or number (supports XTOPT_NBO) XTTYPE_PORTRC: colon-separated port range (names acceptable), (supports XTOPT_NBO) XTTYPE_PLEN: prefix length XTTYPE_PLENMASK: prefix length (ptr: union nf_inet_addr) XTTYPE_ETHERMAC: Ethernet MAC address in hex form

Enumerator
XTTYPE_NONE 
XTTYPE_UINT8 
XTTYPE_UINT16 
XTTYPE_UINT32 
XTTYPE_UINT64 
XTTYPE_UINT8RC 
XTTYPE_UINT16RC 
XTTYPE_UINT32RC 
XTTYPE_UINT64RC 
XTTYPE_DOUBLE 
XTTYPE_STRING 
XTTYPE_TOSMASK 
XTTYPE_MARKMASK32 
XTTYPE_SYSLOGLEVEL 
XTTYPE_HOST 
XTTYPE_HOSTMASK 
XTTYPE_PROTOCOL 
XTTYPE_PORT 
XTTYPE_PORTRC 
XTTYPE_PLEN 
XTTYPE_PLENMASK 
XTTYPE_ETHERMAC 
Enumerator
OTHER_PROBLEM 
PARAMETER_PROBLEM 
VERSION_PROBLEM 
RESOURCE_PROBLEM 
XTF_ONLY_ONCE 
XTF_NO_INVERT 
XTF_BAD_VALUE 
XTF_ONE_ACTION 
Enumerator
XTABLES_EXT_ALIAS 
Enumerator
XTF_DONT_LOAD 
XTF_DURING_LOAD 
XTF_TRY_LOAD 
XTF_LOAD_MUST_SUCCEED 

Function Documentation

void get_kernel_version ( void  )

References LINUX_VERSION, and xtables_free_opts().

Here is the call graph for this function:

void* xtables_calloc ( size_t  ,
size_t   
)

xtables_*alloc - wrappers that exit on failure

References NULL.

Referenced by command_default(), do_command4(), do_command6(), and do_commandarp().

Here is the caller graph for this function:

int xtables_compatible_revision ( const char *  name,
uint8_t  revision,
int  opt 
)
void xtables_init ( void  )

References NULL.

Referenced by xtables_arp_main(), and xtables_init_all().

Here is the caller graph for this function:

int xtables_init_all ( struct xtables_globals xtp,
uint8_t  nfproto 
)

References xtables_init(), xtables_set_nfproto(), and xtables_set_params().

Referenced by ip6tables_main(), ip6tables_restore_main(), ip6tables_save_main(), iptables_main(), iptables_restore_main(), iptables_save_main(), and xtables_events_main().

Here is the call graph for this function:

Here is the caller graph for this function:

int xtables_insmod ( const char *  ,
const char *  ,
bool   
)

References buf, and NULL.

Referenced by xtables_load_ko().

Here is the caller graph for this function:

const char* xtables_ip6addr_to_anyname ( const struct in6_addr *  )

References name, NULL, and xtables_ip6addr_to_numeric().

Here is the call graph for this function:

const char* xtables_ip6addr_to_numeric ( const struct in6_addr *  )

Referenced by xtables_ip6addr_to_anyname(), and xtables_ip6mask_to_numeric().

Here is the caller graph for this function:

int xtables_ip6mask_to_cidr ( const struct in6_addr *  )

Referenced by xtables_ip6mask_to_numeric().

Here is the caller graph for this function:

const char* xtables_ip6mask_to_numeric ( const struct in6_addr *  )

References buf, xtables_ip6addr_to_numeric(), and xtables_ip6mask_to_cidr().

Here is the call graph for this function:

void xtables_ip6parse_any ( const char *  ,
struct in6_addr **  ,
struct in6_addr *  ,
unsigned int *   
)

References buf, and NULL.

void xtables_ip6parse_multiple ( const char *  ,
struct in6_addr **  ,
struct in6_addr **  ,
unsigned int *   
)

References xtables_globals::exit_err, len, name, NULL, PARAMETER_PROBLEM, xt_params, xtables_malloc(), and xtables_realloc().

Referenced by do_command6().

Here is the call graph for this function:

Here is the caller graph for this function:

const char* xtables_ipaddr_to_anyname ( const struct in_addr *  )

References name, NULL, and xtables_ipaddr_to_numeric().

Here is the call graph for this function:

const char* xtables_ipaddr_to_numeric ( const struct in_addr *  )

References buf.

Referenced by xtables_ipaddr_to_anyname(), and xtables_ipmask_to_numeric().

Here is the caller graph for this function:

int xtables_ipmask_to_cidr ( const struct in_addr *  )

Referenced by xtables_ipmask_to_numeric().

Here is the caller graph for this function:

const char* xtables_ipmask_to_numeric ( const struct in_addr *  )

References buf, xtables_ipaddr_to_numeric(), and xtables_ipmask_to_cidr().

Here is the call graph for this function:

void xtables_ipparse_any ( const char *  name,
struct in_addr **  addrpp,
struct in_addr *  maskp,
unsigned int *  naddrs 
)

xtables_ipparse_any - transform arbitrary name to in_addr

Possible inputs (pseudo regex): m{^($hostname|$networkname|$ipaddr)(/$mask)?} "1.2.3.4/5", "1.2.3.4", "hostname", "networkname"

References buf, and NULL.

void xtables_ipparse_multiple ( const char *  ,
struct in_addr **  ,
struct in_addr **  ,
unsigned int *   
)

References xtables_globals::exit_err, len, name, NULL, PARAMETER_PROBLEM, xt_params, xtables_malloc(), and xtables_realloc().

Referenced by do_command4().

Here is the call graph for this function:

Here is the caller graph for this function:

void xtables_lmap_free ( struct xtables_lmap )

References xtables_lmap::name, xtables_lmap::next, and NULL.

Referenced by xtables_lmap_init().

Here is the caller graph for this function:

const char* xtables_lmap_id2name ( const struct xtables_lmap ,
int   
)
struct xtables_lmap* xtables_lmap_init ( const char *  )

References buf, id, NULL, and xtables_lmap_free().

Here is the call graph for this function:

int xtables_lmap_name2id ( const struct xtables_lmap ,
const char *   
)
int xtables_load_ko ( const char *  ,
bool   
)

References xtables_afinfo::kmod, xtables_afinfo::proc_exists, and xtables_insmod().

Referenced by do_command4(), do_command6(), and xtables_compatible_revision().

Here is the call graph for this function:

Here is the caller graph for this function:

void* xtables_malloc ( size_t  )

References NULL.

Referenced by for_each_chain4(), for_each_chain6(), xtables_find_match(), xtables_ip6parse_multiple(), and xtables_ipparse_multiple().

Here is the caller graph for this function:

struct option* xtables_merge_options ( struct option *  origopts,
struct option *  oldopts,
const struct option *  newopts,
unsigned int *  option_offset 
)

References NULL, xtables_globals::option_offset, XT_OPTION_OFFSET_SCALE, xt_params, and xtables_free_opts().

Referenced by command_default().

Here is the call graph for this function:

Here is the caller graph for this function:

struct in6_addr* xtables_numeric_to_ip6addr ( const char *  )

References NULL.

struct in_addr* xtables_numeric_to_ipaddr ( const char *  )
struct in_addr* xtables_numeric_to_ipmask ( const char *  )
void xtables_option_metavalidate ( const char *  ,
const struct xt_option_entry  
)

Verifies that an extension's option map descriptor is valid, and ought to be called right after the extension has been loaded, and before option merging/xfrm.

References ARRAY_SIZE, xtables_globals::exit_err, xt_option_entry::flags, xt_option_entry::id, xt_option_entry::name, NULL, OTHER_PROBLEM, xt_option_entry::ptroff, xt_option_entry::size, xt_option_entry::type, XT_OPTION_OFFSET_SCALE, xt_params, and XTOPT_PUT.

Referenced by xtables_register_match(), and xtables_register_target().

Here is the caller graph for this function:

void xtables_option_mfcall ( struct xtables_match )

Dispatch arguments to the appropriate final_check function, based upon the extension's choice of API.

References xt_entry_match::data, xt_fcheck_call::data, xt_fcheck_call::ext_name, xtables_match::final_check, xtables_match::m, xtables_match::mflags, xtables_match::name, NULL, xt_fcheck_call::udata, xtables_match::udata, xtables_match::x6_fcheck, xtables_match::x6_options, xt_fcheck_call::xflags, and xtables_options_fcheck().

Referenced by do_command4(), do_command6(), and do_commandx().

Here is the call graph for this function:

Here is the caller graph for this function:

void xtables_option_mpcall ( unsigned int  c,
char **  argv,
bool  invert,
struct xtables_match m,
void *  fw 
)
void xtables_option_parse ( struct xt_option_call cb)

The master option parsing routine.

May be used for the ".x6_parse" function pointer in extensions if fully automatic parsing is desired. It may be also called manually from a custom x6_parse function.

References ARRAY_SIZE, xt_option_call::entry, xt_option_entry::excl, xtables_globals::exit_err, xt_option_call::ext_name, xt_option_entry::flags, xt_option_entry::id, xt_option_call::invert, xt_option_entry::name, NULL, xt_option_call::nvals, PARAMETER_PROBLEM, xt_option_entry::type, xt_option_call::xflags, xt_params, XTOPT_INVERT, XTOPT_MULTI, and XTTYPE_NONE.

void xtables_option_tfcall ( struct xtables_target )

Dispatch arguments to the appropriate final_check function, based upon the extension's choice of API.

References xt_entry_target::data, xt_fcheck_call::data, xt_fcheck_call::ext_name, xtables_target::final_check, xtables_target::name, NULL, xtables_target::t, xtables_target::tflags, xt_fcheck_call::udata, xtables_target::udata, xtables_target::x6_fcheck, xtables_target::x6_options, xt_fcheck_call::xflags, and xtables_options_fcheck().

Referenced by do_command4(), do_command6(), do_commandarp(), and do_commandx().

Here is the call graph for this function:

Here is the caller graph for this function:

void xtables_option_tpcall ( unsigned int  c,
char **  argv,
bool  invert,
struct xtables_target t,
void *  fw 
)
void xtables_options_fcheck ( const char *  ,
unsigned  int,
const struct xt_option_entry  
)
struct option* xtables_options_xfrm ( struct option *  ,
struct option *  ,
const struct xt_option_entry ,
unsigned int *   
)

Creates getopt options from the x6-style option map, and assigns each a getopt id.

References xt_option_entry::id, xt_option_entry::name, NULL, xtables_globals::option_offset, xt_option_entry::type, XT_OPTION_OFFSET_SCALE, xt_params, xtables_free_opts(), and XTTYPE_NONE.

Referenced by command_default().

Here is the call graph for this function:

Here is the caller graph for this function:

void xtables_param_act ( unsigned int  status,
const char *  p1,
  ... 
)

xtables_param_act - act on condition : a constant from enum xtables_exittype

XTF_ONLY_ONCE: print error message that option may only be used once. : module name (e.g. "mark") (...): option in conflict (e.g. "--mark") (...): condition to match on (see extensions/ for examples)

XTF_NO_INVERT: option does not support inversion : module name : option in conflict : condition to match on

XTF_BAD_VALUE: bad value for option : module name : option with which the problem occured (e.g. "--mark") : string the user passed in (e.g. "99999999999999")

XTF_ONE_ACTION: two mutually exclusive actions have been specified : module name

Displays an error message and exits the program.

References xtables_globals::exit_err, PARAMETER_PROBLEM, xt_params, XTF_BAD_VALUE, XTF_NO_INVERT, XTF_ONE_ACTION, and XTF_ONLY_ONCE.

void xtables_parse_interface ( const char *  arg,
char *  vianame,
unsigned char *  mask 
)

References xtables_globals::exit_err, IFNAMSIZ, PARAMETER_PROBLEM, and xt_params.

Referenced by do_command4(), do_command6(), and do_commandx().

Here is the caller graph for this function:

u_int16_t xtables_parse_port ( const char *  port,
const char *  proto 
)

References xtables_globals::exit_err, NULL, PARAMETER_PROBLEM, xt_params, xtables_service_to_port(), and xtables_strtoui().

Here is the call graph for this function:

u_int16_t xtables_parse_protocol ( const char *  s)

References ARRAY_SIZE, xtables_globals::exit_err, NULL, PARAMETER_PROBLEM, xt_params, and xtables_strtoui().

Referenced by do_command4(), do_command6(), and do_commandx().

Here is the call graph for this function:

Here is the caller graph for this function:

void xtables_print_num ( uint64_t  number,
unsigned int  format 
)

References FMT, and FMT_KILOMEGAGIGA.

Referenced by print_firewall_details(), and print_header().

Here is the caller graph for this function:

void* xtables_realloc ( void *  ,
size_t   
)

References NULL.

Referenced by xtables_ip6parse_multiple(), and xtables_ipparse_multiple().

Here is the caller graph for this function:

void xtables_register_matches ( struct xtables_match ,
unsigned  int 
)

References xtables_register_match().

Referenced by _init().

Here is the call graph for this function:

Here is the caller graph for this function:

void xtables_register_targets ( struct xtables_target ,
unsigned  int 
)

References xtables_register_target().

Referenced by _init().

Here is the call graph for this function:

Here is the caller graph for this function:

void xtables_rule_matches_free ( struct xtables_rule_match **  matches)

References xtables_match::m, xtables_rule_match::match, xtables_match::next, xtables_rule_match::next, and NULL.

Referenced by do_command4(), do_command6(), and do_commandx().

Here is the caller graph for this function:

void xtables_save_string ( const char *  value)

Print the specified value to standard output, quoting dangerous characters if required.

References NULL.

int xtables_service_to_port ( const char *  name,
const char *  proto 
)

References NULL.

Referenced by xtables_parse_port().

Here is the caller graph for this function:

void xtables_set_nfproto ( uint8_t  )

References NFPROTO_IPV4, and NFPROTO_IPV6.

Referenced by do_commandx(), and xtables_init_all().

Here is the caller graph for this function:

int xtables_set_params ( struct xtables_globals xtp)

xtables_set_params - set the global parameters used by xtables : input xtables_globals structure

The app is expected to pass a valid xtables_globals data-filled with proper values cannot be NULL

Returns -1 on failure to set and 0 on success

References basic_exit_err(), xtables_globals::exit_err, and xt_params.

Referenced by iptables_xml_main(), xtables_arp_main(), and xtables_init_all().

Here is the call graph for this function:

Here is the caller graph for this function:

bool xtables_strtoui ( const char *  ,
char **  ,
unsigned int *  ,
unsigned  int,
unsigned  int 
)

References NULL, and xtables_strtoul().

Referenced by xtables_parse_port(), and xtables_parse_protocol().

Here is the call graph for this function:

Here is the caller graph for this function:

bool xtables_strtoul ( const char *  s,
char **  end,
uintmax_t *  value,
uintmax_t  min,
uintmax_t  max 
)

xtables_strtou{i,l} - string to number conversion : input string : like strtoul's "end" pointer : pointer for result : minimum accepted value : maximum accepted value

If is NULL, we assume the caller wants a "strict strtoul", and hence "15a" is rejected. In either case, the value obtained is compared for min-max compliance. Base is always 0, i.e. autodetect depending on .

Returns true/false whether number was accepted. On failure, *value has undefined contents.

References NULL.

Referenced by xtables_strtoui().

Here is the caller graph for this function:

Variable Documentation

int kernel_version
const struct xtables_pprot xtables_chain_protos[]

Referenced by proto_to_name().

struct xtables_match* xtables_matches