Documentation ¶
Index ¶
- Constants
- type API_TYPE
- type Body
- type Client
- func (c *Client) Close() error
- func (c *Client) Receive() chan *Message
- func (c *Client) Send(m *Message)
- func (c *Client) SendCommand(command API_TYPE, body Body) error
- func (c *Client) SendHello() error
- func (c *Client) SendInterfaceAdd() error
- func (c *Client) SendRedistribute(t ROUTE_TYPE) error
- func (c *Client) SendRedistributeDelete(t ROUTE_TYPE) error
- func (c *Client) SendRouterIDAdd() error
- type FLAG
- type Header
- type HelloBody
- type INTERFACE_STATUS
- type IPRouteBody
- type ImportLookupBody
- type InterfaceAddressUpdateBody
- type InterfaceUpdateBody
- type Message
- type NEXTHOP_FLAG
- type Nexthop
- type NexthopLookupBody
- type ROUTE_TYPE
- type RedistributeBody
- type RouterIDUpdateBody
- type SAFI
Constants ¶
View Source
const ( HEADER_SIZE = 6 HEADER_MARKER = 255 VERSION = 2 INTERFACE_NAMSIZ = 20 )
View Source
const ( INTERFACE_ACTIVE = 0x01 INTERFACE_SUB = 0x02 INTERFACE_LINKDETECTION = 0x04 )
View Source
const ( MESSAGE_NEXTHOP = 0x01 MESSAGE_IFINDEX = 0x02 MESSAGE_DISTANCE = 0x04 MESSAGE_METRIC = 0x08 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API_TYPE ¶
type API_TYPE uint16
API Types.
const ( INTERFACE_ADD API_TYPE INTERFACE_DELETE INTERFACE_ADDRESS_ADD INTERFACE_ADDRESS_DELETE INTERFACE_UP INTERFACE_DOWN IPV4_ROUTE_ADD IPV4_ROUTE_DELETE IPV6_ROUTE_ADD IPV6_ROUTE_DELETE REDISTRIBUTE_ADD REDISTRIBUTE_DELETE REDISTRIBUTE_DEFAULT_ADD REDISTRIBUTE_DEFAULT_DELETE IPV4_NEXTHOP_LOOKUP IPV6_NEXTHOP_LOOKUP IPV4_IMPORT_LOOKUP IPV6_IMPORT_LOOKUP INTERFACE_RENAME ROUTER_ID_ADD ROUTER_ID_DELETE ROUTER_ID_UPDATE HELLO MESSAGE_MAX )
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) SendInterfaceAdd ¶
func (*Client) SendRedistribute ¶
func (c *Client) SendRedistribute(t ROUTE_TYPE) error
func (*Client) SendRedistributeDelete ¶
func (c *Client) SendRedistributeDelete(t ROUTE_TYPE) error
func (*Client) SendRouterIDAdd ¶
type Header ¶
func (*Header) DecodeFromBytes ¶
type HelloBody ¶
type HelloBody struct {
RedistDefault ROUTE_TYPE
}
func (*HelloBody) DecodeFromBytes ¶
type INTERFACE_STATUS ¶
type INTERFACE_STATUS uint8
func (INTERFACE_STATUS) String ¶
func (t INTERFACE_STATUS) String() string
type IPRouteBody ¶
type IPRouteBody struct { Type ROUTE_TYPE Flags FLAG Message uint8 SAFI SAFI Prefix net.IP PrefixLength uint8 Nexthops []net.IP Ifindexs []uint32 Distance uint8 Metric uint32 Api API_TYPE }
func (*IPRouteBody) DecodeFromBytes ¶
func (b *IPRouteBody) DecodeFromBytes(data []byte) error
func (*IPRouteBody) Serialize ¶
func (b *IPRouteBody) Serialize() ([]byte, error)
func (*IPRouteBody) String ¶
func (b *IPRouteBody) String() string
type ImportLookupBody ¶
type ImportLookupBody struct { Api API_TYPE PrefixLength uint8 Prefix net.IP Addr net.IP Metric uint32 Nexthops []*Nexthop }
func (*ImportLookupBody) DecodeFromBytes ¶
func (b *ImportLookupBody) DecodeFromBytes(data []byte) error
func (*ImportLookupBody) Serialize ¶
func (b *ImportLookupBody) Serialize() ([]byte, error)
func (*ImportLookupBody) String ¶
func (b *ImportLookupBody) String() string
type InterfaceAddressUpdateBody ¶
func (*InterfaceAddressUpdateBody) DecodeFromBytes ¶
func (b *InterfaceAddressUpdateBody) DecodeFromBytes(data []byte) error
func (*InterfaceAddressUpdateBody) Serialize ¶
func (b *InterfaceAddressUpdateBody) Serialize() ([]byte, error)
func (*InterfaceAddressUpdateBody) String ¶
func (b *InterfaceAddressUpdateBody) String() string
type InterfaceUpdateBody ¶
type InterfaceUpdateBody struct { Name string Index uint32 Status INTERFACE_STATUS Flags uint64 Metric uint32 MTU uint32 MTU6 uint32 Bandwidth uint32 HardwareAddr net.HardwareAddr }
func (*InterfaceUpdateBody) DecodeFromBytes ¶
func (b *InterfaceUpdateBody) DecodeFromBytes(data []byte) error
func (*InterfaceUpdateBody) Serialize ¶
func (b *InterfaceUpdateBody) Serialize() ([]byte, error)
func (*InterfaceUpdateBody) String ¶
func (b *InterfaceUpdateBody) String() string
type NEXTHOP_FLAG ¶
type NEXTHOP_FLAG uint8
Nexthop Flags.
const ( NEXTHOP_IFINDEX NEXTHOP_FLAG NEXTHOP_IFNAME NEXTHOP_IPV4 NEXTHOP_IPV4_IFINDEX NEXTHOP_IPV4_IFNAME NEXTHOP_IPV6 NEXTHOP_IPV6_IFINDEX NEXTHOP_IPV6_IFNAME NEXTHOP_BLACKHOLE )
func (NEXTHOP_FLAG) String ¶
func (i NEXTHOP_FLAG) String() string
type NexthopLookupBody ¶
func (*NexthopLookupBody) DecodeFromBytes ¶
func (b *NexthopLookupBody) DecodeFromBytes(data []byte) error
func (*NexthopLookupBody) Serialize ¶
func (b *NexthopLookupBody) Serialize() ([]byte, error)
func (*NexthopLookupBody) String ¶
func (b *NexthopLookupBody) String() string
type ROUTE_TYPE ¶
type ROUTE_TYPE uint8
Route Types.
const ( ROUTE_SYSTEM ROUTE_TYPE = iota ROUTE_KERNEL ROUTE_CONNECT ROUTE_STATIC ROUTE_RIP ROUTE_RIPNG ROUTE_OSPF ROUTE_OSPF6 ROUTE_ISIS ROUTE_BGP ROUTE_HSLS ROUTE_OLSR ROUTE_BABEL ROUTE_MAX )
func RouteTypeFromString ¶
func RouteTypeFromString(typ string) (ROUTE_TYPE, error)
func (ROUTE_TYPE) String ¶
func (i ROUTE_TYPE) String() string
type RedistributeBody ¶
type RedistributeBody struct {
Redist ROUTE_TYPE
}
func (*RedistributeBody) DecodeFromBytes ¶
func (b *RedistributeBody) DecodeFromBytes(data []byte) error
func (*RedistributeBody) Serialize ¶
func (b *RedistributeBody) Serialize() ([]byte, error)
type RouterIDUpdateBody ¶
func (*RouterIDUpdateBody) DecodeFromBytes ¶
func (b *RouterIDUpdateBody) DecodeFromBytes(data []byte) error
func (*RouterIDUpdateBody) Serialize ¶
func (b *RouterIDUpdateBody) Serialize() ([]byte, error)
func (*RouterIDUpdateBody) String ¶
func (b *RouterIDUpdateBody) String() string
Click to show internal directories.
Click to hide internal directories.