Route Metric at Kernel Level

flat view

From: Tim Schneider <hidden>
Date: 2009-10-14 21:05:24

Hello,

I've been trying for a while now, to readout the Routing-Metric from a given socket at kernel level. So far, I've always set the routing-table metric by hand using the ifmetric command.
When I tried reading out the struct sock->sk_dst_cache->metrics values, I always got a Metric value which was 0. I thought I was reading out the wrong value, until I discovered, that the metric values, that I put into the standard routing table are not copied into the kernel routing cache which I was reading out. Now I am wondering if it is supposed to be like that, and if so, why it was implemented that way.

Also, since I need to read out the Metric value from the Routing Table, I am in need of some help. Maybe just a push into the right direction. I've been looking at the fib_frontend.c and the other fib_* files which, as I understand, implement the routing tables. Unfortunately they don't seem to export their functions for my Kernel-Module, so I am unable to use those. Is there an entrypoint from where I am able to use the functions given in the fib_* files, or are they strictly closed off from the rest of the Kernel?

Thank you for any help!

Greetings

Tim
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help