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.