当前位置: 技术问答>linux和unix
solaris下检测网口函数
来源: 互联网 发布时间:2016-09-05
本文导语: #include #include #include #include #include #include #include #include #include #include #include #include //#include int main() { int socket_fd = 0; struct ifreq ifr; int ret = 0; /* Setup our control structures. *...
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
//#include
int main()
{
int socket_fd = 0;
struct ifreq ifr;
int ret = 0;
/* Setup our control structures. */
memset(&ifr, 0, sizeof(ifr));
strcpy(ifr.ifr_name, "bge0");
/* Open control socket. */
socket_fd = socket(PF_UNIX, SOCK_DGRAM, 0);
if (socket_fd
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
//#include
int main()
{
int socket_fd = 0;
struct ifreq ifr;
int ret = 0;
/* Setup our control structures. */
memset(&ifr, 0, sizeof(ifr));
strcpy(ifr.ifr_name, "bge0");
/* Open control socket. */
socket_fd = socket(PF_UNIX, SOCK_DGRAM, 0);
if (socket_fd