赞助连接

赞助连接

阅 读 文 章

SCO 设置网卡混杂模式

[来源:网上转载 (http://bbs.chinaunix.net) | 作者:网友(网络转载) | 时间:2008-06-19 | 浏览: 人次 ]

最近又发现在了一个设置SCO 网卡混杂模式的方法,并且可以抓到数据。但是实现起来也有问题,如下:
int Set_Promisc(char *inte *** ce, int sock )
{
                struct ifreq ifr;
                printf("strnlen(inte *** ce)+1 : %d\n",strlen(inte *** ce)+1);
                strncpy(ifr.ifr_name, inte *** ce,strlen(inte *** ce)+1);
                printf("ifr.ifr_name : %s\n",ifr.ifr_name);
                if((ioctl(sock, SIOCGIFFLAGS, &ifr) == -1))
                {
                        /*Could not retrieve flags for the inte *** ce*/
                        perror("Could not retrive flags for the inte *** ce");
                        exit(0);
                }
                printf("The inte *** ce is ::: %s\n", inte *** ce);
                printf("Retrieved flags from inte *** ce successfully\n");
                ifr.ifr_flags |= IFF_LINK0;
                if (ioctl (sock, SIOCSIFFLAGS, &ifr) == -1 )
                {
                        /*Could not set the flags>

你发错地方了。


TAG标签 : 模式 网卡 设置 inte ce printf flags not the sock Could

最新评论 共有0位网友发表了评论

发表评论

评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名:(注册)
密码:
验证码:
匿名发表
网站地图友情连接交流论坛网站投稿广告服务联系我们留言本站长统计
Some rights reserved: www.newhtm.com, 鄂ICP备07010232号 E-mail:chinakafei@live.com,QQ:552766
中国咖啡技术网(Chmhome):国外编程技术书籍,中文编程手册,经典编程文章,交流技术,技术软件下载,计算机论文,毕业论文.