Changes between Version 4 and Version 5 of Tutorials/Layer2Ping/Procedure/Execute
- Timestamp:
- 02/09/15 10:58:22 (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Tutorials/Layer2Ping/Procedure/Execute
v4 v5 109 109 - Open a Layer 2 socket (lines 110 - 115) 110 110 - Bind the socket to the specified interface (lines 117 - 125) 111 - In a buffer compose the contents of the data portion of the Ethernet frame to be sent to the server. In our case the data portion has the format "RQ:<randomNumber>+<randomNumber>" (line 13 3)111 - In a buffer compose the contents of the data portion of the Ethernet frame to be sent to the server. In our case the data portion has the format "RQ:<randomNumber>+<randomNumber>" (line 134) 112 112 - Send the packet. The send is successful if the return from {{{sendPacket}}} matches the number of bytes sent. The {{{sendPacket}}} function is implemented in the file {{{packetFunctions.c}}} in this directory. This function sets the appropriate header fields in the ethernet frame before sending it. 113 113 - Wait for the server to respond (line 145). The {{{receivePacket}}} function is implemented in file {{{packetFunctions.c}}}.