friendev EtherDune TCP/IP library
/home/jander/temp/etherdune/inet.h
Go to the documentation of this file.
1 // EtherDune Network Service base class
2 // Author: Javier Peletier <jm@friendev.com>
3 // Summary: Base data structures for Internet communication
4 // Credits: Some help text taken from Wikipedia and the TCP/IP guide http://http://www.tcpipguide.com/
5 //
6 // Copyright (c) 2015 All Rights Reserved, http://friendev.com
7 //
8 // This source is subject to the GPLv2 license.
9 // Please see the License.txt file for more information.
10 // All other rights reserved.
11 //
12 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
13 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
14 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
15 // PARTICULAR PURPOSE.
16 
24 #ifndef __inet_h_
25 #define __inet_h_
26 
27 #include <ACross.h>
28 #include "config.h"
29 
31 
33 union u16_t
34 {
35  struct
36  {
37  uint8_t l;
38  uint8_t h;
39  };
40  uint16_t v;
41 };
42 union u32_t
43 {
44  struct
45  {
46  u16_t l;
47  u16_t h;
48  };
49  uint32_t v;
50 };
51 
53 
59 union nint16_t
60 {
61  uint16_t rawValue;
62  struct
63  {
64  uint8_t h;
65  uint8_t l;
66  };
67 
74  operator uint16_t()
75  {
76  u16_t u;
77  u.l = l;
78  u.h = h;
79 
80  return u.v;
81  }
82 
87  void operator=(uint16_t v)
88  {
89 
90  l = (uint8_t)v;
91  h = v >> 8;
92  }
93 
97  inline void zero()
98  {
99  rawValue = 0;
100  }
101 };
102 
103 
109 union nint32_t
110 {
111  uint32_t rawValue;
112  struct
113  {
116  };
117  uint8_t raw[4];
118 
125  operator uint32_t()
126  {
127  u32_t u;
128  u.h.h = h.h;
129  u.h.l = h.l;
130  u.l.h = l.h;
131  u.l.l = l.l;
132  return u.v;
133  }
134 
139  void operator=(uint32_t v)
140  {
141  u32_t u;
142  u.v = v;
143 
144  h.h = u.h.h;
145  h.l = u.h.l;
146  l.h = u.l.h;
147  l.l = u.l.l;
148 
149 
150 
151  }
152 
156  inline void zero()
157  {
158  rawValue = 0;
159  }
160 
161 };
162 
165 {
166  uint8_t b[4];
167 };
168 
170 #define IPAddress_P PROGMEM IPAddress_P_
171 
172 #ifdef ACROSS_ARDUINO
173 #define IPADDR_P(b0,b1,b2,b3) (__extension__({static IPAddress_P_ __c PROGMEM = {(b0),(b1),(b2),(b3)}; &__c;}))
175 #else
176 #define IPADDR_P(b0,b1,b2,b3) {{ (b0),(b1),(b2),(b3) }}
178 #endif
179 
182 {
183  uint8_t b[4];
184  uint32_t u;
185 
191  {
192  memcpy_P(b, ip, sizeof(IPAddress));
193  }
194 
200  {
201  operator=(&ip);
202  }
203 
207  void zero()
208  {
209  u = 0;
210  }
211 
216  {
217  //u = 0xFFFFFFFF;
218  *this = IPADDR_P(255, 255, 255, 255); // consumes 2 bytes less than the above, oh well...
219  }
220 
227  char* toString() const
228  {
229  static char addressString[16];
230  sprintf(addressString, "%d.%d.%d.%d", b[0], b[1], b[2], b[3]);
231  return addressString;
232  }
233 
234 };
235 
238 {
239  uint8_t b[6];
240 };
241 
242 #define MACAddress_P PROGMEM MACAddress_P_
243 #ifdef ACROSS_ARDUINO
244 #define MACADDR_P(b0,b1,b2,b3,b4,b5) (__extension__({static MACAddress_P_ __c PROGMEM = {(b0),(b1),(b2),(b3),(b4),(b5)}; &__c;}))
246 #else
247 #define MACADDR_P(b0,b1,b2,b3,b4,b5) {{ (b0),(b1),(b2),(b3),(b4),(b5) }}
249 #endif
250 
253 {
254  uint8_t b[6];
255 
261  {
262  memcpy_P(b, mac, sizeof(MACAddress));
263  }
264 
270  {
271  operator=(&mac);
272  }
273 
274 };
275 
276 
279 {
280  struct
281  {
284  uint8_t HLEN;
285  uint8_t PLEN;
291  };
292  uint8_t raw[28];
293 };
294 
296 union IPHeader
297 {
298  struct
299  {
300  struct
301  {
302  uint8_t IHL : 4;
303  uint8_t version : 4;
304  };
305  struct
306  {
307  uint8_t ECN : 2;
308  uint8_t DSCP : 6;
309  };
312  struct
313  {
314  uint16_t fragmentOffset : 13;
315  uint16_t flags : 3;
316  };
317  uint8_t TTL;
318  uint8_t protocol;
322  };
323  uint8_t raw[20];
324 
325 };
326 
328 union TCPFlags
329 {
330  struct
331  {
332  uint8_t FIN : 1;
333  uint8_t SYN : 1;
334  uint8_t RST : 1;
335  uint8_t PSH : 1;
336  uint8_t ACK : 1;
337  uint8_t URG : 1;
338  uint8_t ECE : 1;
339  uint8_t CWR : 1;
340  };
341  uint8_t raw;
342 
346  void clear()
347  {
348  raw = 0;
349  }
350 };
351 
353 struct TCPHeader
354 {
359 
360  union
361  {
362  struct
363  {
364  uint8_t NS : 1;
365  uint8_t reserved : 3;
366  uint8_t headerLength : 4;
368  };
369  uint16_t allFlags;
370  };
371 
375 };
376 
379 {
380 
381  uint8_t option1;
382  uint8_t option1_length;
384 
385 };
386 
388 struct UDPHeader
389 {
394 };
395 
397 struct DNSHeader
398 {
399  uint16_t identification;
400  union
401  {
402  struct
403  {
404  uint8_t RD : 1;
405  uint8_t TC : 1;
406  uint8_t AA : 1;
407  uint8_t opcode : 4;
408  uint8_t QR : 1;
409  uint8_t rcode : 4;
410  uint8_t reserved : 3;
411  uint8_t RA : 1;
412  };
413  uint16_t flags;
414  };
419 
423  void zero()
424  {
425  memset(this, 0, sizeof(DNSHeader));
426  }
427 
428 };
429 
432 {
433  uint8_t type;
434  uint8_t code;
435  uint16_t checksum;
436  union
437  {
438  struct
439  {
440  uint16_t identifier;
441  uint16_t sequenceNumber;
442  };
443  uint32_t timestamp;
444  };
445 
450  uint8_t* dataStart()
451  {
452  return (uint8_t*)this + sizeof(ICMPHeader);
453  }
454 };
455 
458 {
462 };
463 
466 {
467  uint8_t op;
468  uint8_t htype;
469  uint8_t hlen;
470  uint8_t hops;
473  uint16_t broadcastFlag;
478  union
479  {
481  byte chaddr[16];
482  };
483  byte sname[64];
484  byte filename[128];
486 };
487 
490 {
491  byte data[EtherDune_BUFFER_SIZE - sizeof(DHCPHeader) - sizeof(UDPHeader) - sizeof(IPHeader) - sizeof(EthernetHeader)];
492 };
493 
497 {
498  struct
499  {
501  union
502  {
504  struct
505  {
507  union
508  {
510  struct
511  {
513  union
514  {
515  byte udpData[EtherDune_BUFFER_SIZE - sizeof(EthernetHeader) - sizeof(IPHeader) - sizeof(UDPHeader)];
517  struct
518  {
521  };
522  };
523 
524  };
525  struct
526  {
529  };
530 
531  };
532 
533  };
534 
535  };
536  };
538 };
539 
540 
542 struct ARPEntry
543 {
546  int8_t status_TTL;
547 };
548 
549 
550 static const uint8_t SCK_STATE_CLOSED = 0;
551 static const uint8_t SCK_STATE_LISTEN = 1;
552 static const uint8_t SCK_STATE_SYN_SENT = 2;
553 static const uint8_t SCK_STATE_SYN_RECEIVED = 3;
554 static const uint8_t SCK_STATE_ESTABLISHED = 4;
555 static const uint8_t SCK_STATE_FIN_WAIT_1 = 5;
556 static const uint8_t SCK_STATE_FIN_WAIT_2 = 6;
557 static const uint8_t SCK_STATE_CLOSE_WAIT = 7;
558 static const uint8_t SCK_STATE_CLOSING = 8;
559 static const uint8_t SCK_STATE_LAST_ACK = 9;
560 static const uint8_t SCK_STATE_TIME_WAIT = 10;
561 static const uint8_t SCK_STATE_RESOLVING = 11;
562 
563 static const uint8_t DHCP_STATE_INIT = 0;
564 static const uint8_t DHCP_STATE_SELECTING = 1;
565 static const uint8_t DHCP_STATE_REQUESTING = 2;
566 static const uint8_t DHCP_STATE_BOUND = 3;
567 static const uint8_t DHCP_STATE_RENEWING = 4;
568 static const uint8_t DHCP_STATE_REBINDING = 5;
569 
570 static const uint8_t IP_PROTO_ICMP = 1;
571 static const uint8_t IP_PROTO_TCP = 6;
572 static const uint8_t IP_PROTO_UDP = 17;
573 
574 static const uint8_t ICMP_TYPE_ECHOREPLY = 0;
575 static const uint8_t ICMP_TYPE_ECHOREQUEST = 8;
576 
577 static const uint16_t ETHTYPE_ARP = 0x0806;
578 static const uint16_t ETHTYPE_IP = 0x0800;
579 
580 static const uint8_t ARP_OPCODE_REPLY_L = 0x02;
581 static const uint8_t ARP_OPCODE_REQ_L = 0x01;
582 
583 #endif
uint8_t opcode
Operation Code.
Definition: inet.h:407
uint8_t raw[4]
Definition: inet.h:117
helper struct to store an IP address in PROGMEM
Definition: inet.h:164
Stores a MAC address in memory.
Definition: inet.h:252
static const uint8_t SCK_STATE_FIN_WAIT_1
(both server and client) represents waiting for a connection termination request from the remote TCP...
Definition: inet.h:555
static const uint8_t DHCP_STATE_REBINDING
The client has failed to renew its lease with the server that originally granted it, and now seeks a lease extension with any server that can hear it.
Definition: inet.h:568
Holds a DHCP header.
Definition: inet.h:465
Union of all the different protocol headers and layers to help EtherDune interpret or build packet...
Definition: inet.h:496
uint8_t ECE
ECN-Echo has a dual role, depending on the value of the SYN flag.
Definition: inet.h:338
uint16_t checksum
Error checking data.
Definition: inet.h:435
byte sname[64]
Server Name.
Definition: inet.h:483
static const uint8_t ICMP_TYPE_ECHOREPLY
ICMP echo reply operation type.
Definition: inet.h:574
uint8_t RST
Reset the connection.
Definition: inet.h:334
uint8_t version
Protocol version.
Definition: inet.h:303
IPAddress ciaddr
Client IP Address.
Definition: inet.h:474
uint8_t TTL
Time To Live.
Definition: inet.h:317
void zero()
sets the variable to 0.
Definition: inet.h:156
uint8_t htype
Hardware Type.
Definition: inet.h:468
static const uint8_t SCK_STATE_LAST_ACK
(both server and client) represents waiting for an acknowledgment of the connection termination reque...
Definition: inet.h:559
MACAddress mac
The hardware (layer two) address of the client, which is used for identification and communication...
Definition: inet.h:480
static const uint8_t DHCP_STATE_BOUND
Client has a valid lease and is in its normal operating state.
Definition: inet.h:566
nint16_t etherType
Protocol type, e.g.
Definition: inet.h:461
static const uint16_t ETHTYPE_IP
Ethernet header protocol type for IP.
Definition: inet.h:578
ICMPHeader icmp
Definition: inet.h:509
uint8_t HLEN
Hardware address length.
Definition: inet.h:284
nint16_t option1_value
option value
Definition: inet.h:383
IPAddress sourceIP
Source address.
Definition: inet.h:320
DHCPHeader dhcp
Definition: inet.h:519
uint32_t u
access the IP as a uint32_t for convenience
Definition: inet.h:184
nint16_t h
most significant integer
Definition: inet.h:114
uint8_t QR
Query or Response.
Definition: inet.h:408
Structure to represent an UDP header.
Definition: inet.h:388
uint8_t b[4]
byte-wise access to IP address
Definition: inet.h:183
IPAddress yiaddr
Your IP Address.
Definition: inet.h:475
uint8_t raw[566]
Definition: inet.h:537
nint32_t acknowledgementNumber
if the ACK flag is set then the value of this field is the next sequence number that the receiver is ...
Definition: inet.h:358
static const uint8_t SCK_STATE_FIN_WAIT_2
(both server and client) represents waiting for a connection termination request from the remote TCP...
Definition: inet.h:556
uint8_t PLEN
Protocol address length.
Definition: inet.h:285
nint16_t checksum
The 16-bit checksum field is used for error-checking of the header and data.
Definition: inet.h:373
uint16_t rawValue
provides low level access to the memory containing the network-order integer
Definition: inet.h:61
nint16_t destinationPort
identifies the receiving port
Definition: inet.h:356
uint8_t headerLength
Definition: inet.h:366
uint16_t sequenceNumber
used to identify this echo request
Definition: inet.h:441
uint32_t rawValue
provides low level access to the memory containing the network-order integer
Definition: inet.h:111
IPAddress giaddr
Gateway for DHCP request routing.
Definition: inet.h:477
nint16_t l
least significant integer
Definition: inet.h:115
uint16_t flags
Flags.
Definition: inet.h:315
void operator=(MACAddress_P_ *mac)
Assigns from a MAC address stored in PROGMEM
Definition: inet.h:260
uint8_t reserved
Reserved for future use.
Definition: inet.h:365
static const uint8_t ARP_OPCODE_REPLY_L
ARP Opcode for reply.
Definition: inet.h:580
static const uint8_t ARP_OPCODE_REQ_L
ARP Opcode for request.
Definition: inet.h:581
IPAddress targetIP
Target protocol address.
Definition: inet.h:290
nint16_t urgentPointer
if the URG flag is set, then this 16-bit field is an offset from the sequence number indicating the l...
Definition: inet.h:374
Represents the header of an Ethernet frame.
Definition: inet.h:457
DHCPOptions dhcpOptions
Definition: inet.h:520
MACAddress srcMAC
Source MAC address.
Definition: inet.h:460
uint8_t RA
Recursion Available.
Definition: inet.h:411
static const uint8_t SCK_STATE_SYN_RECEIVED
(server) represents waiting for a confirming connection request acknowledgment after having both rece...
Definition: inet.h:553
static const uint8_t SCK_STATE_CLOSED
(both server and client) represents no connection state at all.
Definition: inet.h:550
uint8_t raw
byte-wise access to all flags
Definition: inet.h:341
byte udpData[566-sizeof(EthernetHeader)-sizeof(IPHeader)-sizeof(UDPHeader)]
Definition: inet.h:515
Structure used to encode part of a DNS query.
Definition: inet.h:397
UDPHeader udp
Definition: inet.h:512
uint8_t raw[20]
byte-wise access to all fields
Definition: inet.h:323
IPAddress siaddr
Server IP address: the address of the server that the client should use for the next step in the boot...
Definition: inet.h:476
Entry in the ARP table.
Definition: inet.h:542
uint16_t allFlags
byte-wise access to all flags.
Definition: inet.h:369
MACAddress mac
MAC address.
Definition: inet.h:545
void setBroadcastIP()
Sets the IP to 255.255.255.255
Definition: inet.h:215
represents an IP address in memory
Definition: inet.h:181
IPAddress magicCookie
Definition: inet.h:485
static const uint8_t SCK_STATE_SYN_SENT
(client) represents waiting for a matching connection request after having sent a connection request...
Definition: inet.h:552
void zero()
Sets the entire header to zero.
Definition: inet.h:423
static const uint8_t SCK_STATE_RESOLVING
IP Address is being resolved.
Definition: inet.h:561
uint8_t protocol
Protocol.
Definition: inet.h:318
Represents a network byte order 32 bit integer.
Definition: inet.h:109
MACAddress dstMAC
Destination MAC address.
Definition: inet.h:459
nint32_t xid
Transaction Identifier.
Definition: inet.h:471
nint16_t checksum
Header Checksum.
Definition: inet.h:319
uint16_t identifier
used to identify this echo request
Definition: inet.h:440
uint8_t code
ICMP subtype.
Definition: inet.h:434
#define IPADDR_P(b0, b1, b2, b3)
defines an IP address as stored in PROGMEM
Definition: inet.h:177
static const uint8_t ICMP_TYPE_ECHOREQUEST
ICMP echo request operation type.
Definition: inet.h:575
uint16_t fragmentOffset
Fragment Offset.
Definition: inet.h:314
void operator=(IPAddress_P_ *ip)
Assigns from an IP address stored in PROGMEM
Definition: inet.h:190
uint16_t flags
Definition: inet.h:413
IP header.
Definition: inet.h:296
uint8_t type
ICMP type.
Definition: inet.h:433
nint16_t secs
Number of seconds elapsed since a client began an attempt to acquire or renew a lease.
Definition: inet.h:472
nint16_t OPER
Operation.
Definition: inet.h:286
uint8_t raw[28]
byte-wise access to all fields
Definition: inet.h:292
static const uint8_t SCK_STATE_TIME_WAIT
(either server or client) represents waiting for enough time to pass to be sure the remote TCP receiv...
Definition: inet.h:560
nint16_t numberOfAuthorityRRs
Authority Record Count.
Definition: inet.h:417
nint16_t windowSize
The size of the receive window, which specifies the number of window size units (by default...
Definition: inet.h:372
uint16_t identification
A 16-bit identification number chosen by the client.
Definition: inet.h:399
Represents a network byte order 16 bit integer.
Definition: inet.h:59
TCP Header data structure.
Definition: inet.h:353
uint8_t IHL
Internet Header Length.
Definition: inet.h:302
uint16_t broadcastFlag
Broadcast flag.
Definition: inet.h:473
uint8_t option1_length
option length
Definition: inet.h:382
uint8_t ECN
Explicit Congestion Notification.
Definition: inet.h:307
ICMP Header and Echo request/reply.
Definition: inet.h:431
nint16_t destinationPort
Identifies the receiving port.
Definition: inet.h:391
uint8_t b[4]
Definition: inet.h:166
char * toString() const
Converts the IP address to a string for display.
Definition: inet.h:227
uint8_t b[6]
byte-wise access to the MAC address
Definition: inet.h:254
void clear()
Sets all flags to zero.
Definition: inet.h:346
MACAddress senderMAC
Sender hardware address.
Definition: inet.h:287
uint8_t PSH
Push function.
Definition: inet.h:335
uint8_t URG
Indicates that the Urgent pointer field is significant.
Definition: inet.h:337
uint8_t NS
ECN-nonce concealment protection (experimental: see RFC 3540).
Definition: inet.h:364
nint16_t dataLength
Total length of payload and header.
Definition: inet.h:392
static const uint16_t ETHTYPE_ARP
Ethernet header protocol type for ARP.
Definition: inet.h:577
#define EtherDune_BUFFER_SIZE
RAM memory buffer size to hold a packet.
Definition: config.h:41
void zero()
Sets the IP address to zero.
Definition: inet.h:207
void operator=(uint32_t v)
Assigns a little endian value to this network-order integer
Definition: inet.h:139
uint8_t hlen
Hardware Address Length.
Definition: inet.h:469
nint16_t numberOfAdditionalRRs
Additional Record Count.
Definition: inet.h:418
nint16_t checksum
The 16-bit checksum field is used for error-checking of the header and data.
Definition: inet.h:393
Structure to encode one 2-byte long TCP option.
Definition: inet.h:378
uint8_t CWR
Congestion Window Reduced (CWR) flag is set by the sending host to indicate that it received a TCP se...
Definition: inet.h:339
MACAddress targetMAC
Target hardware address.
Definition: inet.h:289
nint16_t numberOfAnswerRRs
Answer Record Count.
Definition: inet.h:416
static const uint8_t IP_PROTO_TCP
IP header protocol type for TCP.
Definition: inet.h:571
static const uint8_t DHCP_STATE_REQUESTING
The client is waiting to hear back from the server to which it sent its request.
Definition: inet.h:565
uint32_t timestamp
convenient merge of both identifier and sequence number to use as storage for millis() ...
Definition: inet.h:443
nint16_t sourcePort
Identifies the sending port.
Definition: inet.h:390
uint8_t TC
Truncation Flag.
Definition: inet.h:405
uint8_t * dataStart()
Points to the beginning of the ICMP echo data.
Definition: inet.h:450
static const uint8_t SCK_STATE_LISTEN
(server) represents waiting for a connection request from any remote TCP and port.
Definition: inet.h:551
TCP flags data structure.
Definition: inet.h:328
uint8_t FIN
No more data from sender.
Definition: inet.h:332
byte filename[128]
Definition: inet.h:484
static const uint8_t SCK_STATE_ESTABLISHED
(both server and client) represents an open connection, data received can be delivered to the user...
Definition: inet.h:554
IPAddress ip
IP address.
Definition: inet.h:544
static const uint8_t SCK_STATE_CLOSING
(both server and client) represents waiting for a connection termination request acknowledgment from ...
Definition: inet.h:558
uint8_t DSCP
Differentiated Services Code Point.
Definition: inet.h:308
IPAddress destinationIP
Destination address.
Definition: inet.h:321
TCPFlags flags
TCP Flags.
Definition: inet.h:367
uint8_t l
least significant byte
Definition: inet.h:65
ARP packet layout.
Definition: inet.h:278
uint8_t b[6]
Definition: inet.h:239
nint32_t sequenceNumber
has a dual role: If the SYN flag is set(1), then this is the initial sequence number.The sequence number of the actual first data byte and the acknowledged number in the corresponding ACK are then this sequence number plus 1.
Definition: inet.h:357
uint8_t AA
Authoritative Answer Flag.
Definition: inet.h:406
DNSHeader dns
Definition: inet.h:516
static const uint8_t IP_PROTO_ICMP
IP header protocol type for ICMP.
Definition: inet.h:570
TCPOptions tcpOptions
Definition: inet.h:528
helper struct to store a MAC address in PROGMEM
Definition: inet.h:237
nint16_t identification
Identification.
Definition: inet.h:311
IPHeader ip
Definition: inet.h:506
nint16_t totalLength
This 16-bit field defines the entire packet (fragment) size, including header and data...
Definition: inet.h:310
uint8_t op
Operation Code.
Definition: inet.h:467
nint16_t HTYPE
Hardware type.
Definition: inet.h:282
IPAddress senderIP
Sender protocol address.
Definition: inet.h:288
struct to represent the remaining space for DHCP options
Definition: inet.h:489
uint8_t h
most significant byte
Definition: inet.h:64
uint8_t option1
Option kind.
Definition: inet.h:381
uint8_t rcode
Response Code.
Definition: inet.h:409
TCPHeader tcp
Definition: inet.h:527
ARPPacket arp
Definition: inet.h:503
nint16_t sourcePort
identifies the sending port
Definition: inet.h:355
static const uint8_t DHCP_STATE_INIT
This is the initialization state, where a client begins the process of acquiring a lease...
Definition: inet.h:563
uint8_t hops
Hops.
Definition: inet.h:470
static const uint8_t DHCP_STATE_RENEWING
Client is trying to renew its lease.
Definition: inet.h:567
void operator=(uint16_t v)
Assigns a little endian value to this network-order integer
Definition: inet.h:87
uint8_t reserved
Definition: inet.h:410
EthernetHeader eth
Definition: inet.h:500
nint16_t PTYPE
Protocol type.
Definition: inet.h:283
void zero()
sets the variable to 0.
Definition: inet.h:97
uint8_t RD
Recursion Desired.
Definition: inet.h:404
nint16_t numberOfQuestions
Question Count.
Definition: inet.h:415
uint8_t ACK
Indicates that the Acknowledgment field is significant.
Definition: inet.h:336
uint8_t SYN
Synchronize sequence numbers.
Definition: inet.h:333
static const uint8_t IP_PROTO_UDP
IP header protocol type for UDP.
Definition: inet.h:572
static const uint8_t SCK_STATE_CLOSE_WAIT
(both server and client) represents waiting for a connection termination request from the local user...
Definition: inet.h:557
byte data[566-sizeof(DHCPHeader)-sizeof(UDPHeader)-sizeof(IPHeader)-sizeof(EthernetHeader)]
Definition: inet.h:491
byte chaddr[16]
Definition: inet.h:481
int8_t status_TTL
TTL in minutes to consider the entry valid.
Definition: inet.h:546
static const uint8_t DHCP_STATE_SELECTING
The client is waiting to receive DHCPOFFER messages from one or more DHCP servers, so it can choose one.
Definition: inet.h:564