Documentation ¶
Index ¶
- Constants
- Variables
- func CopyAddr(src *netlink.Addr) *netlink.Addr
- func CopyNeigh(src *netlink.Neigh) *netlink.Neigh
- func CopyNode(src *nlalink.Node) *nlalink.Node
- func CopyRoute(src *netlink.Route) *netlink.Route
- func CopyVpn(src *nlalink.Vpn) *nlalink.Vpn
- func Dispatch(nlmsg *NetlinkMessage, app interface{}) error
- func DispatchAddr(nlmsg *NetlinkMessage, addr *Addr, app interface{})
- func DispatchBridgeVlanInfo(nlmsg *NetlinkMessage, brVlan *BridgeVlanInfo, app interface{})
- func DispatchLink(nlmsg *NetlinkMessage, link *Link, app interface{})
- func DispatchNeigh(nlmsg *NetlinkMessage, neigh *Neigh, app interface{})
- func DispatchNetlinkMessage(nlmsg *NetlinkMessage, app interface{})
- func DispatchNode(nlmsg *NetlinkMessage, node *Node, app interface{})
- func DispatchRoute(nlmsg *NetlinkMessage, route *Route, app interface{})
- func DispatchToAddr(nlmsg *NetlinkMessage, app interface{}) error
- func DispatchToBridgeVlanInfo(nlmsg *NetlinkMessage, app interface{}) error
- func DispatchToLink(nlmsg *NetlinkMessage, app interface{}) error
- func DispatchToNeigh(nlmsg *NetlinkMessage, app interface{}) error
- func DispatchToNode(nlmsg *NetlinkMessage, app interface{}) error
- func DispatchToRoute(nlmsg *NetlinkMessage, app interface{}) error
- func DispatchToVpn(nlmsg *NetlinkMessage, app interface{}) error
- func DispatchUnion(nlmsg *NetlinkMessageUnion, app interface{}) error
- func DispatchVpn(nlmsg *NetlinkMessage, vpn *Vpn, app interface{})
- func NlMsgGroupFromType(nlmsgType uint16) uint16
- func NlMsgGroupStr(g uint16) string
- func NlMsgHdrStr(hdr *syscall.NlMsghdr) string
- func NlMsgStr(nlmsg *syscall.NetlinkMessage) string
- func NlMsgTypeStr(t uint16) string
- func ScopeStr(scope uint8) string
- type Addr
- type BridgeSlaveInfo
- type BridgeVlanInfo
- func BridgeVlanInfoDeserialize(nlmsg *NetlinkMessage) (*BridgeVlanInfo, error)
- func NewBridgeVlanInfo(bridgeVlan nl.BridgeVlanInfo, index int, name string, master int, nid uint8, ...) *BridgeVlanInfo
- func NewBridgeVlanInfoFromNetlink(nid uint8, brvlan *nl.BridgeVlanInfo, link netlink.Link) *BridgeVlanInfo
- func ParseBridgeVlanInfo(b []byte) (*BridgeVlanInfo, error)
- func (b *BridgeVlanInfo) Bytes() ([]byte, error)
- func (b *BridgeVlanInfo) Copy() *BridgeVlanInfo
- func (b *BridgeVlanInfo) Equals(other *BridgeVlanInfo) bool
- func (b *BridgeVlanInfo) PortType() BridgeVlanPortType
- func (b *BridgeVlanInfo) String() string
- func (b *BridgeVlanInfo) ToNetlinkMessage(msgType uint16) (*syscall.NetlinkMessage, error)
- type BridgeVlanPortType
- type EncapInfo
- type Iptun
- type Link
- type Neigh
- type NeighIptun
- type NeighTunnel
- type NetlinkAddrHandler
- type NetlinkBridgeVlanInfoHandler
- type NetlinkLinkHandler
- type NetlinkMessage
- func BridgeVlanInfoSerialize(brvlan *BridgeVlanInfo, msgType uint16) (*NetlinkMessage, error)
- func NewNetlinkMessage(msg *syscall.NetlinkMessage, nid uint8, src NlMsgSrc) *NetlinkMessage
- func NodeSerialize(node *Node, msgType uint16) (*NetlinkMessage, error)
- func VpnSerialize(vpn *Vpn, msgType uint16) (*NetlinkMessage, error)
- type NetlinkMessageHandler
- type NetlinkMessageUnion
- func (n *NetlinkMessageUnion) GetAddr() *Addr
- func (n *NetlinkMessageUnion) GetBridgeVlanInfo() *BridgeVlanInfo
- func (n *NetlinkMessageUnion) GetLink() *Link
- func (n *NetlinkMessageUnion) GetNeigh() *Neigh
- func (n *NetlinkMessageUnion) GetNode() *Node
- func (n *NetlinkMessageUnion) GetRoute() *Route
- func (n *NetlinkMessageUnion) GetVpn() *Vpn
- func (m *NetlinkMessageUnion) Group() uint16
- func (m *NetlinkMessageUnion) String() string
- func (m *NetlinkMessageUnion) Type() uint16
- type NetlinkNeighHandler
- type NetlinkNodeHandler
- type NetlinkRouteHandler
- type NetlinkVpnHandler
- type NlMsgSrc
- type Node
- type Route
- func (r *Route) Copy() *Route
- func (r *Route) GetDst() *net.IPNet
- func (r *Route) GetEncap() netlink.Encap
- func (r *Route) GetGw() net.IP
- func (r *Route) GetLinkIndex() int
- func (r *Route) GetMPLSEncap() *netlink.MPLSEncap
- func (r *Route) GetMPLSNewDst() *netlink.MPLSDestination
- func (r *Route) MultiPathIndex() int
- func (r *Route) String() string
- type Vpn
Constants ¶
View Source
const ( BRIDGE_VLAN_PORT_NONE = 0 BRIDGE_VLAN_PORT_ACCESS = 1 BRIDGE_VLAN_PORT_TRUNK = 2 BRIDGE_VLAN_PORT_MASTER = 3 )
View Source
const BRVLAN_INFO_IFNAME_SIZE = 16
View Source
const NODE_ID_ALL uint8 = 255
Variables ¶
View Source
var NlMsgSrc_name = map[NlMsgSrc]string{ SRC_NOP: "NOP", SRC_KNL: "KNL", SRC_API: "API", }
View Source
var RTMGRPStrings = map[uint16]string{ nlalink.RTMGRP_NODE: "RTMGRP_NODE", nlalink.RTMGRP_VPN: "RTMGRP_VPN", nlalink.RTMGRP_BRIDGE: "RTMGRP_BRIDGE", nlalink.RTMGRP_LINK: "RTMGRP_LINK", nlalink.RTMGRP_ADDR: "RTMGRP_ADDR", nlalink.RTMGRP_NEIGH: "RTMGRP_NEIGH", nlalink.RTMGRP_ROUTE: "RTMGRP_ROUTE", }
View Source
var RTMStrings = map[uint16]string{ nlalink.RTM_NEWNODE: "RTM_NEWNODE", nlalink.RTM_DELNODE: "RTM_DELNODE", nlalink.RTM_SETNODE: "RTM_SETNODE", nlalink.RTM_NEWVPN: "RTM_NEWVPN", nlalink.RTM_DELVPN: "RTM_DELVPN", nlalink.RTM_SETVPN: "RTM_SETVPN", nlalink.RTM_NEWBRIDGE: "RTM_NEWBRIDGE", nlalink.RTM_DELBRIDGE: "RTM_DELBRIDGE", nlalink.RTM_SETBRIDGE: "RTM_SETBRIDGE", syscall.RTM_NEWLINK: "RTM_NEWLINK", syscall.RTM_DELLINK: "RTM_DELLINK", syscall.RTM_SETLINK: "RTM_SETLINK", syscall.RTM_NEWADDR: "RTM_NEWADDR", syscall.RTM_DELADDR: "RTM_DELADDR", nlalink.RTM_SETADDR: "RTM_SETADDR", syscall.RTM_NEWNEIGH: "RTM_NEWNEIGH", syscall.RTM_DELNEIGH: "RTM_DELNEIGH", nlalink.RTM_SETNEIGH: "RTM_SETNEIGH", syscall.RTM_NEWROUTE: "RTM_NEWROUTE", syscall.RTM_DELROUTE: "RTM_DELROUTE", nlalink.RTM_SETROUTE: "RTM_SETROUTE", }
View Source
var RT_SCOPE_strings = map[uint8]string{ syscall.RT_SCOPE_UNIVERSE: "UNIVERSE", syscall.RT_SCOPE_SITE: "SITE", syscall.RT_SCOPE_LINK: "LINK", syscall.RT_SCOPE_HOST: "HOST", syscall.RT_SCOPE_NOWHERE: "NOWHERE", }
Functions ¶
func Dispatch ¶
func Dispatch(nlmsg *NetlinkMessage, app interface{}) error
func DispatchAddr ¶
func DispatchAddr(nlmsg *NetlinkMessage, addr *Addr, app interface{})
func DispatchBridgeVlanInfo ¶ added in v0.4.0
func DispatchBridgeVlanInfo(nlmsg *NetlinkMessage, brVlan *BridgeVlanInfo, app interface{})
func DispatchLink ¶
func DispatchLink(nlmsg *NetlinkMessage, link *Link, app interface{})
func DispatchNeigh ¶
func DispatchNeigh(nlmsg *NetlinkMessage, neigh *Neigh, app interface{})
func DispatchNetlinkMessage ¶
func DispatchNetlinkMessage(nlmsg *NetlinkMessage, app interface{})
func DispatchNode ¶
func DispatchNode(nlmsg *NetlinkMessage, node *Node, app interface{})
func DispatchRoute ¶
func DispatchRoute(nlmsg *NetlinkMessage, route *Route, app interface{})
func DispatchToAddr ¶
func DispatchToAddr(nlmsg *NetlinkMessage, app interface{}) error
func DispatchToBridgeVlanInfo ¶ added in v0.4.0
func DispatchToBridgeVlanInfo(nlmsg *NetlinkMessage, app interface{}) error
func DispatchToLink ¶
func DispatchToLink(nlmsg *NetlinkMessage, app interface{}) error
func DispatchToNeigh ¶
func DispatchToNeigh(nlmsg *NetlinkMessage, app interface{}) error
func DispatchToNode ¶
func DispatchToNode(nlmsg *NetlinkMessage, app interface{}) error
func DispatchToRoute ¶
func DispatchToRoute(nlmsg *NetlinkMessage, app interface{}) error
func DispatchToVpn ¶
func DispatchToVpn(nlmsg *NetlinkMessage, app interface{}) error
func DispatchUnion ¶
func DispatchUnion(nlmsg *NetlinkMessageUnion, app interface{}) error
func DispatchVpn ¶
func DispatchVpn(nlmsg *NetlinkMessage, vpn *Vpn, app interface{})
func NlMsgGroupStr ¶
func NlMsgHdrStr ¶
func NlMsgStr ¶
func NlMsgStr(nlmsg *syscall.NetlinkMessage) string
func NlMsgTypeStr ¶
Types ¶
type Addr ¶
Addr
func AddrDeserialize ¶
func AddrDeserialize(nlmsg *NetlinkMessage) (*Addr, error)
type BridgeSlaveInfo ¶ added in v0.4.0
type BridgeSlaveInfo struct { }
func (*BridgeSlaveInfo) SlaveType ¶ added in v0.4.0
func (b *BridgeSlaveInfo) SlaveType() string
type BridgeVlanInfo ¶ added in v0.4.0
type BridgeVlanInfo struct { nl.BridgeVlanInfo Index int Name string MasterIndex int Mtu uint16 BrId uint32 NId uint8 }
func BridgeVlanInfoDeserialize ¶ added in v0.4.0
func BridgeVlanInfoDeserialize(nlmsg *NetlinkMessage) (*BridgeVlanInfo, error)
func NewBridgeVlanInfo ¶ added in v0.4.0
func NewBridgeVlanInfo(bridgeVlan nl.BridgeVlanInfo, index int, name string, master int, nid uint8, id uint32) *BridgeVlanInfo
func NewBridgeVlanInfoFromNetlink ¶ added in v0.4.0
func NewBridgeVlanInfoFromNetlink(nid uint8, brvlan *nl.BridgeVlanInfo, link netlink.Link) *BridgeVlanInfo
func ParseBridgeVlanInfo ¶ added in v0.4.0
func ParseBridgeVlanInfo(b []byte) (*BridgeVlanInfo, error)
func (*BridgeVlanInfo) Bytes ¶ added in v0.4.0
func (b *BridgeVlanInfo) Bytes() ([]byte, error)
func (*BridgeVlanInfo) Copy ¶ added in v0.4.0
func (b *BridgeVlanInfo) Copy() *BridgeVlanInfo
func (*BridgeVlanInfo) Equals ¶ added in v0.4.0
func (b *BridgeVlanInfo) Equals(other *BridgeVlanInfo) bool
func (*BridgeVlanInfo) PortType ¶ added in v0.4.0
func (b *BridgeVlanInfo) PortType() BridgeVlanPortType
func (*BridgeVlanInfo) String ¶ added in v0.4.0
func (b *BridgeVlanInfo) String() string
func (*BridgeVlanInfo) ToNetlinkMessage ¶ added in v0.4.0
func (b *BridgeVlanInfo) ToNetlinkMessage(msgType uint16) (*syscall.NetlinkMessage, error)
type BridgeVlanPortType ¶ added in v0.4.0
type BridgeVlanPortType uint8
func ParseBridgeVlanPortType ¶ added in v0.4.0
func ParseBridgeVlanPortType(s string) (BridgeVlanPortType, error)
func (BridgeVlanPortType) String ¶ added in v0.4.0
func (t BridgeVlanPortType) String() string
type Link ¶
Link
func LinkDeserialize ¶
func LinkDeserialize(nlmsg *NetlinkMessage) (*Link, error)
func (*Link) GetSlaveInfo ¶ added in v0.4.0
func (ln *Link) GetSlaveInfo() netlink.LinkSlaveInfo
type Neigh ¶
Neigh
func NeighDeserialize ¶
func NeighDeserialize(nlmsg *NetlinkMessage) (*Neigh, error)
func (*Neigh) GetIptun ¶ added in v0.3.1
func (n *Neigh) GetIptun() *NeighIptun
func (*Neigh) IsFdbEntry ¶ added in v0.4.0
func (*Neigh) IsTunnelRemote ¶ added in v0.3.1
func (*Neigh) SetTunnel ¶ added in v0.3.1
func (n *Neigh) SetTunnel(phyLink int, tunnel NeighTunnel)
type NeighIptun ¶ added in v0.3.1
func NewNeighIptun ¶ added in v0.3.1
func NewNeighIptun(tunType string, srcIp net.IP) *NeighIptun
func (*NeighIptun) Copy ¶ added in v0.3.1
func (n *NeighIptun) Copy() NeighTunnel
func (*NeighIptun) String ¶ added in v0.3.1
func (n *NeighIptun) String() string
type NeighTunnel ¶ added in v0.3.1
type NeighTunnel interface { Copy() NeighTunnel String() string }
func CopyNeighTunnel ¶ added in v0.3.1
func CopyNeighTunnel(src NeighTunnel) NeighTunnel
type NetlinkAddrHandler ¶
type NetlinkAddrHandler interface {
NetlinkAddr(*NetlinkMessage, *Addr)
}
type NetlinkBridgeVlanInfoHandler ¶ added in v0.4.0
type NetlinkBridgeVlanInfoHandler interface {
NetlinkBridgeVlanInfo(*NetlinkMessage, *BridgeVlanInfo)
}
type NetlinkLinkHandler ¶
type NetlinkLinkHandler interface {
NetlinkLink(*NetlinkMessage, *Link)
}
type NetlinkMessage ¶
type NetlinkMessage struct { syscall.NetlinkMessage NId uint8 Src NlMsgSrc }
NetlinkMessage
func BridgeVlanInfoSerialize ¶ added in v0.4.0
func BridgeVlanInfoSerialize(brvlan *BridgeVlanInfo, msgType uint16) (*NetlinkMessage, error)
BridgeVlanInfoSerialize coverts BridgeVlanInfo struct to netlink message. msgType is RTM_NEWBRIDGE, RTM_DELBRIDGE, RTM_SETBRIDGE (gonla/nlamsg/nlalink package)
func NewNetlinkMessage ¶
func NewNetlinkMessage(msg *syscall.NetlinkMessage, nid uint8, src NlMsgSrc) *NetlinkMessage
func NodeSerialize ¶
func NodeSerialize(node *Node, msgType uint16) (*NetlinkMessage, error)
func VpnSerialize ¶
func VpnSerialize(vpn *Vpn, msgType uint16) (*NetlinkMessage, error)
func (*NetlinkMessage) Group ¶
func (m *NetlinkMessage) Group() uint16
func (*NetlinkMessage) Len ¶
func (m *NetlinkMessage) Len() uint32
func (*NetlinkMessage) String ¶
func (m *NetlinkMessage) String() string
func (*NetlinkMessage) Type ¶
func (m *NetlinkMessage) Type() uint16
type NetlinkMessageHandler ¶
type NetlinkMessageHandler interface {
NetlinkMessage(*NetlinkMessage)
}
type NetlinkMessageUnion ¶
func NewNetlinkMessageUnion ¶
func NewNetlinkMessageUnion(header *syscall.NlMsghdr, msg interface{}, nid uint8, src NlMsgSrc) *NetlinkMessageUnion
func (*NetlinkMessageUnion) GetAddr ¶
func (n *NetlinkMessageUnion) GetAddr() *Addr
func (*NetlinkMessageUnion) GetBridgeVlanInfo ¶ added in v0.4.0
func (n *NetlinkMessageUnion) GetBridgeVlanInfo() *BridgeVlanInfo
func (*NetlinkMessageUnion) GetLink ¶
func (n *NetlinkMessageUnion) GetLink() *Link
func (*NetlinkMessageUnion) GetNeigh ¶
func (n *NetlinkMessageUnion) GetNeigh() *Neigh
func (*NetlinkMessageUnion) GetNode ¶
func (n *NetlinkMessageUnion) GetNode() *Node
func (*NetlinkMessageUnion) GetRoute ¶
func (n *NetlinkMessageUnion) GetRoute() *Route
func (*NetlinkMessageUnion) GetVpn ¶
func (n *NetlinkMessageUnion) GetVpn() *Vpn
func (*NetlinkMessageUnion) Group ¶
func (m *NetlinkMessageUnion) Group() uint16
func (*NetlinkMessageUnion) String ¶
func (m *NetlinkMessageUnion) String() string
func (*NetlinkMessageUnion) Type ¶
func (m *NetlinkMessageUnion) Type() uint16
type NetlinkNeighHandler ¶
type NetlinkNeighHandler interface {
NetlinkNeigh(*NetlinkMessage, *Neigh)
}
type NetlinkNodeHandler ¶
type NetlinkNodeHandler interface {
NetlinkNode(*NetlinkMessage, *Node)
}
type NetlinkRouteHandler ¶
type NetlinkRouteHandler interface {
NetlinkRoute(*NetlinkMessage, *Route)
}
type NetlinkVpnHandler ¶
type NetlinkVpnHandler interface {
NetlinkVpn(*NetlinkMessage, *Vpn)
}
type Node ¶
type Node struct { *nlalink.Node NId uint8 Ch chan *NetlinkMessageUnion }
Node
func NodeDeserialize ¶
func NodeDeserialize(nlmsg *NetlinkMessage) (*Node, error)
func (*Node) Recv ¶
func (n *Node) Recv() <-chan *NetlinkMessageUnion
func (*Node) Send ¶
func (n *Node) Send(msg *NetlinkMessageUnion) error
type Route ¶
type Route struct { *netlink.Route RtId uint32 // auto increment NId uint8 VpnGw net.IP EnIds []uint32 }
Route
func RouteDeserialize ¶
func RouteDeserialize(nlmsg *NetlinkMessage) (*Route, error)
func (*Route) GetLinkIndex ¶
func (*Route) GetMPLSEncap ¶
func (*Route) GetMPLSNewDst ¶
func (r *Route) GetMPLSNewDst() *netlink.MPLSDestination
func (*Route) MultiPathIndex ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.