16 #ifndef __EtherDune_CONFIG__
17 #define __EtherDune_CONFIG__
41 #define EtherDune_BUFFER_SIZE 566
75 #define EtherDune_SAMPLE_SIZE 42
87 #define ENABLE_IP_RX_CHECKSUM true
93 #define ENABLE_UDPTCP_RX_CHECKSUM true
99 #define ENABLE_ICMP_RX_CHECKSUM true
128 #define MAX_FRAMELEN 1500
130 #define RXBUFFER_SIZE 3072
131 #define TXBUFFER_SIZE 1024
159 #define SCK_TIMEOUT_SYN_SENT_MS 5000
160 #define SCK_TIMEOUT_SYN_RECEIVED_MS 5000
161 #define SCK_TIMEOUT_FIN_WAIT_1_MS 6000
162 #define SCK_TIMEOUT_FIN_WAIT_2_MS 2000
163 #define SCK_TIMEOUT_CLOSE_WAIT_MS 2000
164 #define SCK_TIMEOUT_CLOSING_MS 2000
165 #define SCK_TIMEOUT_LAST_ACK_MS 2000
166 #define SCK_TIMEOUT_TIME_WAIT_MS 3000
167 #define SCK_TIMEOUT_RESOLVING_MS 3000
187 #define DNS_TIMEOUT_QUERY_MS 5000
201 #define ENABLE_DHCP_HOSTNAME _DEBUG
211 #define DHCP_TIMEOUT_SELECTING_MS 1000
212 #define DHCP_TIMEOUT_REQUESTING_MS 5000
213 #define DHCP_TIMEOUT_BOUND_MS 1000
240 #define HTTP_SERVER_HEADER_NAME_MAX_LENGTH 20
241 #define HTTP_SERVER_HEADER_VALUE_MAX_LENGTH 20
242 #define HTTP_SERVER_QUERY_STRING_MAX_LENGTH 41
249 #ifndef DOXYGEN_SHOULD_SKIP_THIS
255 #define RXSTART_INIT 0x0000
256 #define RXSTOP_INIT (RXBUFFER_SIZE-1)
258 #define TX_STATUS_VECTOR_SIZE 15
260 #define TXSTART_INIT (RXSTOP_INIT + 1)
261 #define TXSTOP_INIT (TXSTART_INIT + TXBUFFER_SIZE - 1)
263 #define ENC28J60_MEMSIZE 8192
266 #define SHARED_BUFFER_INIT (TXSTOP_INIT + 1 + TX_STATUS_VECTOR_SIZE)
267 #define SHARED_BUFFER_CAPACITY (ENC28J60_MEMSIZE - SHARED_BUFFER_INIT)
269 #define TXSTART_INIT_DATA (TXSTART_INIT + 1) // skip 1 byte to make room for the control byte required by ENC28J60
271 static const uint16_t i2 = TXSTOP_INIT;
272 static const uint16_t i1 = SHARED_BUFFER_INIT;
275 #define NTICKS(ms) ((ms)/NETWORK_TIMER_RESOLUTION)
294 #define QUOTE(str) #str
298 #if EtherDune_BUFFER_SIZE < 566
299 #error EtherDune_BUFFER_SIZE must be at least 566 bytes
303 #if EtherDune_SAMPLE_SIZE < 42
304 #error EtherDune_SAMPLE_SIZE must be at least 42 bytes
307 #if EtherDune_SAMPLE_SIZE > EtherDune_BUFFER_SIZE
308 #error EtherDune_SAMPLE_SIZE must be less than EtherDune_BUFFER_SIZE
311 #if EtherDune_BUFFER_SIZE & 1
312 #error EtherDune_BUFFER_SIZE must be an even number
315 #define BUFFER_END (SHARED_BUFFER_INIT + SHARED_BUFFER_CAPACITY)
317 #if (BUFFER_END) != (ENC28J60_MEMSIZE)
318 #error Memory mapping error
321 #if RXBUFFER_SIZE & 1
322 #error RXBUFFER_SIZE must be an even number
325 #if (SHARED_BUFFER_CAPACITY) < 2048
326 #error Resulting shared buffer capacity is too small. Reduce TXBUFFER_SIZE or RXBUFFER_SIZE to allow for more shared buffer.
static const int16_t MAX_ARP_TTL
Time the ARP entry is considered fresh, in minutes.
static const uint8_t TCP_SRC_PORT_H
Indicates the most significant byte of the source port number that EtherDune will use by default when...
static const char DHCP_HOSTNAME[]
host name sent to DHCP server.
static const uint8_t DHCP_MAX_ATTEMPTS
how many times to retry if address request is denied.
#define DHCP_TIMEOUT_SELECTING_MS
(in milliseconds) DHCP timeout in the SELECTING DHCP phase (waiting for reply to DHCP DISCOVER) ...
#define SCK_TIMEOUT_TIME_WAIT_MS
(either server or client) represents waiting for enough time to pass to be sure the remote TCP receiv...
static const uint16_t TCP_MAXIMUM_SEGMENT_SIZE
Maximum size of payload accepted by the library.
#define DHCP_TIMEOUT_REQUESTING_MS
(in milliseconds) DHCP timeout in the REQUESTING phase (waiting for reply to DHCP REQUEST) ...
#define SCK_TIMEOUT_RESOLVING_MS
waiting for a DNS query to resolve.
#define DHCP_TIMEOUT_BOUND_MS
(in milliseconds) set to 1 second so as to decrement the renewal timer
static const uint8_t ARP_TABLE_LENGTH
Maximum number of entries in the ARP table.
#define SCK_TIMEOUT_SYN_RECEIVED_MS
(server) SYN has been received, SYN ACK was sent and now waiting for ACK.
#define SCK_TIMEOUT_CLOSING_MS
(both server and client) represents waiting for a connection termination request acknowledgment from ...
#define SCK_TIMEOUT_FIN_WAIT_2_MS
(both server and client) represents waiting for a connection termination request from the remote TCP...
#define DNS_TIMEOUT_QUERY_MS
How long to wait before giving up on a DNS query.
static const uint16_t DHCP_DEFAULT_RENEWAL_TIMER_S
Time in seconds to hold the IP lease, unless stated otherwise by the DHCP server. ...
static const uint8_t ICMP_PING_DATA_LENGTH
size of data to send as part of an echo request
static const uint16_t NETWORK_TIMER_RESOLUTION
Resolution of the NetworkService timer.
#define SCK_TIMEOUT_LAST_ACK_MS
(both server and client) represents waiting for an acknowledgment of the connection termination reque...
static const uint8_t MAX_TCP_CONNECT_RETRIES
how many SYN packets to send before giving up.
#define SCK_TIMEOUT_SYN_SENT_MS
(client) represents waiting for a matching connection request after having sent a connection request...
static const uint8_t UDP_SRC_PORT_H
Indicates the most significant byte of the source port number that EtherDune will use by default when...
#define SCK_TIMEOUT_FIN_WAIT_1_MS
(both server and client) represents waiting for a connection termination request from the remote TCP...
#define SCK_TIMEOUT_CLOSE_WAIT_MS
(both server and client) represents waiting for a connection termination request from the local user...