forked from Mirror/frr
zebra: irdp: convert into module
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
parent
ead4ee99ac
commit
8dc1f7fc88
38
configure.ac
38
configure.ac
|
@ -344,7 +344,7 @@ AC_ARG_ENABLE(shell_access,
|
|||
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,
|
||||
|
@ -570,10 +570,6 @@ else
|
|||
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
|
||||
|
@ -1479,17 +1475,27 @@ AC_CHECK_MEMBERS([struct sockaddr.sa_len,
|
|||
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
|
||||
|
|
|
@ -138,7 +138,6 @@ struct Adv {
|
|||
int pref;
|
||||
};
|
||||
|
||||
extern void irdp_init(void);
|
||||
extern void irdp_if_init(void);
|
||||
extern int irdp_sock_init(void);
|
||||
extern int irdp_config_write(struct vty *, struct interface *);
|
||||
|
|
|
@ -35,8 +35,6 @@
|
|||
|
||||
#include <zebra.h>
|
||||
|
||||
#ifdef HAVE_IRDP
|
||||
|
||||
#include "if.h"
|
||||
#include "vty.h"
|
||||
#include "sockunion.h"
|
||||
|
@ -691,5 +689,3 @@ void irdp_if_init()
|
|||
install_element(INTERFACE_NODE, &ip_irdp_debug_packet_cmd);
|
||||
install_element(INTERFACE_NODE, &ip_irdp_debug_disable_cmd);
|
||||
}
|
||||
|
||||
#endif /* HAVE_IRDP */
|
||||
|
|
|
@ -35,8 +35,6 @@
|
|||
|
||||
#include <zebra.h>
|
||||
|
||||
#ifdef HAVE_IRDP
|
||||
|
||||
#include "if.h"
|
||||
#include "vty.h"
|
||||
#include "sockunion.h"
|
||||
|
@ -53,6 +51,7 @@
|
|||
#include "thread.h"
|
||||
#include "privs.h"
|
||||
#include "libfrr.h"
|
||||
#include "version.h"
|
||||
#include "zebra/interface.h"
|
||||
#include "zebra/rtadv.h"
|
||||
#include "zebra/rib.h"
|
||||
|
@ -341,11 +340,23 @@ static int irdp_finish(void)
|
|||
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;
|
||||
}
|
||||
|
||||
#endif /* HAVE_IRDP */
|
||||
static int irdp_module_init(void)
|
||||
{
|
||||
hook_register(frr_late_init, irdp_init);
|
||||
return 0;
|
||||
}
|
||||
|
||||
FRR_MODULE_SETUP(
|
||||
.name = "zebra_irdp",
|
||||
.version = FRR_VERSION,
|
||||
.description = "zebra IRDP module",
|
||||
.init = irdp_module_init,
|
||||
)
|
||||
|
|
|
@ -36,8 +36,6 @@
|
|||
#include <zebra.h>
|
||||
|
||||
|
||||
#ifdef HAVE_IRDP
|
||||
|
||||
#include "if.h"
|
||||
#include "vty.h"
|
||||
#include "sockunion.h"
|
||||
|
@ -353,6 +351,3 @@ void send_packet(struct interface *ifp, struct stream *s, u_int32_t dst,
|
|||
}
|
||||
/* printf("TX on %s idx %d\n", ifp->name, ifp->ifindex); */
|
||||
}
|
||||
|
||||
|
||||
#endif /* HAVE_IRDP */
|
||||
|
|
|
@ -292,9 +292,6 @@ int main(int argc, char **argv)
|
|||
#if defined(HAVE_RTADV)
|
||||
rtadv_cmd_init();
|
||||
#endif
|
||||
#ifdef HAVE_IRDP
|
||||
irdp_init();
|
||||
#endif
|
||||
/* PTM socket */
|
||||
#ifdef ZEBRA_PTM_SUPPORT
|
||||
zebra_ptm_init();
|
||||
|
|
|
@ -6,6 +6,9 @@ if ZEBRA
|
|||
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
|
||||
|
@ -30,9 +33,6 @@ zebra_zebra_SOURCES = \
|
|||
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 \
|
||||
|
@ -106,6 +106,13 @@ noinst_HEADERS += \
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue