How would I do in a C/C++ program to detect if there is any ethernet card installed in a system?. If one exists, the program needs to get its interface name or the IP address to which it binds to.
If your target is diagnostic, you have to go deep in
the system and look for routines that manages cards not
ip address ( remember that your tcpip may not be still
configured or a card may have more than an address).
However, for normal purposes, you have first to configure, then test the network at system layer ( network neighb., ping local and after remote address, and so on) and then
use high level (application layer) api ( sockets, ftp, http)
making accurate attention to the return code of these.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.