locked
How to bind to specific ethernet in c ?? ( getting the names of connected ethernet ) RRS feed

  • Question

  • I am trying to get ethernet name so that I can bind to it. But If you see following

    linux code which gives me "eth0" after typing command ifconfig on command prompt.

    Likewise how will I get this ethernet name in windows?

    I am using if_indextoname() to get random all ethernet name. I want socket to bind to

    specific ethernet. ipconfig command is not giving me specific name in windows.

    * Linux code *

    #include <net/if.h>
    server.sin6_scope_id=if_nametoindex("eth0");


    Is there any command or code something to know this ethernet names?

    Monday, August 22, 2016 9:58 AM

All replies

  • ipconfig.exe /all, you can also see the names in network control panel.

    netsh.exe can be used to change the network names.


    Sean Liming - Book Author: Starter Guide SIM (WEI), Pro Guide to WE8S & WES 7, Pro Guide to POS for .NET - www.annabooks.com / www.seanliming.com


    Monday, August 22, 2016 3:37 PM