What is the IPv6 equivalent for SIOCADDRT?
Can SIOCADDRT be used to add IPv6 routes? If not, what's the equivalent for开发者_运维技巧 ioctl()?
Yes, you can use SIOCADDRT. Just create AF_INET6 socket for it. For example, take a look at Busybox implementation of "route" command. Also consider using Netlink instead, perhaps via libnl.
Sorry for late answer, I was looking for this myself and found the accepted answer a bit lacking.
I don't know, but
# strace ip route add <ipv6-route>
should tell you.
Not writing low-level network configuration code in your program, but instead delegating the task to the existing system utilities, would be one very good solution.
精彩评论