This commit is contained in:
TriForceX
2019-09-25 20:51:37 -03:00
commit 6203ff3e7c
11215 changed files with 428258 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
Add definitions for IPCTL_FORWARDING and IP6CTL_FORWARDING.
Inspired from
http://svn.gnumonks.org/trunk/grouter/build/src/quagga/quagga/quagga-0.99.1-forward_sysctl-2.6.14.patch
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Index: quagga-0.99.16/zebra/ipforward_sysctl.c
===================================================================
--- quagga-0.99.16.orig/zebra/ipforward_sysctl.c 2010-06-20 23:40:45.000000000 +0200
+++ quagga-0.99.16/zebra/ipforward_sysctl.c 2010-06-20 23:41:37.000000000 +0200
@@ -31,6 +31,15 @@
#define MIB_SIZ 4
+/* Fix for recent (2.6.14) kernel headers */
+#ifndef IPCTL_FORWARDING
+#define IPCTL_FORWARDING NET_IPV4_FORWARD
+#endif
+
+#ifndef IP6CTL_FORWARDING
+#define IP6CTL_FORWARDING NET_IPV6_FORWARDING
+#endif
+
extern struct zebra_privs_t zserv_privs;
/* IPv4 forwarding control MIB. */

94
package/quagga/Config.in Normal file
View File

@@ -0,0 +1,94 @@
config BR2_PACKAGE_QUAGGA
bool "quagga"
depends on BR2_USE_MMU # fork()
help
Routing software suite, providing implementations of OSPFv2,
OSPFv3 (IPv6), RIP v1 and v2, RIPng (IPv6) and BGPv4+.
http://www.quagga.net/
if BR2_PACKAGE_QUAGGA
config BR2_PACKAGE_QUAGGA_ZEBRA
bool "zebra daemon"
help
Build zebra daemon.
config BR2_PACKAGE_QUAGGA_TCP_ZEBRA
bool "Use TCP sockets between zebra and protocol daemons"
depends on BR2_PACKAGE_QUAGGA_ZEBRA
help
Use a TCP socket to communicate between zebra (supervisor)
and the different protocol daemons.
You'll want this enabled if zebra and the protocol daemon(s)
run on different hosts.
config BR2_PACKAGE_QUAGGA_BGPD
bool "BGPv4+ protocol"
help
Build bgpd daemon.
config BR2_PACKAGE_QUAGGA_BGP_ANNOUNCE
bool "BGP route announcement"
depends on BR2_PACKAGE_QUAGGA_BGPD
config BR2_PACKAGE_QUAGGA_ISISD
bool "IS-IS protocol"
help
Enable isisd support in quagga.
config BR2_PACKAGE_QUAGGA_NHRPD
bool "NHRPD protocol"
select BR2_PACKAGE_C_ARES
help
Build Next Hop Routing Protocol daemon.
config BR2_PACKAGE_QUAGGA_OSPFD
bool "OSPFv2 protocol"
help
Build ospfd daemon.
config BR2_PACKAGE_QUAGGA_OSPF6D
bool "OSPFv3 (IPv6) protocol"
help
Build ospf6d daemon.
config BR2_PACKAGE_QUAGGA_RIPD
bool "RIPv2/v3 protocol"
help
Build ripd daemon.
config BR2_PACKAGE_QUAGGA_RIPNGD
bool "RIPng (IPv6) protocol"
help
Build ripngd daemon.
config BR2_PACKAGE_QUAGGA_PIMD
bool "PIMd protocol"
help
Provides IPv4 PIM-SSM multicast routing.
config BR2_PACKAGE_QUAGGA_WATCHQUAGGA
bool "Build watchquagga"
help
Build and install watchquagga, a zebra/protocol daemon
supervisor.
config BR2_PACKAGE_QUAGGA_VTYSH
bool "Build vtysh"
select BR2_PACKAGE_READLINE
help
Build and install vtysh, a vty shell for Quagga.
config BR2_PACKAGE_QUAGGA_SNMP
bool "SNMP support"
depends on BR2_USE_MMU # net-snmp
select BR2_PACKAGE_NETSNMP
help
Make quagga information available via SNMP SMUX.
comment "AgentX support must be enabled in net-snmp or the build will break"
depends on BR2_PACKAGE_QUAGGA_SNMP
endif

View File

@@ -0,0 +1,5 @@
# Locally calculated after checking pgp signature
sha256 e364c082c3309910e1eb7b068bf39ee298e2f2f3f31a6431a5c115193bd653d3 quagga-1.2.4.tar.gz
# Hash for license file
sha256 b39c1bad4e51e2a3389cd25fc4addebe41a3ae7c11100795683f9330de1536e5 COPYING

107
package/quagga/quagga.mk Normal file
View File

@@ -0,0 +1,107 @@
################################################################################
#
# quagga
#
################################################################################
QUAGGA_VERSION = 1.2.4
QUAGGA_SITE = http://download.savannah.gnu.org/releases/quagga
QUAGGA_DEPENDENCIES = host-gawk host-pkgconf
QUAGGA_LICENSE = GPL-2.0+
QUAGGA_LICENSE_FILES = COPYING
# We need to override the sysconf and localstate directories so that
# quagga can create files as the quagga user without extra
# intervention
QUAGGA_CONF_OPTS = \
--program-transform-name='' \
--sysconfdir=/etc/quagga \
--localstatedir=/var/run/quagga
# quagga has its own internal copy of getopt_long. To avoid conflicts with libc's
# getopt, we need to make sure that the getopt function itself is also built.
QUAGGA_CONF_ENV = \
CFLAGS="$(TARGET_CFLAGS) -DREALLY_NEED_PLAIN_GETOPT"
ifeq ($(BR2_PACKAGE_LIBCAP),y)
QUAGGA_CONF_OPTS += --enable-capabilities
QUAGGA_DEPENDENCIES += libcap
else
QUAGGA_CONF_OPTS += --disable-capabilities
endif
ifeq ($(BR2_PACKAGE_PROTOBUF_C),y)
QUAGGA_CONF_OPTS += --enable-protobuf
QUAGGA_DEPENDENCIES += protobuf-c
else
QUAGGA_CONF_OPTS += --disable-protobuf
endif
QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_ZEBRA),--enable-zebra,--disable-zebra)
QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_BGPD),--enable-bgpd,--disable-bgpd)
QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_RIPD),--enable-ripd,--disable-ripd)
QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_RIPNGD),--enable-ripngd,--disable-ripngd)
QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_OSPFD),--enable-ospfd,--disable-ospfd --disable-ospfapi)
QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_OSPF6D),--enable-ospf6d,--disable-ospf6d)
QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_PIMD),--enable-pimd,--disable-pimd)
QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_WATCHQUAGGA),--enable-watchquagga,--disable-watchquagga)
QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_ISISD),--enable-isisd,--disable-isisd)
QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_BGP_ANNOUNCE),--enable-bgp-announce,--disable-bgp-announce)
QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_TCP_ZEBRA),--enable-tcp-zebra,--disable-tcp-zebra)
define QUAGGA_USERS
quagga -1 quagga -1 * - - - Quagga priv drop user
endef
# Set the permissions of /etc/quagga such that quagga (through vtysh)
# can save the configuration - set the folder recursively as the files
# need to be 600, and then set the folder (non-recursively) to 755 so
# it can used. Quagga also needs to write to the folder as it moves
# and creates, rather than overwriting.
define QUAGGA_PERMISSIONS
/etc/quagga r 600 quagga quagga - - - - -
/etc/quagga d 755 quagga quagga - - - - -
endef
# In order for the QUAGGA_PERMISSIONS variable above to work,
# /etc/quagga has to exist. However, this package without any
# sub-option enabled will not create /etc/quagga, so let's create it
# unconditionally in a post-install hook, in case it hasn't been
# already created by the quagga installation.
define QUAGGA_CREATE_ETC_QUAGGA
mkdir -p $(TARGET_DIR)/etc/quagga
endef
QUAGGA_POST_INSTALL_TARGET_HOOKS += QUAGGA_CREATE_ETC_QUAGGA
ifeq ($(BR2_PACKAGE_QUAGGA_NHRPD),y)
QUAGGA_CONF_OPTS += --enable-nhrpd
QUAGGA_DEPENDENCIES += c-ares
else
QUAGGA_CONF_OPTS += --disable-nhrpd
endif
ifeq ($(BR2_PACKAGE_QUAGGA_SNMP),y)
QUAGGA_CONF_ENV += ac_cv_path_NETSNMP_CONFIG=$(STAGING_DIR)/usr/bin/net-snmp-config
QUAGGA_CONF_OPTS += --enable-snmp=agentx
QUAGGA_DEPENDENCIES += netsnmp
endif
ifeq ($(BR2_PACKAGE_QUAGGA_VTYSH),y)
QUAGGA_CONF_OPTS += --enable-vtysh
QUAGGA_DEPENDENCIES += readline
else
QUAGGA_CONF_OPTS += --disable-vtysh
endif
ifeq ($(BR2_TOOLCHAIN_SUPPORTS_PIE),)
QUAGGA_CONF_OPTS += --disable-pie
endif
define QUAGGA_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 644 package/quagga/quagga_tmpfiles.conf \
$(TARGET_DIR)/usr/lib/tmpfiles.d/quagga.conf
$(INSTALL) -D -m 644 package/quagga/quagga@.service \
$(TARGET_DIR)/usr/lib/systemd/system/quagga@.service
endef
$(eval $(autotools-package))

View File

@@ -0,0 +1,17 @@
[Unit]
Description=Quagga %i routing daemon
ConditionFileIsExecutable=/usr/sbin/%i
Wants=quagga@zebra.service
[Service]
Type=simple
EnvironmentFile=/etc/default/quagga-%i
PrivateTmp=true
# Systemd doesn't like having %i in the executable path.
ExecStart=/usr/bin/env /usr/sbin/%i $OPTS -f /etc/quagga/%i.conf
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1 @@
d /var/run/quagga/ 1755 quagga quagga -