mgenetlink

package
v0.0.0-...-b320325 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EGroupNotFound = errors.New("Group not found")
)
View Source
var (
	EInvalidMessage = errors.New("Invalid generic netlink message")
)
View Source
var (
	ENlClient = errors.New("Netlink client not connected, maybe not created with NewGeNl")
)
View Source
var (
	EParseGroup = errors.New("Error parsing multicast group data")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewGeNl

func NewGeNl() (res *Client, err error)

func (*Client) AddGroupMembership

func (c *Client) AddGroupMembership(groupid uint32) (err error)

func (*Client) Close

func (c *Client) Close() (err error)

func (*Client) DropGroupMembership

func (c *Client) DropGroupMembership(groupid uint32) (err error)

func (*Client) GetFamilies

func (c *Client) GetFamilies() (families []Family, err error)

This refers to generic netlink families, not netlink families (netlink family is always NETLINK_GENERIC)

func (*Client) GetFamily

func (c *Client) GetFamily(familyName string) (family *Family, err error)

func (*Client) Open

func (c *Client) Open() (err error)

func (*Client) Receive

func (c *Client) Receive() (msgs []nl.Message, err error)

type Family

type Family struct {
	ID      uint16
	Version uint8
	Name    string
	Groups  []McastGroup
	Ops     []Op //ToDo: struct and parsing
}

func ParseAttrsToFamily

func ParseAttrsToFamily(attrs []mnetlink.Attr) (family Family, err error)

func (*Family) GetGroupByName

func (fam *Family) GetGroupByName(name string) (id uint32, err error)

type McastGroup

type McastGroup struct {
	Id   uint32
	Name string
}

func ParseAttrsToMcastGroup

func ParseAttrsToMcastGroup(attrs []mnetlink.Attr) (group McastGroup, err error)

func ParseAttrsToMcastGroups

func ParseAttrsToMcastGroups(attrs []mnetlink.Attr) (groups []McastGroup, err error)

type Message

type Message struct {
	Cmd      uint8
	Version  uint8
	Reserved uint16
	Data     []byte
}

func (Message) AttributesFromData

func (m Message) AttributesFromData() (attrs []mnetlink.Attr, err error)

func (*Message) MarshalBinary

func (m *Message) MarshalBinary() (data []byte, err error)

func (*Message) UnmarshalBinary

func (m *Message) UnmarshalBinary(src []byte) (err error)

type Op

type Op struct {
	Id    uint32
	Flags uint32
}

func ParseAttrsToOp

func ParseAttrsToOp(attrs []mnetlink.Attr) (op Op, err error)

func ParseAttrsToOps

func ParseAttrsToOps(attrs []mnetlink.Attr) (ops []Op, err error)

Jump to

Keyboard shortcuts

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