[olsr-dev] Does plugins work for Windows version of olsrd

Thomas Lopatic (spam-protected)
Fri Nov 5 16:09:55 CET 2004


> But the thing I'm not sure about is how the dynamic linking/loading 
> works in the Windows version and how the plugin should be built.

For porting the dot_draw plugin I've simply used the Windows port of 
GCC. It does quite a good job when it comes to mapping the shared object 
semantics of Unix-like OSes to the Windows DLL paradigm. Simply say 
"-shared" and GCC will spit out a DLL.

However, creating plugins with a different compiler should not be any 
problem, either. Simply create a DLL and make sure that the following 
functions are exported and that they use the "cdecl" calling convention:

* register_olsr_data()

* plugin_io()

* register_olsr_param()

Also make sure that you export the following variable:

* plugin_interface_version

Exporting variables is a bit unusual on Windows, however, it works via 
the same mechanism as exporting functions.

> But if the public source code for dot_draw contains all needed windows 
> porting changes, I may take a look at this.

When using GCC on Windows you do not need to change anything related to 
the interfacing between the plugin and olsrd. "-shared" by default 
exports all functions and variables contained in the plugin. If you use 
a different compiler, you will probably have to explicitly specify which 
functions and variable are to be seen from the outside, i.e. seen by olsrd.

> Does the olsrd-0.4.7 from www.olsr.org contain the windows source or can 
> I get this source from another place?

Yes, the source code contains everything you need. Make sure that you 
compile olsrd before compiling the plugin, as the plugin uses an object 
file from the olsrd directory that emulates some functions that are 
present on Unix-like OSes but not on Windows.

-Thomas





More information about the Olsr-dev mailing list