[Xorp-users] XORP OSPF on Linux: compile error and documentation request

Atanu Ghosh atanu@ICSI.Berkeley.EDU
Tue, 13 Jul 2004 20:52:09 -0700


The OSPF code is not tested in any environment. At the time the code was
ported we only supported FreeBSD. Thats why we don't try and build it
for Linux. To get the code to compile/work on Linux is going to take
some effort.

We intend to produce our own OSPF implementation so we haven't been
doing much with this code. Its still in the source tree because we
put effort into porting it and it may be useful on FreeBSD.

	Atanu.


>>>>> "Jeff" == Jeff Gold <jgold@mazunetworks.com> writes:

    Jeff> I would like to experiment with XORP using OSPF on Linux.  I understand 
    Jeff> that this is supported only through a contrib package that is thoroughly 
    Jeff> tested only on FreeBSD, but I would like to see how it holds up. 
    Jeff> Unfortunately for me it seems that OSPF won't even compile on Linux.  I 
    Jeff> have managed to solve a few of the problems with the patch attached to 
    Jeff> this message, but I am stuck on the following problem:

    Jeff> $ ./configure --prefix=/usr/local/routed/xorp --without-snmp && \
    Jeff> make clean && make
    Jeff> [...]
    Jeff> g++ -DHAVE_CONFIG_H -I. -I. -I../../.. -I../../.. -I../../.. -I./../src 
    Jeff> -g  -W -Wall -Wwrite-strings -Wcast-qual -Werror -Wpointer-arith 
    Jeff> -Wcast-align -Wstrict-prototypes -Woverloaded-virtual 
    Jeff> -ftemplate-depth-20 -c -o ospfd_xorp.o `test -f ospfd_xorp.C || echo 
    Jeff> './'`ospfd_xorp.C
    Jeff> In file included from ospfd_xorp.C:46:
    Jeff> ospfd_xorp.h:101: error: field `rt_rtm' has incomplete type
    Jeff> make[4]: *** [ospfd_xorp.o] Error 1
    Jeff> make[4]: Leaving directory `/root/xorp-1.0/contrib/ospfd/xorp'

    Jeff> Apparently the xorp/ospfd_xorp.[hC] files are significantly changed 
    Jeff> versions of the freebsd/ospfd_freebsd.[hC] files.  Can this be right? 
    Jeff> How is one supposed to build this on Linux, short of porting the XORP 
    Jeff> changes to the linux/ospfd_linux.[hC] files?

    Jeff> Jeff


    Jeff> diff -urN xorp-1.0/configure xorp-1.0-ospflinux/configure
    Jeff> --- xorp-1.0/configure  2004-07-09 02:34:59.000000000 -0400
    Jeff> +++ xorp-1.0-ospflinux/configure        2004-07-13 10:30:03.000000000 -0400
    Jeff> @@ -9136,7 +9136,7 @@
    Jeff> xorp_cv_ospfd_os="freebsd"
    Jeff> ;;
    Jeff> linux* )
    Jeff> -           xorp_cv_ospfd_os="unsupported"
    Jeff> +           xorp_cv_ospfd_os="linux"
    Jeff> ;;
    Jeff> * )
    Jeff> xorp_cv_ospfd_os="unsupported"
    Jeff> diff -urN xorp-1.0/contrib/ospfd/xorp/ospfd_xorp.C 
    Jeff> xorp-1.0-ospflinux/contrib/ospfd/xorp/ospfd_xorp.C
    Jeff> --- xorp-1.0/contrib/ospfd/xorp/ospfd_xorp.C    2003-09-27 
    Jeff> 18:32:45.000000000 -0400
    Jeff> +++ xorp-1.0-ospflinux/contrib/ospfd/xorp/ospfd_xorp.C  2004-07-13 
    Jeff> 10:30:34.000000000 -0400
    Jeff> @@ -46,6 +46,14 @@
    Jeff> #include "ospfd_xorp.h"
    Jeff> #include "xrl_target.h"

    Jeff> +/* apparently this is a BSD specific macro */
    Jeff> +#ifndef _SIZEOF_ADDR_IFREQ
    Jeff> +# define _SIZEOF_ADDR_IFREQ(ifr) \
    Jeff> +           ((ifr).ifr_addr.sa_len > sizeof(struct sockaddr) ? \
    Jeff> +            (sizeof(struct ifreq) - sizeof(struct sockaddr) + \
    Jeff> +             (ifr).ifr_addr.sa_len) : sizeof(struct ifreq))
    Jeff> +#endif /* _SIZEOF_ADDR_IFREQ */
    Jeff> +
    Jeff> /* Initialize the FreeBSD interface.
    Jeff> * Open the network interface.
    Jeff> * Start the random number generator.
    Jeff> _______________________________________________
    Jeff> Xorp-users mailing list
    Jeff> Xorp-users@xorp.org
    Jeff> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-users