summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* libxtables: add xtables_set_revisionJamal Hadi Salim2009-02-124-23/+16
| | | | | | Introduce xtables_set_revision() and make iptables and ip6tables use it. Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
* libxtables: set names of programsJamal Hadi Salim2009-02-1210-2/+10
| | | | | | Set proper name of application. Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
* libipq: fix compile errorJan Engelhardt2009-02-121-0/+2
| | | | | | | | | | | | libipq.c: In function `ipq_create_handle': libipq.c:220: error: `NFPROTO_IPV4' undeclared (first use in this function) libipq.c:220: error: (Each undeclared identifier is reported only once libipq.c:220: error: for each function it appears in.) libipq.c:222: error: `NFPROTO_IPV6' undeclared (first use in this function) Add the required includes. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* build: restructure Makefile for include/ directoryJan Engelhardt2009-02-124-5/+13
| | | | | | This patch will support adding libiptc to the headers list in future. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* doc: fix one layout issue in iptables-restore.8Shaul Karl2009-02-121-1/+0
| | | | | Reference: http://bugs.debian.org/512281 Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* doc: fix option typo in libxt_multiportMarc Fournier2009-02-121-2/+2
| | | | | Reference: http://bugs.debian.org/511891 Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* libipq: add missing doc for NF_ valuesJan Engelhardt2009-02-121-0/+7
| | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* libxtables: flush before forkJan Engelhardt2009-02-121-0/+6
| | | | | Reference: http://bugs.debian.org/514869 Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* libxt_string: fix undefined behavior/incorrect patlen calculationJan Engelhardt2009-02-121-1/+3
| | | | | | | strlen ran over the end of the string. Use strnlen to bound it. Reference: http://bugs.debian.org/513516 Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* libxtables: use const for vars holding literalsJan Engelhardt2009-02-121-2/+1
| | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* Merge branch 'master' of git://dev.medozas.de/iptablesPatrick McHardy2009-02-1211-67/+73
|\
| * src: consolidate duplicate code in iptables/internal.hJan Engelhardt2009-02-103-4/+2
| | | | | | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
| * libxtables: move compat defines to xtables.cJan Engelhardt2009-02-103-10/+9
| | | | | | | | | | | | | | Addendum to commit v1.4.3-rc1-41-g77f48c2 where the macro users got moved. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
| * src: remove unused ipt_tryload macroJan Engelhardt2009-02-102-4/+0
| | | | | | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
| * src: remove iptables_rule_match indirection macroJan Engelhardt2009-02-104-26/+24
| | | | | | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
| * libxtables: decouple non-xtables parts from headerJan Engelhardt2009-02-107-9/+14
| | | | | | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
| * libxtables: remove unused XT_LIB_DIR macroJan Engelhardt2009-02-101-4/+0
| | | | | | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
| * build: move -ldl to proper LDADDJan Engelhardt2009-02-101-2/+3
| | | | | | | | | | | | libxtables uses dlopen, so *it* has to use -ldl, not the main program. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
| * libxtables: recognize IP6TABLES_LIB_DIR old-style environment variableJan Engelhardt2009-02-101-0/+13
| | | | | | | | | | | | | | | | Commit v1.4.3-rc1-47-g300e290 tried to consolidate the environment variable presence checking code into xtables.c, but missed adding IP6TABLES_LIB_DIR to libxtables. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* | libxtables: simple aliasing macro for exit_errorJamal Hadi Salim2009-02-115-42/+35
| | | | | | | | | | | | | | | | | | | | | | Rename xtables_globals exit_error cb to exit_err and introduce a very simple aliasing macro to point to it. convert iptables, ip6tables and iptables_xml to use it. Note iptables_xml does not have to define its own exit_error() since it can use the basic one provided. Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca> Signed-off-by: Patrick McHardy <kaber@trash.net>
* | libxtables: Replace direct exit_error() calls inside libxtablesJamal Hadi Salim2009-02-111-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace direct exit_error() calls inside libxtables with xt_params->exit_error(). With this change; i can now compile the useless app: ----- #include <xtables.h> int main(int argc, char **argv) { return 0; } ---- with "gcc useless.c -lxtables -ldl" Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca> Signed-off-by: Patrick McHardy <kaber@trash.net>
* | libxtables: Make ip6tables, iptables and iptables-xml use xtables_globalsJamal Hadi Salim2009-02-114-0/+26
| | | | | | | | | | | | | | | | convert ip6tables, iptables and iptables-xml to use xtables_globals/xtables_set_params() Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca> Signed-off-by: Patrick McHardy <kaber@trash.net>
* | libxtables: Add exit_error cb to xtables_globalsJamal Hadi Salim2009-02-112-9/+27
| | | | | | | | | | | | | | | | | | | | Introduce exit_error() as part of xtables_globals structure. When an application registers its xtables_globals definition and does not specify its exit_error() it gets assigned a basic version Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca> Signed-off-by: Patrick McHardy <kaber@trash.net>
* | libxtables: define xtables_free_opts()Jamal Hadi Salim2009-02-112-0/+12
| | | | | | | | | | | | | | | | | | | | | | Introduce xtables_free_opts() an xtables variant of free_opts() which uses xtables_globals already set by xtables_set_params(). The end goal is to have all internal references in xtables.c use xtables_free_opts() instead of depending on external defined free_opts() Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca> Signed-off-by: Patrick McHardy <kaber@trash.net>
* | libxtables: Introduce global params structuringJamal Hadi Salim2009-02-112-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | introduce a new struct,xtables_globals, so as to localize the globals used and help in symbol renames. The applications must invoke xtables_set_params() before starting to use any iptables APIs. xtables_set_params() is intended to free xtables from depending (as it does right now) on existence of such externally definitions (from iptables/iptables6 etc). At the moment, xtables wont even compile without presence of at least one of {iptables/iptables6 etc} Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca> Signed-off-by: Patrick McHardy <kaber@trash.net>
* | Merge branch 'master' of git://dev.medozas.de/iptablesPatrick McHardy2009-02-0992-1036/+963
|\|
| * Merge branch 'origin/master'Jan Engelhardt2009-02-080-0/+0
| |\ | | | | | | | | | | | | (throw away remote three commits as they had been redone in this local branch)
| * | libxtables: move afinfo aroundJan Engelhardt2009-02-0711-52/+71
| | | | | | | | | | | | | | | | | | | | | libxtables should not rely on the program executable providing the magic constants for using [gs]etsockopt. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
| * | libxtables: prefix/order - move parse_protocol to xtables.cJan Engelhardt2009-01-308-146/+96
| | | | | | | | | | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
| * | libxtables: prefix/order - move check_inverse to xtables.cJan Engelhardt2009-01-3064-175/+164
| | | | | | | | | | | | | | | | | | | | | This also adds a warning that intrapositional negation support is deprecated. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
| * | libxtables: prefix - parse and escaped output funcJan Engelhardt2009-01-3011-32/+39
| | | | | | | | | | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
| * | libxtables: prefix - misc functionsJan Engelhardt2009-01-3011-29/+30
| | | | | | | | | | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
| * | libxtables: prefix/order - ascii to ipaddr/ipmask inputJan Engelhardt2009-01-308-29/+29
| | | | | | | | | | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
| * | libxtables: prefix/order - ipaddr/ipmask to ascii outputJan Engelhardt2009-01-3012-67/+67
| | | | | | | | | | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
| * | libxtables: prefix/order - param_actJan Engelhardt2009-01-3016-162/+186
| | | | | | | | | | | | | | | | | | | | | | | | Changes: exittype -> xtables_exittype P_* -> XTF_* flags Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
| * | libxtables: prefix/order - program_nameJan Engelhardt2009-01-3013-48/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | Split XTABLES_VERSION into xtables and iptables, and encode the xtables soversion into the extensions instead. This makes it possible to upgrade iptables without having to recompile 3rd-party extensions (if the libxtables version matches, of course). Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
| * | libxtables: prefix/order - strtouiJan Engelhardt2009-01-2738-173/+141
| | | | | | | | | | | | | | | | | | This commit also throws out the redundant string_to_number_*. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
| * | libxtables: prefix/order - libdirJan Engelhardt2009-01-279-65/+27
| | | | | | | | | | | | | | | | | | Consolidate the libdir variable initialization code into xtables.c. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
| * | libxtables: prefix/order - match/target loadingJan Engelhardt2009-01-275-82/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | This change affects: find_{match,target} -> xtables_find_{match,target} enum xt_tryload -> enum xtables_tryload loose flags like DONT_LOAD -> XTF_DONT_LOAD Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
| * | libxtables: prefix/order - modprobe and xtables.ko loadingJan Engelhardt2009-01-277-17/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | This change affects: load_xtables_ko -> xtables_load_ko modprobe_program -> xtables_modprobe_program Now uses bool for the "quiet" flag. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
| * | libxtables: prefix/order - fw_xallocJan Engelhardt2009-01-276-26/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is good practice to prefix names in a library some way so that it does not clash with external programs' variable names right on the first try. This change: rename fw_[cm]alloc to xtables_[cm]alloc and move the definition from internal.h to xtables.h to avoid potential compiler warnings. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
| * | extensions: use UINT_MAX constants over open-coded numbers (2/2)Jan Engelhardt2009-01-2723-42/+42
| | | | | | | | | | | | | | | | | | Use the handy constants for ranges. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
| * | extensions: use UINT_MAX constants over open-coded bits (1/2)Jan Engelhardt2009-01-278-33/+33
| | | | | | | | | | | | | | | | | | ~0 depends on the sizeof(int), so it is better to use UINT32_MAX. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
| * | libxt_owner: use correct UID/GID boundariesJan Engelhardt2009-01-271-7/+7
| | | | | | | | | | | | | | | | | | | | | -1 is a reserved number (chown uses it to denote "do not change"), so the maximum libxt_owner should permit is up to UINT32_MAX-1. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
| * | src: remove redundant castsJan Engelhardt2009-01-2719-28/+26
| | | | | | | | | | | | | | | | | | All of them are implicitly convertable without any wanted side effects. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
| * | src: remove redundant returns at end of void-returning functionsJan Engelhardt2009-01-276-11/+0
| | | | | | | | | | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* | | xt_NFLOG: Set default NFLOG qthreshold to 0Eric Leblond2009-02-091-1/+1
| |/ |/| | | | | | | | | | | By setting default NFLOG qthreshold to 0, userspace does not overwrite the per-instance value. Signed-off-by: Patrick McHardy <kaber@trash.net>
* | libxtables: prefix names and order #3Jan Engelhardt2009-02-015-82/+94
| | | | | | | | | | | | | | | | | | | | This change affects: find_{match,target} -> xtables_find_{match,target} enum xt_tryload -> enum xtables_tryload loose flags like DONT_LOAD -> XTF_DONT_LOAD Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* | libxtables: prefix names and order it #2Jan Engelhardt2009-02-017-17/+22
| | | | | | | | | | | | | | | | | | | | This change affects: load_xtables_ko -> xtables_load_ko modprobe_program -> xtables_modprobe_program Now uses bool for the "quiet" flag. Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* | libbxtables: prefix names and order it #1Jan Engelhardt2009-02-016-26/+29
|/ | | | | | | | | | | | | | | | It is good practice to prefix names in a library some way so that it does not clash with external programs' variable names right on the first try. This change: rename fw_[cm]alloc to xtables_[cm]alloc and move the definition from internal.h to xtables.h to avoid potential compiler warnings. These functions are intended to fix Jamal's dependency problem in his tc's ipt action. Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>