TinyPPP
PPP networking over any Arduino Stream
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Typedefs | Enumerations
IPStack.h File Reference
#include <stdint.h>
#include <string.h>
#include <Arduino.h>

Go to the source code of this file.

Classes

class  Checksum
 Internet checksum (RFC 1071) over several (possibly odd sized) pieces. More...
 
class  IPStack
 Minimal IPv4 stack (ICMP echo, UDP, TCP, DNS resolver) for platforms without lwIP. More...
 
class  RingBuffer< N >
 Byte ring buffer with a fixed capacity of N bytes. More...
 

Namespaces

namespace  tinyppp
 TinyPPP internals: PPP engine, HDLC framing and the IP stack.
 

Macros

#define TINYPPP_TCP_LINGER   10000
 Max time in ms a socket closed by stop() is kept to complete the close.
 
#define TINYPPP_TCP_LISTENERS   2
 
#define TINYPPP_TCP_MAX_RETRIES   8
 
#define TINYPPP_TCP_RTO   1000
 Initial TCP retransmission timeout in ms (doubled on each retry)
 
#define TINYPPP_TCP_RX_BUFFER   1024
 
#define TINYPPP_TCP_SOCKETS   4
 
#define TINYPPP_TCP_TIME_WAIT   2000
 Time in ms a closed socket stays in TIME_WAIT.
 
#define TINYPPP_TCP_TX_BUFFER   1024
 
#define TINYPPP_UDP_RX_BUFFER   1024
 
#define TINYPPP_UDP_SOCKETS   2
 
#define TINYPPP_UDP_TX_BUFFER   576
 

Typedefs

using ip4_t = uint32_t
 IPv4 address in network byte order as stored in memory.
 

Enumerations

enum class  TCPState : uint8_t {
  Closed , SynSent , SynRcvd , Established ,
  FinWait1 , FinWait2 , CloseWait , Closing ,
  LastAck , TimeWait
}
 TCP connection states (RFC 793) More...
 

Macro Definition Documentation

◆ TINYPPP_TCP_LINGER

#define TINYPPP_TCP_LINGER   10000

Max time in ms a socket closed by stop() is kept to complete the close.

◆ TINYPPP_TCP_LISTENERS

#define TINYPPP_TCP_LISTENERS   2

◆ TINYPPP_TCP_MAX_RETRIES

#define TINYPPP_TCP_MAX_RETRIES   8

◆ TINYPPP_TCP_RTO

#define TINYPPP_TCP_RTO   1000

Initial TCP retransmission timeout in ms (doubled on each retry)

◆ TINYPPP_TCP_RX_BUFFER

#define TINYPPP_TCP_RX_BUFFER   1024

◆ TINYPPP_TCP_SOCKETS

#define TINYPPP_TCP_SOCKETS   4

A minimal IPv4 stack for platforms without lwIP (e.g. SAMD and mbed based WiFiNINA boards, the desktop): ICMP echo, UDP, TCP and a DNS resolver. It is independent from PPP: the link layer implements ipBegin(), ipWrite(), ipEnd() and ipPoll() and passes received packets to ipInput().

Limitations (by design, to keep it small):

  • TCP accepts in-order segments only and has no congestion control
  • no IP fragmentation and reassembly, no IP options on output
  • no IPv6, no multicast

There is no background task: the stack is processed in ipPoll(), which is called by all socket methods. Call it regularly (e.g. TinyPPP::loop()) when the sketch is busy with something else.

◆ TINYPPP_TCP_TIME_WAIT

#define TINYPPP_TCP_TIME_WAIT   2000

Time in ms a closed socket stays in TIME_WAIT.

◆ TINYPPP_TCP_TX_BUFFER

#define TINYPPP_TCP_TX_BUFFER   1024

◆ TINYPPP_UDP_RX_BUFFER

#define TINYPPP_UDP_RX_BUFFER   1024

◆ TINYPPP_UDP_SOCKETS

#define TINYPPP_UDP_SOCKETS   2

◆ TINYPPP_UDP_TX_BUFFER

#define TINYPPP_UDP_TX_BUFFER   576