All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [RFC v1 1/2] package/iptables: add option to enabel libipq build
@ 2021-06-20 20:56 Peter Seiderer
  2021-06-20 20:56 ` [Buildroot] [RFC v1 2/2] package/nrlsmf: new package Peter Seiderer
  2021-07-25 19:57 ` [Buildroot] [RFC v1 1/2] package/iptables: add option to enabel libipq build Thomas Petazzoni
  0 siblings, 2 replies; 4+ messages in thread
From: Peter Seiderer @ 2021-06-20 20:56 UTC (permalink / raw)
  To: buildroot

- add option to enable libipq build
- as libipq.h includes linux/netfilter_ipv4/ip_queue.h install (not
  provided by modern kernels otherwise?)

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
 package/iptables/Config.in   |  5 +++++
 package/iptables/iptables.mk | 10 ++++++++++
 2 files changed, 15 insertions(+)

diff --git a/package/iptables/Config.in b/package/iptables/Config.in
index e6b12603e0..0aacf06c03 100644
--- a/package/iptables/Config.in
+++ b/package/iptables/Config.in
@@ -7,6 +7,11 @@ config BR2_PACKAGE_IPTABLES
 
 if BR2_PACKAGE_IPTABLES
 
+config BR2_PACKAGE_IPTABLES_LIBIPQ
+	bool "libipq"
+	help
+	  Build libipq.
+
 config BR2_PACKAGE_IPTABLES_BPF_NFSYNPROXY
 	bool "bpfc and nfsynproxy"
 	select BR2_PACKAGE_LIBPCAP
diff --git a/package/iptables/iptables.mk b/package/iptables/iptables.mk
index ca8178425e..227b485d43 100644
--- a/package/iptables/iptables.mk
+++ b/package/iptables/iptables.mk
@@ -29,6 +29,16 @@ ifeq ($(BR2_PACKAGE_LIBNFNETLINK),y)
 IPTABLES_DEPENDENCIES += libnfnetlink
 endif
 
+ifeq ($(BR2_PACKAGE_IPTABLES_LIBIPQ),y)
+IPTABLES_CONF_OPTS += --enable-libipq
+define IPTABLES_INSTALL_LIBIPQ_HEADERS_CMD
+	$(INSTALL) -m 0644 -D $(@D)/include/linux/netfilter_ipv4/ip_queue.h $(STAGING_DIR)/usr/include/linux/netfilter_ipv4/ip_queue.h
+endef
+IPTABLES_POST_INSTALL_STAGING_HOOKS += IPTABLES_INSTALL_LIBIPQ_HEADERS_CMD
+else
+IPTABLES_CONF_OPTS += --disable-libipq
+endif
+
 # For iptables-compat tools
 ifeq ($(BR2_PACKAGE_IPTABLES_NFTABLES),y)
 IPTABLES_CONF_OPTS += --enable-nftables
-- 
2.31.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [RFC v1 2/2] package/nrlsmf: new package
  2021-06-20 20:56 [Buildroot] [RFC v1 1/2] package/iptables: add option to enabel libipq build Peter Seiderer
@ 2021-06-20 20:56 ` Peter Seiderer
  2021-07-25 19:57 ` [Buildroot] [RFC v1 1/2] package/iptables: add option to enabel libipq build Thomas Petazzoni
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Seiderer @ 2021-06-20 20:56 UTC (permalink / raw)
  To: buildroot

- use src-nrlsmf-with-protolib-1.1b2a.tgz download (instead of plain
  git one) with bundled protolib as nrlsmf does not compile with an
  up to date protolib version

- needs thread support (pthread.h)

- select BR2_PACKAGE_IPTABLES_LIBIPQ to gain access to
  header linux/netfilter_ipv4/ip_queue.h

- overwrite CFLAGS to re-add nrlsmf specific include paths and
  defines (taken from unix/Makefile.common and unix/Makefile.linux)

- add -fpmerissive to avoid build error

- overwrite SYSTEM_LIBS to avoid libpcap linking

- overwrite CC to link usign g++ (instead of gcc, fixes linking
  error because of missing C++ libs)

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
 DEVELOPERS                 |  1 +
 package/Config.in          |  1 +
 package/nrlsmf/Config.in   | 15 ++++++++++++++
 package/nrlsmf/nrlsmf.hash |  3 +++
 package/nrlsmf/nrlsmf.mk   | 42 ++++++++++++++++++++++++++++++++++++++
 5 files changed, 62 insertions(+)
 create mode 100644 package/nrlsmf/Config.in
 create mode 100644 package/nrlsmf/nrlsmf.hash
 create mode 100644 package/nrlsmf/nrlsmf.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index f6621e9670..2761d6ccfa 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2148,6 +2148,7 @@ F:	package/iwd/
 F:	package/libevdev/
 F:	package/libuev/
 F:	package/log4cplus/
+F:	package/nrlsmf/
 F:	package/postgresql/
 F:	package/python-colorzero/
 F:	package/python-flask-wtf/
diff --git a/package/Config.in b/package/Config.in
index cb8ece4919..c340ae515f 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2232,6 +2232,7 @@ endif
 	source "package/nload/Config.in"
 	source "package/nmap/Config.in"
 	source "package/noip/Config.in"
+	source "package/nrlsmf/Config.in"
 	source "package/ntp/Config.in"
 	source "package/nuttcp/Config.in"
 	source "package/odhcp6c/Config.in"
diff --git a/package/nrlsmf/Config.in b/package/nrlsmf/Config.in
new file mode 100644
index 0000000000..61feba2ef6
--- /dev/null
+++ b/package/nrlsmf/Config.in
@@ -0,0 +1,15 @@
+config BR2_PACKAGE_NRLSMF
+	bool "nrlsmf"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	select BR2_PACKAGE_IPTABLES
+	select BR2_PACKAGE_IPTABLES_LIBIPQ # header linux/netfilter_ipv4/ip_queue.h
+	help
+	  The NRL Simplified Multicast Forwarding (nrlsmf) project is a
+	  user-space software implementation of the forwarding engine
+	  for Simplified Multicast Forwarding (SMF, RFC 6621).
+
+	  https://www.nrl.navy.mil/Our-Work/Areas-of-Research/Information-Technology/NCS/SMF
+
+comment "nrlsmf needs a toolchain w/ C++, threads"
+	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS
diff --git a/package/nrlsmf/nrlsmf.hash b/package/nrlsmf/nrlsmf.hash
new file mode 100644
index 0000000000..9d066c6f0c
--- /dev/null
+++ b/package/nrlsmf/nrlsmf.hash
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256  d72f0ea8d12d19ee30cbbbf96bcfc9d5f57c4e2d11fe0e336a4e8005fef7c5b0  src-nrlsmf-with-protolib-1.1b2a.tgz
+sha256  8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903  COPYING
diff --git a/package/nrlsmf/nrlsmf.mk b/package/nrlsmf/nrlsmf.mk
new file mode 100644
index 0000000000..554291c880
--- /dev/null
+++ b/package/nrlsmf/nrlsmf.mk
@@ -0,0 +1,42 @@
+################################################################################
+#
+# nrlsmf
+#
+################################################################################
+
+NRLSMF_VERSION = 1.1b2a
+#NRLSMF_SITE = $(call github,USNavalResearchLaboratory,nrlsmf,v$(NRLSMF_VERSION))
+NRLSMF_SOURCE = src-nrlsmf-with-protolib-$(NRLSMF_VERSION).tgz
+NRLSMF_SITE = https://github.com/USNavalResearchLaboratory/nrlsmf/releases/download/v$(NRLSMF_VERSION)
+NRLSMF_LICENSE = BSD-2-Clause (protolib)
+NRLSMF_DEPENDENCIES = iptables
+
+NRLSMF_CFLAGS = \
+	-I$(@D)/unix \
+	-I$(@D)/common \
+	-I$(@D)/protolib/common \
+	-I$(@D)/protolib/manet \
+	-DMNE_SUPPORT \
+	-DUNIX \
+	-DLINUX \
+	-DHAVE_IPV6 \
+	-DHAVE_GETLOGIN \
+	-DHAVE_LOCKF \
+	-DHAVE_OLD_SIGNALHANDLER \
+	-DHAVE_DIRFD \
+	-DHAVE_ASSERT \
+	-DNO_SCM_RIGHTS \
+	-DHAVE_SCHED \
+	-fpermissive
+
+define NRLSMF_BUILD_CMDS
+	$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)/unix -f Makefile.linux \
+		CFLAGS="$(NRLSMF_TARGET_CFLAGS) $(NRLSMF_CFLAGS)" \
+		CC="$(TARGET_CXX)" SYSTEM_LIBS="-ldl" all
+endef
+
+define NRLSMF_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/unix/nrlsmf $(TARGET_DIR)/usr/bin/nrlsmf
+endef
+
+$(eval $(generic-package))
-- 
2.31.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [RFC v1 1/2] package/iptables: add option to enabel libipq build
  2021-06-20 20:56 [Buildroot] [RFC v1 1/2] package/iptables: add option to enabel libipq build Peter Seiderer
  2021-06-20 20:56 ` [Buildroot] [RFC v1 2/2] package/nrlsmf: new package Peter Seiderer
@ 2021-07-25 19:57 ` Thomas Petazzoni
  2021-07-27 20:52   ` Peter Seiderer
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2021-07-25 19:57 UTC (permalink / raw)
  To: Peter Seiderer; +Cc: buildroot

On Sun, 20 Jun 2021 22:56:06 +0200
Peter Seiderer <ps.report@gmx.net> wrote:

> - add option to enable libipq build
> - as libipq.h includes linux/netfilter_ipv4/ip_queue.h install (not
>   provided by modern kernels otherwise?)
> 
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>

Is it really a good idea to add an option for this library?

Debian dropped installing libipq 5 years ago, as this library is
deprecated:

  https://salsa.debian.org/pkg-netfilter-team/pkg-iptables/-/commit/bf21537d27ee72cc69ca0883059b315ceaf9737d

Also in 2012, iptables developers said they would keep this library for
1.5-2 years:

  https://git.netfilter.org/iptables/commit/?id=a624e0a1b2d075253b599ababd4ea1351ef42b2a

But then, when I look at the nrlsmf source code, I don't see any
reference to libipq or ip_queue.h. Am I missing something ?

Thanks,

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [RFC v1 1/2] package/iptables: add option to enabel libipq build
  2021-07-25 19:57 ` [Buildroot] [RFC v1 1/2] package/iptables: add option to enabel libipq build Thomas Petazzoni
@ 2021-07-27 20:52   ` Peter Seiderer
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Seiderer @ 2021-07-27 20:52 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: buildroot

Hello Thomas,

On Sun, 25 Jul 2021 21:57:56 +0200, Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:

> On Sun, 20 Jun 2021 22:56:06 +0200
> Peter Seiderer <ps.report@gmx.net> wrote:
>
> > - add option to enable libipq build
> > - as libipq.h includes linux/netfilter_ipv4/ip_queue.h install (not
> >   provided by modern kernels otherwise?)
> >
> > Signed-off-by: Peter Seiderer <ps.report@gmx.net>
>
> Is it really a good idea to add an option for this library?
>
> Debian dropped installing libipq 5 years ago, as this library is
> deprecated:
>
>   https://salsa.debian.org/pkg-netfilter-team/pkg-iptables/-/commit/bf21537d27ee72cc69ca0883059b315ceaf9737d
>
> Also in 2012, iptables developers said they would keep this library for
> 1.5-2 years:
>
>   https://git.netfilter.org/iptables/commit/?id=a624e0a1b2d075253b599ababd4ea1351ef42b2a

Did the patch as part of porting an custom (very ancient ubuntu based) project
to up-to-date buildroot, but hope to get rid of all legacy dependencies on the
long run..., no problem with dropping this patch...

>
> But then, when I look at the nrlsmf source code, I don't see any
> reference to libipq or ip_queue.h. Am I missing something ?

File smf-1.1b2/protolib/unix/linuxDetour.cpp:
 15 #include <linux/netfilter_ipv4/ip_queue.h>

Mhhh, maybe I mistake it because of the ip_queue.h file found in libipq...

No problem dropping this patch, see above ;-)

Regards,
Peter

>
> Thanks,
>
> Thomas

_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-07-27 20:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-20 20:56 [Buildroot] [RFC v1 1/2] package/iptables: add option to enabel libipq build Peter Seiderer
2021-06-20 20:56 ` [Buildroot] [RFC v1 2/2] package/nrlsmf: new package Peter Seiderer
2021-07-25 19:57 ` [Buildroot] [RFC v1 1/2] package/iptables: add option to enabel libipq build Thomas Petazzoni
2021-07-27 20:52   ` Peter Seiderer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.