On Fre, 2008-05-30 at 14:57 +0200, Thomas.Martin@rohde-schwarz.com
wrote:
[...]
I tested the changesets below and they work fine.
But for correct topology display olsrd_dot_draw.c should also consider
OLSR_TC_EDGE_DOWN flag
For that I pushed:
http://gredler.at/hg/olsrd/rev/09e7fc5e93c3



> --- a/lib/dot_draw/src/olsrd_dot_draw.c	Sun Apr 27 22:07:05 2008 +0200 
> +++ b/lib/dot_draw/src/olsrd_dot_draw.c	Fri May 30 14:50:58 2008 +0200 
> @@ -43,7 +43,11 @@ 
> * Dynamic linked library for the olsr.org olsr daemon 
> */ 
> 
> -  
> +#ifdef _WRS_KERNEL 
> +#include <vxWorks.h> 
> +#include <sockLib.h> 
> +#include <wrn/coreip/netinet/in.h> 
> +#else 
> #include <sys/types.h> 
> #include <sys/socket.h> 
> #include <netinet/in.h> 
> @@ -57,6 +61,7 @@ 
> #include <unistd.h> 
> #include <errno.h> 
> #include <stdarg.h> 
> +#endif 

This is getting somewhat ugly. But I can't think of a better solution.

> #include "olsr.h" 
> #include "ipcalc.h" 
> @@ -79,11 +84,14 @@ 
> #define close(x) closesocket(x) 
> #endif 
> 
> +#ifdef _WRS_KERNEL 
> +static int ipc_open; 
> +static int ipc_socket_up; 

What do you need these for?
IIRC I killed them ages ago - at least in the dot-draw and httpinfo
plugins. Just use "-1" for the two below variables if there is no
connection.

> +#define DOT_DRAW_PORT 2004 
> +#endif 
>
> static int ipc_socket; 
> static int ipc_connection; 
> - 
> - 
> 
> /* IPC initialization function */ 
> static int 
> @@ -120,8 +128,11 @@ ipc_send_fmt(const char *format, ...) __ 
> *This function is called by the my_init 
> *function in uolsrd_plugin.c 
> */ 
> -int 
> -olsrd_plugin_init(void) 
> +#ifdef _WRS_KERNEL 
> +int olsrd_dotdraw_init(void) 
> +#else 
> +int olsrd_plugin_init(void) 
> +#endif 

This is IMHO also ugly. IMHO it is better to just rename the function in
*all* files of that plugin.
*If* some old version of some OS has a problem with it, we can add a
#define (or whatever) for them.

	Bernd
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services




