仅接收传入数据包 [英] Receive Incoming Packets Only

查看:94
本文介绍了仅接收传入数据包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

随着另一个线程变得混乱,新线程开始了.
我只希望嗅探传入的数据包.我目前处于混杂模式,只想收到通知.尝试向其添加IPLEVEL,并在SIO_RCVALL_IPLEVEL上获得红色的波浪线.我有#include MSTcpIP.h.使用窗口套接字.

New thread started as the other one was getting messy.
I only want incoming packets sniffed. I am currently in promiscuous mode and would like to get only incomming. Trying to add IPLEVEL to this and getting the squiggly red lines on SIO_RCVALL_IPLEVEL. I have #include MSTcpIP.h. Using Window Sockets.

// Set socket to promiscuous mode
// setsockopt wont work ... dont even try it
if ( WSAIoctl( sniff_socket,
               SIO_RCVALL_IPLEVEL,
               &optval,
               sizeof(optval),
               NULL,
               0,
               &dwLen,
               NULL,
               NULL ) == SOCKET_ERROR )

 {

推荐答案

好的...几件事:
1)确保进行此调用的文件具有直接链接到mstcpip.h
(应该具有#include "mstcpip.h"或类似名称)
2)确保SIO_RCVALL_IPLEVEL仅定义一次.

您正在使用Visual Studio吗?如果是这样的话:
1)要确保存在#include的链接,请右键单击文件名并打开文件,如果编译器具有清晰的路径,则会打开该文件,否则会显示找不到文件.
2)在解决方案级别搜索SIO_RCVALL_IPLEVEL定义.
Alright... a few things:
1) Make sure that the file where you''re making this call from has a direct link to mstcpip.h
(should have #include "mstcpip.h" or something similar)
2) Make sure that SIO_RCVALL_IPLEVEL is only defined once.

You''re using Visual Studio? if so:
1) To make sure the linkage is there for #include, right click on the filename and open the file, if the compiler has a clear path to it, it will open, otherwise it will say file not found.
2) Do a solution level search for SIO_RCVALL_IPLEVEL definitions.


这篇关于仅接收传入数据包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆