From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arturo Borrero Gonzalez Subject: [ebtables-compat PATCH v3] ebtables-compat: add mark target extension Date: Tue, 03 Feb 2015 16:29:35 +0100 Message-ID: <20150203152829.24689.98604.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]:59656 "EHLO smtp.cica.es" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965954AbbBCP3r (ORCPT ); Tue, 3 Feb 2015 10:29:47 -0500 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 --- v2: address comments by Pablo: delete some macros and split long line. Also, include cached kernel header. v3: check for mark_supplied in final_check(). Minor cosmetic changes. extensions/libebt_mark.c | 191 +++++++++++++++++++++++++++ include/linux/netfilter_bridge/ebt_mark_t.h | 23 +++ iptables/nft-bridge.h | 53 +++++++ iptables/xtables-eb.c | 57 ++------ 4 files changed, 284 insertions(+), 40 deletions(-) create mode 100644 extensions/libebt_mark.c create mode 100644 include/linux/netfilter_bridge/ebt_mark_t.h diff --git a/extensions/libebt_mark.c b/extensions/libebt_mark.c new file mode 100644 index 0000000..587b4a6 --- /dev/null +++ b/extensions/libebt_mark.c @@ -0,0 +1,191 @@ +/* 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 + * -