In IPv6, you cannot simply have 16byte IP address portion. You should have scope id as well. Separating { IP address, scope id } and port number could be possible but it will only make source codes complex. Some might argue that in this way, we could save some memory foot-print but I might say that considering size of sockaddr_in6, it is no big deal. -In bottom line, I recommend you to have class IpPort (which is basically sockaddr_in6 with helper function) even you only want IP address. +In bottom line, I recommend you to have class IpAddr (which is basically sockaddr_in6 with helper functions) even you only want IP address. + +{section: Converting obsolete BSD interface} + +Since we have few hundreds lines of code, I think I can change it by manually. But scary thing is how to test all of them. Do you have any idea? I am desperate. + +{section: Changing every lines which dealing with IP address} + +My plan is to use compiler generated error. This plan has some analogy to 'escape analysis'. Consider "old" IP address structure is escaping from socket interfaces to every leaf of source codes. If we disallow from the top, there will be no IPv4 address flowing to the leaf. Here is flow. + +1:Find every BSD socket functions that returns IP address or accepts IP address argument +1:Make proxy function for all of them. +1:Change every lines where calls old functions to proxy functions. Definitely, proxy functions should allow only new class "IpAddr" instead of sockaddr, and sockaddr_in. +1:You will have tons of error message. +1:Resolving this all error message with class IpAddr. +1:You have the code base that compatible with IPv6 sockets. {section: Todo} Manageable daily work-list.