28 List NetworkService::activeServices;
29 List SharedBuffer::bufferList;
76 activeServices.
add(
this);
80 activeServices.
remove(
this);
82 void NetworkService::processIncomingPacket()
86 #if ENABLE_IP_RX_CHECKSUM || ENABLE_UDPTCP_RX_CHECKSUM
93 ACWARN(
"IP Header checksum error");
101 if (service->onPacketReceived())
105 ACTRACE(
"nobody wants this packet");
118 if ((int32_t)(millis() -
tickTimer) >= 0)
173 for (
int i = 0; i < 4; i++)
180 void NetworkService::notifyOnDNSResolve(uint8_t status, uint16_t
id,
const IPAddress& ip)
184 service->onDNSResolve(status,
id, ip);
Stores a MAC address in memory.
Union of all the different protocol headers and layers to help EtherDune interpret or build packet...
static const uint16_t ETHTYPE_IP
Ethernet header protocol type for IP.
MACAddress * whoHas(IPAddress &ip)
Attempts to return the MAC address associated with the provided IP address.
static uint8_t begin(uint8_t cspin)
uint8_t b[4]
byte-wise access to IP address
static DNSClient & DNS()
Obtains access to the DNS service singleton instance.
static EthBuffer packet
in-memory packet buffer currently being processed.
uint16_t rawValue
provides low level access to the memory containing the network-order integer
virtual void onDNSResolve(uint8_t status, uint16_t identification, const IPAddress &ip)
Called on each network service every time a DNS response is received.
static bool begin(uint8_t cspin)
Initializes EtherDune and the underlying hardware
represents an IP address in memory
static IPAddress netmask
Subnet mask.
void remove(ListItem *item)
static IPAddress gatewayIP
IP address of the gateway in this network.
ACROSS_MODULE("NetworkService")
virtual void tick()
This is a timer function that is called every NETWORK_TIMER_RESOLUTION milliseconds on every service...
static void packetSend(uint16_t len)
static uint32_t tickTimer
Contains functions to perform IP checksum operations.
static IPAddress dnsIP
IP address of the DNS server to use.
static MACAddress localMAC
Ethernet MAC address.
Implements the ARP protocol as an EtherDune service.
static bool sendIPPacket(uint16_t length)
Puts the current in-memory packet in the network
static ARPService ARP
ARP singleton instance.
static void prepareIPPacket(const IPAddress &remoteIP)
Sets up common IP header values for all outgoing IP packets and calculates the IP header checksum ...
static void writeBuf(uint16_t dst, uint16_t len, const byte *data)
static void loop()
Gives processing time to EtherDune so that it can check for incoming packets or send queued packets...
static bool sameLAN(IPAddress &dst)
Determines whether the given IP is in the same subnet as localIP
static IPAddress localIP
IP address of this application.
static const uint16_t NETWORK_TIMER_RESOLUTION
Resolution of the NetworkService timer.
Abstract base class for any network service running in EtherDune.
void zero()
sets the variable to 0.