Re: How can i relate to an element by it's name in the configuration file?
Cliff Frey <[email protected]>
| Newsgroups | gmane.network.routing.click |
|---|---|
| Message-ID | <CAFtVOqmTbHX-Y7f8cW-WsUF1JqMt64UscYwMHCxGOzPPW-+LQA@mail.gmail.com> |
use "this" in as the context (i.e. the element that you are calling cp_element from). If you run this, you can see other examples of it being used: git grep cp_element ./elements/ Cliff On Tue, Oct 25, 2011 at 9:32 AM, Xavier Salip <[email protected]> wrote: > I also tried with cp_element but what should i put on Router or context? > > Thanks > > On Tue, Oct 25, 2011 at 6:09 PM, Cliff Frey <[email protected]> wrote: > >> You can use the cp_element function to do this. >> >> On Tue, Oct 25, 2011 at 5:08 AM, Xavier Salip <[email protected]>wrote: >> >>> Hi list, >>> >>> How can i relate to an element by it's name in the configuration file? >>> I know it's possible to pass a pointer from one element to another >>> through the config. using *ElementCastArg* but this way i need to pass >>> as many pointers as elements i want to use. So when having a large number of >>> elements it's not very efficient. >>> If all my elements have the same name with different index (SOA1, SOA2, >>> SOA3....SOAn) it is possible to pass the first part of the string (SOA) and >>> the 'n' value through config. and then use a for loop to acces each of the >>> elements? >>> >>> I've tried with: *Element* Router::find (const String &name, >>> ErrorHandler * errh = 0)* to find the elements SOA1, SOA2... SOAn, but i >>> don't know how to associate my configuration file (.click) with the Router. >>> >>> Any idea? >>> >>> Thank you >>> >>> >>> >>> >> >