Busybox: Upgrade to 1.21.1 (stable). lsof active.
[tomato.git] / release / src / router / iptables / ip6tables-standalone.c
blobb7dfd179b42da8672293518091f64dcf036d153a
1 /*
2 * Author: Paul.Russell@rustcorp.com.au and mneuling@radlogic.com.au
4 * (C) 2000-2002 by the netfilter coreteam <coreteam@netfilter.org>:
5 * Paul 'Rusty' Russell <rusty@rustcorp.com.au>
6 * Marc Boucher <marc+nf@mbsi.ca>
7 * James Morris <jmorris@intercode.com.au>
8 * Harald Welte <laforge@gnumonks.org>
9 * Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
11 * Based on the ipchains code by Paul Russell and Michael Neuling
13 * iptables -- IP firewall administration for kernels with
14 * firewall table (aimed for the 2.3 kernels)
16 * See the accompanying manual page iptables(8) for information
17 * about proper usage of this program.
19 * This program is free software; you can redistribute it and/or modify
20 * it under the terms of the GNU General Public License as published by
21 * the Free Software Foundation; either version 2 of the License, or
22 * (at your option) any later version.
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
29 * You should have received a copy of the GNU General Public License
30 * along with this program; if not, write to the Free Software
31 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
34 #include <stdio.h>
35 #include <stdlib.h>
36 #include <errno.h>
37 #include <ip6tables.h>
39 #ifdef IPTABLES_MULTI
40 int
41 ip6tables_main(int argc, char *argv[])
42 #else
43 int
44 main(int argc, char *argv[])
45 #endif
47 int ret;
48 char *table = "filter";
49 ip6tc_handle_t handle = NULL;
51 program_name = "ip6tables";
52 program_version = IPTABLES_VERSION;
54 lib_dir = getenv("IP6TABLES_LIB_DIR");
55 if (!lib_dir)
56 lib_dir = IP6T_LIB_DIR;
58 #ifdef NO_SHARED_LIBS
59 init_extensions();
60 #endif
62 ret = do_command6(argc, argv, &table, &handle);
63 if (ret)
64 ret = ip6tc_commit(&handle);
66 if (!ret)
67 fprintf(stderr, "ip6tables: %s\n",
68 ip6tc_strerror(errno));
70 exit(!ret);