Missing rt_priority in user-space visibility into kernel routing state?
Missing rt_priority in user-space visibility into kernel routing state?
- Subject: Missing rt_priority in user-space visibility into kernel routing state?
- From: Philip Prindeville <email@hidden>
- Date: Thu, 21 Feb 2013 14:05:04 -0700
I was porting some code (for the Poco toolkit) to examine kernel routing tables in a platform-independent way, and noticed that while OpenBSD, Linux, and even Win32 all expose routing metrics to user-space, this doesn't seem to happen in Darwin.
For instance, in OpenBSD, the rt_msghdr includes the rt_priority field (as uint8_t):
http://fxr.watson.org/fxr/source/net/route.h?v=OPENBSD#L123
But the rt_msghdr2 in XNU 10.8.2 doesn't seem to include any priority (nor does the substructure rt_metrics):
http://fxr.watson.org/fxr/source/bsd/net/route.h?v=xnu-2050.18.24#L264
I've RTFM'd several times but can't figure out how to calculate, from within user-space, how route-selection happens in the kernel.
Is there some out-of-band mechanism for getting this information? I was using sysctl() on CTL_NET.PF_ROUTE.0.0.NET_RT_DUMP2.0 but this seems to be a dead-end.
I have some applications that rely on understanding kernel routing to operate correctly and I'm blocked on porting them to MacOS X until I can figure out, for instance, which interface on a multi homed host will the kernel use on an active (outbound) unbound connection when contacting a remote host (especially important in the case of NATting so I know which gateway's external address to advertise, for instance).
Thanks,
-Philip
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden