[Click] add routing enteries from an external file to Click configuration file

Eddie Kohler ekohler at gmail.com
Thu Dec 1 08:53:08 EST 2011


Hi Ahmed, Sandeep,

Another way is to use Script elements.  For example, create a file
like this; say it is in /tmp/myroutes

add 1.0.0.0/8 1.0.0.1 0
add 2.0.0.0/8 2.0.0.1 1
...

Then, in your configuration:

.... -> my_routing_table :: RadixIPLookup -> ....
Script(write my_routing_table.ctrl $(cat /tmp/myroutes))


Eddie





On Mon, Nov 28, 2011 at 2:43 PM, sandeep <sandeep048 at gmail.com> wrote:
> Hi Ahmed,
>
> One way to do it is using
> RadixIPLookup's<http://read.cs.ucla.edu/click/elements/radixiplookup>
> add
> write handler.
>
> Write a program which reads your file and prints appropriate write
> statements.  Eg: write ril.add(ADDR/MASK [GW] OUT)
>
> Send this output to "netcat <host> <port>". This method is for userlevel
> click and works using
> ControlSocket<http://read.cs.ucla.edu/click/elements/controlsocket>
> element.
> For kernel module use /click file system.
>
> Kind Regards,
> Sandeep,
> PhD Student,
> CTVR - Trinity College Dublin
>
> On Mon, Nov 28, 2011 at 8:34 AM, ahmed A. <amego83 at gmail.com> wrote:
>>
>> hi,
>>
>> My question may sound primitive, but I couldn't find any answer for it so
>> far,  Does anyone know if it is possible to add my routing entries to
> click
>> configuration file from an external file ?
>>
>> For example for RadixIPLookup( ) click element, so instead of adding all
>> the entries between the brackets, how I can tell the element to read them
>> from a file ?
>>
>> Thanks
>>
>> Ahmed
>> _______________________________________________
>> click mailing list
>> click at amsterdam.lcs.mit.edu
>> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click



More information about the click mailing list