From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arturo Borrero Gonzalez Subject: [ebtables-compat PATCH 2/2] ebtables-compat: add mark target extension Date: Thu, 29 Jan 2015 17:44:39 +0100 Message-ID: <20150129164439.21224.8860.stgit@nfdev.cica.es> References: <20150129164433.21224.14657.stgit@nfdev.cica.es> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: pablo@netfilter.org To: netfilter-devel@vger.kernel.org Return-path: Received: from smtp4.cica.es ([150.214.5.182]:42328 "EHLO smtp.cica.es" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754248AbbA2Qov (ORCPT ); Thu, 29 Jan 2015 11:44:51 -0500 In-Reply-To: <20150129164433.21224.14657.stgit@nfdev.cica.es> Sender: netfilter-devel-owner@vger.kernel.org List-ID: Translate the mark target extension to the xtables-compat environment. Signed-off-by: Arturo Borrero Gonzalez --- extensions/libebt_mark.c | 187 ++++++++++++++++++++++++++++++++++++++++++++++ iptables/nft-bridge.c | 2 iptables/nft-bridge.h | 52 +++++++++++++ iptables/xtables-eb.c | 52 +++---------- 4 files changed, 253 insertions(+), 40 deletions(-) create mode 100644 extensions/libebt_mark.c diff --git a/extensions/libebt_mark.c b/extensions/libebt_mark.c new file mode 100644 index 0000000..97039ba --- /dev/null +++ b/extensions/libebt_mark.c @@ -0,0 +1,187 @@ +/* ebt_mark + * + * Authors: + * Bart De Schuymer + * + * July, 2002, September 2006 + * + * Adapted by Arturo Borrero Gonzalez + * to use libxtables for ebtables-compat in 2015. + */ + +#include +#include +#include +#include +#include +#include +#include "iptables/nft.h" +#include "iptables/nft-bridge.h" + +static int mark_supplied; + +#define MARK_TARGET '1' +#define MARK_SETMARK '2' +#define MARK_ORMARK '3' +#define MARK_ANDMARK '4' +#define MARK_XORMARK '5' +static struct option brmark_opts[] = { + { .name = "mark-target",.has_arg = true, .val = MARK_TARGET }, + /* an oldtime messup, we should have always used the scheme + * -