Skip to contentSkip to conversation

get a route from within c code

LARTC Andreani Luca 2 participants 2 messages Sep 25, 2002

lore
Share & tools
lore
#0 lore raw

I woluld like to know if there is a way to know the route to a destination without asking it via console (ip route get) but from within c code. One possible way is to make system("ip route gat xxx.xxx.xxx.xxx"), redirect to a file and then read the file.
Is there a simpler and more efficient way?

Thanks,

Luca Andreani
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#1 lore raw
Quoted 4 lines

I woluld like to know if there is a way to know the route to a destination without asking it via console (ip route get) but from within c code. One possible way is to make system("ip route gat xxx.xxx.xxx.xxx"),

redirect

Quoted 2 lines

to a file and then read the file.
Is there a simpler and more efficient way?

So...the 'ip' command is C code, right ?
And you can download the source...

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/