Skip to content

nispor/mozim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

33b3651 · Jan 13, 2025

History

65 Commits
Dec 15, 2024
Feb 19, 2024
Dec 15, 2024
Dec 16, 2024
Jan 7, 2025
Feb 12, 2023
Oct 24, 2021
Mar 27, 2022
Dec 14, 2024
Jan 13, 2025
Oct 24, 2021
Dec 16, 2024

Repository files navigation

Mozim -- DHCP Client Library

Still doing code sign, no real work this project can do yet. Check again in 2022.

DONE:

  • raw socket with BPF applied and accepting all mac address.
  • DHCP discovery and request.
  • Renew, rebind.
  • DHCP IP apply via cli tool mzc.
  • Route
  • Timeout and retry

TODO:

  • Verify XID.
  • Handle vendor difference: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/848
  • Support multiple DHCP servers with DHCPNAK reply.
  • Support DHCPNAK
  • Support DHCPDECLINE: Client to server indicating network address is already in use.
  • Support DHCPINFORM: Client to server, asking only for local configuration parameters; client already has externally configured network address.
  • Rate control -- Token bucket (RFC 2698)
  • Initial sleep before discovery/solicit(need check RFC)

Try out

# Below script will create veth eth1/eth1.ep.
# The `eth1.ep` is DHCP server interface running dnsmasq in `mozim` network
# namespace.
sudo ./utils/test_env_mozim &
cargo run --example mozim_dhcpv4_async
cargo run --example mozim_dhcpv6_sync