如何制作发送udp数据包的Raw套接字 [英] How can i make Raw socket which send udp packets

查看:156
本文介绍了如何制作发送udp数据包的Raw套接字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,代码项目,
我想问这个问题,无论如何还是要问一个问题:我怎么能创建一个原始套接字,在Windows下用c ++发送很多UDP数据包?如果是这样,请告诉我如何执行的代码或教程.
谢谢
提前,
Cyber​​warfare

Hey code-project,
I am wanting to ask this question, for quite sometime anyway the question: How can i create an Raw socket which sends an lot of UDP packets in c++ under Windows? If so please show me an code of how to do it or an tutorial.
Thanks
In advance,
Cyberwarfare

推荐答案

关注:
面向初学者的简单UDP时间服务器和客户端 [ ^ ]
Follow :
A simple UDP time server and client for beginners[^]


据我所知,我们在Windows中具有完整的原始套接字支持,从win2000开始到Windows XP SP1结束.从WinXP SP2开始,仅原始UDP套接字可用,甚至原始UDP套接字也有一些额外的限制.有关这些限制的更多信息,请访问: http://msdn.microsoft.com/zh-cn/library/ms740548%28v = vs.85%29.aspx [ http://www.winpcap.org/default.htm [ ^ ].
我不会在这里写有关winpcap的小说,请查看其文档.如果您需要在Windows上完全自由,请使用此功能. winpcap的另一个好处是,它在源代码级别与libpcap(unix兄弟版本)兼容,因此您可以使用它编写与平台无关的网络工具.我最喜欢的数据包嗅探器:WireShark使用Winpcap.

现在,您已经掌握了基本信息和关键字,可以使用google搜索代码示例.例如,在Google上使用"winpcap raw udp数据包教程"关键字,我发现了这一点:
As far as I know right we had full raw socket support in windows beginning with win2000 and ending with WinXP SP1. From WinXP SP2 only raw UDP sockets are available and even raw UDP sockets have some extra restrictions. More about these limitations here: http://msdn.microsoft.com/en-us/library/ms740548%28v=vs.85%29.aspx[^].

You can use the winpcap driver to have better raw socket support, even with TCP: http://www.winpcap.org/default.htm[^].
I''m not going to write a novel about winpcap here, check out its documentation. If you need total freedom on windows use this. Another benefit of winpcap is that its compatible with libpcap (its unix sibling) on source level so you can write platform independent network tools using it. Winpcap is utilized by my favorite packet sniffer: WireShark.

Now you have the essential info and the keywords to search for code examples using google. For example using the "winpcap raw udp packet tutorial" keywords with google I found this: How to craft UDP packets and send them with WinPCap[^]


这篇关于如何制作发送udp数据包的Raw套接字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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