Documentation ¶
Index ¶
- Constants
- Variables
- func AsPathTokenGet(str string) (string, int, uint32)
- func AsSegmentDelimiter(typ uint8) (string, string)
- func BgpAsApi(As uint32)
- func BgpEventString(s int) string
- func BgpPeerApi(As uint32)
- func BgpStateString(s int) string
- func CapabilityCodeString(code uint8) string
- func CommunityValParse(s string) (uint32, error)
- func GrpcDial() (*grpc.ClientConn, error)
- func GrpcRegisterCli(conn *grpc.ClientConn, moduleName string, parser *cmd.Node) error
- func GrpcRegisterModule(conn *grpc.ClientConn, moduleName string, modulePort string) error
- func NewAsPath()
- func NewBgpError(code, subCode uint8, data []byte, message string) error
- func ParseIP(str string) net.IP
- func ReadFull(conn net.Conn, length int) ([]byte, error)
- func ServerStop()
- func TimerStop(t *time.Timer)
- type Afi
- type AfiSafi
- type As2Segment
- type As4Segment
- func (seg *As4Segment) Append(asnum uint32)
- func (seg *As4Segment) DecodeFromBytes(data []byte) error
- func (seg *As4Segment) EncodeLength() int
- func (seg *As4Segment) GetLength() int
- func (seg *As4Segment) GetType() uint8
- func (seg *As4Segment) PathLength() int
- func (seg *As4Segment) Serialize() ([]byte, error)
- func (seg *As4Segment) String() string
- type AsPath
- type AsPathList
- type AsSegmentInterface
- type AttrAggregator
- type AttrAsPath
- type AttrAtomicAggregate
- type AttrBase
- type AttrClusterList
- type AttrCommunity
- type AttrInterface
- type AttrLocalPref
- type AttrMed
- type AttrNexthop
- type AttrOrigin
- type AttrOriginatorId
- type AttrPrefixSid
- type AttrUnknown
- type BGPAttrFlag
- type BGPAttrType
- type BgpBody
- type BgpCapability
- type BgpHeader
- type BgpKeepAlive
- type BgpMessage
- type BgpNotification
- type BgpOpen
- type BgpRouteRefresh
- type BgpUpdate
- type Cap4OctetAsNumber
- type CapAddPath
- type CapCarryingLabelInfo
- type CapEnhancedRouteRefresh
- type CapGracefulRestart
- type CapGracefulRestartTuple
- type CapLongLivedGracefulRestart
- type CapLongLivedGracefulRestartTuple
- type CapMultiProtocol
- type CapRouteRefresh
- type CapRouteRefreshCisco
- type CapUnknown
- type Capability
- type CapabilityBase
- type CapabilityInterface
- type Community
- type CommunityList
- type CommunityListEntry
- type CommunityListMap
- func (clist CommunityListMap) CommunityListAdd(name string, typ CommunityListType, policy policy.Action, str string) error
- func (clist CommunityListMap) CommunityListDelete(name string, typ CommunityListType, policy policy.Action, str string) error
- func (clist CommunityListMap) CommunityListGet(name string) *CommunityList
- type CommunityListType
- type EsiType
- type EthernetSegmentIdentifier
- type Event
- type EvpnEthernetAutoDiscoveryRoute
- type EvpnNlri
- type EvpnRouteTypeInterface
- type Fn
- type Fsm
- func (f *Fsm) BgpOpenProcess(msg *BgpMessage)
- func (f *Fsm) ChangeStateTo(s int)
- func (f *Fsm) ConnectRetryTimerStart()
- func (f *Fsm) DelayOpenTimer() bool
- func (f *Fsm) Event(e *Event)
- func (f *Fsm) EventActive(e *Event)
- func (f *Fsm) EventConnect(e *Event)
- func (f *Fsm) EventEstablished(e *Event)
- func (f *Fsm) EventIdle(e *Event)
- func (f *Fsm) EventLoop(done chan interface{})
- func (f *Fsm) EventOpenConfirm(e *Event)
- func (f *Fsm) EventOpenSent(e *Event)
- func (f *Fsm) IdleTimerStart()
- func (f *Fsm) KeepaliveTimerStart()
- func (f *Fsm) NotifyAndSendEvent(e int, err error) *Event
- func (f *Fsm) SendEvent(e int)
- func (f *Fsm) SendKeepAlive()
- func (f *Fsm) SendNotification(notify *BgpNotification)
- func (f *Fsm) SendOpen()
- func (f *Fsm) SendPacket(msg *BgpMessage)
- func (f *Fsm) Stop()
- func (f *Fsm) TcpConnect() func()
- func (f *Fsm) TcpDrop()
- func (f *Fsm) TcpEstablish()
- func (f *Fsm) TcpRead(conn net.Conn)
- func (f *Fsm) TcpWrite(conn net.Conn)
- type GrpcComponent
- func (s *GrpcComponent) DoExec(_ context.Context, req *openconfig.ExecRequest) (*openconfig.ExecReply, error)
- func (s *GrpcComponent) Show(req *openconfig.ShowRequest, stream openconfig.Show_ShowServer) error
- func (s *GrpcComponent) Start() component.Component
- func (s *GrpcComponent) StartClient()
- func (s *GrpcComponent) StartServer()
- func (s *GrpcComponent) Stop() component.Component
- type Ipv6Tlv
- type LabelIndexTlv
- type MessageCount
- type Neighbor
- func (n *Neighbor) Address() net.IP
- func (n *Neighbor) AfiSafiSet(afi Afi, safi Safi) error
- func (n *Neighbor) HoldTime() uint16
- func (n *Neighbor) LocalAs() uint32
- func (n *Neighbor) RemoteAs() uint32
- func (n *Neighbor) RemoteAsSet(as uint32) error
- func (n *Neighbor) Reset(resetType ResetType) error
- func (n *Neighbor) Start()
- func (n *Neighbor) Stop()
- type NeighborConfig
- type OptParamCapability
- type OptParamInterface
- type OptParamUnknown
- type OriginatorSrbgTlv
- type PeerGroup
- type PeerGroupConfig
- type PrefixList
- type PrefixListEntry
- type PrefixListMaster
- func (m *PrefixListMaster) DescriptionSet(name string, desc string)
- func (m *PrefixListMaster) DescriptionUnset(name string, desc string)
- func (m *PrefixListMaster) EntryAdd(name string, p *netutil.Prefix, seq, eq, le, ge int)
- func (m *PrefixListMaster) EntryDelete(name string, p *netutil.Prefix, seq, eq, le, ge int)
- func (m *PrefixListMaster) PrefixListDelete(name string)
- func (m *PrefixListMaster) PrefixListGet(name string) *PrefixList
- func (m *PrefixListMaster) PrefixListLookup(name string) *PrefixList
- type PrefixNLRI
- type ResetType
- type RouteDistinguisherInterface
- type Safi
- type Server
- func (s *Server) GracefulRestartDisable() error
- func (s *Server) GracefulRestartEnable() error
- func (s *Server) GracefulRestartTime() int
- func (s *Server) NeighborAdd(addrStr string) error
- func (s *Server) NeighborAfiSafiSet(addrStr string, afi Afi, safi Safi) error
- func (s *Server) NeighborReflectorClientDisable(addrStr string) error
- func (s *Server) NeighborReflectorClientEnable(addrStr string) error
- func (s *Server) NeighborRemoteAsSet(addrStr string, as uint32) error
- func (s *Server) Port() uint16
- func (s *Server) PortSet(port uint16)
- func (s *Server) PortUnset()
- func (s *Server) Reset(addrStr string, resetType ResetType) error
- func (s *Server) ResetAll() error
- func (s *Server) RouterId() net.IP
- func (s *Server) RouterIdSet(routerIdStr string) error
- func (s *Server) RouterIdUnset() error
- func (s *Server) Runnable() bool
- func (s *Server) Serv()
- type ServerComponent
- type ServerConfig
- type ShowTask
- type Srgb
- type Srv6Sid
- type Srv6VpnSidTlv
- type TlvBase
- type TlvInterface
Constants ¶
View Source
const ( AS_SET = 1 AS_SEQUENCE = 2 AS_CONFED_SEQUENCE = 3 AS_CONFED_SET = 4 )
View Source
const ( BGP_ORIGIN_IGP = 0 BGP_ORIGIN_EGP = 1 BGP_ORIGIN_INCOMPLETE = 2 )
View Source
const ( COMMUNITY_INTERNET uint32 = 0x00000000 COMMUNITY_GSHUT = 0xffff0000 COMMUNITY_NO_EXPORT = 0xffffff01 COMMUNITY_NO_ADVERTISE = 0xffffff02 COMMUNITY_LOCAL_AS = 0xffffff03 COMMUNITY_NO_PEER = 0xffffff04 )
View Source
const ( GR_RESTART_TIME = 120 GR_STALE_PATH_TIME = 360 )
View Source
const ( AS_UNSPEC = 0 // Unspecifed AS number will be used in config. AS_TRANS = 23456 // RFC6793 BGP Support for Four-Octet AS Number Space )
View Source
const ( AFI_IP Afi = 1 AFI_IP6 = 2 AFI_L2VPN = 25 AFI_LS = 16388 AFI_OPAQUE = 16397 )
View Source
const ( SAFI_UNICAST Safi = 1 SAFI_MULTICAST = 2 SAFI_MPLS_LABEL = 4 SAFI_ENCAPSULATION = 7 SAFI_VPLS = 65 SAFI_EVPN = 70 SAFI_LS = 71 SAFI_LS_VPN = 72 SAFI_MPLS_VPN = 128 SAFI_MPLS_VPN_MULTICAST = 129 SAFI_RT_CONSTRTAINS = 132 SAFI_FLOW_SPEC_UNICAST = 133 SAFI_FLOW_SPEC_VPN = 134 SAFI_KEY_VALUE = 241 )
View Source
const ( BGP_ERR_MSG_HEADER_ERROR uint8 BGP_ERR_OPEN_MESSAGE_ERROR BGP_ERR_UPDATE_MESSAGE_ERROR BGP_ERR_HOLD_TIMER_EXPIRED BGP_ERR_FSM_ERROR BGP_ERR_CEASE BGP_ERR_ROUTE_REFRESH_MESSAGE_ERROR )
Notification error code rfc 4271 4.5.
View Source
const ( BGP_ERR_SUB_CONNECTION_NOT_SYNCHRONIZED uint8 BGP_ERR_SUB_BAD_MESSAGE_LENGTH BGP_ERR_SUB_BAD_MESSAGE_TYPE )
Notification Error Subcode for BGP_ERR_MESSAGE_HEADER_ERROR
View Source
const ( BGP_ERR_SUB_UNSUPPORTED_VERSION_NUMBER uint8 BGP_ERR_SUB_BAD_PEER_AS BGP_ERR_SUB_BAD_BGP_IDENTIFIER BGP_ERR_SUB_UNSUPPORTED_OPTIONAL_PARAMETER BGP_ERR_SUB_DEPRECATED_AUTHENTICATION_FAILURE BGP_ERR_SUB_UNACCEPTABLE_HOLD_TIME BGP_ERR_SUB_UNSUPPORTED_CAPABILITY )
Notification Error Subcode for BGP_ERR_OPEN_MESSAGE_ERROR
View Source
const ( BGP_ERR_SUB_MALFORMED_ATTRIBUTE_LIST uint8 BGP_ERR_SUB_UNRECOGNIZED_WELL_KNOWN_ATTRIBUTE BGP_ERR_SUB_MISSING_WELL_KNOWN_ATTRIBUTE BGP_ERR_SUB_ATTRIBUTE_FLAGS_ERROR BGP_ERR_SUB_ATTRIBUTE_LENGTH_ERROR BGP_ERR_SUB_INVALID_ORIGIN_ATTRIBUTE BGP_ERR_SUB_DEPRECATED_ROUTING_LOOP BGP_ERR_SUB_INVALID_NEXT_HOP_ATTRIBUTE BGP_ERR_SUB_OPTIONAL_ATTRIBUTE_ERROR BGP_ERR_SUB_INVALID_NETWORK_FIELD BGP_ERR_SUB_MALFORMED_AS_PATH )
Notification Error Subcode for BGP_ERR_UPDATE_MESSAGE_ERROR
View Source
const ( BGP_ERR_SUB_RECEIVE_UNEXPECTED_MESSAGE_IN_OPENSENT_STATE uint8 BGP_ERR_SUB_RECEIVE_UNEXPECTED_MESSAGE_IN_OPENCONFIRM_STATE BGP_ERR_SUB_RECEIVE_UNEXPECTED_MESSAGE_IN_ESTABLISHED_STATE )
Notification Error Subcode for BGP_ERR_FSM_ERROR
View Source
const ( BGP_ERR_SUB_MAXIMUM_NUMBER_OF_PREFIXES_REACHED uint8 BGP_ERR_SUB_ADMINISTRATIVE_SHUTDOWN BGP_ERR_SUB_PEER_DECONFIGURED BGP_ERR_SUB_ADMINISTRATIVE_RESET BGP_ERR_SUB_CONNECTION_REJECTED BGP_ERR_SUB_OTHER_CONFIGURATION_CHANGE BGP_ERR_SUB_CONNECTION_COLLISION_RESOLUTION BGP_ERR_SUB_OUT_OF_RESOURCES BGP_ERR_SUB_HARD_RESET //draft-ietf-idr-bgp-gr-notification-07 )
Notification Error Subcode for BGP_ERR_CEASE (RFC4486)
View Source
const ( EVPN_ROUTE_TYPE_ETHERNET_AUTO_DISCOVERY = 1 EVPN_ROUTE_TYPE_MAC_IP_ADVERTISEMENT = 2 EVPN_INCLUSIVE_MULTICAST_ETHERNET_TAG = 3 EVPN_ETHERNET_SEGMENT_ROUTE = 4 EVPN_IP_PREFIX = 5 )
View Source
const ( BGP_FSM_IDLE int = iota BGP_FSM_CONNECT BGP_FSM_ACTIVE BGP_FSM_OPENSENT BGP_FSM_OPENCONFIRM BGP_FSM_ESTABLISHED )
View Source
const ( ManualStart // 1 ManualStop // 2 AutomaticStart // 3 ManualStart_with_Passive // 4 AutomaticStart_with_Passive // 5 AutomaticStart_with_Damp // 6 AutomaticStart_with_Damp_and_Passive // 7 AutomaticStop // 8 ConnectRetryTimer_Expires // 9 HoldTimer_Expires // 10 KeepaliveTimer_Expires // 11 DelayOpenTimer_Expires // 12 IdleHoldTimer_Expires // 13 TcpConnection_Valid // 14 Tcp_CR_Invalid // 15 Tcp_CR_Acked // 16 TcpConnectionConfirmed // 17 TcpConnectionFails // 18 BGPOpen // 19 BGPOpen_with_DelayOpenTimer_running // 20 BGPHeaderErr // 21 BGPOpenMsgErr // 22 OpenCollisionDump // 23 NotifMsgVerErr // 24 NotifMsg // 25 KeepAliveMsg // 26 UpdateMsg // 27 UpdateMsgErr // 28 RouteRefreshMsg // 29 - local extention CapabilityMsg // 30 - local extension )
View Source
const ( BGP_MODULE_NAME = "bgpd" BGP_MODULE_PORT = "2651" GRPC_SERVER_ADDRESS = "" // This means localhost. GRPC_SERVER_PORT = "2650" GRPC_CONNECT_RETRY_TIME = 5 )
View Source
const ( BGP_MARKER_LEN = 16 BGP_HEADER_LEN = 19 BGP_MAX_PACKET_LEN = 4096 )
View Source
const ( BGP_MSG_OPEN = 1 BGP_MSG_UPDATE = 2 BGP_MSG_NOTIFICATION = 3 BGP_MSG_KEEPALIVE = 4 BGP_MSG_ROUTE_REFRESH = 5 BGP_MSG_CAPABILITY = 6 BGP_MSG_ROUTE_REFRESH_OLD = 128 )
View Source
const ( BGP_CAP_MULTIPROTOCOL uint8 = 1 // RFC2858 BGP_CAP_ROUTE_REFRESH = 2 // RFC2918 BGP_CAP_ORF = 3 // RFC5291 BGP_CAP_CARRYING_LABEL_INFO = 4 // RFC3107 BGP_CAP_EXT_NEXTHOP = 5 // RFC5549 BGP_CAP_GRACEFUL_RESTART = 64 // RFC4724 BGP_CAP_4OCTET_AS_NUMBER = 65 // RFC6793 BGP_CAP_DYNAMIC_CAP = 67 // draft-ietf-idr-dynamic-cap BGP_CAP_MULTI_SESSION = 68 // draft-ietf-idr-bgp-multisession BGP_CAP_ADD_PATH = 69 // RFC7911 BGP_CAP_ENHANCED_ROUTE_REFRESH = 70 // RFC7313 BGP_CAP_LONG_LIVED_GRACEFUL_RESTART = 71 // draft-uttaro-idr-bgp-persistence BGP_CAP_ROUTE_REFRESH_CISCO = 128 BGP_CAP_LONG_LIVED_GRACEFUL_RESTART_OLD = 129 // draft-uttaro-idr-bgp-persistence )
View Source
const ( BGP_ADD_PATH_RECEIVE uint8 = 1 BGP_ADD_PATH_SEND = 2 BGP_ADD_PATH_BOTH = 3 )
View Source
const ( HARD_RESET = iota SOFT_RESET_BOTH SOFT_RESET_IN SOFT_RESET_OUT )
View Source
const ( PREFIX_SID_TYPE_LABEL_INDEX uint8 = 1 PREFIX_SID_TYPE_IPV6_TLV = 2 PREFIX_SID_TYPE_ORIGINATOR_SRGB_TLV = 3 PREFIX_SID_TYPE_SRV6_VPN_SID_TLV = 4 // TBD. )
View Source
const (
BGPServerReset = iota
)
View Source
const (
BGP_ERR_SUB_HOLD_TIMER_EXPIRED uint8
)
Notification Error Subcode for BGP_ERR_HOLD_TIMER_EXPIRED
View Source
const (
BGP_ERR_SUB_INVALID_MESSAGE_LENGTH uint8
)
Notification Error Subcode for BGP_ERR_ROUTE_REFRESH
View Source
const BGP_OPT_CAPABILITY = 2
View Source
const (
BGP_PORT = 179 // BGP default port
)
View Source
const (
DEFAULT_HOLDTIME = 90
)
View Source
const FORWARDING_PRESERVED_FLAG = 0xf0
View Source
const RESTART_FLAG = 0x08
Variables ¶
View Source
var Afi2String = map[Afi]string{ AFI_IP: "ipv4", AFI_IP6: "ipv6", AFI_L2VPN: "l2vpn", AFI_LS: "ls", AFI_OPAQUE: "opaque", }
View Source
var BGPAttrTypeString = map[BGPAttrType]string{ BGP_ATTR_TYPE_ORIGIN: "origin", BGP_ATTR_TYPE_AS_PATH: "aspath", BGP_ATTR_TYPE_NEXT_HOP: "nexthop", BGP_ATTR_TYPE_MED: "med", BGP_ATTR_TYPE_LOCAL_PREF: "local preference", BGP_ATTR_TYPE_ATOMIC_AGGREGATE: "atmic aggregate", BGP_ATTR_TYPE_AGGREGATOR: "aggregator", BGP_ATTR_TYPE_COMMUNITIES: "communities", BGP_ATTR_TYPE_ORIGINATOR_ID: "originator id", BGP_ATTR_TYPE_CLUSTER_LIST: "cluster list", BGP_ATTR_TYPE_MP_REACH_NLRI: "mp reach nlri", BGP_ATTR_TYPE_MP_UNREACH_NLRI: "mp unreach nlri", BGP_ATTR_TYPE_EXTENDED_COMMUNITIES: "ext communities", BGP_ATTR_TYPE_AS4_PATH: "as4 path", BGP_ATTR_TYPE_AS4_AGGREGATOR: "as4 aggregator", BGP_ATTR_TYPE_PREFIX_SID: "prefix sid", }
View Source
var BgpEvent2String = map[int]string{ ManualStart: "ManualStart", ManualStop: "ManualStop", AutomaticStart: "AutomaticStart", ManualStart_with_Passive: "ManualStart_with_Passive", AutomaticStart_with_Passive: "AutomaticStart_with_Passive", AutomaticStart_with_Damp: "AutomaticStart_with_Damp", AutomaticStart_with_Damp_and_Passive: "AutomaticStart_with_Damp_and_Passive", AutomaticStop: "AutomaticStop", ConnectRetryTimer_Expires: "ConnectRetryTimer_Expires", HoldTimer_Expires: "HoldTimer_Expires", KeepaliveTimer_Expires: "KeepaliveTimer_Expires", DelayOpenTimer_Expires: "DelayOpenTimer_Expires", IdleHoldTimer_Expires: "IdleHoldTimer_Expires", TcpConnection_Valid: "TcpConnection_Valid", Tcp_CR_Invalid: "Tcp_CR_Invalid", Tcp_CR_Acked: "Tcp_CR_Acked", TcpConnectionConfirmed: "TcpConnectionConfirmed", TcpConnectionFails: "TcpConnectionFails", BGPOpen: "BGPOpen", BGPOpen_with_DelayOpenTimer_running: "BGPOpen_with_DelayOpenTimer_running", BGPHeaderErr: "BGPHeaderErr", BGPOpenMsgErr: "BGPOpenMsgErr", OpenCollisionDump: "OpenCollisionDump", NotifMsgVerErr: "NotifMsgVerErr", NotifMsg: "NotifMsg", KeepAliveMsg: "KeepAliveMsg", UpdateMsg: "UpdateMsg", UpdateMsgErr: "UpdateMsgErr", RouteRefreshMsg: "RouteRefreshMsg", CapabilityMsg: "CapabilityMsg", }
View Source
var BgpState2String = map[int]string{ BGP_FSM_IDLE: "Idle", BGP_FSM_CONNECT: "Connect", BGP_FSM_ACTIVE: "Active", BGP_FSM_OPENSENT: "OpenSent", BGP_FSM_OPENCONFIRM: "OpenConfirm", BGP_FSM_ESTABLISHED: "Established", }
View Source
var CapabilityCode2String = map[uint8]string{ BGP_CAP_MULTIPROTOCOL: "Muitiprotocol", BGP_CAP_ROUTE_REFRESH: "RouteRefresh", BGP_CAP_CARRYING_LABEL_INFO: "Carrying Label Info", BGP_CAP_GRACEFUL_RESTART: "Graceful Restart", BGP_CAP_4OCTET_AS_NUMBER: "4 Octet AS", BGP_CAP_ADD_PATH: "Add Path", BGP_CAP_ENHANCED_ROUTE_REFRESH: "Enhanced Route Refresh", BGP_CAP_ROUTE_REFRESH_CISCO: "Route Refresh Cisco", BGP_CAP_LONG_LIVED_GRACEFUL_RESTART: "Long Lived Graceful Restart", }
View Source
var Safi2String = map[Safi]string{ SAFI_UNICAST: "unicast", SAFI_MULTICAST: "multicast", SAFI_MPLS_LABEL: "label", SAFI_ENCAPSULATION: "encap", SAFI_VPLS: "vpls", SAFI_EVPN: "evpn", SAFI_MPLS_VPN: "vpn", SAFI_MPLS_VPN_MULTICAST: "vpn-multicast", SAFI_RT_CONSTRTAINS: "rt-constraints", SAFI_FLOW_SPEC_UNICAST: "flowspec-unicast", SAFI_FLOW_SPEC_VPN: "flowspec-vpn", SAFI_KEY_VALUE: "key", }
View Source
var WellKnownCommunityMap = map[uint32]string{ COMMUNITY_INTERNET: "internet", COMMUNITY_GSHUT: "gshut", COMMUNITY_NO_EXPORT: "no-export", COMMUNITY_NO_ADVERTISE: "no-advertise", COMMUNITY_LOCAL_AS: "local-AS", COMMUNITY_NO_PEER: "nopeer", }
View Source
var WellKnownCommunityStrMap = map[string]uint32{ "internet": COMMUNITY_INTERNET, "gshut": COMMUNITY_GSHUT, "no-export": COMMUNITY_NO_EXPORT, "no-advertise": COMMUNITY_NO_ADVERTISE, "local-AS": COMMUNITY_LOCAL_AS, "nopeer": COMMUNITY_NO_PEER, }
Functions ¶
func AsSegmentDelimiter ¶
func BgpEventString ¶
func BgpPeerApi ¶
func BgpPeerApi(As uint32)
func BgpStateString ¶
func CapabilityCodeString ¶
func CommunityValParse ¶
func GrpcDial ¶
func GrpcDial() (*grpc.ClientConn, error)
func GrpcRegisterCli ¶
func GrpcRegisterModule ¶
func GrpcRegisterModule(conn *grpc.ClientConn, moduleName string, modulePort string) error
func ServerStop ¶
func ServerStop()
Types ¶
type As2Segment ¶
func (*As2Segment) DecodeFromBytes ¶
func (seg *As2Segment) DecodeFromBytes(data []byte) error
func (*As2Segment) EncodeLength ¶
func (seg *As2Segment) EncodeLength() int
func (*As2Segment) PathLength ¶
func (seg *As2Segment) PathLength() int
func (*As2Segment) Serialize ¶
func (seg *As2Segment) Serialize() ([]byte, error)
func (*As2Segment) String ¶
func (seg *As2Segment) String() string
type As4Segment ¶
func NewAs4Segment ¶
func NewAs4Segment(typ uint8) *As4Segment
func (*As4Segment) Append ¶
func (seg *As4Segment) Append(asnum uint32)
func (*As4Segment) DecodeFromBytes ¶
func (seg *As4Segment) DecodeFromBytes(data []byte) error
func (*As4Segment) EncodeLength ¶
func (seg *As4Segment) EncodeLength() int
func (*As4Segment) GetLength ¶
func (seg *As4Segment) GetLength() int
func (*As4Segment) GetType ¶
func (seg *As4Segment) GetType() uint8
func (*As4Segment) PathLength ¶
func (seg *As4Segment) PathLength() int
func (*As4Segment) Serialize ¶
func (seg *As4Segment) Serialize() ([]byte, error)
func (*As4Segment) String ¶
func (seg *As4Segment) String() string
type AsPathList ¶
type AsPathList struct { }
type AsSegmentInterface ¶
type AttrAggregator ¶
Aggregator.
func (*AttrAggregator) DecodeFromBytes ¶
func (attr *AttrAggregator) DecodeFromBytes(data []byte) error
type AttrAsPath ¶
AS path.
func (*AttrAsPath) DecodeFromBytes ¶
func (attr *AttrAsPath) DecodeFromBytes(data []byte) error
func (*AttrAsPath) MarshalJSON ¶
func (attr *AttrAsPath) MarshalJSON() ([]byte, error)
func (*AttrAsPath) String ¶
func (attr *AttrAsPath) String() string
type AttrAtomicAggregate ¶
type AttrAtomicAggregate struct {
AttrBase
}
Atomic Aggregate.
func (*AttrAtomicAggregate) DecodeFromBytes ¶
func (attr *AttrAtomicAggregate) DecodeFromBytes(data []byte) error
func (*AttrAtomicAggregate) MarshalJSON ¶
func (attr *AttrAtomicAggregate) MarshalJSON() ([]byte, error)
func (*AttrAtomicAggregate) String ¶
func (attr *AttrAtomicAggregate) String() string
type AttrBase ¶
type AttrBase struct { Flags BGPAttrFlag Type BGPAttrType Length uint16 Value []byte }
func (*AttrBase) DecodeFromBytes ¶
func (*AttrBase) TotalLength ¶
type AttrClusterList ¶
Cluster list.
func (*AttrClusterList) DecodeFromBytes ¶
func (attr *AttrClusterList) DecodeFromBytes(data []byte) error
type AttrCommunity ¶
Community.
func (*AttrCommunity) DecodeFromBytes ¶
func (attr *AttrCommunity) DecodeFromBytes(data []byte) error
func (*AttrCommunity) MarshalJSON ¶
func (attr *AttrCommunity) MarshalJSON() ([]byte, error)
type AttrInterface ¶
type AttrInterface interface { DecodeFromBytes([]byte) error Serialize() ([]byte, error) TotalLength() int }
func NewAttrByType ¶
func NewAttrByType(typ byte) AttrInterface
type AttrLocalPref ¶
Local preference.
func (*AttrLocalPref) DecodeFromBytes ¶
func (attr *AttrLocalPref) DecodeFromBytes(data []byte) error
func (*AttrLocalPref) MarshalJSON ¶
func (attr *AttrLocalPref) MarshalJSON() ([]byte, error)
func (*AttrLocalPref) String ¶
func (attr *AttrLocalPref) String() string
type AttrNexthop ¶
Nexthop.
func (*AttrNexthop) DecodeFromBytes ¶
func (attr *AttrNexthop) DecodeFromBytes(data []byte) error
func (*AttrNexthop) MarshalJSON ¶
func (attr *AttrNexthop) MarshalJSON() ([]byte, error)
func (*AttrNexthop) String ¶
func (attr *AttrNexthop) String() string
type AttrOrigin ¶
type AttrOrigin struct {
AttrBase
}
Origin.
func (*AttrOrigin) MarshalJSON ¶
func (attr *AttrOrigin) MarshalJSON() ([]byte, error)
func (*AttrOrigin) String ¶
func (attr *AttrOrigin) String() string
type AttrOriginatorId ¶
Originator ID.
func (*AttrOriginatorId) DecodeFromBytes ¶
func (attr *AttrOriginatorId) DecodeFromBytes(data []byte) error
type AttrPrefixSid ¶
type AttrPrefixSid struct { AttrBase Tlvs []TlvInterface }
func (*AttrPrefixSid) DecodeFromBytes ¶
func (attr *AttrPrefixSid) DecodeFromBytes(data []byte) error
type BGPAttrFlag ¶
type BGPAttrFlag uint8
const ( BGP_ATTR_FLAG_EXTENDED_LENGTH BGPAttrFlag = 1 << 4 BGP_ATTR_FLAG_PARTIAL BGPAttrFlag = 1 << 5 BGP_ATTR_FLAG_TRANSITIVE BGPAttrFlag = 1 << 6 BGP_ATTR_FLAG_OPTIONAL BGPAttrFlag = 1 << 7 )
func (BGPAttrFlag) Info ¶
func (f BGPAttrFlag) Info() string
func (BGPAttrFlag) IsExtendedLength ¶
func (f BGPAttrFlag) IsExtendedLength() bool
func (BGPAttrFlag) IsOptional ¶
func (f BGPAttrFlag) IsOptional() bool
func (BGPAttrFlag) IsPartial ¶
func (f BGPAttrFlag) IsPartial() bool
func (BGPAttrFlag) IsTransitive ¶
func (f BGPAttrFlag) IsTransitive() bool
type BGPAttrType ¶
type BGPAttrType uint8
const ( BGP_ATTR_TYPE_ORIGIN BGPAttrType // 1 BGP_ATTR_TYPE_AS_PATH // 2 BGP_ATTR_TYPE_NEXT_HOP // 3 BGP_ATTR_TYPE_MED // 4 BGP_ATTR_TYPE_LOCAL_PREF // 5 BGP_ATTR_TYPE_ATOMIC_AGGREGATE // 6 BGP_ATTR_TYPE_AGGREGATOR // 7 BGP_ATTR_TYPE_COMMUNITIES // 8 BGP_ATTR_TYPE_ORIGINATOR_ID // 9 BGP_ATTR_TYPE_CLUSTER_LIST // 10 BGP_ATTR_TYPE_MP_REACH_NLRI // 14 BGP_ATTR_TYPE_MP_UNREACH_NLRI // 15 BGP_ATTR_TYPE_EXTENDED_COMMUNITIES // 16 BGP_ATTR_TYPE_AS4_PATH // 17 BGP_ATTR_TYPE_AS4_AGGREGATOR // 18 BGP_ATTR_TYPE_PREFIX_SID BGPAttrType = 40 )
type BgpCapability ¶
type BgpCapability struct { }
func (*BgpCapability) DecodeFromBytes ¶
func (msg *BgpCapability) DecodeFromBytes(data []byte) error
func (*BgpCapability) Serialize ¶
func (msg *BgpCapability) Serialize() ([]byte, error)
type BgpHeader ¶
func (*BgpHeader) DecodeFromBytes ¶
type BgpKeepAlive ¶
type BgpKeepAlive struct { }
func (*BgpKeepAlive) DecodeFromBytes ¶
func (msg *BgpKeepAlive) DecodeFromBytes(data []byte) error
func (*BgpKeepAlive) Serialize ¶
func (msg *BgpKeepAlive) Serialize() ([]byte, error)
type BgpMessage ¶
func NewBgpKeepAliveMsg ¶
func NewBgpKeepAliveMsg() *BgpMessage
func NewBgpNotificationMsg ¶
func NewBgpNotificationMsg(notify *BgpNotification) *BgpMessage
func NewBgpOpenMsg ¶
func NewBgpOpenMsg(n *Neighbor) *BgpMessage
func ParseBgpBody ¶
func ParseBgpBody(header *BgpHeader, buf []byte) (*BgpMessage, error)
func (*BgpMessage) Serialize ¶
func (msg *BgpMessage) Serialize() ([]byte, error)
func (*BgpMessage) Type ¶
func (msg *BgpMessage) Type() int
type BgpNotification ¶
func (*BgpNotification) DecodeFromBytes ¶
func (msg *BgpNotification) DecodeFromBytes(data []byte) error
func (*BgpNotification) Error ¶
func (e *BgpNotification) Error() string
func (*BgpNotification) Serialize ¶
func (msg *BgpNotification) Serialize() ([]byte, error)
type BgpOpen ¶
type BgpOpen struct { Version uint8 As uint32 HoldTime uint16 RouterId net.IP OptParamLen uint8 OptParams []OptParamInterface }
func (*BgpOpen) DecodeFromBytes ¶
type BgpRouteRefresh ¶
func (*BgpRouteRefresh) DecodeFromBytes ¶
func (msg *BgpRouteRefresh) DecodeFromBytes(data []byte) error
func (*BgpRouteRefresh) Serialize ¶
func (msg *BgpRouteRefresh) Serialize() ([]byte, error)
type BgpUpdate ¶
type BgpUpdate struct { WithdrawLen uint16 Withdraws []*PrefixNLRI TotalAttrLen uint16 Attrs []AttrInterface `json:"attrs"` NLRI []*PrefixNLRI }
func (*BgpUpdate) DecodeFromBytes ¶
type Cap4OctetAsNumber ¶
type Cap4OctetAsNumber struct { CapabilityBase As uint32 }
func (*Cap4OctetAsNumber) DecodeFromBytes ¶
func (c *Cap4OctetAsNumber) DecodeFromBytes(data []byte) error
func (*Cap4OctetAsNumber) Serialize ¶
func (c *Cap4OctetAsNumber) Serialize() ([]byte, error)
type CapAddPath ¶
type CapAddPath struct { CapabilityBase AfiSafi AfiSafi SendRecieve uint8 }
func (*CapAddPath) DecodeFromBytes ¶
func (c *CapAddPath) DecodeFromBytes(data []byte) error
type CapCarryingLabelInfo ¶
type CapCarryingLabelInfo struct {
CapabilityBase
}
type CapEnhancedRouteRefresh ¶
type CapEnhancedRouteRefresh struct {
CapabilityBase
}
type CapGracefulRestart ¶
type CapGracefulRestart struct { CapabilityBase Flags uint8 // 4bit Time uint16 // 12bit Tuples []*CapGracefulRestartTuple }
func (*CapGracefulRestart) DecodeFromBytes ¶
func (c *CapGracefulRestart) DecodeFromBytes(data []byte) error
func (*CapGracefulRestart) Serialize ¶
func (c *CapGracefulRestart) Serialize() ([]byte, error)
type CapGracefulRestartTuple ¶
type CapLongLivedGracefulRestart ¶
type CapLongLivedGracefulRestart struct { CapabilityBase Tuples []*CapLongLivedGracefulRestartTuple }
func (*CapLongLivedGracefulRestart) DecodeFromBytes ¶
func (c *CapLongLivedGracefulRestart) DecodeFromBytes(data []byte) error
type CapMultiProtocol ¶
type CapMultiProtocol struct { CapabilityBase AfiSafi AfiSafi }
func (*CapMultiProtocol) DecodeFromBytes ¶
func (c *CapMultiProtocol) DecodeFromBytes(data []byte) error
func (*CapMultiProtocol) Serialize ¶
func (c *CapMultiProtocol) Serialize() ([]byte, error)
type CapRouteRefresh ¶
type CapRouteRefresh struct {
CapabilityBase
}
func (*CapRouteRefresh) Serialize ¶
func (c *CapRouteRefresh) Serialize() ([]byte, error)
type CapRouteRefreshCisco ¶
type CapRouteRefreshCisco struct {
CapabilityBase
}
type CapUnknown ¶
type CapUnknown struct {
CapabilityBase
}
type Capability ¶
type Capability struct { OptType uint8 OptLen uint8 Capability []CapabilityInterface }
func (*Capability) DecodeFromBytes ¶
func (c *Capability) DecodeFromBytes(data []byte) error
func (*Capability) Serialize ¶
func (c *Capability) Serialize() ([]byte, error)
type CapabilityBase ¶
func (*CapabilityBase) DecodeFromBytes ¶
func (c *CapabilityBase) DecodeFromBytes(data []byte) error
func (*CapabilityBase) Length ¶
func (c *CapabilityBase) Length() int
func (*CapabilityBase) Serialize ¶
func (c *CapabilityBase) Serialize() ([]byte, error)
type CapabilityInterface ¶
type CapabilityInterface interface { DecodeFromBytes([]byte) error Serialize() ([]byte, error) Length() int }
func DecodeCapability ¶
func DecodeCapability(data []byte) (CapabilityInterface, error)
type Community ¶
type Community []uint32
func CommunityParse ¶
func (Community) MarshalJSON ¶
func (Community) SortUnique ¶
type CommunityList ¶
type CommunityList struct { Type CommunityListType Name string Entry []*CommunityListEntry }
func (*CommunityList) String ¶
func (list *CommunityList) String() string
type CommunityListEntry ¶
type CommunityListEntry struct { Type CommunityListType Policy policy.Action Community Community Regstr string }
func NewCommunityListEntry ¶
func NewCommunityListEntry(typ CommunityListType, policy policy.Action, str string) (*CommunityListEntry, error)
func (*CommunityListEntry) Equal ¶
func (lhs *CommunityListEntry) Equal(rhs *CommunityListEntry) bool
type CommunityListMap ¶
type CommunityListMap map[string]*CommunityList
func NewCommunityListMap ¶
func NewCommunityListMap() CommunityListMap
func (CommunityListMap) CommunityListAdd ¶
func (clist CommunityListMap) CommunityListAdd(name string, typ CommunityListType, policy policy.Action, str string) error
func (CommunityListMap) CommunityListDelete ¶
func (clist CommunityListMap) CommunityListDelete(name string, typ CommunityListType, policy policy.Action, str string) error
func (CommunityListMap) CommunityListGet ¶
func (clist CommunityListMap) CommunityListGet(name string) *CommunityList
type CommunityListType ¶
type CommunityListType int
const ( CommunityListStandard CommunityListType = iota CommunityListExpanded )
func (CommunityListType) String ¶
func (typ CommunityListType) String() string
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
func NewIoErrorEvent ¶
func NewMsgEvent ¶
func NewMsgEvent(e int, msg *BgpMessage) *Event
type EvpnEthernetAutoDiscoveryRoute ¶
type EvpnEthernetAutoDiscoveryRoute struct { Rd RouteDistinguisherInterface Esi EthernetSegmentIdentifier Etag uint32 Label uint32 }
func (*EvpnEthernetAutoDiscoveryRoute) DecodeFromBytes ¶
func (e *EvpnEthernetAutoDiscoveryRoute) DecodeFromBytes([]byte) error
type EvpnNlri ¶
type EvpnNlri struct { RouteType uint8 Length uint8 RouteTypeData EvpnRouteTypeInterface }
func (*EvpnNlri) DecodeFromBytes ¶
type EvpnRouteTypeInterface ¶
type Fsm ¶
type Fsm struct {
// contains filtered or unexported fields
}
func (*Fsm) BgpOpenProcess ¶
func (f *Fsm) BgpOpenProcess(msg *BgpMessage)
func (*Fsm) ChangeStateTo ¶
func (*Fsm) ConnectRetryTimerStart ¶
func (f *Fsm) ConnectRetryTimerStart()
func (*Fsm) DelayOpenTimer ¶
func (*Fsm) EventActive ¶
func (*Fsm) EventConnect ¶
func (*Fsm) EventEstablished ¶
func (*Fsm) EventOpenConfirm ¶
func (*Fsm) EventOpenSent ¶
func (*Fsm) IdleTimerStart ¶
func (f *Fsm) IdleTimerStart()
func (*Fsm) KeepaliveTimerStart ¶
func (f *Fsm) KeepaliveTimerStart()
func (*Fsm) SendKeepAlive ¶
func (f *Fsm) SendKeepAlive()
func (*Fsm) SendNotification ¶
func (f *Fsm) SendNotification(notify *BgpNotification)
func (*Fsm) SendPacket ¶
func (f *Fsm) SendPacket(msg *BgpMessage)
func (*Fsm) TcpConnect ¶
func (f *Fsm) TcpConnect() func()
func (*Fsm) TcpEstablish ¶
func (f *Fsm) TcpEstablish()
type GrpcComponent ¶
type GrpcComponent struct { Server *Server // contains filtered or unexported fields }
func (*GrpcComponent) DoExec ¶
func (s *GrpcComponent) DoExec(_ context.Context, req *openconfig.ExecRequest) (*openconfig.ExecReply, error)
func (*GrpcComponent) Show ¶
func (s *GrpcComponent) Show(req *openconfig.ShowRequest, stream openconfig.Show_ShowServer) error
func (*GrpcComponent) Start ¶
func (s *GrpcComponent) Start() component.Component
func (*GrpcComponent) StartClient ¶
func (s *GrpcComponent) StartClient()
func (*GrpcComponent) StartServer ¶
func (s *GrpcComponent) StartServer()
func (*GrpcComponent) Stop ¶
func (s *GrpcComponent) Stop() component.Component
type Ipv6Tlv ¶
func (Ipv6Tlv) DecodeFromBytes ¶
type LabelIndexTlv ¶
func (LabelIndexTlv) DecodeFromBytes ¶
func (tlv LabelIndexTlv) DecodeFromBytes(data []byte) error
type MessageCount ¶
type MessageCount struct {
// contains filtered or unexported fields
}
func (MessageCount) Sum ¶
func (m MessageCount) Sum() uint64
type Neighbor ¶
type Neighbor struct { Config NeighborConfig // contains filtered or unexported fields }
func (*Neighbor) RemoteAsSet ¶
type NeighborConfig ¶
type NeighborConfig struct {
// contains filtered or unexported fields
}
type OptParamCapability ¶
type OptParamCapability struct { OptParamType uint8 OptParamLen uint8 OptCaps []CapabilityInterface }
func (*OptParamCapability) Serialize ¶
func (o *OptParamCapability) Serialize() ([]byte, error)
type OptParamInterface ¶
type OptParamUnknown ¶
func (*OptParamUnknown) Serialize ¶
func (o *OptParamUnknown) Serialize() ([]byte, error)
type OriginatorSrbgTlv ¶
func (OriginatorSrbgTlv) DecodeFromBytes ¶
func (tlv OriginatorSrbgTlv) DecodeFromBytes(data []byte) error
type PeerGroup ¶
type PeerGroup struct {
Config PeerGroupConfig
}
type PeerGroupConfig ¶
type PrefixList ¶
type PrefixList struct { Description string `json:"description,omitempty"` Entries []*PrefixListEntry `json:"prefix-list"` }
func NewPrefixList ¶
func NewPrefixList() *PrefixList
func (*PrefixList) Add ¶
func (plist *PrefixList) Add(entry *PrefixListEntry)
func (*PrefixList) Delete ¶
func (plist *PrefixList) Delete(entry *PrefixListEntry)
func (*PrefixList) NewSeq ¶
func (plist *PrefixList) NewSeq() int
type PrefixListEntry ¶
type PrefixListMaster ¶
type PrefixListMaster struct {
PrefixLists map[string]*PrefixList `json:"prefix-list"`
}
func NewPrefixListMaster ¶
func NewPrefixListMaster() *PrefixListMaster
func (*PrefixListMaster) DescriptionSet ¶
func (m *PrefixListMaster) DescriptionSet(name string, desc string)
func (*PrefixListMaster) DescriptionUnset ¶
func (m *PrefixListMaster) DescriptionUnset(name string, desc string)
func (*PrefixListMaster) EntryAdd ¶
func (m *PrefixListMaster) EntryAdd(name string, p *netutil.Prefix, seq, eq, le, ge int)
func (*PrefixListMaster) EntryDelete ¶
func (m *PrefixListMaster) EntryDelete(name string, p *netutil.Prefix, seq, eq, le, ge int)
func (*PrefixListMaster) PrefixListDelete ¶
func (m *PrefixListMaster) PrefixListDelete(name string)
func (*PrefixListMaster) PrefixListGet ¶
func (m *PrefixListMaster) PrefixListGet(name string) *PrefixList
func (*PrefixListMaster) PrefixListLookup ¶
func (m *PrefixListMaster) PrefixListLookup(name string) *PrefixList
type PrefixNLRI ¶
func (*PrefixNLRI) DecodeFromBytes ¶
func (p *PrefixNLRI) DecodeFromBytes(data []byte) error
func (*PrefixNLRI) TotalLength ¶
func (p *PrefixNLRI) TotalLength() int
type Server ¶
type Server struct { Config ServerConfig Neighbors map[string]*Neighbor // contains filtered or unexported fields }
var (
DefaultServer *Server
)
func ServerStart ¶
func (*Server) GracefulRestartDisable ¶
func (*Server) GracefulRestartEnable ¶
func (*Server) GracefulRestartTime ¶
func (*Server) NeighborAdd ¶
func (*Server) NeighborAfiSafiSet ¶
func (*Server) NeighborReflectorClientDisable ¶
func (*Server) NeighborReflectorClientEnable ¶
func (*Server) NeighborRemoteAsSet ¶
func (*Server) RouterIdSet ¶
func (*Server) RouterIdUnset ¶
type ServerComponent ¶
type ServerComponent struct {
Server *Server
}
func (*ServerComponent) Start ¶
func (s *ServerComponent) Start() component.Component
func (*ServerComponent) Stop ¶
func (s *ServerComponent) Stop() component.Component
type ServerConfig ¶
type ShowTask ¶
func NewShowTask ¶
func NewShowTask() *ShowTask
type Srv6VpnSidTlv ¶
func (Srv6VpnSidTlv) DecodeFromBytes ¶
func (tlv Srv6VpnSidTlv) DecodeFromBytes(data []byte) error
type TlvBase ¶
func (TlvBase) DecodeFromBytes ¶
type TlvInterface ¶
type TlvInterface interface { DecodeFromBytes([]byte) error // Serialize() ([]byte, error) Length() int }
func DecodeTlv ¶
func DecodeTlv(data []byte) (TlvInterface, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.