ZioPRoTo (Saverio Proto | 1 Jul 2010 11:28
Picon
Gravatar

Re: Timeout Function

> How can I register my timeout function into olsrd-0.6 to execute some
> operations?
> For example, if the name of my function is "my_timeout", how can I register
> this function to olsrd know when call my_timeout function?

I hope I understand your question.

you can use the olsr_start_time function to register a function to a
timer. Everytime the timer expires your function will be called.

See an example here:
http://olsr.org/git/?p=olsrd.git;a=blob;f=lib/obamp/src/obamp.c;h=286df98c05cee6fe186c988747dff063343e35c5;hb=master#l1828

Saverio

--

-- 
Olsr-dev mailing list
Olsr-dev <at> lists.olsr.org
http://lists.olsr.org/mailman/listinfo/olsr-dev

Airton Ishimori | 1 Jul 2010 14:15
Picon

Re: Timeout Function

Ok, thanks.
That was it.


On Thu, Jul 1, 2010 at 06:28, ZioPRoTo (Saverio Proto) <zioproto <at> gmail.com> wrote:
> How can I register my timeout function into olsrd-0.6 to execute some
> operations?
> For example, if the name of my function is "my_timeout", how can I register
> this function to olsrd know when call my_timeout function?

I hope I understand your question.

you can use the olsr_start_time function to register a function to a
timer. Everytime the timer expires your function will be called.

See an example here:
http://olsr.org/git/?p=olsrd.git;a=blob;f=lib/obamp/src/obamp.c;h=286df98c05cee6fe186c988747dff063343e35c5;hb=master#l1828

Saverio

--

-- 
Olsr-dev mailing list
Olsr-dev <at> lists.olsr.org
http://lists.olsr.org/mailman/listinfo/olsr-dev
ZioPRoTo (Saverio Proto | 3 Jul 2010 17:16
Picon
Gravatar

Re: olsrd dynamic hna

I'm with Gioacchino at the Italian Hackmeeting.

We solved this problem making a little trivial and dirty patch. We
read again the configuration file after olsr is running, but we have
modified the file inserting the changed HNA.

We use SIGUSR1 to trigger OLSR and call
olsrmain_load_config("/tmp/olsr.conf") that reads a new temporary
configuration file with the new hna. It is a very little piece of
code, no need to do a all new plugin.

There is any plugin that now uses SIGUSR1 ??
I'm not very good in Unix and Signals... so please if I did some big
mistake tell me.

If you think the approach is feasible, and if you think that reloading
the config file has some benefit also for other application scenarios,
we can clean up our patch and push it to the repository.

ciao !

Saverio and Gioacchino

--

-- 
Olsr-dev mailing list
Olsr-dev <at> lists.olsr.org
http://lists.olsr.org/mailman/listinfo/olsr-dev

Mitar | 3 Jul 2010 20:46
Picon

Re: olsrd dynamic hna

Hi!

On Sat, Jul 3, 2010 at 5:16 PM, ZioPRoTo (Saverio Proto)
<zioproto <at> gmail.com> wrote:
> There is any plugin that now uses SIGUSR1 ??

Yes. One our internal plugin uses SIGUSR1:

http://lists.olsr.org/pipermail/olsr-dev/2010-April/003711.html

Could you maybe use SIGHUP? It is quite common to use it for reloading
the config.

There was an idea to make an API where plugins could register a
handler for signal and olsrd would then run them in series. But
currently there is nothing yet.

> If you think the approach is feasible, and if you think that reloading
> the config file has some benefit also for other application scenarios,
> we can clean up our patch and push it to the repository.

It is definitely a feature which is missing in OLSR for production use
(it is really bad when we have to reset the olsrd on our VPN server
just to reload the config). But I think that there is probably some
more work needed for this to work properly than just reloading config?
Plugins maybe have to reinitialize their structures if you change
configuration?

Mitar

--

-- 
Olsr-dev mailing list
Olsr-dev <at> lists.olsr.org
http://lists.olsr.org/mailman/listinfo/olsr-dev

Henning Rogge | 4 Jul 2010 00:09

Re: olsrd dynamic hna

Am Samstag 03 Juli 2010, 20:46:27 schrieb Mitar:
> Hi!
> 
> On Sat, Jul 3, 2010 at 5:16 PM, ZioPRoTo (Saverio Proto)
> 
> <zioproto <at> gmail.com> wrote:
> > There is any plugin that now uses SIGUSR1 ??
> 
> Yes. One our internal plugin uses SIGUSR1:
> 
> http://lists.olsr.org/pipermail/olsr-dev/2010-April/003711.html
> 
> Could you maybe use SIGHUP? It is quite common to use it for reloading
> the config.
> 
> There was an idea to make an API where plugins could register a
> handler for signal and olsrd would then run them in series. But
> currently there is nothing yet.
> 
> > If you think the approach is feasible, and if you think that reloading
> > the config file has some benefit also for other application scenarios,
> > we can clean up our patch and push it to the repository.
> 
> It is definitely a feature which is missing in OLSR for production use
> (it is really bad when we have to reset the olsrd on our VPN server
> just to reload the config). But I think that there is probably some
> more work needed for this to work properly than just reloading config?
> Plugins maybe have to reinitialize their structures if you change
> configuration?
One of the plans for OLSRd 0.7.0 is a better configuration management.

We already have an internal telnet server so plugins can just add a command of 
their own without any server code, but the config system is on our list too.

But it will have to wait until I got OLSRv2 running.

Henning Rogge

-- 
1) You can't win.
2) You can't break even.
3) You can't leave the game.
— The Laws of Thermodynamics, summarized
--

-- 
Olsr-dev mailing list
Olsr-dev <at> lists.olsr.org
http://lists.olsr.org/mailman/listinfo/olsr-dev
Airton Ishimori | 5 Jul 2010 21:18
Picon

Dynamic library

How can I create ipk package (example.ipk) for olsrd-0.6 with OpenWrt SDK?

I want to the example.ipk holds a dynamic library (dll_example.so.0.1) and when I install in the OpenWrt Whiterrussian, the library dll_example.so.0.1 willl be intalled into directory /usr/lib. I want to the library will be used by olsrd-0.6 as a plugin.

My implementation holds the fucntion that construct the dynamic library. (my_ini and my_fini).

--

-- 
Olsr-dev mailing list
Olsr-dev <at> lists.olsr.org
http://lists.olsr.org/mailman/listinfo/olsr-dev
Henning Rogge | 6 Jul 2010 07:56
Picon
Favicon

Re: Dynamic library

On Mon July 5 2010 21:18:30 Airton Ishimori wrote:
> How can I create ipk package (example.ipk) for olsrd-0.6 with OpenWrt SDK?
> 
> I want to the example.ipk holds a dynamic library (dll_example.so.0.1) and
> when I install in the OpenWrt Whiterrussian, the library dll_example.so.0.1
> willl be intalled into directory /usr/lib. I want to the library will be
> used by olsrd-0.6 as a plugin.
> 
> My implementation holds the fucntion that construct the dynamic library.
> (my_ini and my_fini).
First step would be to integrate your plugin into the OLSRd makefile. This 
should be nearly automatic with linux as long as you copy your plugin 
directory with the plugin makefile into the libs/ subfolder of OLSRd. You will 
find examples for plugin makefiles in the other plugins.

Second step would be to modify the OpenWRT ipk makefile to build an additional 
package.

Henning Rogge
-- 
Diplom-Informatiker Henning Rogge , Fraunhofer-Institut für
Kommunikation, Informationsverarbeitung und Ergonomie FKIE
Kommunikationssysteme (KOM)
Neuenahrer Straße 20, 53343 Wachtberg, Germany
Telefon +49 228 9435-961,   Fax +49 228 9435 685
mailto:henning.rogge <at> fkie.fraunhofer.de http://www.fkie.fraunhofer.de
GPG: E1C6 0914 490B 3909 D944 F80D 4487 C67C 55EC CFE0
--

-- 
Olsr-dev mailing list
Olsr-dev <at> lists.olsr.org
http://lists.olsr.org/mailman/listinfo/olsr-dev
Airton Ishimori | 7 Jul 2010 19:02
Picon

[OFF-Topic] MIPS Architeture

I compile the plugin, but when I move with "scp" comand text.so.0.1 for OpenWrt /usr/lib directory, come back this (follow) when I do olsrd -f /etc/olsr.conf

---------- LOADING LIBRARY test.so.0.1 ----------
olsrd: '/usr/lib/test.so.0.1' is not an ELF executable for MIPS
olsrd: '/usr/lib/test.so.0.1' is not an ELF executable for MIPS
DL loading failed: "Unrecognized binary type"!
-- PLUGIN LOADING FAILED! --

I compiled the plugin from inside of olsrd-0.6.0/lib/test folder with comand make V=99.

--
Airton Ishimori

--

-- 
Olsr-dev mailing list
Olsr-dev <at> lists.olsr.org
http://lists.olsr.org/mailman/listinfo/olsr-dev
Henning Rogge | 7 Jul 2010 19:06

Re: [OFF-Topic] MIPS Architeture

Am Mittwoch 07 Juli 2010, 19:02:24 schrieb Airton Ishimori:
> I compile the plugin, but when I move with "scp" comand text.so.0.1 for
> OpenWrt /usr/lib directory, come back this (follow) when I do olsrd -f
> /etc/olsr.conf
> 
> ---------- LOADING LIBRARY test.so.0.1 ----------
> olsrd: '/usr/lib/test.so.0.1' is not an ELF executable for MIPS
> olsrd: '/usr/lib/test.so.0.1' is not an ELF executable for MIPS
> DL loading failed: "Unrecognized binary type"!
> -- PLUGIN LOADING FAILED! --
> 
> I compiled the plugin from inside of olsrd-0.6.0/lib/test folder with
> comand make V=99.
Maybe you used a different Target System/Profile for your current built system 
than the one you are trying to use the shared library ?

Henning Rogge

-- 
1) You can't win.
2) You can't break even.
3) You can't leave the game.
— The Laws of Thermodynamics, summarized
--

-- 
Olsr-dev mailing list
Olsr-dev <at> lists.olsr.org
http://lists.olsr.org/mailman/listinfo/olsr-dev
Airton Ishimori | 7 Jul 2010 19:37
Picon

Re: [OFF-Topic] MIPS Architeture

I'm testing the implementation of a plugin for olsrd-0.6. The basically, the plugin contein function that send the time the current node to neigbour. The function do broadcast this the message.

I create a two socket, one to send and other to receive, both utilize the same port number to communicate. I added that my event function into olsrd with olsr_start_timer() function.

The target system is OpenWrt Witherussian. How example the Makefile, I used the ../lib/mini/Makefile.

--
Airton Ishimori



On Wed, Jul 7, 2010 at 14:06, Henning Rogge <hrogge <at> googlemail.com> wrote:
Am Mittwoch 07 Juli 2010, 19:02:24 schrieb Airton Ishimori:
> I compile the plugin, but when I move with "scp" comand text.so.0.1 for
> OpenWrt /usr/lib directory, come back this (follow) when I do olsrd -f
> /etc/olsr.conf
>
> ---------- LOADING LIBRARY test.so.0.1 ----------
> olsrd: '/usr/lib/test.so.0.1' is not an ELF executable for MIPS
> olsrd: '/usr/lib/test.so.0.1' is not an ELF executable for MIPS
> DL loading failed: "Unrecognized binary type"!
> -- PLUGIN LOADING FAILED! --
>
> I compiled the plugin from inside of olsrd-0.6.0/lib/test folder with
> comand make V=99.
Maybe you used a different Target System/Profile for your current built system
than the one you are trying to use the shared library ?

Henning Rogge

--
1) You can't win.
2) You can't break even.
3) You can't leave the game.
— The Laws of Thermodynamics, summarized

--

-- 
Olsr-dev mailing list
Olsr-dev <at> lists.olsr.org
http://lists.olsr.org/mailman/listinfo/olsr-dev

Gmane