[olsr-dev] some Qs about exending the dyn_gw plugin

Jens Nachtigall (spam-protected)
Fri Nov 5 18:59:08 CET 2004


> > 1st
> > I've seen the new config file scheme:
> > LoadPlugin "olsrd_dyn_gw.so.0.1"
> > {
> >     PlParam     "key4"   "value3"
> >     # Might be possible to set options here in
> >     # future versions
> > }
> > This would mean one IP per line, right? e.g.
> >
> > LoadPlugin "olsrd_dyn_gw.so.0.1"
> > {
> >     PlParam     "IP_1"   "141.1.1.1"
> >     PlParam     "IP_2"   "141.6.6.6"
> >     # Might be possible to set options here in
> >     # future versions
> > }
> > and not
> > LoadPlugin "olsrd_dyn_gw.so.0.1"
> > {
> >     PlParam     "IPs"   "141.1.1.1"  "141.6.6.6"
> >     # Might be possible to set options here in
> >     # future versions
> > }
> > ???
>
> Yes - that means that you can set keys/values pairs. I would guess
> something like this would be suitable:
>
>   LoadPlugin "olsrd_dyn_gw.so.0.1"
>   {
>       PlParam     "Detection" "ping" # ping or route
>       PlParam     "Net"   "0.0.0.0/0"
>       PlParam     "Net"   "141.1.1.1/24"
> # etc.
>   }

That's actually not as I wanted to do this. I don't want to do this 
exclusive, ie I want
1st try detecting a 0.0.0.0/0 in the routing table (as is done now)
If one is detected _and_ IP addresses are given, do a ping to validate.

This way the plugin won't try to ping, if no routing table entry for a 
gw is available.

Also I only plan to detect inet gw automatically, everything else makes 
it unnessary complicated (NAT, etc., as describe in my previous email)


[...]

> > 3rd
> > Currently I use system(2) [e.g. system("ping -c 1 -q IP")] to do
> > the ping, which is suboptimal since the ping would be done with
> > olsrd's prevelidges (i.e. root) and afaics it also blocks olsrd
> > while the ping the going on. Anybody knowing a better approach or
> > syscall, respectively?
>
> You could spawn a thread to do this.

I'll look into this.

> You can also build and send the 
> ICMP packet your self so you don't have to depend on external
> programs.

I look into the ping code, which seems to be a more compley program than 
I thought ;-). I'll see.

Thanks for the quick reply (and the nice plugin infrastructure ;-)

Jens
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.olsr.org/pipermail/olsr-dev/attachments/20041105/a56dfe34/attachment.sig>


More information about the Olsr-dev mailing list