C#/C++ Capture local machine ip packet and drop it

て烟熏妆下的殇ゞ 提交于 2019-12-12 05:27:12

问题


I am working on a firewall project. So far I succeed to block packets by ip basis which is I done by windows filtering platform. But my customer does not want to block the whole ip. He wants to block specific url. So now I need to capture each packet and read it. So far I can do that by C# raw socket. But I dont know how to drop that specific packet. Please help me out on that.


回答1:


Does this help you?

http://www.osix.net/modules/article/?id=824

In this article the author reads packets in raw format and then sends them on. I think you can probably use this as a basis for what you want to do.



来源:https://stackoverflow.com/questions/4151617/c-c-capture-local-machine-ip-packet-and-drop-it

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!