Documentation
¶
Index ¶
- Constants
- func AddMembership(socket *sonic.Socket, multicastIP netip.Addr, iff *net.Interface) error
- func AddSourceMembership(socket *sonic.Socket, multicastIP netip.Addr, sourceIP netip.Addr, ...) error
- func BlockSource(socket *sonic.Socket, multicastIP, sourceIP netip.Addr) (err error)
- func DropMembership(socket *sonic.Socket, multicastIP netip.Addr) error
- func DropSourceMembership(socket *sonic.Socket, multicastIP, sourceIP netip.Addr) (err error)
- func GetMulticastInterfaceAddr(socket *sonic.Socket) (netip.Addr, error)
- func GetMulticastInterfaceAddrAndGroup(socket *sonic.Socket) (interfaceAddr, multicastAddr netip.Addr, err error)
- func GetMulticastInterfaceIndex(socket *sonic.Socket) (int, error)
- func GetMulticastLoop(socket *sonic.Socket) (bool, error)
- func GetMulticastTTL(socket *sonic.Socket) (uint8, error)
- func SetMulticastAll(socket *sonic.Socket, all bool) error
- func SetMulticastInterface(socket *sonic.Socket, iff *net.Interface) (netip.Addr, error)
- func SetMulticastLoop(socket *sonic.Socket, loop bool) error
- func SetMulticastTTL(socket *sonic.Socket, ttl uint8) error
- func UnblockSource(socket *sonic.Socket, multicastIP, sourceIP netip.Addr) (err error)
- func ValidateMulticastIP(ip netip.Addr) error
- type IPMreqSource
Constants ¶
View Source
const IP_MULTICAST_ALL = 49 /* grepped torvalds/linux */
View Source
const SizeofIPMreqSource = syscall.SizeofIPMreq + 4
SizeofIPMreqSource I would love to do unsafe.SizeOf but for a struct with 3 4-byte arrays, it returns 8 on my Mac. It should return 12 :). So we add 4 bytes instead which is enough for the source IP.
Variables ¶
This section is empty.
Functions ¶
func AddMembership ¶
AddMembership makes the given socket a member of the specified multicast IP.
func AddSourceMembership ¶
func BlockSource ¶
func DropSourceMembership ¶
func SetMulticastInterface ¶
func UnblockSource ¶
func ValidateMulticastIP ¶
Types ¶
type IPMreqSource ¶
type IPMreqSource struct { Multiaddr [4]byte /* in_addr */ Interface [4]byte /* in_addr */ Sourceaddr [4]byte /* in_addr */ }
IPMreqSource adds Sourceaddr to net.IPMreq
Click to show internal directories.
Click to hide internal directories.