I haven't completely implemented it yet, but I did come up with a basic algorithm to convert the IPv6 address into a 'code' form. I still have to write the code to actually create the socket, though.