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
|