bgp

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: 21 Imported by: 0

Documentation

Index

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 AsPathTokenGet

func AsPathTokenGet(str string) (string, int, uint32)

func AsSegmentDelimiter

func AsSegmentDelimiter(typ uint8) (string, string)

func BgpAsApi

func BgpAsApi(As uint32)

func BgpEventString

func BgpEventString(s int) string

func BgpPeerApi

func BgpPeerApi(As uint32)

func BgpStateString

func BgpStateString(s int) string

func CapabilityCodeString

func CapabilityCodeString(code uint8) string

func CommunityValParse

func CommunityValParse(s string) (uint32, error)

func GrpcDial

func GrpcDial() (*grpc.ClientConn, error)

func GrpcRegisterCli

func GrpcRegisterCli(conn *grpc.ClientConn, moduleName string, parser *cmd.Node) error

func GrpcRegisterModule

func GrpcRegisterModule(conn *grpc.ClientConn, moduleName string, modulePort string) error

func NewAsPath

func NewAsPath()

func NewBgpError

func NewBgpError(code, subCode uint8, data []byte, message string) error

func ParseIP

func ParseIP(str string) net.IP

func ReadFull

func ReadFull(conn net.Conn, length int) ([]byte, error)

func ServerStop

func ServerStop()

func TimerStop

func TimerStop(t *time.Timer)

Types

type Afi

type Afi uint16

type AfiSafi

type AfiSafi uint32

func AfiSafiValue

func AfiSafiValue(afi Afi, safi Safi) AfiSafi

func (AfiSafi) Afi

func (v AfiSafi) Afi() Afi

func (AfiSafi) Safi

func (v AfiSafi) Safi() Safi

func (AfiSafi) String

func (afisafi AfiSafi) String() string

type As2Segment

type As2Segment struct {
	Type   uint8
	Length uint8
	As     []uint16
}

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

type As4Segment struct {
	Type   uint8
	Length uint8
	As     []uint32
}

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 AsPath

type AsPath []AsSegmentInterface

func AsPathParse

func AsPathParse(str string) (AsPath, error)

func (AsPath) Append

func (aspath AsPath) Append(asnum uint32) AsPath

func (AsPath) PathLength

func (aspath AsPath) PathLength() int

func (AsPath) Prepend

func (aspath AsPath) Prepend(path AsPath) AsPath

AsPath Prepend.

func (AsPath) String

func (aspath AsPath) String() string

type AsPathList

type AsPathList struct {
}

type AsSegmentInterface

type AsSegmentInterface interface {
	String() string
	Serialize() ([]byte, error)
	DecodeFromBytes([]byte) error
	EncodeLength() int
	PathLength() int
	Append(uint32)
	GetLength() int
	GetType() uint8
}

type AttrAggregator

type AttrAggregator struct {
	AttrBase
	As      uint32
	Address net.IP
}

Aggregator.

func (*AttrAggregator) DecodeFromBytes

func (attr *AttrAggregator) DecodeFromBytes(data []byte) error

type AttrAsPath

type AttrAsPath struct {
	AttrBase
	AsPath AsPath
}

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 (attr *AttrBase) DecodeFromBytes(data []byte) error

func (*AttrBase) Serialize

func (attr *AttrBase) Serialize() ([]byte, error)

func (*AttrBase) TotalLength

func (attr *AttrBase) TotalLength() int

type AttrClusterList

type AttrClusterList struct {
	AttrBase
	ClusterList []net.IP
}

Cluster list.

func (*AttrClusterList) DecodeFromBytes

func (attr *AttrClusterList) DecodeFromBytes(data []byte) error

type AttrCommunity

type AttrCommunity struct {
	AttrBase
	Community Community
}

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

type AttrLocalPref struct {
	AttrBase
	LocalPref uint32
}

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 AttrMed

type AttrMed struct {
	AttrBase
	Med uint32
}

MED.

func (*AttrMed) DecodeFromBytes

func (attr *AttrMed) DecodeFromBytes(data []byte) error

func (*AttrMed) MarshalJSON

func (attr *AttrMed) MarshalJSON() ([]byte, error)

func (*AttrMed) String

func (attr *AttrMed) String() string

type AttrNexthop

type AttrNexthop struct {
	AttrBase
	Nexthop net.IP
}

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

type AttrOriginatorId struct {
	AttrBase
	RouterId net.IP
}

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 AttrUnknown

type AttrUnknown struct {
	AttrBase
}

Unknown.

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 BgpBody

type BgpBody interface {
	DecodeFromBytes([]byte) error
	Serialize() ([]byte, error)
}

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

type BgpHeader struct {
	Marker []byte
	Len    uint16
	Type   uint8
}

func (*BgpHeader) DecodeFromBytes

func (msg *BgpHeader) DecodeFromBytes(data []byte) error

func (*BgpHeader) Serialize

func (msg *BgpHeader) Serialize() ([]byte, error)

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

type BgpMessage struct {
	Header BgpHeader
	Body   BgpBody
}

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

type BgpNotification struct {
	Code    uint8
	SubCode uint8
	Data    []byte
	Message string
}

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

func (msg *BgpOpen) DecodeFromBytes(data []byte) error

func (*BgpOpen) Serialize

func (msg *BgpOpen) Serialize() ([]byte, error)

type BgpRouteRefresh

type BgpRouteRefresh struct {
	Afi         uint16
	Demarcation uint8
	Safi        uint8
}

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

func (msg *BgpUpdate) DecodeFromBytes(data []byte) error

func (*BgpUpdate) Serialize

func (msg *BgpUpdate) Serialize() ([]byte, error)

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 CapGracefulRestartTuple struct {
	Afi   Afi
	Safi  Safi
	Flags uint8
}

type CapLongLivedGracefulRestart

type CapLongLivedGracefulRestart struct {
	CapabilityBase
	Tuples []*CapLongLivedGracefulRestartTuple
}

func (*CapLongLivedGracefulRestart) DecodeFromBytes

func (c *CapLongLivedGracefulRestart) DecodeFromBytes(data []byte) error

type CapLongLivedGracefulRestartTuple

type CapLongLivedGracefulRestartTuple struct {
	Afi         Afi
	Safi        Safi
	Flags       uint8
	RestartTime uint32
}

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

type CapabilityBase struct {
	CapCode  uint8
	CapLen   uint8
	CapValue []byte
}

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 CommunityParse(s string) (Community, error)

func (Community) Equal

func (lhs Community) Equal(rhs Community) bool

func (Community) MarshalJSON

func (c Community) MarshalJSON() ([]byte, error)

func (Community) SortUnique

func (c Community) SortUnique() Community

func (Community) String

func (c Community) String() string

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 EsiType

type EsiType uint8
const (
	ESI_ARBITRARY EsiType = iota
	ESI_LACP
	ESI_MSTP
	ESI_MAC
	ESI_ROUTERID
	ESI_AS
)

type EthernetSegmentIdentifier

type EthernetSegmentIdentifier struct {
	Type  EsiType
	Value []byte
}

type Event

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

func NewEvent

func NewEvent(e int) *Event

func NewIoErrorEvent

func NewIoErrorEvent(e int, err error) *Event

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

func (n *EvpnNlri) DecodeFromBytes(data []byte) error

func (*EvpnNlri) Serialize

func (n *EvpnNlri) Serialize() ([]byte, error)

type EvpnRouteTypeInterface

type EvpnRouteTypeInterface interface {
	DecodeFromBytes([]byte) error
}

type Fn

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

type Fsm

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

func NewFsm

func NewFsm(n *Neighbor) *Fsm

func (*Fsm) BgpOpenProcess

func (f *Fsm) BgpOpenProcess(msg *BgpMessage)

func (*Fsm) ChangeStateTo

func (f *Fsm) ChangeStateTo(s int)

func (*Fsm) ConnectRetryTimerStart

func (f *Fsm) ConnectRetryTimerStart()

func (*Fsm) DelayOpenTimer

func (f *Fsm) DelayOpenTimer() bool

func (*Fsm) Event

func (f *Fsm) Event(e *Event)

func (*Fsm) EventActive

func (f *Fsm) EventActive(e *Event)

func (*Fsm) EventConnect

func (f *Fsm) EventConnect(e *Event)

func (*Fsm) EventEstablished

func (f *Fsm) EventEstablished(e *Event)

func (*Fsm) EventIdle

func (f *Fsm) EventIdle(e *Event)

func (*Fsm) EventLoop

func (f *Fsm) EventLoop(done chan interface{})

func (*Fsm) EventOpenConfirm

func (f *Fsm) EventOpenConfirm(e *Event)

func (*Fsm) EventOpenSent

func (f *Fsm) EventOpenSent(e *Event)

func (*Fsm) IdleTimerStart

func (f *Fsm) IdleTimerStart()

func (*Fsm) KeepaliveTimerStart

func (f *Fsm) KeepaliveTimerStart()

func (*Fsm) NotifyAndSendEvent

func (f *Fsm) NotifyAndSendEvent(e int, err error) *Event

func (*Fsm) SendEvent

func (f *Fsm) SendEvent(e int)

func (*Fsm) SendKeepAlive

func (f *Fsm) SendKeepAlive()

func (*Fsm) SendNotification

func (f *Fsm) SendNotification(notify *BgpNotification)

func (*Fsm) SendOpen

func (f *Fsm) SendOpen()

func (*Fsm) SendPacket

func (f *Fsm) SendPacket(msg *BgpMessage)

func (*Fsm) Stop

func (f *Fsm) Stop()

func (*Fsm) TcpConnect

func (f *Fsm) TcpConnect() func()

func (*Fsm) TcpDrop

func (f *Fsm) TcpDrop()

func (*Fsm) TcpEstablish

func (f *Fsm) TcpEstablish()

func (*Fsm) TcpRead

func (f *Fsm) TcpRead(conn net.Conn)

func (*Fsm) TcpWrite

func (f *Fsm) TcpWrite(conn net.Conn)

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

type Ipv6Tlv struct {
	TlvBase
	Flags uint16
}

func (Ipv6Tlv) DecodeFromBytes

func (tlv Ipv6Tlv) DecodeFromBytes(data []byte) error

type LabelIndexTlv

type LabelIndexTlv struct {
	TlvBase
	Flags      uint16
	LabelIndex uint32
}

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 NewNeighbor

func NewNeighbor(server *Server, addr net.IP) *Neighbor

func (*Neighbor) Address

func (n *Neighbor) Address() net.IP

func (*Neighbor) AfiSafiSet

func (n *Neighbor) AfiSafiSet(afi Afi, safi Safi) error

func (*Neighbor) HoldTime

func (n *Neighbor) HoldTime() uint16

func (*Neighbor) LocalAs

func (n *Neighbor) LocalAs() uint32

func (*Neighbor) RemoteAs

func (n *Neighbor) RemoteAs() uint32

func (*Neighbor) RemoteAsSet

func (n *Neighbor) RemoteAsSet(as uint32) error

func (*Neighbor) Reset

func (n *Neighbor) Reset(resetType ResetType) error

func (*Neighbor) Start

func (n *Neighbor) Start()

func (*Neighbor) Stop

func (n *Neighbor) Stop()

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 OptParamInterface interface {
	Serialize() ([]byte, error)
}

type OptParamUnknown

type OptParamUnknown struct {
	OptType  uint8
	OptLen   uint8
	OptValue []byte
}

func (*OptParamUnknown) Serialize

func (o *OptParamUnknown) Serialize() ([]byte, error)

type OriginatorSrbgTlv

type OriginatorSrbgTlv struct {
	TlvBase
	Flags uint16
	Srgb  []Srgb
}

func (OriginatorSrbgTlv) DecodeFromBytes

func (tlv OriginatorSrbgTlv) DecodeFromBytes(data []byte) error

type PeerGroup

type PeerGroup struct {
	Config PeerGroupConfig
}

func (*PeerGroup) As

func (pg *PeerGroup) As() uint32

type PeerGroupConfig

type PeerGroupConfig struct {
	Name string
	As   uint32
}

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 PrefixListEntry struct {
	Seq    int             `json:"seq"`
	Eq     int             `json:"eq,omitempty"`
	Le     int             `json:"le,omitempty"`
	Ge     int             `json:"ge,omitempty"`
	Prefix *netutil.Prefix `json:"prefix"`
}

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

type PrefixNLRI struct {
	netutil.Prefix
}

func (*PrefixNLRI) DecodeFromBytes

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

func (*PrefixNLRI) TotalLength

func (p *PrefixNLRI) TotalLength() int

type ResetType

type ResetType int

type RouteDistinguisherInterface

type RouteDistinguisherInterface interface {
	DecodeFromBytes([]byte) error
	Serialize() ([]byte, error)
	Len() int
	String() string
	MarshalJSON() ([]byte, error)
}

type Safi

type Safi uint8

type Server

type Server struct {
	Config    ServerConfig
	Neighbors map[string]*Neighbor
	// contains filtered or unexported fields
}
var (
	DefaultServer *Server
)

func NewServer

func NewServer(as uint32) *Server

func ServerStart

func ServerStart(As uint32) *Server

func (*Server) GracefulRestartDisable

func (s *Server) GracefulRestartDisable() error

func (*Server) GracefulRestartEnable

func (s *Server) GracefulRestartEnable() error

func (*Server) GracefulRestartTime

func (s *Server) GracefulRestartTime() int

func (*Server) NeighborAdd

func (s *Server) NeighborAdd(addrStr string) error

func (*Server) NeighborAfiSafiSet

func (s *Server) NeighborAfiSafiSet(addrStr string, afi Afi, safi Safi) error

func (*Server) NeighborReflectorClientDisable

func (s *Server) NeighborReflectorClientDisable(addrStr string) error

func (*Server) NeighborReflectorClientEnable

func (s *Server) NeighborReflectorClientEnable(addrStr string) error

func (*Server) NeighborRemoteAsSet

func (s *Server) NeighborRemoteAsSet(addrStr string, as uint32) error

func (*Server) Port

func (s *Server) Port() uint16

func (*Server) PortSet

func (s *Server) PortSet(port uint16)

func (*Server) PortUnset

func (s *Server) PortUnset()

func (*Server) Reset

func (s *Server) Reset(addrStr string, resetType ResetType) error

func (*Server) ResetAll

func (s *Server) ResetAll() error

func (*Server) RouterId

func (s *Server) RouterId() net.IP

func (*Server) RouterIdSet

func (s *Server) RouterIdSet(routerIdStr string) error

func (*Server) RouterIdUnset

func (s *Server) RouterIdUnset() error

func (*Server) Runnable

func (s *Server) Runnable() bool

func (*Server) Serv

func (s *Server) Serv()

type ServerComponent

type ServerComponent struct {
	Server *Server
}

func (*ServerComponent) Start

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

func (*ServerComponent) Stop

type ServerConfig

type ServerConfig struct {
	As              uint32
	RouterId        string
	GracefulRestart bool
	GrRestartTime   *int
	GrStalePathTime *int
}

type ShowTask

type ShowTask struct {
	Json     bool
	First    bool
	Continue bool
	Str      string
	Index    interface{}
}

func NewShowTask

func NewShowTask() *ShowTask

type Srgb

type Srgb []byte

type Srv6Sid

type Srv6Sid struct {
	Type uint8  // 1 octet
	Sid  []byte // 16 octet
}

type Srv6VpnSidTlv

type Srv6VpnSidTlv struct {
	TlvBase
	Sids []*Srv6Sid
}

func (Srv6VpnSidTlv) DecodeFromBytes

func (tlv Srv6VpnSidTlv) DecodeFromBytes(data []byte) error

type TlvBase

type TlvBase struct {
	TlvType   uint8
	TlvLength uint16
	Value     []byte
}

func (TlvBase) DecodeFromBytes

func (tlv TlvBase) DecodeFromBytes(data []byte) error

func (TlvBase) Length

func (tlv TlvBase) Length() int

type TlvInterface

type TlvInterface interface {
	DecodeFromBytes([]byte) error
	// Serialize() ([]byte, error)
	Length() int
}

func DecodeTlv

func DecodeTlv(data []byte) (TlvInterface, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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