friendev EtherDune TCP/IP library
Protected Member Functions | List of all members
ICMP Class Referenceabstract

Implements common ICMP packet building routines and ICMP checksum. More...

#include <ICMP.h>

Inheritance diagram for ICMP:
NetworkService ListItem ENC28J60 ICMPPingAutoReply ICMPPinger

Protected Member Functions

bool loadAll ()
 Loads the entire ICMP packet into memory. More...
 
void calcICMPChecksum ()
 Calculates the ICMP checksum and populates the checksum field in the ICMP header. More...
 
void sendICMPPacket (const IPAddress &targetIP, uint16_t dataLength)
 Sends an ICMP packet More...
 
virtual bool onICMPMessage ()=0
 
- Protected Member Functions inherited from NetworkService
 NetworkService ()
 
 ~NetworkService ()
 
virtual void tick ()
 This is a timer function that is called every NETWORK_TIMER_RESOLUTION milliseconds on every service. More...
 
virtual void onDNSResolve (uint8_t status, uint16_t identification, const IPAddress &ip)
 Called on each network service every time a DNS response is received. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from NetworkService
static bool sendIPPacket (uint16_t length)
 Puts the current in-memory packet in the network More...
 
static void prepareIPPacket (const IPAddress &remoteIP)
 Sets up common IP header values for all outgoing IP packets and calculates the IP header checksum More...
 
static bool sameLAN (IPAddress &dst)
 Determines whether the given IP is in the same subnet as localIP More...
 
static bool begin (uint8_t cspin)
 Initializes EtherDune and the underlying hardware More...
 
static void loop ()
 Gives processing time to EtherDune so that it can check for incoming packets or send queued packets. More...
 
static DNSClientDNS ()
 Obtains access to the DNS service singleton instance. More...
 
- Static Protected Member Functions inherited from ENC28J60
static void writeByte (byte b)
 
static void writeByte (uint16_t dst, byte b)
 
static void writeBuf (uint16_t dst, uint16_t len, const byte *data)
 
static void writeBuf (uint16_t len, const byte *data)
 
static uint16_t hardwareChecksum (uint16_t src, uint16_t len)
 
static uint16_t hardwareChecksumRxOffset (uint16_t offset, uint16_t len)
 
static void moveMem (uint16_t dest, uint16_t src, uint16_t len)
 
static void readBuf (uint16_t src, uint16_t len, byte *data)
 
static void readBuf (uint16_t len, byte *data)
 
static byte readByte (uint16_t src)
 
static void packetSend (uint16_t len)
 
static void packetSend (uint16_t len, const byte *data)
 
static void loadSample ()
 
static void loadAll ()
 
static void release ()
 
static uint8_t begin (uint8_t cspin)
 
static void loop ()
 
static void enableBroadcast ()
 
static bool isLinkUp ()
 Determines whether the network link is ready More...
 
- Static Protected Attributes inherited from NetworkService
static EthBuffer packet
 in-memory packet buffer currently being processed. More...
 
static ARPService ARP
 ARP singleton instance. More...
 
static MACAddress localMAC
 Ethernet MAC address. More...
 
static IPAddress localIP = { 0, 0, 0, 0 }
 IP address of this application. More...
 
static IPAddress gatewayIP = { 0, 0, 0, 0 }
 IP address of the gateway in this network. More...
 
static IPAddress netmask = { 0, 0, 0, 0 }
 Subnet mask. More...
 
static IPAddress dnsIP = { 0, 0, 0, 0 }
 IP address of the DNS server to use. More...
 

Detailed Description

Implements common ICMP packet building routines and ICMP checksum.

Implements code common to all ICMP services, such as checksum and packet preparation

This is an abstract base class, a building block for any ICMP-based service.

Definition at line 31 of file ICMP.h.

Member Function Documentation

void ICMP::calcICMPChecksum ( )
protected

Calculates the ICMP checksum and populates the checksum field in the ICMP header.

If receiving, calculating the checksum sets packet.icmp.checksum to zero if the packet had no checksum errors.

Definition at line 59 of file ICMP.cpp.

bool ICMP::loadAll ( )
protected

Loads the entire ICMP packet into memory.

Returns
true if checksum is correct, false otherwise. The packet contents are nevertheless loaded into the packet buffer

Definition at line 40 of file ICMP.cpp.

virtual bool ICMP::onICMPMessage ( )
protectedpure virtual
void ICMP::sendICMPPacket ( const IPAddress targetIP,
uint16_t  dataLength 
)
protected

Sends an ICMP packet

Parameters
targetIPWhere to send the ICMP packet
dataLengthICMP payload length

Definition at line 69 of file ICMP.cpp.


The documentation for this class was generated from the following files: