[LiSA-Devel] Switch API prototyping

Andreea-Cristina Hodea andreea.cristina.hodea at gmail.com
Mon Mar 11 13:38:32 EET 2013


Hi,

Now the cli makes ioctl calls and communicates with daemons (cdp,
rstp) by using queues and shared memory. In both cases (kernel calls
and daemons), the cli context is used and data structures defined in
cli implementation. Should we consider that all implementations of the
API would make use of the data structures defined in cli
implementation?

For example, the function cmd_if_desc from cli/configure_if.c could
set the description of an interface by calling if_set_desc of the
switch API. I'm thinking at the following two possibilities for
if_set_desc:

void if_set_desc(int ifindex, char *desc, void* ctx); //ctx would help
when opening the socket for ioctl call in current implementation; for
other implementations could be used for optional parameters
or
void if_set_desc(struct swcfgreq *swcfgr, struct cli_context *ctx);

Which one is the right way to go? Or maybe another approach would be better?

Thanks,
Andreea


More information about the LiSA-Devel mailing list