How can I embed raw packets into my network

When testing some functions of receiving network device drivers, I need to send special packets to the wire. I know that I need to open a raw socket and push out bytes. Is there any known example (C, perl, any) of code already available for playback at this level?

(added later) I would prefer non-platform answers, they will be most useful for everyone.

+3
source share
6 answers

I found that there is a good example here on Security-Freak , which required only a small modification for flexibility. I hope there are more answers in other languages.

0
source

http://www.codeproject.com/KB/IP/sendrawpacket.aspx

There is already an existing project that can help you with this.

+2
source

packet. , SOCK_RAW SOCK_DGRAM, , . , , .

+2
+1

. UDP IP-, , . , UDP .

0

Source: https://habr.com/ru/post/1730265/


All Articles