[LiSA-Devel] [CLI&SW_API] get_if_list

Claudiu Ghioc claudiughioc at gmail.com
Tue Apr 16 16:55:39 EEST 2013


> Hello,
>
> I'm working on interposing the sw_api between cli and lisa kernel
> module and, right now, at cmd_show_vlan, which calls if_map_fetch.
> I've made some digging on the functions calling if_map_fetch (which
> currently makes a ioctl on SW_GETIFLIST) and it turned out that almost
> all of them also need the name of the interface and not only the
> ifindex. I remember we talked about the difference between the name
> and the description of an interface, so now I'm asking myself where to
> obtain the name of an interface from because get_if_list returns only
> the indexes and not a struct net_switch_dev *.
>
> If I understand correctly, the name of a interface is held in kernel
> space and description of a interface is held in userspace, so I think
> there was a misunderstanding on get_if_list returning only the
> ifindex, as for obtaining the names (and not the descriptions) another
> system call would be required. Is it ok if get_if_list returns a list
> of net_switch_dev structures instead of ifindexes?
>
> Andreea

Hi Andreea,
In get_if_list (the LiSA implementation) we receive an array of struct
net_switch_dev(from kernel). In userspace we have defined an identical
structure (struct net_switch_device) in order to map the array and
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.

-- 
Claudiu Ghioc
Software Developer
CloudBit
Email: claudiu.ghioc at gmail.com
+(40) 745 783 796


More information about the LiSA-Devel mailing list