Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Author: Paul.Russell@rustcorp.com.au and mneuling@radlogic.com.au |
| 3 | * |
| 4 | * Based on the ipchains code by Paul Russell and Michael Neuling |
| 5 | * |
| 6 | * iptables -- IP firewall administration for kernels with |
| 7 | * firewall table (aimed for the 2.3 kernels) |
| 8 | * |
| 9 | * See the accompanying manual page iptables(8) for information |
| 10 | * about proper usage of this program. |
| 11 | * |
| 12 | * This program is free software; you can redistribute it and/or modify |
| 13 | * it under the terms of the GNU General Public License as published by |
| 14 | * the Free Software Foundation; either version 2 of the License, or |
| 15 | * (at your option) any later version. |
| 16 | * |
| 17 | * This program is distributed in the hope that it will be useful, |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 20 | * GNU General Public License for more details. |
| 21 | * |
| 22 | * You should have received a copy of the GNU General Public License |
| 23 | * along with this program; if not, write to the Free Software |
| 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 25 | */ |
| 26 | |
| 27 | #include <stdio.h> |
Rusty Russell | db78047 | 2000-12-19 05:17:50 +0000 | [diff] [blame] | 28 | #include <stdlib.h> |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 29 | #include <errno.h> |
Harald Welte | d8e6563 | 2001-01-05 15:20:07 +0000 | [diff] [blame] | 30 | #include <string.h> |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 31 | #include <iptables.h> |
| 32 | |
| 33 | int |
| 34 | main(int argc, char *argv[]) |
| 35 | { |
| 36 | int ret; |
| 37 | char *table = "filter"; |
Rusty Russell | f7b062f | 2001-01-07 06:55:24 +0000 | [diff] [blame] | 38 | iptc_handle_t handle = NULL; |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 39 | |
| 40 | program_name = "iptables"; |
| 41 | program_version = NETFILTER_VERSION; |
| 42 | |
Harald Welte | 3efb6ea | 2001-08-06 18:50:21 +0000 | [diff] [blame] | 43 | #ifdef NO_SHARED_LIBS |
| 44 | init_extensions(); |
| 45 | #endif |
| 46 | |
Rusty Russell | f7b062f | 2001-01-07 06:55:24 +0000 | [diff] [blame] | 47 | ret = do_command(argc, argv, &table, &handle); |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 48 | if (ret) |
Rusty Russell | f7b062f | 2001-01-07 06:55:24 +0000 | [diff] [blame] | 49 | ret = iptc_commit(&handle); |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 50 | |
| 51 | if (!ret) |
| 52 | fprintf(stderr, "iptables: %s\n", |
| 53 | iptc_strerror(errno)); |
| 54 | |
| 55 | exit(!ret); |
| 56 | } |