[LiSA-Devel] [CLI&SW_API] get_if_list

Radu Rendec radu.rendec at mindbit.ro
Tue Apr 16 17:51:37 EEST 2013


On Tue, 2013-04-16 at 17:01 +0300, Andreea-Cristina Hodea wrote:
> On Tue, Apr 16, 2013 at 4:55 PM, Claudiu Ghioc <claudiughioc at gmail.com> wrote:
> >> Is it ok if get_if_list returns a list of net_switch_dev structures instead of ifindexes?
> ...
> > have a generic structure which describes a switch device. I guess we
> > can return the array of struct net_switch_device in get_if_list; the
> > cli can use either the interface index or the name whichever suits
> > better.
> 
> Ok, I was thinking at something similar, but I wanted to make sure I
> didn't miss anything. Thanks, Claudiu.

If I recall correctly, we discussed this during the meeting on April 8th
and we decided that in user space we would use a structure that is very
similar to net_switch_dev, but also contains a list_head.

Then get_if_list() would receive a list_head as argument and enchain
these structures to that list_head.

Actually, Andreea, I think this was your idea (because you thought it
would be consistent with the other functions that return lists of
various objects).

To answer your original question (how you can get the name by the index)
you can take a look at cli/command/config_if.c around line 373. Or use
"man 7 netdevice" (as suggested in the comment in the same file).

Radu




More information about the LiSA-Devel mailing list