Advertisement
Advertisement
| 03.26.2008 at 06:27PM PDT, ID: 23272704 | Points: 500 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: |
Put example:
// Check to see if transmit buffer is available
if ( ICMPIsTxReady() )
{
// Transmit ICMP packet.
ICMPPut(&RemoteNode, ICMP_ECHO_REPLY, data, datalen, id, seq);
// Done. ICMP is put into transmit queue.
//--------------------------------------------------------------
Get example:
// Check to see if any packet is ready
if ( IPGetHeader(&Remote, &IPProtocol, &IPLen) )
{
// Check what kind of protocol it is
if ( IPProtocol == IP_PROT_ICMP )
{
// This is ICMPP packet. Fetch it.
ICMPGet(&ICMPCode, data, &dataLen, &id, &seq);
// Process this ICMP packet.
../
// When done processing this packet, discard it
MACDiscardRx();
}
else
{
// This is not an ICMP packet. Handle it
|