Page MenuHomeFreeBSD

routing: move all kernel datapath definitions to route/route_fib.h
Needs ReviewPublic

Authored by melifaro on Mar 8 2023, 1:23 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 28, 8:26 AM
Unknown Object (File)
Tue, Mar 26, 4:03 AM
Unknown Object (File)
Jan 3 2024, 6:14 AM
Unknown Object (File)
Dec 31 2023, 6:04 AM
Unknown Object (File)
Nov 18 2023, 6:51 PM
Unknown Object (File)
Nov 18 2023, 6:49 PM
Unknown Object (File)
Nov 9 2023, 11:12 PM
Unknown Object (File)
Nov 6 2023, 10:35 PM

Details

Reviewers
None
Group Reviewers
network
Summary

Currently, net/route.h contains mixture of 3 different definition types: 1) routing socket structures (rt_msghdr), 2) common macro/structures used in the datapath (struct route, RO_NHFREE) and 3) some kernel routing notification definitions (rt_ifmsg, rt_routemsg).

With the recent Netlink introduction, routing socket stopped to be the sole provider of the network-related information.
Additionally, there are other network-control-related headers such as net/route/route_ctl.h, net/route/nhop.h which group the definitions of related functionality.

The intent of this change is to clean up net/route.h from most of the kernel bits, by moving them to dedicated places.
In the end net/route.h should only have rtsock-specific definition.

Specifically,

  • nexthop flags are moved to net/route/nhop.h
  • network control functions are moved to net/route/route_ctl.h
  • datapath-related functions are moved to the newly-created net/route/route_fib.h

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 50229
Build 47121: arc lint + arc unit

Event Timeline

melifaro added a reviewer: network.

If I'm reading this right there's a userspace visible change in definitions (e.g. struct route is no longer visible without _KERNEL). If so, should we do an exp-run over the ports to see what the fallout is going to be like?

melifaro edited the summary of this revision. (Show Details)

Add userland version of struct rt_addrinfo

In D38981#887266, @kp wrote:

If I'm reading this right there's a userspace visible change in definitions (e.g. struct route is no longer visible without _KERNEL). If so, should we do an exp-run over the ports to see what the fallout is going to be like?

That's a good idea. There are not a lot of reasons to use struct route in the userland, as the only meaningful fields there are mtu and the sockaddr, but given that the file has been around for quite a while - guess it's worth doing.