udpcmsg

package
v0.0.0-...-264f9d0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CmsgPktInfo

func CmsgPktInfo(b []byte, addr netip.Addr) []byte

Pack addr into a control msg (Inet[4|6]Pktinfo). b is the buffer for packing, if b is not big enough (or nil), a new slice will be allocated. Invalid addr returns nil.

func CmsgSize

func CmsgSize(addr netip.Addr) int

Cmsg size for addr. If addr is invalid, returns 0.

func Ok

func Ok() bool

func ParseLocalAddr

func ParseLocalAddr(oob []byte) (netip.Addr, error)

Parses local addr from oob control msgs. May return invalid addr and nil error if no local addr info was found.

func SetOpt

func SetOpt(c *net.UDPConn) (inet6 bool, err error)

Set socket option to receive local addr in oob. Inet6 is true if c is an inet6 connection and IPV6_RECVPKTINFO was set. otherwise, c is an inet4 connection and IP_PKTINFO was set.

Types

This section is empty.

Jump to

Keyboard shortcuts

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