Documentation ¶
Index ¶
Constants ¶
const ( GRP_LINK = 1 << iota GRP_NOTIFY = 1 << iota GRP_NEIGH = 1 << iota GRP_TC = 1 << iota GRP_IPV4_IFADDR = 1 << iota GRP_IPV4_MROUTE = 1 << iota GRP_IPV4_ROUTE = 1 << iota GRP_IPV4_RULE = 1 << iota GRP_IPV6_IFADDR = 1 << iota GRP_IPV6_MROUTE = 1 << iota GRP_IPV6_ROUTE = 1 << iota GRP_IPV6_IFINFO = 1 << iota GRP_DECnet_IFADDR = 1 << iota GRP_NOP2 = 1 << iota GRP_DECnet_ROUTE = 1 << iota GRP_DECnet_RULE = 1 << iota GRP_NOP4 = 1 << iota GRP_IPV6_PREFIX = 1 << iota GRP_IPV6_RULE = 1 << iota GRP_ND_USEROPT = 1 << iota GRP_PHONET_IFADDR = 1 << iota GRP_PHONET_ROUTE = 1 << iota )
const ( RTM_NEWLINK netlink.MessageType = iota + netlink.MIN_TYPE RTM_DELLINK RTM_GETLINK RTM_SETLINK RTM_NEWADDR RTM_DELADDR RTM_GETADDR RTM_RESERVED23 RTM_NEWROUTE RTM_DELROUTE RTM_GETROUTE RTM_RESERVED27 RTM_NEWNEIGH RTM_DELNEIGH RTM_GETNEIGH RTM_RESERVED31 RTM_NEWRULE RTM_DELRULE RTM_GETRULE RTM_RESERVED35 RTM_NEWQDISC RTM_DELQDISC RTM_GETQDISC RTM_RESERVED39 RTM_NEWTCLASS RTM_DELTCLASS RTM_GETTCLASS RTM_RESERVED43 RTM_NEWTFILTER RTM_DELTFILTER RTM_GETTFILTER RTM_RESERVED47 RTM_NEWACTION RTM_DELACTION RTM_GETACTION RTM_RESERVED51 RTM_NEWPREFIX RTM_RESERVED53 RTM_RESERVED54 RTM_RESERVED55 RTM_RESERVED56 RTM_RESERVED57 RTM_GETMULTICAST RTM_RESERVED59 RTM_RESERVED60 RTM_RESERVED61 RTM_GETANYCAST RTM_RESERVED63 RTM_NEWNEIGHTBL RTM_RESERVED65 RTM_GETNEIGHTBL RTM_SETNEIGHTBL RTM_NEWNDUSEROPT RTM_RESERVED69 RTM_RESERVED70 RTM_RESERVED71 RTM_NEWADDRLABEL RTM_DELADDRLABEL RTM_GETADDRLABEL RTM_RESERVED75 RTM_RESERVED76 RTM_RESERVED77 RTM_GETDCB RTM_SETDCB RTM_BASE = RTM_NEWLINK RTM_MAX = RTM_SETDCB )
netlink.MessageType's for RTNETLINK
Variables ¶
var ScopeStrings = map[Scope]string{ RT_SCOPE_UNIVERSE: "RT_SCOPE_UNIVERSE", RT_SCOPE_SITE: "RT_SCOPE_SITE", RT_SCOPE_LINK: "RT_SCOPE_LINK", RT_SCOPE_HOST: "RT_SCOPE_HOST", RT_SCOPE_NOWHERE: "RT_SCOPE_NOWHERE", }
Functions ¶
This section is empty.
Types ¶
type Family ¶
type Family uint8
Family is already defined in syscall, but we re-define them here for type-safety.
type Header ¶
type Header interface { Len() int // The (unpadded) length of the Header. UnmarshalNetlink([]byte) error MarshalNetlink() ([]byte, error) }
An RTNetlink Header describes the structures between the netlink header and the nlattributes.
type Message ¶
type Message struct { Header Header Attributes []netlink.Attribute }
A Message contains a Header object and a series of attributes. It is extracted from the Body of a netlink.Message
func NewMessage ¶
Create a new rtnetlink.Message based off of a header an list of attributes (which may be nil or empty).
func (Message) GetAttribute ¶
Retrieve (the first) Attribute identified by Type, returning an error if not found.
func (Message) MarshalNetlink ¶
Handles the appropriate calls to marshal the Header and Attribute values, and return an appropriately aligned result.
func (*Message) SetAttribute ¶
func (self *Message) SetAttribute(attr netlink.Attribute)
Replace or append the attribute with the AttributeType of attr
func (*Message) UnmarshalNetlink ¶
Unmarshals a generic message using the header as a guide. An error will be returned if the header cannot unmarshal properly, or any attribute in the series failed.