netfilter
firewalling, NAT, and packet mangling for linux
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ebtables.c File Reference
#include <getopt.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <signal.h>
#include "include/ebtables_u.h"
#include "include/ethernetdb.h"
Include dependency graph for ebtables.c:

Macros

#define OPT_COMMANDS   (replace->flags & OPT_COMMAND || replace->flags & OPT_ZERO)
 
#define OPT_COMMAND   0x01
 
#define OPT_TABLE   0x02
 
#define OPT_IN   0x04
 
#define OPT_OUT   0x08
 
#define OPT_JUMP   0x10
 
#define OPT_PROTOCOL   0x20
 
#define OPT_SOURCE   0x40
 
#define OPT_DEST   0x80
 
#define OPT_ZERO   0x100
 
#define OPT_LOGICALIN   0x200
 
#define OPT_LOGICALOUT   0x400
 
#define OPT_KERNELDATA   0x800 /* This value is also defined in ebtablesd.c */
 
#define OPT_COUNT   0x1000 /* This value is also defined in libebtc.c */
 
#define OPT_CNT_INCR   0x2000 /* This value is also defined in libebtc.c */
 
#define OPT_CNT_DECR   0x4000 /* This value is also defined in libebtc.c */
 
#define OPTION_OFFSET   256
 
#define IF_WILDCARD   1
 
#define LIST_N   0x04
 
#define LIST_C   0x08
 
#define LIST_X   0x10
 
#define LIST_MAC2   0x20
 

Functions

void ebt_early_init_once ()
 
int do_command (int argc, char *argv[], int exec_style, struct ebt_u_replace *replace_)
 

Macro Definition Documentation

#define IF_WILDCARD   1
#define LIST_C   0x08

Referenced by do_command().

#define LIST_MAC2   0x20

Referenced by do_command().

#define LIST_N   0x04

Referenced by do_command().

#define LIST_X   0x10

Referenced by do_command().

#define OPT_CNT_DECR   0x4000 /* This value is also defined in libebtc.c */
#define OPT_CNT_INCR   0x2000 /* This value is also defined in libebtc.c */
#define OPT_COMMAND   0x01

Referenced by do_command().

#define OPT_COMMANDS   (replace->flags & OPT_COMMAND || replace->flags & OPT_ZERO)

Referenced by do_command().

#define OPT_COUNT   0x1000 /* This value is also defined in libebtc.c */

Referenced by do_command().

#define OPT_DEST   0x80

Referenced by do_command().

#define OPT_IN   0x04

Referenced by do_command().

#define OPT_JUMP   0x10

Referenced by do_command().

#define OPT_KERNELDATA   0x800 /* This value is also defined in ebtablesd.c */

Referenced by do_command().

#define OPT_LOGICALIN   0x200

Referenced by do_command().

#define OPT_LOGICALOUT   0x400

Referenced by do_command().

#define OPT_OUT   0x08

Referenced by do_command().

#define OPT_PROTOCOL   0x20

Referenced by do_command().

#define OPT_SOURCE   0x40

Referenced by do_command().

#define OPT_TABLE   0x02

Referenced by do_command().

#define OPT_ZERO   0x100

Referenced by do_command().

#define OPTION_OFFSET   256

Function Documentation

int do_command ( int  argc,
char *  argv[],
int  exec_style,
struct ebt_u_replace replace_ 
)

References _PATH_ETHERTYPES, ATOMIC_ENV_VARIABLE, ebt_counter::bcnt, ebt_u_entry::bitmask, buffer, ebt_u_replace::chains, ebt_u_table::check, ebt_u_entry::cnt, ebt_u_entry::cnt_surplus, ebt_u_replace::command, ebt_u_entry::destmac, ebt_u_entry::destmsk, ethertypeent::e_ethertype, EBT_802_3, EBT_ACCEPT, ebt_add_match(), ebt_add_rule(), ebt_add_watcher(), EBT_CHAIN_MAXNAMELEN, ebt_change_counters(), ebt_change_policy(), ebt_check_for_loops(), ebt_check_inverse2, ebt_check_option2, EBT_CONTINUE, ebt_delete_chain(), ebt_delete_rule(), ebt_deliver_counters(), ebt_deliver_table(), EBT_DESTMAC, ebt_do_final_checks(), ebt_errormsg, ebt_find_match(), ebt_find_table(), ebt_find_target(), ebt_find_watcher(), ebt_flush_chains(), ebt_get_chainnr(), ebt_get_kernel_table(), ebt_get_mac_and_mask(), ebt_get_table(), EBT_IDEST, EBT_IIN, EBT_ILOGICALIN, EBT_ILOGICALOUT, ebt_initialize_entry(), ebt_invert, EBT_IOUT, EBT_IPROTO, EBT_ISOURCE, ebt_list_extensions(), ebt_matches, ebt_modprobe, ebt_new_chain(), EBT_NOPROTO, ebt_print_bug, ebt_print_error, ebt_print_error2, ebt_print_memory, ebt_rename_chain(), EBT_RETURN, EBT_SOURCEMAC, EBT_STANDARD_TARGET, ebt_standard_targets, EBT_TABLE_MAXNAMELEN, ebt_to_chain, ebt_watchers, ebt_zero_counters(), ebt_u_entries::entries, entries, ebt_u_entry::ethproto, EXEC_STYLE_DAEMON, EXEC_STYLE_PRG, ebt_u_replace::filename, ebt_u_match::final_check, ebt_u_watcher::final_check, ebt_u_target::final_check, ebt_u_replace::flags, ebt_u_match::flags, ebt_u_watcher::flags, ebt_u_target::flags, getethertypebyname(), ebt_u_entries::hook_mask, IFNAMSIZ, ebt_u_entry::in, ebt_u_entry::invflags, LIST_C, LIST_MAC2, LIST_N, LIST_X, ebt_u_entry::logical_in, ebt_u_entry::logical_out, ebt_u_match_list::m, ebt_u_match::m, ebt_u_entry::m_list, ebt_u_replace::name, ebt_entry_target::name, ebt_u_target::name, ebt_u_replace::nentries, ebt_u_match_list::next, ebt_u_watcher_list::next, ebt_u_entry::next, ebt_u_match::next, ebt_u_watcher::next, NF_BR_BROUTING, NF_BR_NUMHOOKS, NULL, ebt_u_replace::num_chains, ebt_u_replace::num_counters, NUM_STANDARD_TARGETS, OPT_COMMAND, OPT_COMMANDS, OPT_COUNT, OPT_DEST, OPT_IN, OPT_JUMP, OPT_KERNELDATA, OPT_LOGICALIN, OPT_LOGICALOUT, OPT_OUT, OPT_PROTOCOL, OPT_SOURCE, OPT_TABLE, OPT_ZERO, ebt_u_match::option_offset, ebt_u_watcher::option_offset, ebt_u_target::option_offset, ebt_u_entry::out, ebt_u_match::parse, ebt_u_watcher::parse, ebt_u_target::parse, ebt_counter::pcnt, PRINT_VERSION, PROGNAME, ebt_u_entry::replace, ebt_u_replace::selected_chain, ebt_u_entry::sourcemac, ebt_u_entry::sourcemsk, ebt_u_entry::t, ebt_u_target::t, ebt_entry_target::u, use_lockfd, ebt_u_match::used, ebt_u_watcher::used, ebt_u_target::used, ebt_u_watcher_list::w, ebt_u_watcher::w, and ebt_u_entry::w_list.

Here is the call graph for this function:

void ebt_early_init_once ( )

References ebt_iterate_matches(), ebt_iterate_targets(), and ebt_iterate_watchers().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function: