summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * 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>
* man: fix physdev manpageBart De Schuymer2009-01-261-3/+3
| | | | | | | | A sentence of the physdev module's help entry was truncated by the man program because the line starts with a single quote. Signed-off-by: Bart De Schuymer <bdschuym@pandora.be> Signed-off-by: Patrick McHardy <kaber@trash.net>
* libxt_owner: add more spaces to outputDaniel Drake2009-01-191-2/+2
| | | | | | | | | | | | | Commit bb9284d1 ("libxt_owner: add spaces to output") moved the printing of spaces away from the owner_mt_print() function family, but forgot to add spaces in all of the print_item() functions that are called. This is likely to be at least the partial cause of https://bugs.gentoo.org/show_bug.cgi?id=254435 Signed-off-by: Daniel Drake <dsd@gentoo.org> Approves-of-this-patch: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Patrick McHardy <kaber@trash.net>
* doc: augment ICMP manpage by type/code syntaxJan Engelhardt2009-01-142-3/+3
| | | | | | | | | The ICMP match module also allows numeric type/code as in "--icmp-type type/code". Document it. Based upon a patch by Victor Stinner <vstinner@inl.fr>. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* doc: escape minus sign in manpage (2)Jan Engelhardt2009-01-142-135/+136
| | | | Addendum to previous patch.
* build: remove non-portable ruleJan Engelhardt2009-01-121-3/+0
| | | | | | | | | | > Makefile.am:97: `%'-style pattern rules are a GNU make extension (iptables still requires GNU make for extensions/, because it is so much easier to write.) Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Patrick McHardy <kaber@trash.net>
* build: use regular = assignments in MakefileJan Engelhardt2009-01-121-10/+10
| | | | | | | | | | Resolves warnings: Makefile.am:7: `:='-style assignments are not portable Makefile.am:71: `:='-style assignments are not portable etc. Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Patrick McHardy <kaber@trash.net>
* doc: escape minus sign in manpagesJan Engelhardt2009-01-1279-414/+416
| | | | | | | groff formats '-' as a hyphen, and '\-' is needed for a minus. Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Patrick McHardy <kaber@trash.net>
* doc: resynchronize markup in iptables,ip6tables.8.inJan Engelhardt2009-01-082-15/+13
| | | | | | | | Change .br to .PP in the intro section and use consistent paragraphing in later ones. Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* doc: put iptables version into manpageJan Engelhardt2009-01-083-4/+4
| | | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* build: resolve autotools suggestionsJan Engelhardt2009-01-073-4/+9
| | | | | | | libtool2 wants to put files into m4, so let it have it. Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* env: augment deprecation noticeJan Engelhardt2009-01-076-6/+12
| | | | | | | Tell the user what to use instead of IP*TABLES_LIBDIR. Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* rateest: guard against segfaultJan Engelhardt2008-12-301-0/+3
| | | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* iptables-save: output ! in position according to manpageJan Engelhardt2008-12-0916-78/+54
| | | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Patrick McHardy <kaber@trash.net>
* src: remove unused include filesJan Engelhardt2008-12-076-141/+0
| | | | | | | | No .c files include any of these - in fact they seem to be remnants missed during commit b1f568309a09e61f892dee3c23279cecff0b0ff4 - so remove them. Signed-off-by: Patrick McHardy <kaber@trash.net>
* libiptc: guard chain index allocation for different malloc implementationsJan Engelhardt2008-11-261-1/+1
| | | | | | | | Some libc implementations such as µClibc return NULL on malloc(0). They are free to do that per C standard. Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signeed-off-by: Patrick McHardy <kaber@trash.net>
* doc: fix a typo in libip6t_REJECT.manJan Engelhardt2008-11-241-2/+1
| | | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Patrick McHardy <kaber@trash.net>
* src: remove inclusion of iptables.hJan Engelhardt2008-11-2040-38/+38
| | | | | | | | | iptables.h and ip6tables.h only include declarations internal to iptables (specifically iptables.c and ip6tables.c), as most of the public API has been moved to xtables.h a few months ago. Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Patrick McHardy <kaber@trash.net>
* iptables: refer to dmesg when we hit errorPablo Neira Ayuso2008-11-192-2/+4
| | | | | | | | | | | This does not make any better, but at least refer to dmesg which is the common source of information to diagnose kernel-side problems. This is helpful for newbie users. # iptables -I INPUT -j CLUSTERIP iptables: Invalid argument. Run `dmesg' for more information. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>