Home > other >  Is there a name card for VxWorks interface
Is there a name card for VxWorks interface

Time:10-09

Or which bosses have written access card name function, the scene will use VxWorks under test for a connected network program,
I am ready to use the socket and the ioctl operation state to obtain the network card, but the second parameter is the ioctl ifreq type structure, need to put the card name assigned to ifr - & gt; Ifr_name

Struct ifreq ifr.
Int SKFD=socket (AF_INET, SOCK_DGRAM, 0);
Strcpy (ifr) ifr_name adapterName);

If (ioctl (SKFD SIOCGIFFLAGS, & amp; Ifr) & lt; 0)
{
Close (SKFD);
return -1;
}

If (ifr) ifr_flags & amp; IFF_RUNNING)
{
Nic work \ n printf (" % s ", adapterName);
Close (SKFD);
return 0;
}
The else
{
Nic work abnormal printf (" % s \ n ", adapterName);
Close (SKFD);
return -1;
}

CodePudding user response:

Monitoring network is connected, directly Ping not to go,,

CodePudding user response:

Agree with the upstairs, see connectivity to the network card name do, a lot of CARDS also don't need these things,
Int x=ping (" IP ", 1, 0); Useful. 0 is, through the gate, and the other didn't

CodePudding user response:

MuxShow ifShow to see

CodePudding user response:

MuxShow ifShow, ifconfig, this name is named in the drive, if open source, can enter the code

CodePudding user response:

MuxShow ifconfig can look at it

CodePudding user response:

To have a look at the environment Ipnet2 Ipnet_cmd_ifconfig ipstack_ifconfig_print_info this function in this folder, use ipcom_sysctl () is the kernel apis to obtain to parameters, pay attention to the first parameter name [6] configuration, can write directly to death, I was using this function RX/TX data to be obtained,
  • Related