From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pablo Neira Ayuso Subject: Re: [PATCH 2/3] Add MARK target for arptables Date: Wed, 11 Feb 2015 00:18:52 +0100 Message-ID: <20150210231852.GA3715@salvia> References: <1423207590-13423-1-git-send-email-gaofeng@cn.fujitsu.com> <1423207590-13423-2-git-send-email-gaofeng@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netfilter-devel@vger.kernel.org To: Gao feng Return-path: Received: from mail.us.es ([193.147.175.20]:41208 "EHLO mail.us.es" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751242AbbBJXPm (ORCPT ); Tue, 10 Feb 2015 18:15:42 -0500 Content-Disposition: inline In-Reply-To: <1423207590-13423-2-git-send-email-gaofeng@cn.fujitsu.com> Sender: netfilter-devel-owner@vger.kernel.org List-ID: On Fri, Feb 06, 2015 at 03:26:29PM +0800, Gao feng wrote: > We can use MARK target to set make value for > arp packet. > > Signed-off-by: Gao feng > --- > extensions/Makefile | 2 +- > extensions/arpt_MARK.c | 119 +++++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 120 insertions(+), 1 deletion(-) > create mode 100644 extensions/arpt_MARK.c > > diff --git a/extensions/Makefile b/extensions/Makefile > index 09b244e..0189cc9 100644 > --- a/extensions/Makefile > +++ b/extensions/Makefile > @@ -1,6 +1,6 @@ > #! /usr/bin/make > > -EXT_FUNC+=standard mangle CLASSIFY > +EXT_FUNC+=standard mangle CLASSIFY MARK > EXT_OBJS+=$(foreach T,$(EXT_FUNC), extensions/arpt_$(T).o) > > extensions/ebt_%.o: extensions/arpt_%.c include/arptables.h include/arptables_common.h > diff --git a/extensions/arpt_MARK.c b/extensions/arpt_MARK.c > new file mode 100644 > index 0000000..ce24bdb > --- /dev/null > +++ b/extensions/arpt_MARK.c > @@ -0,0 +1,119 @@ > +/* > + * (C) 2015 by Gao feng > + * > + * arpt_MARK.c -- arptables extension to set mark for arp packet > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License as published by > + * the Free Software Foundation; either version 2 of the License, or > + * (at your option) any later version. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, write to the Free Software > + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. > + */ > + > +#include > +#include > +#include > +#include > +#include > + > +static void > +help(void) > +{ > + printf( > +"MARK target v%s options:\n" > +"--set-mark mark : set the mark value\n", > + ARPTABLES_VERSION); > +} > + > +#define MARK_OPT 1 > + > +static struct option opts[] = { > + { "set-mark" , required_argument, 0, MARK_OPT }, > + {0} Please, add all options that MARK support according to man iptables-extensions.