John Que <[EMAIL PROTECTED]> wrote:
> 
> I had spent time trying to write something which
> uses RTA_SRC and RTA_DST and got some problems.
> (I probably made something stupid.)
> I googled for such examples and did not get much.
> I saw that the zebra project and iproute uses
> netlinks but it is complex.,

Have a look at

http://gondor.apana.org.au/~herbert/findsaddr-linux.c

which I wrote for traceroute some years back.  It should be easy
to adapt to get the interface instead of the source address.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to