github.com/cilium/cilium@v1.16.2/pkg/fqdn/proxy/ipfamily/ipfamily.go (about) 1 // SPDX-License-Identifier: Apache-2.0 2 // Copyright Authors of Cilium 3 4 package ipfamily 5 6 import "golang.org/x/sys/unix" 7 8 type IPFamily struct { 9 Name string 10 UDPAddress string 11 TCPAddress string 12 Localhost string 13 14 SocketOptsFamily int 15 SocketOptsTransparent int 16 SocketOptsRecvOrigDstAddr int 17 } 18 19 func IPv4() IPFamily { 20 return IPFamily{ 21 Name: "ipv4", 22 UDPAddress: "udp4", 23 TCPAddress: "tcp4", 24 Localhost: "127.0.0.1", 25 26 SocketOptsFamily: unix.SOL_IP, 27 SocketOptsTransparent: unix.IP_TRANSPARENT, 28 SocketOptsRecvOrigDstAddr: unix.IP_RECVORIGDSTADDR, 29 } 30 } 31 32 func IPv6() IPFamily { 33 return IPFamily{ 34 Name: "ipv6", 35 UDPAddress: "udp6", 36 TCPAddress: "tcp6", 37 Localhost: "::1", 38 39 SocketOptsFamily: unix.SOL_IPV6, 40 SocketOptsTransparent: unix.IPV6_TRANSPARENT, 41 SocketOptsRecvOrigDstAddr: unix.IPV6_RECVORIGDSTADDR, 42 } 43 }