[LiSA-Devel] Virtual VLAN interface

Andreea-Cristina Hodea andreea.cristina.hodea at gmail.com
Wed May 22 12:10:26 EEST 2013


Hi,

When obtaining the type of an interface based on index, if the
interface was a vlan interface, I would also need the vlan id.
Supposing vlan interfaces are always named "vlan$vlanid", I see two
solutions to obtaining the vlan id:

1. sscanf on the interface name
2. when returning the type, also return the vlan id if the interface
is of type SW_IF_VIF.

Now I was wondering, which one is more accurate? Can I count on naming
"vlan$id"?

The context of the question is given by cmd_no_int_any and
cmd_int_any, for example, when replacing ioctl calls with
sw_ops->if_get_type.

Thanks,
Andreea


More information about the LiSA-Devel mailing list