I have no experience in IPv6 programming, perhaps this chapter will be filled by others or moved away to another HOWTO.
More Information can be found here:
RFC 2553 / Basic Socket Interface Extensions for IPv6
Draft / Advanced Sockets API for IPv6