Search code examples
network-programmingdevice-driverethernet

How can I inject raw packets onto my network


In testing certain network device driver receive features, I need to send special packets on the wire. I know I need to open a raw socket and push the bytes out. Is there some well-known example (C, perl, whatever) code already available for playing at this level?

(added later) I would prefer non-platform-specific answers, they'll be the most useful for everyone.


Solution

  • I found that there's a good C example here at Security-Freak, which only needed a little modification for flexibility. I'm hoping there are more answers in other languages.