//from https://github.com/golang/go // Boolean to int. func boolint(b bool) int { … } //from https://github.com/golang/go func ipToSockaddr(family int, ip net.IP, port int, zone string) (syscall.Sockaddr, error) { … } //from https://github.com/golang/go func sockaddr(a *net.TCPAddr, family int) (syscall.Sockaddr, error) { … } type ipStackCapabilities … var ipStackCaps … //from https://github.com/golang/go // supportsIPv4 reports whether the platform supports IPv4 networking // functionality. func supportsIPv4() bool { … } //from https://github.com/golang/go // supportsIPv6 reports whether the platform supports IPv6 networking // functionality. func supportsIPv6() bool { … } //from https://github.com/golang/go // supportsIPv4map reports whether the platform supports mapping an // IPv4 address inside an IPv6 address at transport layer // protocols. See RFC 4291, RFC 4038 and RFC 3493. func supportsIPv4map() bool { … } //from https://github.com/golang/go // Probe probes IPv4, IPv6 and IPv4-mapped IPv6 communication // capabilities which are controlled by the IPV6_V6ONLY socket option // and kernel configuration. // // Should we try to use the IPv4 socket interface if we're only // dealing with IPv4 sockets? As long as the host system understands // IPv4-mapped IPv6, it's okay to pass IPv4-mapeed IPv6 addresses to // the IPv6 interface. That simplifies our code and is most // general. Unfortunately, we need to run on kernels built without // IPv6 support too. So probe the kernel to figure it out. func (p *ipStackCapabilities) probe() { … } //from https://github.com/golang/go //Change: we check the first IP address in the list of candidate SCTP IP addresses func (a *SCTPAddr) isWildcard() bool { … } func (a *SCTPAddr) family() int { … } //from https://github.com/golang/go func favoriteAddrFamily(network string, laddr *SCTPAddr, raddr *SCTPAddr, mode string) (family int, ipv6only bool) { … } //from https://github.com/golang/go //Changes: it is for SCTP only func setDefaultSockopts(s int, family int, ipv6only bool) error { … }