* Add license specifier to all Cargo.toml files
Explicitly specify `license = "GPL-2.0-only"` in each Cargo.toml
file. The wording is from the SPX guidelines.
* Add shell script to check licenses of Rust projects
rust/check_licenses.sh automatically verifies all dependencies
for accidental usage of GPLv3. Since basically nobody in the
universe uses GPLv3, it tends not to do much.
Port the C from `bpf_num_possible_cpus()` over to safe Rust,
with proper error handling and unit tests to ensure that it
is giving the correct answers. Change usages to the new safe
function.
IMPORTANT: run "remove_pinned_maps.sh" before you run the new
version of lqosd. The eBPF map structure has changed.
1) Add a "last_seen" value to the map_traffic eBPF map.
2) Whenever traffic is seen, update "last_seen" to equal the
result of a bpf_ktime_get_boot_ns() call.
3) When retrieving the unknown IP list, perform a syscall to
obtain the time since boot in nanoseconds and subtract
five minutes.
4) Filter out any unknown IPs that exceed the 5 minute window.
This should solve the problem with "unknown IPs" filling up
on start, and gradually accumulating.
Replaces the previously separate repo, merging the Rust
system into the mainline ready for 1.4.
The Rust system currently provides:
* lqos_bus: type definitions for localhost control bus.
* lqos_config: handler for configuration files.
* lqos_node_manager: local web-based monitor and manager.
* lqos_sys: eBPF program that handles all of the tracking,
CPU assignment, VLAN redirect, TC queue assignment,
and RTT tracking. Wrapped in a Rust core, providing
consistent in-Rust building and mostly-safe wrappers
to C code.
* lqosd: a daemon designed to run continually while
LibreQoS is operating. On start, it parses the configuration
files and sets up interface mapping (the Python code is still
required to actually build queues). It then assigns the various
eBPF programs to appropriate interfaces. The eBPF systems are
removed when the daemon terminates.
lqosd also provides a "bus", listening to requests for changes
or information on localhost, providing a control plane for
the rest of the project.
* lqtop: An example program demonstrating how to use the bus,
acts like "top", showing current network traffic and mappings.
* xdp_iphash_to_cpu_cmdline: a Rust wrapper providing the same
services as the cpumap originated tool of the same name. This is
a "shim" - it will go away once the native Python library is
ready.
* xdp_pping: also a shim, providing equivalent services to the
cpumap service of the same name.
A helper shell script "remove_pinned_maps.sh" can be used to
remove all pinned eBPF maps from the system, allowing for eBPF
program upgrades that change persistent map structures without
a reboot.
Signed-off-by: Herbert Wolverson <herberticus@gmail.com>