xref: /aosp_15_r20/external/iptables/iptables/xtables-eb-standalone.c (revision a71a954618bbadd4a345637e5edcf36eec826889)
1 /*
2  * Author: [email protected] and [email protected]
3  *
4  * Based on the ipchains code by Paul Russell and Michael Neuling
5  *
6  * (C) 2000-2002 by the netfilter coreteam <[email protected]>:
7  * 		    Paul 'Rusty' Russell <[email protected]>
8  * 		    Marc Boucher <[email protected]>
9  * 		    James Morris <[email protected]>
10  * 		    Harald Welte <[email protected]>
11  * 		    Jozsef Kadlecsik <[email protected]>
12  *
13  *	arptables -- IP firewall administration for kernels with
14  *	firewall table (aimed for the 2.3 kernels)
15  *
16  *	See the accompanying manual page arptables(8) for information
17  *	about proper usage of this program.
18  *
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.
23  *
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.
28  *
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.
32  */
33 
34 #include <stdio.h>
35 #include <stdlib.h>
36 #include <errno.h>
37 #include <string.h>
38 #include <xtables.h>
39 #include <iptables.h>
40 #include "nft.h"
41 
42 #include "xtables-multi.h"
43 
xtables_eb_main(int argc,char * argv[])44 int xtables_eb_main(int argc, char *argv[])
45 {
46 	int ret;
47 	char *table = "filter";
48 	struct nft_handle h;
49 
50 	nft_init_eb(&h, "ebtables");
51 
52 	ret = do_commandeb(&h, argc, argv, &table, false);
53 	if (ret)
54 		ret = nft_bridge_commit(&h);
55 
56 	nft_fini_eb(&h);
57 
58 	if (!ret)
59 		fprintf(stderr, "ebtables: %s\n", nft_strerror(errno));
60 
61 	exit(!ret);
62 }
63