johnyburd / net-route

Rust crate providing a cross platform interface for interacting with the routing table
https://docs.rs/net-route/
17 stars 12 forks source link

Feature request: GetRoute #28

Open szguoxz opened 2 months ago

szguoxz commented 2 months ago

This is a very nice little package, but can we have a small feature? GetRoute(packet)

given a packet, can you return the route information?

Or to make it simple: GetRoute(src: SocketAddr, dest: SocketAddr)

I mean I need the route information for a packet, or a src/dst address pair with port information. As the kernel may need these information to match certain ip rules to apply certain routing tables.

larseggert commented 3 hours ago

Yes, the ability to get the route entry towards a destination IP address would be great.