[OLSR-users] Support for OpenBSD?

Andreas Tønnesen (spam-protected)
Sun May 15 20:04:58 CEST 2005


AFAIK, sysctlbyname is only used for IP/net configuration stuff(IP
forwarding, ICMP redirect disabling etc.) none of which are
crucial for basic olsrd operation. You could define out the call
to sysctlbyname for OpenBSD for a start and get back to this later.

- Andreas


Holger Mauermann wrote:
> Andreas Tønnesen wrote:
> 
>>Here's another patch to include the rts socket.
> 
> 
> I made some more patches and if I now run 'gmake OS=obsd' it compiles
> without errors until that point:
> 
> cc -o olsrd src/build_msg.o src/duplicate_set.o src/generate_msg.o
> src/hashing.o src/hna_set.o src/hysteresis.o src/interfaces.o
> src/ipc_frontend.o src/link_set.o src/local_hna_set.o src/lq_avl.o
> src/lq_list.o src/lq_mpr.o src/lq_packet.o src/lq_route.o src/main.o
> src/mantissa.o src/mid_set.o src/mpr.o src/mpr_selector_set.o
> src/neighbor_table.o src/net.o src/olsr.o src/packet.o src/parser.o
> src/plugin.o src/plugin_loader.o src/process_package.o
> src/process_routes.o src/rebuild_packet.o src/routing_table.o
> src/scheduler.o src/socket_parser.o src/tc_set.o
> src/two_hop_neighbor_table.o src/bsd/apm.o src/bsd/kernel_routes.o
> src/bsd/net.o src/unix/ifnet.o src/unix/log.o src/unix/misc.o
> src/cfgparser/oscan.o src/cfgparser/oparse.o src/cfgparser/olsrd_conf.o -lm
> src/interfaces.o(.text+0x387): In function `queue_if':
> src/interfaces.c:333: warning: strcpy() is almost always misused, please
> use strlcpy()
> src/lq_route.o(.text+0x3a1): In function `etx_to_string':
> src/lq_route.c:307: warning: sprintf() is often misused, please use
> snprintf()
> src/bsd/net.o(.text+0x1f): In function `set_sysctl_int':
> src/bsd/net.c:88: undefined reference to `sysctlbyname'
> collect2: ld returned 1 exit status
> gmake: *** [olsrd] Error 1
> 
> 
> Do you have any ideas?
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> Index: Makefile
> ===================================================================
> RCS file: /cvsroot/olsrd/olsrd-current/Makefile,v
> retrieving revision 1.57
> diff -u -r1.57 Makefile
> --- Makefile	14 Apr 2005 23:29:15 -0000	1.57
> +++ Makefile	15 May 2005 16:57:04 -0000
> @@ -145,6 +145,25 @@
>  install: install_olsrd
>  
>  else
> +ifeq ($(OS), obsd)
> +
> +#
> +# OPENBSD SPECIFIC CONFIGURATION
> +#
> +
> +INSTALL_PREFIX ?=
> +
> +SRCS +=         $(wildcard src/bsd/*.c) $(wildcard src/unix/*.c)
> +HDRS +=         $(wildcard src/bsd/*.h) $(wildcard src/unix/*.h)
> +CFLAGS ?=       $(CCWARNINGS) -O2 -g
> +LIBS =          -lm
> +MAKEDEPEND =    makedepend -f $(DEPFILE) -D__OpenBSD__ $(INCLUDES) $(SRCS)
> +
> +all:     cfgparser olsrd
> +install: install_olsrd
> +
> +
> +else
>  ifeq ($(OS), osx)
>  
>  #
> @@ -281,6 +300,7 @@
>  endif
>  endif
>  endif
> +endif
>  
>  #
>  # END OF OS SPECIFIC STUFF
> Index: src/main.c
> ===================================================================
> RCS file: /cvsroot/olsrd/olsrd-current/src/main.c,v
> retrieving revision 1.77
> diff -u -r1.77 main.c
> --- src/main.c	15 May 2005 13:43:34 -0000	1.77
> +++ src/main.c	15 May 2005 16:57:05 -0000
> @@ -474,7 +474,7 @@
>    /* ioctl socket */
>    close(ioctl_s);
>  
> -#if defined __FreeBSD__ || defined __MacOSX__ || defined __NetBSD__
> +#if defined __FreeBSD__ || defined __MacOSX__ || defined __NetBSD__ || defined __OpenBSD__
>    /* routing socket */
>    close(rts);
>  #endif
> Index: src/bsd/net.c
> ===================================================================
> RCS file: /cvsroot/olsrd/olsrd-current/src/bsd/net.c,v
> retrieving revision 1.20
> diff -u -r1.20 net.c
> --- src/bsd/net.c	20 Mar 2005 16:52:25 -0000	1.20
> +++ src/bsd/net.c	15 May 2005 16:57:05 -0000
> @@ -49,8 +49,13 @@
>  #endif
>  
>  #include <net/if.h>
> -#include <net/if_var.h>
> +
> +#ifdef __OpenBSD__
> +#include <netinet/if_ether.h>
> +#else
>  #include <net/ethernet.h>
> +#include <net/if_var.h>
> +#endif
>  
>  #ifdef __FreeBSD__
>  #include <net80211/ieee80211.h>
> Index: src/unix/ifnet.c
> ===================================================================
> RCS file: /cvsroot/olsrd/olsrd-current/src/unix/ifnet.c,v
> retrieving revision 1.25
> diff -u -r1.25 ifnet.c
> --- src/unix/ifnet.c	7 Mar 2005 19:17:02 -0000	1.25
> +++ src/unix/ifnet.c	15 May 2005 16:57:05 -0000
> @@ -40,7 +40,7 @@
>   */
>  
>  
> -#if defined __FreeBSD__ || defined __MacOSX__ || defined __NetBSD__
> +#if defined __FreeBSD__ || defined __MacOSX__ || defined __NetBSD__ || defined __OpenBSD__
>  #define ifr_netmask ifr_addr
>  #endif
>  
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> olsr-users mailing list
> (spam-protected)
> https://www.olsr.org/mailman/listinfo/olsr-users

-- 
Andreas Tønnesen
http://www.olsr.org



More information about the Olsr-users mailing list