From patchwork Tue Mar 15 14:41:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venkatesh Vivekanandan X-Patchwork-Id: 63883 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp713263lbc; Tue, 15 Mar 2016 07:51:11 -0700 (PDT) X-Received: by 10.140.28.54 with SMTP id 51mr37905553qgy.36.1458053471771; Tue, 15 Mar 2016 07:51:11 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id d126si26752603qkb.84.2016.03.15.07.51.11; Tue, 15 Mar 2016 07:51:11 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 042D062FC6; Tue, 15 Mar 2016 14:51:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 1D1B862FD4; Tue, 15 Mar 2016 14:49:58 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id F311462FD6; Tue, 15 Mar 2016 14:49:29 +0000 (UTC) Received: from mail-gw3-out.broadcom.com (mail-gw3-out.broadcom.com [216.31.210.64]) by lists.linaro.org (Postfix) with ESMTP id 7A6EC62F70 for ; Tue, 15 Mar 2016 14:42:02 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.24,339,1455004800"; d="scan'208";a="90125512" Received: from mail-irv-18.broadcom.com ([10.15.198.37]) by mail-gw3-out.broadcom.com with ESMTP; 15 Mar 2016 07:48:21 -0700 Received: from mail-irva-13.broadcom.com (mail-irva-13.broadcom.com [10.11.16.103]) by mail-irv-18.broadcom.com (Postfix) with ESMTP id E1DB482026; Tue, 15 Mar 2016 07:42:01 -0700 (PDT) Received: from apslabuser-PowerEdge-T610.ban.broadcom.com (unknown [10.131.60.56]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id DBE2A40FE9; Tue, 15 Mar 2016 07:41:37 -0700 (PDT) From: venkatesh.vivekanandan@linaro.org To: lng-odp@lists.linaro.org Date: Tue, 15 Mar 2016 20:11:57 +0530 Message-Id: <1458052917-28501-1-git-send-email-venkatesh.vivekanandan@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCH v3 2/6] linux-generic: odp-ipfw: Initial changes to compile ipfw in odp X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Venkatesh Vivekanandan - created example/ipfw/ipfw/Makefile.am - changes done in example/m4/configure.m4 to accommodate odp_ipfw - odp_ipfw is to create rules in userspace. All packets that pass the rule will be sent out on another interface and dropped otherwise. Default rule is to accept all the packets. Signed-off-by: Venkatesh Vivekanandan --- example/Makefile.am | 3 ++- example/ipfw/ipfw/Makefile.am | 43 +++++++++++++++++++++++++++++++++++++++++++ example/m4/configure.m4 | 3 ++- 3 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 example/ipfw/ipfw/Makefile.am diff --git a/example/Makefile.am b/example/Makefile.am index 2d425c6..33556da 100644 --- a/example/Makefile.am +++ b/example/Makefile.am @@ -1 +1,2 @@ -SUBDIRS = classifier generator ipsec packet time timer traffic_mgmt l2fwd_simple +SUBDIRS = classifier generator ipsec packet time timer traffic_mgmt \ + l2fwd_simple ipfw/ipfw diff --git a/example/ipfw/ipfw/Makefile.am b/example/ipfw/ipfw/Makefile.am new file mode 100644 index 0000000..a6759e3 --- /dev/null +++ b/example/ipfw/ipfw/Makefile.am @@ -0,0 +1,43 @@ +#include $(top_srcdir)/example/Makefile.inc + +OBJDIR=objs +# ipfw and uipfw are built in subdirs +INCDIRS = -I ../$(OBJDIR)/include_e -DEMULATE_SYSCTL +INCDIRS += -I ../sys -I ../extra/sys -I ../extra/sys/contrib/pf + +OBJPATH = ./$(OBJDIR) + +E_CFLAGS = $(INCDIRS) +E_CFLAGS += -include ../extra/glue.h # headers +E_CFLAGS += -include ../extra/missing.h # headers +E_CFLAGS += -O2 -Wall -Werror +E_CFLAGS += -fno-strict-aliasing +E_CFLAGS += -Wno-pointer-arith + +E_CFLAGS += -DUSERSPACE # communicate through userspace +E_CFLAGS += -D__BSD_VISIBLE +E_CFLAGS += -DNEED_STRTONUM -DNEED_SYSCTLBYNAME -DNEED_ROUNDUP2 +E_CFLAGS += -DNEED_SIN_LEN +E_CFLAGS += -Wno-unused-but-set-variable +E_CFLAGS += -Wno-unused + +AM_CFLAGS = $(E_CFLAGS) + +AM_LDFLAGS += -lutil + +bin_PROGRAMS = odp_ipfw$(EXEEXT) +odp_ipfw_LDFLAGS = $(AM_LDFLAGS) -static +odp_ipfw_CFLAGS = $(AM_CFLAGS) -I${top_srcdir}/example + +noinst_HEADERS = \ + $(top_srcdir)/example/example_debug.h + +dist_odp_ipfw_SOURCES = altq.c \ + dummynet.c \ + ipfw2.c \ + ipv6.c \ + main.c \ + tables.c \ + ../extra/expand_number.c \ + ../extra/glue.c \ + ../extra/humanize_number.c diff --git a/example/m4/configure.m4 b/example/m4/configure.m4 index 74869ff..ebe38ec 100644 --- a/example/m4/configure.m4 +++ b/example/m4/configure.m4 @@ -6,4 +6,5 @@ AC_CONFIG_FILES([example/classifier/Makefile example/time/Makefile example/timer/Makefile example/traffic_mgmt/Makefile - example/l2fwd_simple/Makefile]) + example/l2fwd_simple/Makefile + example/ipfw/ipfw/Makefile])