[Click] possible to use variables in config file?

Eddie Kohler kohler at cs.ucla.edu
Mon Oct 18 13:22:15 EDT 2004


Marcel Poisot wrote:
> I was hoping to clean up my Click config file a little bit, by putting 
> declarations of variables (such as dump pathnames, net dev names, etc) 
> at the top of the file.
> 
> Is there anyway to just make a variable name?  I have some absolute path 
> names for dumps, and it would be nice to keep the base of the path in 
> some variable name for easier maintenance.  Is there a way to do this? 
> The same applies for frequently used parameters and the like.

Hi Marcel,

So one thing a lot of people do is pass Click configurations through the cpp 
preprocessor.  Then you can use #define for variables.

> BTW, I noticed AddessInfo and PortInfo aren't linked anywhere in the 
> element documentation pages.  I just guessed their URLs...

Thanks, we fixed that bug.

> Also, is there a way to instantiate or use a Click element from WITHIN a 
> click element?  It would be nice to internally call FixTCPChecksum from 
> within the element I'm creating, as opposed to doing it myself or 
> requiring the user to string that element after mine with every use.

You can inherit from FixTCPChecksum and provide that functionality within your 
own element.  But really I'd document the dependency clearly.

Eddie


More information about the click mailing list