[LiSA-Devel] Get interface name

Claudiu Ghioc claudiughioc at gmail.com
Fri May 10 13:10:15 EEST 2013


On Thu, May 9, 2013 at 6:39 PM, Claudiu Ghioc <claudiughioc at gmail.com> wrote:
> Hello,
>
> I have some trouble retrieving an interface's name based on its index.
> In if_add (in the "bridge" and "8021q" implementation) I have to add
> the interface to the default bridge ("vlan1") and I need the name of
> the interface. I used the existing function if_get_name(from
> lib/if_generic.h) with different kind of sockets. I tried
> "socket(AF_UNIX, SOCK_DGRAM, 0);" and "socket(PF_INET, SOCK_STREAM,
> 0);" and it still returns null. I found that any kind of socket would
> suffice. The LiSA implementation used the PF_SWITCH socket. Any idea?
>
> Thank you!

I figured it out, it was another mistake of mine. I forgot to
initialize the socket variable.


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


More information about the LiSA-Devel mailing list