Name of the primary network interface, how to find in bsp header files?

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Aug 7 12:17:24 UTC 2020


On 07/08/2020 13:39, Heinz Junkes wrote:

> Can I get the name of the primary network interface from the header files of a target-bsp?

Some BSPs have an RTEMS_BSP_NETWORK_DRIVER_NAME define.

With libbsd you can try something like this:

     char ifnamebuf[IF_NAMESIZE];
     char *ifname;


     ifname = if_indextoname(1, &ifnamebuf[0]);
     assert(ifname != NULL);



More information about the devel mailing list