136using TinyPPP = TinyPPP_Generic;
#define TINYPPP_MRU
Definition PPPEngine.h:21
Minimal IPv4 stack (ICMP echo, UDP, TCP, DNS resolver) for platforms without lwIP.
Definition IPStack.h:195
bool ipInput(const uint8_t *data, size_t len, bool reply=true)
Definition IPStack.h:542
void ipLinkDown()
Called when the link goes down: all connections are reset.
Definition IPStack.h:571
static IPStack *& current()
The stack used by sockets that were created without an explicit stack.
Definition IPStack.h:215
void poll()
Processes the link (input and timers): called by all socket methods.
Definition IPStack.h:221
Portable PPP engine: LCP, PAP client and IPCP over an Arduino Stream.
Definition PPPEngine.h:134
void writeIPv4(const uint8_t *data, size_t len)
Adds data to the packet started with beginIPv4()
Definition PPPEngine.h:266
bool sendIPv4(const uint8_t *data, size_t len)
Sends a complete IPv4 packet.
Definition PPPEngine.h:253
void start(Stream &io)
Starts the PPP negotiation on the indicated stream.
Definition PPPEngine.h:165
void process()
Reads available input and runs the timers: call frequently.
Definition PPPEngine.h:196
void setOfferedDNS(ip4_t dns1, ip4_t dns2=0)
DNS servers to offer the peer if it asks for them (server role)
Definition PPPEngine.h:143
void setLocalIP(ip4_t ip)
Optional static address configuration. 0 = negotiate with the peer.
Definition PPPEngine.h:139
ip4_t localIP() const
Our IP address (0 if not negotiated yet)
Definition PPPEngine.h:286
void setLogger(Print *log)
Debug output (nullptr to disable)
Definition PPPEngine.h:162
ip4_t dns2() const
Second DNS server received from the peer.
Definition PPPEngine.h:292
ip4_t dns1() const
First DNS server received from the peer.
Definition PPPEngine.h:290
void setPeerIP(ip4_t ip)
Address to assign to the peer if it requests one (server role)
Definition PPPEngine.h:141
void stop()
Closes the link gracefully (sends LCP Terminate-Request)
Definition PPPEngine.h:180
ip4_t peerIP() const
IP address of the peer.
Definition PPPEngine.h:288
bool beginIPv4()
Streaming API for chained buffers (e.g. lwIP pbuf)
Definition PPPEngine.h:260
bool endIPv4()
Sends the packet started with beginIPv4()
Definition PPPEngine.h:268
bool isUp() const
true when IPCP is open and IPv4 packets can be exchanged
Definition PPPEngine.h:280
uint16_t mtu() const
MTU we may use for sending (peer MRU)
Definition PPPEngine.h:294
Byte ring buffer with a fixed capacity of N bytes.
Definition IPStack.h:76
PPP network interface for platforms without lwIP: the PPP engine combined with the TinyPPP IPStack (T...
Definition TinyPPP_Generic.h:26
ip4_t ipLocal() const override
Definition TinyPPP_Generic.h:127
bool begin(Stream &io)
Starts the PPP negotiation over the indicated (already opened) stream.
Definition TinyPPP_Generic.h:34
IPAddress subnetMask() const
Always 255.255.255.255 (point-to-point link)
Definition TinyPPP_Generic.h:75
void * _stateRef
Definition TinyPPP_Generic.h:104
void onLinkUp() override
Called when IPCP is opened: addresses are available.
Definition TinyPPP_Generic.h:112
ip4_t ipDns(int n) const override
Definition TinyPPP_Generic.h:128
void onReceive(PacketCallback cb, void *ref=nullptr)
Definition TinyPPP_Generic.h:83
PacketCallback _rxCallback
Definition TinyPPP_Generic.h:101
bool send(const uint8_t *data, size_t len)
Sends a raw IPv4 packet.
Definition TinyPPP_Generic.h:94
void * _rxRef
Definition TinyPPP_Generic.h:102
bool waitConnected(uint32_t timeoutMs=30000)
Waits (while processing the link) until IPCP is up.
Definition TinyPPP_Generic.h:58
uint16_t ipMtu() const override
Definition TinyPPP_Generic.h:129
void ipPoll() override
Processes link input: received packets are passed to ipInput()
Definition TinyPPP_Generic.h:125
IPAddress localIP() const
Our IP address.
Definition TinyPPP_Generic.h:71
StateCallback _stateCallback
Definition TinyPPP_Generic.h:103
bool ipBegin() override
Starts an outgoing IPv4 packet.
Definition TinyPPP_Generic.h:122
bool connected() const
true when the link is up and has an IP address
Definition TinyPPP_Generic.h:69
void end()
Terminates the link.
Definition TinyPPP_Generic.h:41
bool config(IPAddress local, IPAddress peer=IPAddress(0, 0, 0, 0), IPAddress dns1=IPAddress(0, 0, 0, 0), IPAddress dns2=IPAddress(0, 0, 0, 0))
Definition TinyPPP_Generic.h:48
void onIPv4Packet(const uint8_t *data, size_t len) override
Called for each received IPv4 packet.
Definition TinyPPP_Generic.h:106
void ipWrite(const uint8_t *data, size_t len) override
Adds data to the outgoing packet.
Definition TinyPPP_Generic.h:123
void setLogger(Print &out)
Debug output, e.g. setLogger(Serial1)
Definition TinyPPP_Generic.h:98
void onStateChange(StateCallback cb, void *ref=nullptr)
Callback for link up/down; ref is passed to the callback.
Definition TinyPPP_Generic.h:88
IPAddress dnsIP(int n=0) const
The DNS server n (0 or 1) received from the peer.
Definition TinyPPP_Generic.h:77
void onLinkDown() override
Called when the IP link goes down.
Definition TinyPPP_Generic.h:116
IPAddress gatewayIP() const
The IP address of the peer.
Definition TinyPPP_Generic.h:73
bool ipEnd() override
Sends the packet.
Definition TinyPPP_Generic.h:124
bool ipIsUp() const override
Definition TinyPPP_Generic.h:126
void loop()
Processes input and timers: call regularly.
Definition TinyPPP_Generic.h:44
TinyPPP internals: PPP engine, HDLC framing and the IP stack.
Definition HDLC.h:11
IPAddress toIPAddress(ip4_t ip)
Converts an engine address to an Arduino IPAddress.
Definition PPPEngine.h:1146
ip4_t fromIPAddress(const IPAddress &ip)
Converts an Arduino IPAddress to an engine address (0 if not set)
Definition PPPEngine.h:1152
TinyPPP_ESP32 TinyPPP
The PPP network interface of this platform.
Definition TinyPPP_ESP32.h:304