#protocols #ppp #alloc #heap #compatible #required #point-to-point

no-std ppproto

Point-to-Point Protocol (PPP) for embedded systems. no-std compatible, no alloc (heap) required.

6 releases

0.2.1 Nov 14, 2024
0.2.0 Oct 6, 2024
0.1.2 Aug 29, 2023
0.0.0 Mar 7, 2023

#1522 in Embedded development

Download history 61/week @ 2024-10-21 130/week @ 2024-10-28 149/week @ 2024-11-04 184/week @ 2024-11-11 358/week @ 2024-11-18 129/week @ 2024-11-25 65/week @ 2024-12-02 107/week @ 2024-12-09 59/week @ 2024-12-16 35/week @ 2024-12-23 16/week @ 2024-12-30 75/week @ 2025-01-06 76/week @ 2025-01-13 37/week @ 2025-01-20 32/week @ 2025-01-27 33/week @ 2025-02-03

193 downloads per month
Used in embassy-net-ppp

MIT/Apache

48KB
1.5K SLoC

ppproto

Rust implementation of the Point-to-Point Protocol (PPP) for embedded systems. no-std compatible, no alloc (heap) required.

Relevant RFCs

  • RFC 1661 - The Point-to-Point Protocol (PPP)
  • RFC 1332 - The PPP Internet Protocol Control Protocol (IPCP)
  • RFC 1334 - PPP Authentication Protocols

Testing against pppd

Put this in /etc/ppp/pap-secrets, where myhostname is the hostname of your machine.

myuser myhostname mypass 192.168.7.10
socat -v -x PTY,link=pty1,rawer PTY,link=pty2,rawer
pppd $PWD/pty1 115200 192.168.7.1: ms-dns 8.8.4.4 ms-dns 8.8.8.8 nodetach debug local persist silent noproxyarp
RUST_LOG=trace cargo run --bin simple -- --device pty2
ping 192.168.7.10

Testing against a real modem

  • minicom -D /dev/ttyUSB0 -b 115200
  • put whatever AT commands you need to connect (such as ATD*99#)
  • Control+A Q
  • RUST_LOG=trace cargo run --bin simple -- --device /dev/ttyUSB0

If you want to "MITM" the serial communications to see the raw bytes coming and going, you can do this:

socat -v -x /dev/ttyUSB0 PTY,link=pty,rawer

and then use $PWD/pty instead of /dev/ttyUSB0

License

This work is licensed under either of

at your option.

Dependencies

~0.7–1.2MB
~27K SLoC