netlinkconnector

package module
v0.0.0-...-c849dae Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2016 License: GPL-3.0 Imports: 6 Imported by: 0

README

Build Status

Documentation

Index

Constants

View Source
const (
	CN_IDX_PROC            = 0x1
	CN_VAL_PROC            = 0x1
	CN_IDX_CIFS            = 0x2
	CN_VAL_CIFS            = 0x1
	CN_W1_IDX              = 0x3 /* w1 communication */
	CN_W1_VAL              = 0x1
	CN_IDX_V86D            = 0x4
	CN_VAL_V86D_UVESAF     = 0x1
	CN_IDX_BB              = 0x5 /* BlackBoard, from the TSP GPL sampling framework */
	CN_DST_IDX             = 0x6
	CN_DST_VAL             = 0x1
	CN_IDX_DM              = 0x7 /* Device Mapper */
	CN_VAL_DM_USERSPACE_LO = 0x1
	CN_IDX_DRBD            = 0x8
	CN_VAL_DRBD            = 0x1
	CN_KVP_IDX             = 0x9 /* HyperV KVP */
	CN_KVP_VAL             = 0x1 /* queries from the kernel */
	CN_VSS_IDX             = 0xA /* HyperV VSS */
	CN_VSS_VAL             = 0x1 /* queries from the kernel */

	CN_NETLINK_USERS = 11

	CONNECTOR_MAX_MSG_SIZE = 16384
)

* idx and val are unique identifiers which * are used for message routing and * must be registered in connector.h for in-kernel usage. * get from /usr/include/connector.h

View Source
const (
	SizeofCbId = 8
)
View Source
const (
	SizeofCnMsg = 20
)

Variables

This section is empty.

Functions

func NativeEndian

func NativeEndian() binary.ByteOrder

Get native endianness for the system

func NlmAlignOf

func NlmAlignOf(msglen int) int

Round the length of a netlink message up to align it properly. copy from src/syscall/netlink_linux.go

Types

type CbId

type CbId struct {
	Idx uint32
	Val uint32
}

* idx and val are unique identifiers which * are used for message routing and * must be registered in connector.h for in-kernel usage.

func DeserializeCbId

func DeserializeCbId(b []byte) (*CbId, error)

func (*CbId) Len

func (self *CbId) Len() int

func (*CbId) Serialize

func (self *CbId) Serialize() []byte

type CnMsg

type CnMsg struct {
	Id     CbId
	Seq    uint32
	Ack    uint32
	Length uint16
	Flags  uint16
	Data   []byte
}

func DeserializeCnMsg

func DeserializeCnMsg(b []byte) (*CnMsg, error)

func ParseNetlinkConnectorMessage

func ParseNetlinkConnectorMessage(b []byte) ([]*CnMsg, error)

ParseNetlinkConnectorMessage parses b as an array of netlink connector messages and returns the slice containing the CnMsg structures.

func (*CnMsg) AddData

func (self *CnMsg) AddData(data CnRequestData)

func (*CnMsg) Len

func (self *CnMsg) Len() int

func (*CnMsg) Serialize

func (self *CnMsg) Serialize() []byte

type CnRequestData

type CnRequestData interface {
	Len() int
	Serialize() []byte
}

type NetlinkConnector

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

func NewNetlinkConnector

func NewNetlinkConnector(idx uint32) (*NetlinkConnector, error)

Get a new Handler for Netlink connector

func (*NetlinkConnector) Close

func (self *NetlinkConnector) Close()

Close Netlink Connector

func (*NetlinkConnector) GetFd

func (self *NetlinkConnector) GetFd() int

Return a file descriptor

func (*NetlinkConnector) Read

func (self *NetlinkConnector) Read() ([]*CnMsg, error)

Returns the slice containing the CnMsg(Netlink Connector Message) structures

func (*NetlinkConnector) Write

func (self *NetlinkConnector) Write(cnmsg *CnMsg) error

Write Netlink Connector Message

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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