ipv4

package
v0.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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

func AddMembership(
	socket *sonic.Socket,
	multicastIP netip.Addr,
	iff *net.Interface,
) error

AddMembership makes the given socket a member of the specified multicast IP.

func AddSourceMembership

func AddSourceMembership(
	socket *sonic.Socket,
	multicastIP netip.Addr,
	sourceIP netip.Addr,
	iff *net.Interface,
) error

func BlockSource

func BlockSource(
	socket *sonic.Socket,
	multicastIP, sourceIP netip.Addr,
) (err error)

func DropMembership

func DropMembership(socket *sonic.Socket, multicastIP netip.Addr) error

func DropSourceMembership

func DropSourceMembership(
	socket *sonic.Socket,
	multicastIP, sourceIP netip.Addr,
) (err error)

func GetMulticastInterfaceAddr

func GetMulticastInterfaceAddr(socket *sonic.Socket) (netip.Addr, error)

func GetMulticastInterfaceAddrAndGroup

func GetMulticastInterfaceAddrAndGroup(
	socket *sonic.Socket,
) (interfaceAddr, multicastAddr netip.Addr, err error)

func GetMulticastInterfaceIndex

func GetMulticastInterfaceIndex(socket *sonic.Socket) (int, error)

func GetMulticastLoop

func GetMulticastLoop(socket *sonic.Socket) (bool, error)

func GetMulticastTTL

func GetMulticastTTL(socket *sonic.Socket) (uint8, error)

func SetMulticastAll

func SetMulticastAll(socket *sonic.Socket, all bool) error

func SetMulticastInterface

func SetMulticastInterface(
	socket *sonic.Socket,
	iff *net.Interface,
) (netip.Addr, error)

func SetMulticastLoop

func SetMulticastLoop(socket *sonic.Socket, loop bool) error

func SetMulticastTTL

func SetMulticastTTL(socket *sonic.Socket, ttl uint8) error

func UnblockSource

func UnblockSource(
	socket *sonic.Socket,
	multicastIP, sourceIP netip.Addr,
) (err error)

func ValidateMulticastIP

func ValidateMulticastIP(ip netip.Addr) error

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL