@@ -1,2 +1,2 @@
SUBDIRS = classifier generator ipsec packet time timer traffic_mgmt \
- l2fwd_simple ipfw/ipfw
+ l2fwd_simple ipfw/ipfw ipfw
new file mode 100644
@@ -0,0 +1,111 @@
+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 -I../../include
+# ODP specific start
+INCDIRS += -I$(top_srcdir)/test \
+ -I$(top_srcdir)/platform/@with_platform@/include \
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/helper/include
+# ODP specific end
+
+
+OBJPATH = ./$(OBJDIR)
+
+# EFILES* are the dummy files created to avoid compilation errors.
+# Please refer Makefile.kipfw available at
+# https://github.com/luigirizzo/netmap-ipfw.git
+
+#EFILES_. = libutil.h
+#EFILES_sys = condvar.h priv.h _lock.h cpuset.h
+#EFILES_sys += lock.h ucred.h # taskqueue.h
+#EFILES_sys += sockio.h
+#EFILES_sys += cpuset.h
+#EFILES_machine = in_cksum.h
+#EFILES_netinet = in_pcb.h ip_carp.h pim.h sctp.h tcp_var.h
+#EFILES_net = if_types.h bpf.h netisr.h vnet.h
+#EFILES_linux = module.h
+
+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-variadic-macros
+E_CFLAGS += -Wno-pointer-arith
+E_CFLAGS += -g
+E_CFLAGS += -DKERNEL_SIDE # build the kernel side of the firewall
+E_CFLAGS += -DUSERSPACE # communicate through userspace
+E_CFLAGS += -DINET
+E_CFLAGS += -DIPFIREWALL_DEFAULT_TO_ACCEPT
+E_CFLAGS += -D_BSD_SOURCE
+E_CFLAGS += -D_DEFAULT_SOURCE # on glibc 2.20 and above
+# many of the kernel headers need _KERNEL
+E_CFLAGS += -D_KERNEL
+E_CFLAGS += -D__BSD_VISIBLE
+E_CFLAGS += -D_GNU_SOURCE # ffsl
+E_CFLAGS += -DNEED_SIN_LEN
+E_CFLAGS += -include ./extra/linux_defs.h
+E_CFLAGS += -Wno-unused-but-set-variable
+E_CFLAGS += -Wno-unused
+E_CFLAGS += -Dradix -DNEED_ROUNDUP2
+
+#ipfw + dummynet section, other parts are not compiled in
+SRCS_IPFW = sys/netpfil/ipfw/ip_fw2.c sys/netpfil/ipfw/ip_fw_pfil.c
+SRCS_IPFW += sys/netpfil/ipfw/ip_fw_sockopt.c
+SRCS_IPFW += sys/netpfil/ipfw/ip_fw_dynamic.c
+SRCS_IPFW += sys/netpfil/ipfw/ip_fw_table.c
+SRCS_IPFW += sys/netpfil/ipfw/ip_fw_log.c
+SRCS_IPFW += sys/netpfil/ipfw/ip_dummynet.c sys/netpfil/ipfw/ip_dn_io.c
+SRCS_IPFW += sys/netpfil/ipfw/ip_dn_glue.c
+SRCS_IPFW += sys/netpfil/ipfw/ip_fw_iface.c
+SRCS_IPFW += sys/netpfil/ipfw/ip_fw_table_algo.c
+SRCS_IPFW += sys/netpfil/ipfw/ip_fw_table_value.c
+SRCS_IPFW += sys/netpfil/ipfw/dn_heap.c
+SRCS_IPFW += sys/netpfil/ipfw/dn_sched_fifo.c
+SRCS_IPFW += sys/netpfil/ipfw/dn_sched_wf2q.c
+SRCS_IPFW += sys/netpfil/ipfw/dn_sched_rr.c
+SRCS_IPFW += sys/netpfil/ipfw/dn_sched_qfq.c
+SRCS_IPFW += sys/netpfil/ipfw/dn_sched_prio.c
+SRCS_NET = sys/net/radix.c
+SRCS_NETINET = sys/netinet/in_cksum.c
+# Module glue and functions missing in linux
+IPFW_SRCS = $(SRCS_IPFW) $(SRCS_NET) $(SRCS_NETINET)
+IPFW_SRCS += extra/ipfw2_mod.c # bsd_compat.c
+
+IPFW_SRCS += extra/missing.c extra/session.c
+
+# entries to create empty files
+#EFILES_. += opt_inet.h opt_ipsec.h opt_ipdivert.h
+#EFILES_. += opt_inet6.h opt_ipfw.h opt_mpath.h
+#EFILES_. += opt_mbuf_stress_test.h opt_param.h
+#EFILES_. += timeconv.h
+
+#EFILES_altq += if_altq.h
+
+#EFILES_net += if_var.h route.h if_clone.h
+#EFILES_netpfil/pf += pf_mtag.h
+#EFILES_netinet += in_var.h ip_var.h udp_var.h
+#EFILES_netinet6 += ip6_var.h
+#EFILES_sys += proc.h sockopt.h sysctl.h
+# new
+#EFILES_sys += mutex.h _mutex.h _rwlock.h rwlock.h
+#EFILES_sys += eventhandler.h
+#EFILES_sys += jail.h ktr.h rmlock.h
+#EFILES_sys += counter.h
+
+#EFILES_vm += vm.h vm_extern.h
+
+AM_CFLAGS = $(E_CFLAGS)
+AM_CFLAGS += -I$(top_srcdir)/platform/$(with_platform)/arch/$(ARCH)
+
+AM_LDFLAGS += ../../lib/.libs/libodp.a ../../lib/.libs/libodphelper.a -lpthread
+
+bin_PROGRAMS = odp_uipfw$(EXEEXT)
+odp_uipfw_LDFLAGS = $(AM_LDFLAGS) -static
+odp_uipfw_CFLAGS = $(AM_CFLAGS) -I${top_srcdir}/example
+
+noinst_HEADERS = \
+ $(top_srcdir)/example/example_debug.h
+
+dist_odp_uipfw_SOURCES = $(IPFW_SRCS)
@@ -7,4 +7,5 @@ AC_CONFIG_FILES([example/classifier/Makefile
example/timer/Makefile
example/traffic_mgmt/Makefile
example/l2fwd_simple/Makefile
- example/ipfw/ipfw/Makefile])
+ example/ipfw/ipfw/Makefile
+ example/ipfw/Makefile])