librelist archives

« back to archive

Changing the Click Configuration file at run-time

Changing the Click Configuration file at run-time

From:
Imran Khan
Date:
2014-11-26 @ 05:39
Dear All,

I hope my mail finds you in good health and high spirits. I have a question
regarding the configuration file of click router. I have set up my router
perfectly fine but I have one small issue. What if I want to make changes
to the click configuration file at run-time. Something similar to CLI for
the router, for instance, if I want to change the router gateway, ports or
static IPs, at run-time, then I could enter something like:

*click IP_Router.click -g0 11.11.11.50 -g1 11.11.12.50*

where g0 stands for gateway zero and g1 stands for gateway one.

If I have defined g0 (router_gateway0) and g1 (router_gateway1) in my
configuration file as:

*AddressInfo(router_gateway0 11.11.9.50, router_gateway1 11.11.10.50);*

What I want when I run this click file is that I can give it specific
arguments and the click configuration is to change the gateways at run-time
by parsing the command line arguments and replacing them in my click
configuration file before running the router.

So my configuration file should change to to the following (before running):

*AddressInfo(router_gateway0 11.11.9.50, router_gateway1 11.11.10.50);*


Cheers,

Imran Khan

Re: [click] Changing the Click Configuration file at run-time

From:
Antonie Henning
Date:
2014-11-26 @ 07:39
Hi Imran,
The hotswap feature can do what you need. In userlevel it works well if 
click is running single thread. The routing table elements can also be 
updated with new routes at run-time with write handlers.
RegardsA
      From: Imran Khan <khan.imran2591@gmail.com>
 To: click@librelist.com 
 Sent: Wednesday, November 26, 2014 7:39 AM
 Subject: [click] Changing the Click Configuration file at run-time
   


Dear All,
I hope my mail finds you in good health and high spirits. I have a 
question regarding the configuration file of click router. I have set up 
my router perfectly fine but I have one small issue. What if I want to 
make changes to the click configuration file at run-time. Something 
similar to CLI for the router, for instance, if I want to change the 
router gateway, ports or static IPs, at run-time, then I could enter 
something like:
click IP_Router.click -g0 11.11.11.50 -g1 11.11.12.50
 where g0 stands for gateway zero and g1 stands for gateway one.
If I have defined g0 (router_gateway0) and g1 (router_gateway1) in my 
configuration file as:
AddressInfo(router_gateway0 11.11.9.50, router_gateway1 11.11.10.50);
What I want when I run this click file is that I can give it specific 
arguments and the click configuration is to change the gateways at 
run-time by parsing the command line arguments and replacing them in my 
click co nfiguration file before running the router.
So my configuration file should change to to the following (before running):
AddressInfo(router_gateway0 11.11.9.50, router_gateway1 11.11.10.50);


Cheers,

Imran Khan