diff --git a/Cargo.toml b/Cargo.toml index 139af4d..bf252ac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,9 +25,9 @@ indexmap = { version = "2.14.0", features = ["serde"] } log = { version = "0.4.29", features = ["std"] } nix = { version = "0.31.3", features = ["feature", "sched"] } rtnetlink = { git = "https://github.com/rust-netlink/rtnetlink" } +rmsd_yaml = "0.1" serde = { version = "1.0", default-features = false, features = ["derive"] } serde_json = "1.0.140" -serde_yaml = "0.9.34" tokio = { version = "1.30", features = ["rt", "net", "time", "macros"] } [dev-dependencies] diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..f5f5c03 --- /dev/null +++ b/TODO.md @@ -0,0 +1,44 @@ +# TODO + +## `ip route` + +- add/del/change/replace/append/prepend: support metric options (`mtu`, + `advmss`, `rtt`, `rttvar`, `reordering`, `window`, `cwnd`, `initcwnd`, + `initrwnd`, `ssthresh`, `hoplimit`, `rto_min`, `features`, `quickack`, + `congctl`, `fastopen_no_cookie`, `realms`, `as`) — `src/ip/route/add.rs` +- add/del/change/replace/append/prepend: support multipath (`nexthop ...`, + `weight`), `nhid ID`, and the `pervasive` next-hop flag — + `src/ip/route/add.rs`, `src/ip/route/modify.rs` +- add/del/change/replace/append/prepend: support `tos TOS` and + `ttl-propagate` in NODE_SPEC +- add/del/change/replace/append/prepend: support `encap` + (`mpls | ip | ip6 | seg6 | seg6local | rpl | ioam6 | xfrm`) +- add/del/change/replace/append/prepend: accept TIME values with `s`/`ms` + suffix (e.g. `expires 300s`) +- get: support `vrf NAME` and `as ADDRESS` — `src/ip/route/get.rs` +- show/flush selectors: support `root PREFIX`, `match PREFIX`, + `exact PREFIX`, and `vrf NAME` — `src/ip/route/show.rs` + (`RouteShowFilter::parse`) +- show: display metrics, `expires`, `nhid`, `encap`, `realms`, + `ipproto`/`sport`/`dport`/`flowlabel`; populate `ttl_propagate` from the + dump — `src/ip/route/show.rs` (`parse_nl_msg_to_route`) +- tests: add coverage for the above (`tests/ip_route*.rs`) + +## `ip link` + +- show: implement `-o`/`--oneline` output — `src/ip/link/show.rs` (also + applies to address/neighbour/route show) +- show: implement `-s`/`--stats` RX/TX statistics output — + `src/ip/link/show.rs` +- add/set: audit per-type options against `ip link add type help` + (candidates: vxlan, bond, bridge) + +## `ip address` + +- show: implement `-o`/`--oneline` output — `src/ip/address/show.rs` +- show: implement `-s`/`--stats` RX/TX statistics output — + `src/ip/address/show.rs` +- show: accept the `-br` short flag (brief output works via `--brief`, but + `-br` is rejected by clap) — `src/ip/main.rs` +- show: format unknown numeric address protocols like iproute2 (`proto 0x63`, + not `proto 99`) — `src/ip/address/show.rs` diff --git a/src/result.rs b/src/result.rs index ce7fbea..df7d41b 100644 --- a/src/result.rs +++ b/src/result.rs @@ -12,7 +12,7 @@ pub trait CanDisplay: serde::Serialize + Sized { } fn to_yaml_string(&self) -> String { - serde_yaml::to_string(self).expect("Failed to generate JSON string") + rmsd_yaml::to_string(self).expect("Failed to generate YAML string") } }