kubernetes/vendor/github.com/vishvananda/netlink/nl/nl_linux.go

const FAMILY_ALL

const FAMILY_V4

const FAMILY_V6

const FAMILY_MPLS

const RECEIVE_BUFFER_SIZE

const PidKernel

const SizeofCnMsgOp

var SupportedNlFamilies

var nextSeqNr

var SocketTimeoutTv

var EnableErrorMessageReporting

// GetIPFamily returns the family type of a net.IP.
func GetIPFamily(ip net.IP) int {}

var nativeEndian

// NativeEndian gets native endianness for the system
func NativeEndian() binary.ByteOrder {}

// Byte swap a 16 bit value if we aren't big endian
func Swap16(i uint16) uint16 {}

// Byte swap a 32 bit value if aren't big endian
func Swap32(i uint32) uint32 {}

const NLMSGERR_ATTR_UNUSED

const NLMSGERR_ATTR_MSG

const NLMSGERR_ATTR_OFFS

const NLMSGERR_ATTR_COOKIE

const NLMSGERR_ATTR_POLICY

type NetlinkRequestData

const PROC_CN_MCAST_LISTEN

const PROC_CN_MCAST_IGNORE

type CbID

type CnMsg

type CnMsgOp

func NewCnMsg(idx, val, op uint32) *CnMsgOp {}

func (msg *CnMsgOp) Serialize() []byte {}

func DeserializeCnMsgOp(b []byte) *CnMsgOp {}

func (msg *CnMsgOp) Len() int {}

type IfInfomsg

// Create an IfInfomsg with family specified
func NewIfInfomsg(family int) *IfInfomsg {}

func DeserializeIfInfomsg(b []byte) *IfInfomsg {}

func (msg *IfInfomsg) Serialize() []byte {}

func (msg *IfInfomsg) Len() int {}

func (msg *IfInfomsg) EncapType() string {}

// Round the length of a netlink message up to align it properly.
// Taken from syscall/netlink_linux.go by The Go Authors under BSD-style license.
func nlmAlignOf(msglen int) int {}

func rtaAlignOf(attrlen int) int {}

func NewIfInfomsgChild(parent *RtAttr, family int) *IfInfomsg {}

type Uint32Bitfield

func (a *Uint32Bitfield) Serialize() []byte {}

func DeserializeUint32Bitfield(data []byte) *Uint32Bitfield {}

type Uint32Attribute

func (a *Uint32Attribute) Serialize() []byte {}

func (a *Uint32Attribute) Len() int {}

type RtAttr

// Create a new Extended RtAttr object
func NewRtAttr(attrType int, data []byte) *RtAttr {}

// NewRtAttrChild adds an RtAttr as a child to the parent and returns the new attribute
//
// Deprecated: Use AddRtAttr() on the parent object
func NewRtAttrChild(parent *RtAttr, attrType int, data []byte) *RtAttr {}

// AddRtAttr adds an RtAttr as a child and returns the new attribute
func (a *RtAttr) AddRtAttr(attrType int, data []byte) *RtAttr {}

// AddChild adds an existing NetlinkRequestData as a child.
func (a *RtAttr) AddChild(attr NetlinkRequestData) {}

func (a *RtAttr) Len() int {}

// Serialize the RtAttr into a byte array
// This can't just unsafe.cast because it must iterate through children.
func (a *RtAttr) Serialize() []byte {}

type NetlinkRequest

// Serialize the Netlink Request into a byte array
func (req *NetlinkRequest) Serialize() []byte {}

func (req *NetlinkRequest) AddData(data NetlinkRequestData) {}

// AddRawData adds raw bytes to the end of the NetlinkRequest object during serialization
func (req *NetlinkRequest) AddRawData(data []byte) {}

// Execute the request against the given sockType.
// Returns a list of netlink messages in serialized format, optionally filtered
// by resType.
func (req *NetlinkRequest) Execute(sockType int, resType uint16) ([][]byte, error) {}

// ExecuteIter executes the request against the given sockType.
// Calls the provided callback func once for each netlink message.
// If the callback returns false, it is not called again, but
// the remaining messages are consumed/discarded.
//
// Thread safety: ExecuteIter holds a lock on the socket until
// it finishes iteration so the callback must not call back into
// the netlink API.
func (req *NetlinkRequest) ExecuteIter(sockType int, resType uint16, f func(msg []byte) bool) error {}

func dummyMsgIterFunc(msg []byte) bool {}

// Create a new netlink request from proto and flags
// Note the Len value will be inaccurate once data is added until
// the message is serialized
func NewNetlinkRequest(proto, flags int) *NetlinkRequest {}

type NetlinkSocket

func getNetlinkSocket(protocol int) (*NetlinkSocket, error) {}

// GetNetlinkSocketAt opens a netlink socket in the network namespace newNs
// and positions the thread back into the network namespace specified by curNs,
// when done. If curNs is close, the function derives the current namespace and
// moves back into it when done. If newNs is close, the socket will be opened
// in the current network namespace.
func GetNetlinkSocketAt(newNs, curNs netns.NsHandle, protocol int) (*NetlinkSocket, error) {}

// executeInNetns sets execution of the code following this call to the
// network namespace newNs, then moves the thread back to curNs if open,
// otherwise to the current netns at the time the function was invoked
// In case of success, the caller is expected to execute the returned function
// at the end of the code that needs to be executed in the network namespace.
// Example:
//
//	func jobAt(...) error {
//	     d, err := executeInNetns(...)
//	     if err != nil { return err}
//	     defer d()
//	     < code which needs to be executed in specific netns>
//	 }
//
// TODO: his function probably belongs to netns pkg.
func executeInNetns(newNs, curNs netns.NsHandle) (func(), error) {}

// Create a netlink socket with a given protocol (e.g. NETLINK_ROUTE)
// and subscribe it to multicast groups passed in variable argument list.
// Returns the netlink socket on which Receive() method can be called
// to retrieve the messages from the kernel.
func Subscribe(protocol int, groups ...uint) (*NetlinkSocket, error) {}

// SubscribeAt works like Subscribe plus let's the caller choose the network
// namespace in which the socket would be opened (newNs). Then control goes back
// to curNs if open, otherwise to the netns at the time this function was called.
func SubscribeAt(newNs, curNs netns.NsHandle, protocol int, groups ...uint) (*NetlinkSocket, error) {}

func (s *NetlinkSocket) Close() {}

func (s *NetlinkSocket) GetFd() int {}

func (s *NetlinkSocket) GetTimeouts() (send, receive time.Duration) {}

func (s *NetlinkSocket) Send(request *NetlinkRequest) error {}

func (s *NetlinkSocket) Receive() ([]syscall.NetlinkMessage, *unix.SockaddrNetlink, error) {}

// SetSendTimeout allows to set a send timeout on the socket
func (s *NetlinkSocket) SetSendTimeout(timeout *unix.Timeval) error {}

// SetReceiveTimeout allows to set a receive timeout on the socket
func (s *NetlinkSocket) SetReceiveTimeout(timeout *unix.Timeval) error {}

// SetReceiveBufferSize allows to set a receive buffer size on the socket
func (s *NetlinkSocket) SetReceiveBufferSize(size int, force bool) error {}

// SetExtAck requests error messages to be reported on the socket
func (s *NetlinkSocket) SetExtAck(enable bool) error {}

func (s *NetlinkSocket) GetPid() (uint32, error) {}

func ZeroTerminated(s string) []byte {}

func NonZeroTerminated(s string) []byte {}

func BytesToString(b []byte) string {}

func Uint8Attr(v uint8) []byte {}

func Uint16Attr(v uint16) []byte {}

func BEUint16Attr(v uint16) []byte {}

func Uint32Attr(v uint32) []byte {}

func BEUint32Attr(v uint32) []byte {}

func Uint64Attr(v uint64) []byte {}

func BEUint64Attr(v uint64) []byte {}

func ParseRouteAttr(b []byte) ([]syscall.NetlinkRouteAttr, error) {}

// ParseRouteAttrAsMap parses provided buffer that contains raw RtAttrs and returns a map of parsed
// atttributes indexed by attribute type or error if occured.
func ParseRouteAttrAsMap(b []byte) (map[uint16]syscall.NetlinkRouteAttr, error) {}

func netlinkRouteAttrAndValue(b []byte) (*unix.RtAttr, []byte, int, error) {}

type SocketHandle

// Close closes the netlink socket
func (sh *SocketHandle) Close() {}