]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - share/examples/find_interface/README
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / share / examples / find_interface / README
1 This is a simple program which demonstrates how to query the kernel
2 routing mechanism using only a UDP socket.  Pass it a hostname on
3 the command line (sorry, it doesn't parse dotted decimal) and it will
4 print out an IP address which names the interface over which UDP
5 packets intended for that destination would be sent.
6 A more sophisticated program might use the list obtained from SIOCGIFCONF
7 to match the address with an interface name, but applications programmers
8 much more often need to know the address of the interface rather than
9 the name.