diff options
Diffstat (limited to 'tools/remus/imqebt/include')
-rw-r--r-- | tools/remus/imqebt/include/ebtables_u.h | 379 | ||||
-rw-r--r-- | tools/remus/imqebt/include/ethernetdb.h | 58 | ||||
-rw-r--r-- | tools/remus/imqebt/include/linux/if_ether.h | 146 | ||||
-rw-r--r-- | tools/remus/imqebt/include/linux/netfilter_bridge.h | 91 | ||||
-rw-r--r-- | tools/remus/imqebt/include/linux/netfilter_bridge/ebt_imq.h | 8 | ||||
-rw-r--r-- | tools/remus/imqebt/include/linux/netfilter_bridge/ebtables.h | 276 | ||||
-rw-r--r-- | tools/remus/imqebt/include/linux/types.h | 209 |
7 files changed, 0 insertions, 1167 deletions
diff --git a/tools/remus/imqebt/include/ebtables_u.h b/tools/remus/imqebt/include/ebtables_u.h deleted file mode 100644 index fad004258a..0000000000 --- a/tools/remus/imqebt/include/ebtables_u.h +++ /dev/null @@ -1,379 +0,0 @@ -/* - * $Id: ebtables.c,v 1.03 2002/01/19 - * - * Copyright (C) 2001-2002 Bart De Schuymer - * - * This code is stongly inspired on the iptables code which is - * Copyright (C) 1999 Paul `Rusty' Russell & Michael J. Neuling - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef EBTABLES_U_H -#define EBTABLES_U_H -#include <netinet/in.h> -#include <linux/netfilter_bridge/ebtables.h> -#include <linux/netfilter/x_tables.h> - -#ifndef IPPROTO_SCTP -#define IPPROTO_SCTP 132 -#endif -#ifndef IPPROTO_DCCP -#define IPPROTO_DCCP 33 -#endif - -#define EXEC_STYLE_PRG 0 -#define EXEC_STYLE_DAEMON 1 - -#ifndef EBT_MIN_ALIGN -#define EBT_MIN_ALIGN (__alignof__(struct _xt_align)) -#endif -#define EBT_ALIGN(s) (((s) + (EBT_MIN_ALIGN-1)) & ~(EBT_MIN_ALIGN-1)) -#define ERRORMSG_MAXLEN 128 - -struct ebt_u_entries -{ - int policy; - unsigned int nentries; - /* counter offset for this chain */ - unsigned int counter_offset; - /* used for udc */ - unsigned int hook_mask; - char *kernel_start; - char name[EBT_CHAIN_MAXNAMELEN]; - struct ebt_u_entry *entries; -}; - -struct ebt_cntchanges -{ - unsigned short type; - unsigned short change; /* determines incremental/decremental/change */ - struct ebt_cntchanges *prev; - struct ebt_cntchanges *next; -}; - -#define EBT_ORI_MAX_CHAINS 10 -struct ebt_u_replace -{ - char name[EBT_TABLE_MAXNAMELEN]; - unsigned int valid_hooks; - /* nr of rules in the table */ - unsigned int nentries; - unsigned int num_chains; - unsigned int max_chains; - struct ebt_u_entries **chains; - /* nr of counters userspace expects back */ - unsigned int num_counters; - /* where the kernel will put the old counters */ - struct ebt_counter *counters; - /* - * can be used e.g. to know if a standard option - * has been specified twice - */ - unsigned int flags; - /* we stick the specified command (e.g. -A) in here */ - char command; - /* - * here we stick the chain to do our thing on (can be -1 if unspecified) - */ - int selected_chain; - /* used for the atomic option */ - char *filename; - /* tells what happened to the old rules (counter changes) */ - struct ebt_cntchanges *cc; -}; - -struct ebt_u_table -{ - char name[EBT_TABLE_MAXNAMELEN]; - void (*check)(struct ebt_u_replace *repl); - void (*help)(const char **); - struct ebt_u_table *next; -}; - -struct ebt_u_match_list -{ - struct ebt_u_match_list *next; - struct ebt_entry_match *m; -}; - -struct ebt_u_watcher_list -{ - struct ebt_u_watcher_list *next; - struct ebt_entry_watcher *w; -}; - -struct ebt_u_entry -{ - unsigned int bitmask; - unsigned int invflags; - uint16_t ethproto; - char in[IFNAMSIZ]; - char logical_in[IFNAMSIZ]; - char out[IFNAMSIZ]; - char logical_out[IFNAMSIZ]; - unsigned char sourcemac[ETH_ALEN]; - unsigned char sourcemsk[ETH_ALEN]; - unsigned char destmac[ETH_ALEN]; - unsigned char destmsk[ETH_ALEN]; - struct ebt_u_match_list *m_list; - struct ebt_u_watcher_list *w_list; - struct ebt_entry_target *t; - struct ebt_u_entry *prev; - struct ebt_u_entry *next; - struct ebt_counter cnt; - struct ebt_counter cnt_surplus; /* for increasing/decreasing a counter and for option 'C' */ - struct ebt_cntchanges *cc; - /* the standard target needs this to know the name of a udc when - * printing out rules. */ - struct ebt_u_replace *replace; -}; - -struct ebt_u_match -{ - char name[EBT_FUNCTION_MAXNAMELEN]; - /* size of the real match data */ - unsigned int size; - void (*help)(void); - void (*init)(struct ebt_entry_match *m); - int (*parse)(int c, char **argv, int argc, - const struct ebt_u_entry *entry, unsigned int *flags, - struct ebt_entry_match **match); - void (*final_check)(const struct ebt_u_entry *entry, - const struct ebt_entry_match *match, - const char *name, unsigned int hookmask, unsigned int time); - void (*print)(const struct ebt_u_entry *entry, - const struct ebt_entry_match *match); - int (*compare)(const struct ebt_entry_match *m1, - const struct ebt_entry_match *m2); - const struct option *extra_ops; - /* - * can be used e.g. to check for multiple occurance of the same option - */ - unsigned int flags; - unsigned int option_offset; - struct ebt_entry_match *m; - /* - * if used == 1 we no longer have to add it to - * the match chain of the new entry - * be sure to put it back on 0 when finished - */ - unsigned int used; - struct ebt_u_match *next; -}; - -struct ebt_u_watcher -{ - char name[EBT_FUNCTION_MAXNAMELEN]; - unsigned int size; - void (*help)(void); - void (*init)(struct ebt_entry_watcher *w); - int (*parse)(int c, char **argv, int argc, - const struct ebt_u_entry *entry, unsigned int *flags, - struct ebt_entry_watcher **watcher); - void (*final_check)(const struct ebt_u_entry *entry, - const struct ebt_entry_watcher *watch, const char *name, - unsigned int hookmask, unsigned int time); - void (*print)(const struct ebt_u_entry *entry, - const struct ebt_entry_watcher *watcher); - int (*compare)(const struct ebt_entry_watcher *w1, - const struct ebt_entry_watcher *w2); - const struct option *extra_ops; - unsigned int flags; - unsigned int option_offset; - struct ebt_entry_watcher *w; - unsigned int used; - struct ebt_u_watcher *next; -}; - -struct ebt_u_target -{ - char name[EBT_FUNCTION_MAXNAMELEN]; - unsigned int size; - void (*help)(void); - void (*init)(struct ebt_entry_target *t); - int (*parse)(int c, char **argv, int argc, - const struct ebt_u_entry *entry, unsigned int *flags, - struct ebt_entry_target **target); - void (*final_check)(const struct ebt_u_entry *entry, - const struct ebt_entry_target *target, const char *name, - unsigned int hookmask, unsigned int time); - void (*print)(const struct ebt_u_entry *entry, - const struct ebt_entry_target *target); - int (*compare)(const struct ebt_entry_target *t1, - const struct ebt_entry_target *t2); - const struct option *extra_ops; - unsigned int option_offset; - unsigned int flags; - struct ebt_entry_target *t; - unsigned int used; - struct ebt_u_target *next; -}; - -/* libebtc.c */ - -extern struct ebt_u_table *ebt_tables; -extern struct ebt_u_match *ebt_matches; -extern struct ebt_u_watcher *ebt_watchers; -extern struct ebt_u_target *ebt_targets; - -void ebt_register_table(struct ebt_u_table *); -void ebt_register_match(struct ebt_u_match *); -void ebt_register_watcher(struct ebt_u_watcher *); -void ebt_register_target(struct ebt_u_target *t); -int ebt_get_kernel_table(struct ebt_u_replace *replace, int init); -struct ebt_u_target *ebt_find_target(const char *name); -struct ebt_u_match *ebt_find_match(const char *name); -struct ebt_u_watcher *ebt_find_watcher(const char *name); -struct ebt_u_table *ebt_find_table(const char *name); -int ebtables_insmod(const char *modname); -void ebt_list_extensions(void); -void ebt_initialize_entry(struct ebt_u_entry *e); -void ebt_cleanup_replace(struct ebt_u_replace *replace); -void ebt_reinit_extensions(void); -void ebt_double_chains(struct ebt_u_replace *replace); -void ebt_free_u_entry(struct ebt_u_entry *e); -struct ebt_u_entries *ebt_name_to_chain(const struct ebt_u_replace *replace, - const char* arg); -struct ebt_u_entries *ebt_name_to_chain(const struct ebt_u_replace *replace, - const char* arg); -int ebt_get_chainnr(const struct ebt_u_replace *replace, const char* arg); -/**/ -void ebt_change_policy(struct ebt_u_replace *replace, int policy); -void ebt_flush_chains(struct ebt_u_replace *replace); -int ebt_check_rule_exists(struct ebt_u_replace *replace, - struct ebt_u_entry *new_entry); -void ebt_add_rule(struct ebt_u_replace *replace, struct ebt_u_entry *new_entry, - int rule_nr); -void ebt_delete_rule(struct ebt_u_replace *replace, - struct ebt_u_entry *new_entry, int begin, int end); -void ebt_zero_counters(struct ebt_u_replace *replace); -void ebt_change_counters(struct ebt_u_replace *replace, - struct ebt_u_entry *new_entry, int begin, int end, - struct ebt_counter *cnt, int mask); -void ebt_new_chain(struct ebt_u_replace *replace, const char *name, int policy); -void ebt_delete_chain(struct ebt_u_replace *replace); -void ebt_rename_chain(struct ebt_u_replace *replace, const char *name); -/**/ -void ebt_do_final_checks(struct ebt_u_replace *replace, struct ebt_u_entry *e, - struct ebt_u_entries *entries); -int ebt_check_for_references(struct ebt_u_replace *replace, int print_err); -int ebt_check_for_references2(struct ebt_u_replace *replace, int chain_nr, - int print_err); -void ebt_check_for_loops(struct ebt_u_replace *replace); -void ebt_add_match(struct ebt_u_entry *new_entry, struct ebt_u_match *m); -void ebt_add_watcher(struct ebt_u_entry *new_entry, struct ebt_u_watcher *w); -void ebt_iterate_matches(void (*f)(struct ebt_u_match *)); -void ebt_iterate_watchers(void (*f)(struct ebt_u_watcher *)); -void ebt_iterate_targets(void (*f)(struct ebt_u_target *)); -void __ebt_print_bug(char *file, int line, char *format, ...); -void __ebt_print_error(char *format, ...); - -/* communication.c */ - -int ebt_get_table(struct ebt_u_replace *repl, int init); -void ebt_deliver_counters(struct ebt_u_replace *repl); -void ebt_deliver_table(struct ebt_u_replace *repl); - -/* useful_functions.c */ - -extern int ebt_invert; -void ebt_check_option(unsigned int *flags, unsigned int mask); -#define ebt_check_inverse(arg) _ebt_check_inverse(arg, argc, argv) -int _ebt_check_inverse(const char option[], int argc, char **argv); -void ebt_print_mac(const unsigned char *mac); -void ebt_print_mac_and_mask(const unsigned char *mac, const unsigned char *mask); -int ebt_get_mac_and_mask(const char *from, unsigned char *to, unsigned char *mask); -void ebt_parse_ip_address(char *address, uint32_t *addr, uint32_t *msk); -char *ebt_mask_to_dotted(uint32_t mask); -void ebt_parse_ip6_address(char *address, struct in6_addr *addr, - struct in6_addr *msk); -char *ebt_ip6_to_numeric(const struct in6_addr *addrp); - - -int do_command(int argc, char *argv[], int exec_style, - struct ebt_u_replace *replace_); - -struct ethertypeent *parseethertypebynumber(int type); - -#define ebt_to_chain(repl) \ -({struct ebt_u_entries *_ch = NULL; \ -if (repl->selected_chain != -1) \ - _ch = repl->chains[repl->selected_chain]; \ -_ch;}) -#define ebt_print_bug(format, args...) \ - __ebt_print_bug(__FILE__, __LINE__, format, ##args) -#define ebt_print_error(format,args...) __ebt_print_error(format, ##args); -#define ebt_print_error2(format, args...) do {__ebt_print_error(format, ##args); \ - return -1;} while (0) -#define ebt_check_option2(flags,mask) \ -({ebt_check_option(flags,mask); \ - if (ebt_errormsg[0] != '\0') \ - return -1;}) -#define ebt_check_inverse2(option) \ -({int __ret = ebt_check_inverse(option); \ -if (ebt_errormsg[0] != '\0') \ - return -1; \ -if (!optarg) { \ - __ebt_print_error("Option without (mandatory) argument"); \ - return -1; \ -} \ -__ret;}) -#define ebt_print_memory() do {printf("Ebtables: " __FILE__ \ - " %s %d :Out of memory.\n", __FUNCTION__, __LINE__); exit(-1);} while (0) - -/* used for keeping the rule counters right during rule adds or deletes */ -#define CNT_NORM 0 -#define CNT_DEL 1 -#define CNT_ADD 2 -#define CNT_CHANGE 3 - -extern const char *ebt_hooknames[NF_BR_NUMHOOKS]; -extern const char *ebt_standard_targets[NUM_STANDARD_TARGETS]; -extern char ebt_errormsg[ERRORMSG_MAXLEN]; -extern char *ebt_modprobe; -extern int ebt_silent; -extern int ebt_printstyle_mac; - -/* - * Transforms a target string into the right integer, - * returns 0 on success. - */ -#define FILL_TARGET(_str, _pos) ({ \ - int _i, _ret = 0; \ - for (_i = 0; _i < NUM_STANDARD_TARGETS; _i++) \ - if (!strcmp(_str, ebt_standard_targets[_i])) {\ - _pos = -_i - 1; \ - break; \ - } \ - if (_i == NUM_STANDARD_TARGETS) \ - _ret = 1; \ - _ret; \ -}) - -/* Transforms the target value to an index into standard_targets[] */ -#define TARGET_INDEX(_value) (-_value - 1) -/* Returns a target string corresponding to the value */ -#define TARGET_NAME(_value) (ebt_standard_targets[TARGET_INDEX(_value)]) -/* True if the hook mask denotes that the rule is in a base chain */ -#define BASE_CHAIN (hookmask & (1 << NF_BR_NUMHOOKS)) -/* Clear the bit in the hook_mask that tells if the rule is on a base chain */ -#define CLEAR_BASE_CHAIN_BIT (hookmask &= ~(1 << NF_BR_NUMHOOKS)) -#define PRINT_VERSION printf(PROGNAME" v"PROGVERSION" ("PROGDATE")\n") -#ifndef PROC_SYS_MODPROBE -#define PROC_SYS_MODPROBE "/proc/sys/kernel/modprobe" -#endif -#define ATOMIC_ENV_VARIABLE "EBTABLES_ATOMIC_FILE" -#endif /* EBTABLES_U_H */ diff --git a/tools/remus/imqebt/include/ethernetdb.h b/tools/remus/imqebt/include/ethernetdb.h deleted file mode 100644 index fc3458225f..0000000000 --- a/tools/remus/imqebt/include/ethernetdb.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* All data returned by the network data base library are supplied in - host order and returned in network order (suitable for use in - system calls). */ - -#ifndef _ETHERNETDB_H -#define _ETHERNETDB_H 1 - -#include <features.h> -#include <netinet/in.h> -#include <stdint.h> - -/* Absolute file name for network data base files. */ -#ifndef _PATH_ETHERTYPES -#define _PATH_ETHERTYPES "/etc/ethertypes" -#endif /* _PATH_ETHERTYPES */ - -struct ethertypeent { - char *e_name; /* Official ethernet type name. */ - char **e_aliases; /* Alias list. */ - int e_ethertype; /* Ethernet type number. */ -}; - -/* Open ethertype data base files and mark them as staying open even - after a later search if STAY_OPEN is non-zero. */ -extern void setethertypeent(int __stay_open) __THROW; - -/* Close ethertype data base files and clear `stay open' flag. */ -extern void endethertypeent(void) __THROW; - -/* Get next entry from ethertype data base file. Open data base if - necessary. */ -extern struct ethertypeent *getethertypeent(void) __THROW; - -/* Return entry from ethertype data base for network with NAME. */ -extern struct ethertypeent *getethertypebyname(__const char *__name) - __THROW; - -/* Return entry from ethertype data base which number is PROTO. */ -extern struct ethertypeent *getethertypebynumber(int __ethertype) __THROW; - - -#endif /* ethernetdb.h */ diff --git a/tools/remus/imqebt/include/linux/if_ether.h b/tools/remus/imqebt/include/linux/if_ether.h deleted file mode 100644 index 1ab699484f..0000000000 --- a/tools/remus/imqebt/include/linux/if_ether.h +++ /dev/null @@ -1,146 +0,0 @@ -/* - * INET An implementation of the TCP/IP protocol suite for the LINUX - * operating system. INET is implemented using the BSD Socket - * interface as the means of communication with the user level. - * - * Global definitions for the Ethernet IEEE 802.3 interface. - * - * Version: @(#)if_ether.h 1.0.1a 02/08/94 - * - * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> - * Donald Becker, <becker@super.org> - * Alan Cox, <alan@lxorguk.ukuu.org.uk> - * Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _LINUX_IF_ETHER_H -#define _LINUX_IF_ETHER_H - -#include <linux/types.h> - -/* - * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble - * and FCS/CRC (frame check sequence). - */ - -#define ETH_ALEN 6 /* Octets in one ethernet addr */ -#define ETH_HLEN 14 /* Total octets in header. */ -#define ETH_ZLEN 60 /* Min. octets in frame sans FCS */ -#define ETH_DATA_LEN 1500 /* Max. octets in payload */ -#define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */ -#define ETH_FCS_LEN 4 /* Octets in the FCS */ - -/* - * These are the defined Ethernet Protocol ID's. - */ - -#define ETH_P_LOOP 0x0060 /* Ethernet Loopback packet */ -#define ETH_P_PUP 0x0200 /* Xerox PUP packet */ -#define ETH_P_PUPAT 0x0201 /* Xerox PUP Addr Trans packet */ -#define ETH_P_IP 0x0800 /* Internet Protocol packet */ -#define ETH_P_X25 0x0805 /* CCITT X.25 */ -#define ETH_P_ARP 0x0806 /* Address Resolution packet */ -#define ETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet [ NOT AN OFFICIALLY REGISTERED ID ] */ -#define ETH_P_IEEEPUP 0x0a00 /* Xerox IEEE802.3 PUP packet */ -#define ETH_P_IEEEPUPAT 0x0a01 /* Xerox IEEE802.3 PUP Addr Trans packet */ -#define ETH_P_DEC 0x6000 /* DEC Assigned proto */ -#define ETH_P_DNA_DL 0x6001 /* DEC DNA Dump/Load */ -#define ETH_P_DNA_RC 0x6002 /* DEC DNA Remote Console */ -#define ETH_P_DNA_RT 0x6003 /* DEC DNA Routing */ -#define ETH_P_LAT 0x6004 /* DEC LAT */ -#define ETH_P_DIAG 0x6005 /* DEC Diagnostics */ -#define ETH_P_CUST 0x6006 /* DEC Customer use */ -#define ETH_P_SCA 0x6007 /* DEC Systems Comms Arch */ -#define ETH_P_TEB 0x6558 /* Trans Ether Bridging */ -#define ETH_P_RARP 0x8035 /* Reverse Addr Res packet */ -#define ETH_P_ATALK 0x809B /* Appletalk DDP */ -#define ETH_P_AARP 0x80F3 /* Appletalk AARP */ -#define ETH_P_8021Q 0x8100 /* 802.1Q VLAN Extended Header */ -#define ETH_P_IPX 0x8137 /* IPX over DIX */ -#define ETH_P_IPV6 0x86DD /* IPv6 over bluebook */ -#define ETH_P_PAUSE 0x8808 /* IEEE Pause frames. See 802.3 31B */ -#define ETH_P_SLOW 0x8809 /* Slow Protocol. See 802.3ad 43B */ -#define ETH_P_WCCP 0x883E /* Web-cache coordination protocol - * defined in draft-wilson-wrec-wccp-v2-00.txt */ -#define ETH_P_PPP_DISC 0x8863 /* PPPoE discovery messages */ -#define ETH_P_PPP_SES 0x8864 /* PPPoE session messages */ -#define ETH_P_MPLS_UC 0x8847 /* MPLS Unicast traffic */ -#define ETH_P_MPLS_MC 0x8848 /* MPLS Multicast traffic */ -#define ETH_P_ATMMPOA 0x884c /* MultiProtocol Over ATM */ -#define ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport - * over Ethernet - */ -#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ -#define ETH_P_AOE 0x88A2 /* ATA over Ethernet */ -#define ETH_P_TIPC 0x88CA /* TIPC */ -#define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */ -#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */ - -/* - * Non DIX types. Won't clash for 1500 types. - */ - -#define ETH_P_802_3 0x0001 /* Dummy type for 802.3 frames */ -#define ETH_P_AX25 0x0002 /* Dummy protocol id for AX.25 */ -#define ETH_P_ALL 0x0003 /* Every packet (be careful!!!) */ -#define ETH_P_802_2 0x0004 /* 802.2 frames */ -#define ETH_P_SNAP 0x0005 /* Internal only */ -#define ETH_P_DDCMP 0x0006 /* DEC DDCMP: Internal only */ -#define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/ -#define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */ -#define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */ -#define ETH_P_CAN 0x000C /* Controller Area Network */ -#define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/ -#define ETH_P_TR_802_2 0x0011 /* 802.2 frames */ -#define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */ -#define ETH_P_CONTROL 0x0016 /* Card specific control frames */ -#define ETH_P_IRDA 0x0017 /* Linux-IrDA */ -#define ETH_P_ECONET 0x0018 /* Acorn Econet */ -#define ETH_P_HDLC 0x0019 /* HDLC frames */ -#define ETH_P_ARCNET 0x001A /* 1A for ArcNet :-) */ -#define ETH_P_DSA 0x001B /* Distributed Switch Arch. */ -#define ETH_P_TRAILER 0x001C /* Trailer switch tagging */ -#define ETH_P_PHONET 0x00F5 /* Nokia Phonet frames */ - -/* - * This is an Ethernet frame header. - */ - -struct ethhdr { - unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ - unsigned char h_source[ETH_ALEN]; /* source ether addr */ - __be16 h_proto; /* packet type ID field */ -} __attribute__((packed)); - -#ifdef __KERNEL__ -#include <linux/skbuff.h> - -static inline struct ethhdr *eth_hdr(const struct sk_buff *skb) -{ - return (struct ethhdr *)skb_mac_header(skb); -} - -int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr); - -#ifdef CONFIG_SYSCTL -extern struct ctl_table ether_table[]; -#endif - -extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len); - -/* - * Display a 6 byte device address (MAC) in a readable format. - */ -extern char *print_mac(char *buf, const unsigned char *addr); -#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x" -#define MAC_BUF_SIZE 18 -#define DECLARE_MAC_BUF(var) char var[MAC_BUF_SIZE] __maybe_unused - -#endif - -#endif /* _LINUX_IF_ETHER_H */ diff --git a/tools/remus/imqebt/include/linux/netfilter_bridge.h b/tools/remus/imqebt/include/linux/netfilter_bridge.h deleted file mode 100644 index cd3f538ae1..0000000000 --- a/tools/remus/imqebt/include/linux/netfilter_bridge.h +++ /dev/null @@ -1,91 +0,0 @@ -#ifndef __LINUX_BRIDGE_NETFILTER_H -#define __LINUX_BRIDGE_NETFILTER_H - -/* bridge-specific defines for netfilter. - */ - -/* Bridge Hooks */ -/* After promisc drops, checksum checks. */ -#define NF_BR_PRE_ROUTING 0 -/* If the packet is destined for this box. */ -#define NF_BR_LOCAL_IN 1 -/* If the packet is destined for another interface. */ -#define NF_BR_FORWARD 2 -/* Packets coming from a local process. */ -#define NF_BR_LOCAL_OUT 3 -/* Packets about to hit the wire. */ -#define NF_BR_POST_ROUTING 4 -/* Not really a hook, but used for the ebtables broute table */ -#define NF_BR_BROUTING 5 -#define NF_BR_NUMHOOKS 6 - -#ifdef __KERNEL__ -#include <linux/netfilter.h> -#include <linux/if_ether.h> -#include <linux/if_vlan.h> -#include <linux/if_pppox.h> - -enum nf_br_hook_priorities { - NF_BR_PRI_FIRST = INT_MIN, - NF_BR_PRI_NAT_DST_BRIDGED = -300, - NF_BR_PRI_FILTER_BRIDGED = -200, - NF_BR_PRI_BRNF = 0, - NF_BR_PRI_NAT_DST_OTHER = 100, - NF_BR_PRI_FILTER_OTHER = 200, - NF_BR_PRI_NAT_SRC = 300, - NF_BR_PRI_LAST = INT_MAX, -}; - -#ifdef CONFIG_BRIDGE_NETFILTER - -#define BRNF_PKT_TYPE 0x01 -#define BRNF_BRIDGED_DNAT 0x02 -#define BRNF_DONT_TAKE_PARENT 0x04 -#define BRNF_BRIDGED 0x08 -#define BRNF_NF_BRIDGE_PREROUTING 0x10 - - -/* Only used in br_forward.c */ -extern int nf_bridge_copy_header(struct sk_buff *skb); -static inline int nf_bridge_maybe_copy_header(struct sk_buff *skb) -{ - if (skb->nf_bridge && - skb->nf_bridge->mask & (BRNF_BRIDGED | BRNF_BRIDGED_DNAT)) - return nf_bridge_copy_header(skb); - return 0; -} - -static inline unsigned int nf_bridge_encap_header_len(const struct sk_buff *skb) -{ - switch (skb->protocol) { - case __cpu_to_be16(ETH_P_8021Q): - return VLAN_HLEN; - case __cpu_to_be16(ETH_P_PPP_SES): - return PPPOE_SES_HLEN; - default: - return 0; - } -} - -/* This is called by the IP fragmenting code and it ensures there is - * enough room for the encapsulating header (if there is one). */ -static inline unsigned int nf_bridge_pad(const struct sk_buff *skb) -{ - if (skb->nf_bridge) - return nf_bridge_encap_header_len(skb); - return 0; -} - -struct bridge_skb_cb { - union { - __be32 ipv4; - } daddr; -}; - -#else -#define nf_bridge_maybe_copy_header(skb) (0) -#define nf_bridge_pad(skb) (0) -#endif /* CONFIG_BRIDGE_NETFILTER */ - -#endif /* __KERNEL__ */ -#endif diff --git a/tools/remus/imqebt/include/linux/netfilter_bridge/ebt_imq.h b/tools/remus/imqebt/include/linux/netfilter_bridge/ebt_imq.h deleted file mode 100644 index 30095f09df..0000000000 --- a/tools/remus/imqebt/include/linux/netfilter_bridge/ebt_imq.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef __LINUX_BRIDGE_EBT_IMQ_H -#define __LINUX_BRIDGE_EBT_IMQ_H - -struct ebt_imq_info -{ - unsigned int todev; -}; -#endif diff --git a/tools/remus/imqebt/include/linux/netfilter_bridge/ebtables.h b/tools/remus/imqebt/include/linux/netfilter_bridge/ebtables.h deleted file mode 100644 index 71d39702a5..0000000000 --- a/tools/remus/imqebt/include/linux/netfilter_bridge/ebtables.h +++ /dev/null @@ -1,276 +0,0 @@ -/* - * ebtables - * - * Authors: - * Bart De Schuymer <bdschuym@pandora.be> - * - * ebtables.c,v 2.0, April, 2002 - * - * This code is stongly inspired on the iptables code which is - * Copyright (C) 1999 Paul `Rusty' Russell & Michael J. Neuling - */ - -/* Local copy of the kernel file, needed for Sparc64 support */ -#ifndef __LINUX_BRIDGE_EFF_H -#define __LINUX_BRIDGE_EFF_H -#include <linux/if.h> -#include <linux/netfilter_bridge.h> -#include <linux/if_ether.h> - -#define EBT_TABLE_MAXNAMELEN 32 -#define EBT_CHAIN_MAXNAMELEN EBT_TABLE_MAXNAMELEN -#define EBT_FUNCTION_MAXNAMELEN EBT_TABLE_MAXNAMELEN - -/* verdicts >0 are "branches" */ -#define EBT_ACCEPT -1 -#define EBT_DROP -2 -#define EBT_CONTINUE -3 -#define EBT_RETURN -4 -#define NUM_STANDARD_TARGETS 4 -/* ebtables target modules store the verdict inside an int. We can - * reclaim a part of this int for backwards compatible extensions. - * The 4 lsb are more than enough to store the verdict. */ -#define EBT_VERDICT_BITS 0x0000000F - -struct ebt_counter -{ - uint64_t pcnt; - uint64_t bcnt; -}; - -struct ebt_replace -{ - char name[EBT_TABLE_MAXNAMELEN]; - unsigned int valid_hooks; - /* nr of rules in the table */ - unsigned int nentries; - /* total size of the entries */ - unsigned int entries_size; - /* start of the chains */ -#ifdef KERNEL_64_USERSPACE_32 - uint64_t hook_entry[NF_BR_NUMHOOKS]; -#else - struct ebt_entries *hook_entry[NF_BR_NUMHOOKS]; -#endif - /* nr of counters userspace expects back */ - unsigned int num_counters; - /* where the kernel will put the old counters */ -#ifdef KERNEL_64_USERSPACE_32 - uint64_t counters; - uint64_t entries; -#else - struct ebt_counter *counters; - char *entries; -#endif -}; - -struct ebt_entries { - /* this field is always set to zero - * See EBT_ENTRY_OR_ENTRIES. - * Must be same size as ebt_entry.bitmask */ - unsigned int distinguisher; - /* the chain name */ - char name[EBT_CHAIN_MAXNAMELEN]; - /* counter offset for this chain */ - unsigned int counter_offset; - /* one standard (accept, drop, return) per hook */ - int policy; - /* nr. of entries */ - unsigned int nentries; - /* entry list */ - char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace)))); -}; - -/* used for the bitmask of struct ebt_entry */ - -/* This is a hack to make a difference between an ebt_entry struct and an - * ebt_entries struct when traversing the entries from start to end. - * Using this simplifies the code alot, while still being able to use - * ebt_entries. - * Contrary, iptables doesn't use something like ebt_entries and therefore uses - * different techniques for naming the policy and such. So, iptables doesn't - * need a hack like this. - */ -#define EBT_ENTRY_OR_ENTRIES 0x01 -/* these are the normal masks */ -#define EBT_NOPROTO 0x02 -#define EBT_802_3 0x04 -#define EBT_SOURCEMAC 0x08 -#define EBT_DESTMAC 0x10 -#define EBT_F_MASK (EBT_NOPROTO | EBT_802_3 | EBT_SOURCEMAC | EBT_DESTMAC \ - | EBT_ENTRY_OR_ENTRIES) - -#define EBT_IPROTO 0x01 -#define EBT_IIN 0x02 -#define EBT_IOUT 0x04 -#define EBT_ISOURCE 0x8 -#define EBT_IDEST 0x10 -#define EBT_ILOGICALIN 0x20 -#define EBT_ILOGICALOUT 0x40 -#define EBT_INV_MASK (EBT_IPROTO | EBT_IIN | EBT_IOUT | EBT_ILOGICALIN \ - | EBT_ILOGICALOUT | EBT_ISOURCE | EBT_IDEST) - -struct ebt_entry_match -{ - union { - char name[EBT_FUNCTION_MAXNAMELEN]; - struct ebt_match *match; - } u; - /* size of data */ - unsigned int match_size; -#ifdef KERNEL_64_USERSPACE_32 - unsigned int pad; -#endif - unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace)))); -}; - -struct ebt_entry_watcher -{ - union { - char name[EBT_FUNCTION_MAXNAMELEN]; - struct ebt_watcher *watcher; - } u; - /* size of data */ - unsigned int watcher_size; -#ifdef KERNEL_64_USERSPACE_32 - unsigned int pad; -#endif - unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace)))); -}; - -struct ebt_entry_target -{ - union { - char name[EBT_FUNCTION_MAXNAMELEN]; - struct ebt_target *target; - } u; - /* size of data */ - unsigned int target_size; -#ifdef KERNEL_64_USERSPACE_32 - unsigned int pad; -#endif - unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace)))); -}; - -#define EBT_STANDARD_TARGET "standard" -struct ebt_standard_target -{ - struct ebt_entry_target target; - int verdict; -#ifdef KERNEL_64_USERSPACE_32 - unsigned int pad; -#endif -}; - -/* one entry */ -struct ebt_entry { - /* this needs to be the first field */ - unsigned int bitmask; - unsigned int invflags; - uint16_t ethproto; - /* the physical in-dev */ - char in[IFNAMSIZ]; - /* the logical in-dev */ - char logical_in[IFNAMSIZ]; - /* the physical out-dev */ - char out[IFNAMSIZ]; - /* the logical out-dev */ - char logical_out[IFNAMSIZ]; - unsigned char sourcemac[ETH_ALEN]; - unsigned char sourcemsk[ETH_ALEN]; - unsigned char destmac[ETH_ALEN]; - unsigned char destmsk[ETH_ALEN]; - /* sizeof ebt_entry + matches */ - unsigned int watchers_offset; - /* sizeof ebt_entry + matches + watchers */ - unsigned int target_offset; - /* sizeof ebt_entry + matches + watchers + target */ - unsigned int next_offset; - unsigned char elems[0] __attribute__ ((aligned (__alignof__(struct ebt_replace)))); -}; - -/* {g,s}etsockopt numbers */ -#define EBT_BASE_CTL 128 - -#define EBT_SO_SET_ENTRIES (EBT_BASE_CTL) -#define EBT_SO_SET_COUNTERS (EBT_SO_SET_ENTRIES+1) -#define EBT_SO_SET_MAX (EBT_SO_SET_COUNTERS+1) - -#define EBT_SO_GET_INFO (EBT_BASE_CTL) -#define EBT_SO_GET_ENTRIES (EBT_SO_GET_INFO+1) -#define EBT_SO_GET_INIT_INFO (EBT_SO_GET_ENTRIES+1) -#define EBT_SO_GET_INIT_ENTRIES (EBT_SO_GET_INIT_INFO+1) -#define EBT_SO_GET_MAX (EBT_SO_GET_INIT_ENTRIES+1) - -/* blatently stolen from ip_tables.h - * fn returns 0 to continue iteration */ -#define EBT_MATCH_ITERATE(e, fn, args...) \ -({ \ - unsigned int __i; \ - int __ret = 0; \ - struct ebt_entry_match *__match; \ - \ - for (__i = sizeof(struct ebt_entry); \ - __i < (e)->watchers_offset; \ - __i += __match->match_size + \ - sizeof(struct ebt_entry_match)) { \ - __match = (void *)(e) + __i; \ - \ - __ret = fn(__match , ## args); \ - if (__ret != 0) \ - break; \ - } \ - if (__ret == 0) { \ - if (__i != (e)->watchers_offset) \ - __ret = -EINVAL; \ - } \ - __ret; \ -}) - -#define EBT_WATCHER_ITERATE(e, fn, args...) \ -({ \ - unsigned int __i; \ - int __ret = 0; \ - struct ebt_entry_watcher *__watcher; \ - \ - for (__i = e->watchers_offset; \ - __i < (e)->target_offset; \ - __i += __watcher->watcher_size + \ - sizeof(struct ebt_entry_watcher)) { \ - __watcher = (void *)(e) + __i; \ - \ - __ret = fn(__watcher , ## args); \ - if (__ret != 0) \ - break; \ - } \ - if (__ret == 0) { \ - if (__i != (e)->target_offset) \ - __ret = -EINVAL; \ - } \ - __ret; \ -}) - -#define EBT_ENTRY_ITERATE(entries, size, fn, args...) \ -({ \ - unsigned int __i; \ - int __ret = 0; \ - struct ebt_entry *__entry; \ - \ - for (__i = 0; __i < (size);) { \ - __entry = (void *)(entries) + __i; \ - __ret = fn(__entry , ## args); \ - if (__ret != 0) \ - break; \ - if (__entry->bitmask != 0) \ - __i += __entry->next_offset; \ - else \ - __i += sizeof(struct ebt_entries); \ - } \ - if (__ret == 0) { \ - if (__i != (size)) \ - __ret = -EINVAL; \ - } \ - __ret; \ -}) - -#endif diff --git a/tools/remus/imqebt/include/linux/types.h b/tools/remus/imqebt/include/linux/types.h deleted file mode 100644 index de999aeb6a..0000000000 --- a/tools/remus/imqebt/include/linux/types.h +++ /dev/null @@ -1,209 +0,0 @@ -#ifndef _LINUX_TYPES_H -#define _LINUX_TYPES_H - -#include <asm/types.h> - -#ifndef __ASSEMBLY__ -#ifdef __KERNEL__ - -#define DECLARE_BITMAP(name,bits) \ - unsigned long name[BITS_TO_LONGS(bits)] - -#endif - -#include <linux/posix_types.h> - -#ifdef __KERNEL__ - -typedef __u32 __kernel_dev_t; - -typedef __kernel_fd_set fd_set; -typedef __kernel_dev_t dev_t; -typedef __kernel_ino_t ino_t; -typedef __kernel_mode_t mode_t; -typedef __kernel_nlink_t nlink_t; -typedef __kernel_off_t off_t; -typedef __kernel_pid_t pid_t; -typedef __kernel_daddr_t daddr_t; -typedef __kernel_key_t key_t; -typedef __kernel_suseconds_t suseconds_t; -typedef __kernel_timer_t timer_t; -typedef __kernel_clockid_t clockid_t; -typedef __kernel_mqd_t mqd_t; - -typedef _Bool bool; - -typedef __kernel_uid32_t uid_t; -typedef __kernel_gid32_t gid_t; -typedef __kernel_uid16_t uid16_t; -typedef __kernel_gid16_t gid16_t; - -typedef unsigned long uintptr_t; - -#ifdef CONFIG_UID16 -/* This is defined by include/asm-{arch}/posix_types.h */ -typedef __kernel_old_uid_t old_uid_t; -typedef __kernel_old_gid_t old_gid_t; -#endif /* CONFIG_UID16 */ - -#if defined(__GNUC__) -typedef __kernel_loff_t loff_t; -#endif - -/* - * The following typedefs are also protected by individual ifdefs for - * historical reasons: - */ -#ifndef _SIZE_T -#define _SIZE_T -typedef __kernel_size_t size_t; -#endif - -#ifndef _SSIZE_T -#define _SSIZE_T -typedef __kernel_ssize_t ssize_t; -#endif - -#ifndef _PTRDIFF_T -#define _PTRDIFF_T -typedef __kernel_ptrdiff_t ptrdiff_t; -#endif - -#ifndef _TIME_T -#define _TIME_T -typedef __kernel_time_t time_t; -#endif - -#ifndef _CLOCK_T -#define _CLOCK_T -typedef __kernel_clock_t clock_t; -#endif - -#ifndef _CADDR_T -#define _CADDR_T -typedef __kernel_caddr_t caddr_t; -#endif - -/* bsd */ -typedef unsigned char u_char; -typedef unsigned short u_short; -typedef unsigned int u_int; -typedef unsigned long u_long; - -/* sysv */ -typedef unsigned char unchar; -typedef unsigned short ushort; -typedef unsigned int uint; -typedef unsigned long ulong; - -#ifndef __BIT_TYPES_DEFINED__ -#define __BIT_TYPES_DEFINED__ - -typedef __u8 u_int8_t; -typedef __s8 int8_t; -typedef __u16 u_int16_t; -typedef __s16 int16_t; -typedef __u32 u_int32_t; -typedef __s32 int32_t; - -#endif /* !(__BIT_TYPES_DEFINED__) */ - -typedef __u8 uint8_t; -typedef __u16 uint16_t; -typedef __u32 uint32_t; - -#if defined(__GNUC__) -typedef __u64 uint64_t; -typedef __u64 u_int64_t; -typedef __s64 int64_t; -#endif - -/* this is a special 64bit data type that is 8-byte aligned */ -#define aligned_u64 __u64 __attribute__((aligned(8))) -#define aligned_be64 __be64 __attribute__((aligned(8))) -#define aligned_le64 __le64 __attribute__((aligned(8))) - -/** - * The type used for indexing onto a disc or disc partition. - * - * Linux always considers sectors to be 512 bytes long independently - * of the devices real block size. - * - * blkcnt_t is the type of the inode's block count. - */ -#ifdef CONFIG_LBD -typedef u64 sector_t; -typedef u64 blkcnt_t; -#else -typedef unsigned long sector_t; -typedef unsigned long blkcnt_t; -#endif - -/* - * The type of an index into the pagecache. Use a #define so asm/types.h - * can override it. - */ -#ifndef pgoff_t -#define pgoff_t unsigned long -#endif - -#endif /* __KERNEL__ */ - -/* - * Below are truly Linux-specific types that should never collide with - * any application/library that wants linux/types.h. - */ - -#ifdef __CHECKER__ -#define __bitwise__ __attribute__((bitwise)) -#else -#define __bitwise__ -#endif -#ifdef __CHECK_ENDIAN__ -#define __bitwise __bitwise__ -#else -#define __bitwise -#endif - -typedef __u16 __bitwise __le16; -typedef __u16 __bitwise __be16; -typedef __u32 __bitwise __le32; -typedef __u32 __bitwise __be32; -typedef __u64 __bitwise __le64; -typedef __u64 __bitwise __be64; - -typedef __u16 __bitwise __sum16; -typedef __u32 __bitwise __wsum; - -#ifdef __KERNEL__ -typedef unsigned __bitwise__ gfp_t; -typedef unsigned __bitwise__ fmode_t; - -#ifdef CONFIG_PHYS_ADDR_T_64BIT -typedef u64 phys_addr_t; -#else -typedef u32 phys_addr_t; -#endif - -typedef phys_addr_t resource_size_t; - -typedef struct { - volatile int counter; -} atomic_t; - -#ifdef CONFIG_64BIT -typedef struct { - volatile long counter; -} atomic64_t; -#endif - -struct ustat { - __kernel_daddr_t f_tfree; - __kernel_ino_t f_tinode; - char f_fname[6]; - char f_fpack[6]; -}; - -#endif /* __KERNEL__ */ -#endif /* __ASSEMBLY__ */ -#endif /* _LINUX_TYPES_H */ |