Consider the WinPcap tutorial for sending a single packet. To start running it, it is relatively straightforward:
- copy and paste the code into your IDE for C (in my case code::blocks)
- add
#define HAVE_REMOTE
to the 1st line - set the build options (link libraries and directories)
- set the proper mac addresses
- fill the array with the data you want to send
- compile and execute (as administrator)
It works nice and is well documented. If you run the other tutorial for capturing packets, you will see that the packet is transmitted properly.
However, if you set the 13th array element to 0~5, the packet will not be transmitted properly. For example, before sending down the packet, add the following line of code:
packet[12]=5;
This way, the packet that was previously being transmitted, no longer will be transmitted (without any error message). Which doesn't make any sense. According to the documentation, this array element is already part of the payload (ie: no longer mac address, length or header), and could be any integer from 0 to 255.
Issue
Why this 13th array element is causing the packets to no longer be transmitted?