Documentation ¶
Index ¶
- func AddDefaultGw(ip net.IP) error
- func NetworkGetRoutes() ([]*net.IPNet, error)
- func NetworkLinkAdd(name string, linkType string) error
- func NetworkLinkAddIp(iface *net.Interface, ip net.IP, ipNet *net.IPNet) error
- func NetworkLinkUp(iface *net.Interface) error
- type IfAddrmsg
- type IfInfomsg
- type NetlinkRequest
- type NetlinkRequestData
- type NetlinkSocket
- type RtAttr
- type RtMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDefaultGw ¶
Add a new default gateway. Identical to: ip route add default via $ip
func NetworkGetRoutes ¶
Returns an array of IPNet for all the currently routed subnets on ipv4 This is similar to the first column of "ip route" output
func NetworkLinkAdd ¶
Add a new network link of a specified type. This is identical to running: ip add link $name type $linkType
func NetworkLinkAddIp ¶
Add an Ip address to an interface. This is identical to: ip addr add $ip/$ipNet dev $iface
func NetworkLinkUp ¶
Bring up a particular network interface
Types ¶
type IfAddrmsg ¶
func (*IfAddrmsg) ToWireFormat ¶
type IfInfomsg ¶
func (*IfInfomsg) ToWireFormat ¶
type NetlinkRequest ¶
type NetlinkRequest struct { syscall.NlMsghdr Data []NetlinkRequestData }
func (*NetlinkRequest) AddData ¶
func (rr *NetlinkRequest) AddData(data NetlinkRequestData)
func (*NetlinkRequest) ToWireFormat ¶
func (rr *NetlinkRequest) ToWireFormat() []byte
type NetlinkRequestData ¶
type NetlinkRequestData interface {
ToWireFormat() []byte
}
type NetlinkSocket ¶
type NetlinkSocket struct {
// contains filtered or unexported fields
}
func (*NetlinkSocket) Close ¶
func (s *NetlinkSocket) Close()
func (*NetlinkSocket) GetPid ¶
func (s *NetlinkSocket) GetPid() (uint32, error)
func (*NetlinkSocket) HandleAck ¶
func (s *NetlinkSocket) HandleAck(seq uint32) error
func (*NetlinkSocket) Recieve ¶
func (s *NetlinkSocket) Recieve() ([]syscall.NetlinkMessage, error)
func (*NetlinkSocket) Send ¶
func (s *NetlinkSocket) Send(request *NetlinkRequest) error
type RtAttr ¶
func (*RtAttr) ToWireFormat ¶
Click to show internal directories.
Click to hide internal directories.