C/C++ Windows 流量拦截器
我想为我的机器后面的网络开发一个带宽分配器。
现在,我已经阅读了有关 NDIS 的内容,但我不确定既不是源自我的计算机也不是发往我的计算机的网络流量是否会进入我的 TCP/IP 堆栈,以便我可以通过 NDIS 在窗户机器。
I want to develop a bandwidth allocator to a network which will be behind my machine.
Now, I've read about NDIS but I am not sure whether the network traffic that is neither originating from my machine nor is destined for my machine will enter my TCP/IP stack, so that I can block/unblock packets via NDIS on a windows machine.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
NDIS(内核)驱动程序位于 Windows 网络堆栈中,因此只能拦截由该堆栈处理的数据包。
您无法过滤未发送到您计算机的数据包。
(当计算机充当路由器时,数据包被发送到计算机,计算机将数据包转发到实际接收者,如果这是问题的话)
NDIS (kernel) drivers live in the Windows network stack, and so can only intercept packets which are handled by this stack.
You cannot filter packets which are not send to your computer.
(When the computer acts as a router, the packets are send to the computer and the computer forwards the packets to the actual recepient, if that was the question)
在正常操作模式下,NIC 驱动程序/固件将丢弃不相关的流量,如上所述。 然而,这是一个软件问题,因此可以通过在设备驱动程序和/或固件中添加适当的逻辑来更改此行为。 例如,这就是嗅探器的工作原理。
In normal operation mode the irrelevant traffic will be dropped by the NIC driver/firmware, like pointed above. However, this is a SW issue so this behavior can be changed by adding an appropriate logic into the device driver and/or firmware. This is how sniffers operate, for example.