AC_ARG_ENABLE(rtadv,
AS_HELP_STRING([--disable-rtadv], [disable IPV6 router advertisement feature]))
AC_ARG_ENABLE(irdp,
- AS_HELP_STRING([--enable-irdp], [enable IRDP server support in zebra]))
+ AS_HELP_STRING([--disable-irdp], [enable IRDP server support in zebra (default if supported)]))
AC_ARG_ENABLE(capabilities,
AS_HELP_STRING([--disable-capabilities], [disable using POSIX capabilities]))
AC_ARG_ENABLE(rusage,
AC_MSG_RESULT(no)
fi
-if test "${enable_irdp}" = "yes"; then
- AC_DEFINE(HAVE_IRDP,, IRDP )
-fi
-
if test x"${enable_user}" = x"no"; then
enable_user=""
else
dnl ---------------------------
dnl IRDP/pktinfo/icmphdr checks
dnl ---------------------------
-AC_CHECK_TYPES([struct in_pktinfo],
- [AC_CHECK_TYPES([struct icmphdr],
- [if test "${enable_irdp}" != "no"; then
- AC_DEFINE(HAVE_IRDP,, IRDP)
- fi],
- [if test "${enable_irdp}" = "yes"; then
- AC_MSG_ERROR(['IRDP requires in_pktinfo at the moment!'])
- fi], [FRR_INCLUDES])],
- [if test "${enable_irdp}" = "yes"; then
- AC_MSG_ERROR(['IRDP requires in_pktinfo at the moment!'])
- fi], [FRR_INCLUDES])
+
+AC_CHECK_TYPES([struct in_pktinfo], [
+ AC_CHECK_TYPES([struct icmphdr], [
+ IRDP=true
+ ], [
+ IRDP=false
+ ], [FRR_INCLUDES])
+], [
+ IRDP=false
+], [FRR_INCLUDES])
+
+case "${enable_irdp}" in
+yes)
+ $IRDP || AC_MSG_ERROR(['IRDP requires in_pktinfo at the moment!'])
+ ;;
+no)
+ IRDP=false
+ ;;
+esac
+
+AM_CONDITIONAL(IRDP, $IRDP)
dnl -----------------------
dnl checking for IP_PKTINFO
#include <zebra.h>
-#ifdef HAVE_IRDP
-
#include "if.h"
#include "vty.h"
#include "sockunion.h"
#include "thread.h"
#include "privs.h"
#include "libfrr.h"
+#include "version.h"
#include "zebra/interface.h"
#include "zebra/rtadv.h"
#include "zebra/rib.h"
return 0;
}
-void irdp_init(void)
+static int irdp_init(struct thread_master *master)
{
irdp_if_init();
hook_register(frr_early_fini, irdp_finish);
+ return 0;
+}
+
+static int irdp_module_init(void)
+{
+ hook_register(frr_late_init, irdp_init);
+ return 0;
}
-#endif /* HAVE_IRDP */
+FRR_MODULE_SETUP(
+ .name = "zebra_irdp",
+ .version = FRR_VERSION,
+ .description = "zebra IRDP module",
+ .init = irdp_module_init,
+)
sbin_PROGRAMS += zebra/zebra
dist_examples_DATA += zebra/zebra.conf.sample
+if IRDP
+module_LTLIBRARIES += zebra/zebra_irdp.la
+endif
if SNMP
module_LTLIBRARIES += zebra/zebra_snmp.la
endif
zebra/ipforward_proc.c \
zebra/ipforward_solaris.c \
zebra/ipforward_sysctl.c \
- zebra/irdp_interface.c \
- zebra/irdp_main.c \
- zebra/irdp_packet.c \
zebra/kernel_netlink.c \
zebra/kernel_socket.c \
zebra/label_manager.c \
zebra/zserv.h \
# end
+zebra_zebra_irdp_la_SOURCES = \
+ zebra/irdp_interface.c \
+ zebra/irdp_main.c \
+ zebra/irdp_packet.c \
+ # end
+zebra_zebra_irdp_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
+
zebra_zebra_snmp_la_SOURCES = zebra/zebra_snmp.c
zebra_zebra_snmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS)
zebra_zebra_snmp_la_LDFLAGS = -avoid-version -module -shared -export-dynamic