user788041
user788041

Reputation: 81

Get gateway address in C/C++

I use ioctl() to set the gateway address (SIOCADDRT with RTF_GATEWAY in the flags).

What's the standard ioctl routine to retrieve it?

Upvotes: 3

Views: 9147

Answers (1)

Neil Alexander
Neil Alexander

Reputation: 110

My understanding is that there is no 'standard ioctl routine' to get the gateway address in a cross-platform-friendly fashion. On Linux you might consider looking at using Netlink sockets, as described in this post.

Upvotes: 1

Related Questions