Blame iptables/xtables-arp-standalone.c

Packit 7b22a4
/*
Packit 7b22a4
 * Author: Paul.Russell@rustcorp.com.au and mneuling@radlogic.com.au
Packit 7b22a4
 *
Packit 7b22a4
 * Based on the ipchains code by Paul Russell and Michael Neuling
Packit 7b22a4
 *
Packit 7b22a4
 * (C) 2000-2002 by the netfilter coreteam <coreteam@netfilter.org>:
Packit 7b22a4
 * 		    Paul 'Rusty' Russell <rusty@rustcorp.com.au>
Packit 7b22a4
 * 		    Marc Boucher <marc+nf@mbsi.ca>
Packit 7b22a4
 * 		    James Morris <jmorris@intercode.com.au>
Packit 7b22a4
 * 		    Harald Welte <laforge@gnumonks.org>
Packit 7b22a4
 * 		    Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Packit 7b22a4
 *
Packit 7b22a4
 *	arptables -- IP firewall administration for kernels with
Packit 7b22a4
 *	firewall table (aimed for the 2.3 kernels)
Packit 7b22a4
 *
Packit 7b22a4
 *	See the accompanying manual page arptables(8) for information
Packit 7b22a4
 *	about proper usage of this program.
Packit 7b22a4
 *
Packit 7b22a4
 *	This program is free software; you can redistribute it and/or modify
Packit 7b22a4
 *	it under the terms of the GNU General Public License as published by
Packit 7b22a4
 *	the Free Software Foundation; either version 2 of the License, or
Packit 7b22a4
 *	(at your option) any later version.
Packit 7b22a4
 *
Packit 7b22a4
 *	This program is distributed in the hope that it will be useful,
Packit 7b22a4
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 7b22a4
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 7b22a4
 *	GNU General Public License for more details.
Packit 7b22a4
 *
Packit 7b22a4
 *	You should have received a copy of the GNU General Public License
Packit 7b22a4
 *	along with this program; if not, write to the Free Software
Packit 7b22a4
 *	Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Packit 7b22a4
 */
Packit 7b22a4
Packit 7b22a4
#include <stdio.h>
Packit 7b22a4
#include <stdlib.h>
Packit 7b22a4
#include <errno.h>
Packit 7b22a4
#include <string.h>
Packit 7b22a4
#include <xtables.h>
Packit 7b22a4
#include "nft.h"
Packit 7b22a4
#include <linux/netfilter_arp/arp_tables.h>
Packit 7b22a4
Packit 7b22a4
#include "xtables-multi.h"
Packit 7b22a4
Packit 7b22a4
extern struct xtables_globals arptables_globals;
Packit 7b22a4
Packit 7b22a4
int xtables_arp_main(int argc, char *argv[])
Packit 7b22a4
{
Packit 7b22a4
	int ret;
Packit 7b22a4
	char *table = "filter";
Packit 7b22a4
	struct nft_handle h;
Packit 7b22a4
Packit 7b22a4
	nft_init_arp(&h, "arptables");
Packit 7b22a4
Packit 7b22a4
	ret = do_commandarp(&h, argc, argv, &table, false);
Packit 7b22a4
	if (ret)
Packit 7b22a4
		ret = nft_commit(&h);
Packit 7b22a4
Packit 7b22a4
	nft_fini(&h);
Packit 7b22a4
Packit 7b22a4
	if (!ret)
Packit 7b22a4
		fprintf(stderr, "arptables: %s\n", nft_strerror(errno));
Packit 7b22a4
Packit 7b22a4
	exit(!ret);
Packit 7b22a4
}