rip

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: May 17, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RIPv1               uint8 = 1
	RIPv2               uint8 = 2
	RIP_PORT_DEFAULT          = 520
	RIP_PACKET_MINSIZE        = 4
	INADDR_RIP_GROUP          = "224.0.0.9"
	RIP_METRIC_INFINITY       = 16
)
View Source
const (
	RIP_REQUEST     = 1
	RIP_RESPONSE    = 2
	RIP_TRACEON     = 3 // Obsolete
	RIP_TRACEOFF    = 4 // Obsolete
	RIP_POLL        = 5
	RIP_POLL_ENTRY  = 6
	RIP_COMMAND_MAX = 7
)
View Source
const (
	VRF_DEFAULT = 0
)

Variables

This section is empty.

Functions

func IsClassA

func IsClassA(ip net.IP) bool

func IsClassABroadcast

func IsClassABroadcast(ip net.IP) bool

func IsClassB

func IsClassB(ip net.IP) bool

func IsClassBBroadcast

func IsClassBBroadcast(ip net.IP) bool

func IsClassC

func IsClassC(ip net.IP) bool

func IsClassCBroadcast

func IsClassCBroadcast(ip net.IP) bool

func MakeSocket

func MakeSocket() int

Types

type Client

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

func NewClient

func NewClient(dispatCh chan interface{}) *Client

func (*Client) InterfaceSubscribe

func (c *Client) InterfaceSubscribe(vrfId uint32) error

func (*Client) RouterIdSubscribe

func (c *Client) RouterIdSubscribe(vrfId uint32) error

func (*Client) Start

func (c *Client) Start()

func (*Client) Stop

func (c *Client) Stop()

type Fn

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

type InterfaceInfo

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

type Packet

type Packet struct {
	Command  byte
	Version  byte
	Padding1 byte
	Padding2 byte
	Rtes     []*Rte
}

func (*Packet) DecodeFromBytes

func (p *Packet) DecodeFromBytes(data []byte) error

type RpcComponent

type RpcComponent struct {
	Server *Server
}

func (*RpcComponent) Start

func (c *RpcComponent) Start() component.Component

func (*RpcComponent) Stop

func (c *RpcComponent) Stop() component.Component

type Rte

type Rte struct {
	Family  uint16
	Tag     uint16
	Prefix  net.IP
	Mask    net.IP
	Nexthop net.IP
	Metric  uint32
}

type Server

type Server struct {
	Version      uint8 // RIPv1 and RIPv2
	Sock         int
	SyncCh       chan *Fn
	DispatCh     chan interface{}
	Done         chan interface{}
	Client       *Client
	Running      bool
	IfMap        map[string]*fea.Interface
	EnableIfMap  map[string]bool
	PassiveIfMap map[string]bool
	Buffer       []byte
}

func NewServer

func NewServer() *Server

func (*Server) Dispatch

func (s *Server) Dispatch(res interface{})

func (*Server) EnableInterfaceSet

func (s *Server) EnableInterfaceSet(ifName string) error

func (*Server) EnableInterfaceUnset

func (s *Server) EnableInterfaceUnset(ifName string) error

func (*Server) EnableNetworkSet

func (s *Server) EnableNetworkSet() error

func (*Server) EnableNetworkUnset

func (s *Server) EnableNetworkUnset() error

func (*Server) InterfaceInfoGet

func (s *Server) InterfaceInfoGet(ifp *fea.Interface) *InterfaceInfo

func (*Server) NeighborSet

func (s *Server) NeighborSet() error

func (*Server) NeighborUnset

func (s *Server) NeighborUnset() error

func (*Server) PacketParse

func (s *Server) PacketParse() error

func (*Server) PacketRecv

func (s *Server) PacketRecv()

func (*Server) Read

func (s *Server) Read()

func (*Server) RouterSet

func (s *Server) RouterSet() error

func (*Server) RouterUnset

func (s *Server) RouterUnset() error

func (*Server) Start

func (s *Server) Start()

func (*Server) Stop

func (s *Server) Stop()

func (*Server) VersionSet

func (s *Server) VersionSet(version int) error

func (*Server) VersionUnset

func (s *Server) VersionUnset(version int) error

type ServerComponent

type ServerComponent struct {
	Server *Server
}

func (*ServerComponent) Start

func (c *ServerComponent) Start() component.Component

func (*ServerComponent) Stop

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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