Documentation ¶
Index ¶
- Constants
- Variables
- func CompareFlowSpecNLRI(n, m *FlowSpecNLRI) (int, error)
- func FlatUpdate(f1, f2 map[string]string) error
- func NewMessageError(typeCode, subTypeCode uint8, data []byte, msg string) error
- func RouteFamilyToAfiSafi(rf RouteFamily) (uint16, uint8)
- func ValidateAttribute(a PathAttributeInterface, rfs map[RouteFamily]bool, doConfedCheck bool) (bool, error)
- func ValidateBGPMessage(m *BGPMessage) error
- func ValidateFlags(t BGPAttrType, flags BGPAttrFlag) (bool, string)
- func ValidateOpenMsg(m *BGPOpen, expectedAS uint32) error
- func ValidateUpdateMsg(m *BGPUpdate, rfs map[RouteFamily]bool, doConfedCheck bool) (bool, error)
- type AddrPrefixInterface
- type AigpTLV
- type AigpTLVDefault
- type AigpTLVIgpMetric
- type AigpTLVType
- type As4PathParam
- type AsPathParam
- type AsPathParamFormat
- type AsPathParamInterface
- type BGPAddPathMode
- type BGPAttrFlag
- type BGPAttrType
- type BGPBody
- type BGPCapabilityCode
- type BGPFlowSpecType
- type BGPHeader
- type BGPKeepAlive
- type BGPMessage
- func NewBGPKeepAliveMessage() *BGPMessage
- func NewBGPNotificationMessage(errcode uint8, errsubcode uint8, data []byte) *BGPMessage
- func NewBGPOpenMessage(myas uint16, holdtime uint16, id string, optparams []OptionParameterInterface) *BGPMessage
- func NewBGPRouteRefreshMessage(afi uint16, demarcation uint8, safi uint8) *BGPMessage
- func NewBGPUpdateMessage(withdrawnRoutes []*IPAddrPrefix, pathattrs []PathAttributeInterface, ...) *BGPMessage
- func NewEndOfRib(family RouteFamily) *BGPMessage
- func NewTestBGPOpenMessage() *BGPMessage
- func NewTestBGPUpdateMessage() *BGPMessage
- func ParseBGPBody(h *BGPHeader, data []byte) (*BGPMessage, error)
- func ParseBGPMessage(data []byte) (*BGPMessage, error)
- type BGPNotification
- type BGPOpen
- type BGPRouteRefresh
- type BGPUpdate
- type CapAddPath
- type CapCarryingLabelInfo
- type CapEnhancedRouteRefresh
- type CapFourOctetASNumber
- type CapGracefulRestart
- type CapGracefulRestartTuple
- type CapMultiProtocol
- type CapRouteRefresh
- type CapRouteRefreshCisco
- type CapUnknown
- type ColorExtended
- type DefaultAsPath
- type DefaultOpaqueExtendedValue
- type DefaultParameterCapability
- type DefaultPmsiTunnelID
- type DefaultRouteDistinguisher
- func (rd *DefaultRouteDistinguisher) DecodeFromBytes(data []byte) error
- func (rd *DefaultRouteDistinguisher) Len() int
- func (rd *DefaultRouteDistinguisher) MarshalJSON() ([]byte, error)
- func (rd *DefaultRouteDistinguisher) Serialize() ([]byte, error)
- func (rd *DefaultRouteDistinguisher) String() string
- type ESILabelExtended
- func (e *ESILabelExtended) Flat() map[string]string
- func (e *ESILabelExtended) GetTypes() (ExtendedCommunityAttrType, ExtendedCommunityAttrSubType)
- func (e *ESILabelExtended) MarshalJSON() ([]byte, error)
- func (e *ESILabelExtended) Serialize() ([]byte, error)
- func (e *ESILabelExtended) String() string
- type ESIType
- type ESImportRouteTarget
- func (e *ESImportRouteTarget) Flat() map[string]string
- func (e *ESImportRouteTarget) GetTypes() (ExtendedCommunityAttrType, ExtendedCommunityAttrSubType)
- func (e *ESImportRouteTarget) MarshalJSON() ([]byte, error)
- func (e *ESImportRouteTarget) Serialize() ([]byte, error)
- func (e *ESImportRouteTarget) String() string
- type EVPNEthernetAutoDiscoveryRoute
- type EVPNEthernetSegmentRoute
- type EVPNMacIPAdvertisementRoute
- type EVPNMulticastEthernetTagRoute
- type EVPNNLRI
- func (n *EVPNNLRI) AFI() uint16
- func (n *EVPNNLRI) DecodeFromBytes(data []byte) error
- func (l *EVPNNLRI) Flat() map[string]string
- func (n *EVPNNLRI) Len() int
- func (n *EVPNNLRI) MarshalJSON() ([]byte, error)
- func (n *EVPNNLRI) RD() RouteDistinguisherInterface
- func (n *EVPNNLRI) SAFI() uint8
- func (n *EVPNNLRI) Serialize() ([]byte, error)
- func (n *EVPNNLRI) String() string
- type EVPNRouteTypeInterface
- type EncapExtended
- type EncapNLRI
- type EncapSubTLVType
- type Encapv6NLRI
- type EthernetSegmentIdentifier
- type EthernetType
- type ExtendedCommunityAttrSubType
- type ExtendedCommunityAttrType
- type ExtendedCommunityInterface
- type FSMState
- type FlowSpecComponent
- func (p *FlowSpecComponent) DecodeFromBytes(data []byte) error
- func (p *FlowSpecComponent) Len() int
- func (p *FlowSpecComponent) MarshalJSON() ([]byte, error)
- func (p *FlowSpecComponent) Serialize() ([]byte, error)
- func (p *FlowSpecComponent) String() string
- func (p *FlowSpecComponent) Type() BGPFlowSpecType
- type FlowSpecComponentInterface
- type FlowSpecComponentItem
- type FlowSpecDestinationMac
- func (p *FlowSpecDestinationMac) DecodeFromBytes(data []byte) error
- func (p *FlowSpecDestinationMac) Len() int
- func (p *FlowSpecDestinationMac) MarshalJSON() ([]byte, error)
- func (p *FlowSpecDestinationMac) Serialize() ([]byte, error)
- func (p *FlowSpecDestinationMac) String() string
- func (p *FlowSpecDestinationMac) Type() BGPFlowSpecType
- type FlowSpecDestinationPrefix
- func (p *FlowSpecDestinationPrefix) DecodeFromBytes(data []byte) error
- func (p *FlowSpecDestinationPrefix) Len() int
- func (p *FlowSpecDestinationPrefix) MarshalJSON() ([]byte, error)
- func (p *FlowSpecDestinationPrefix) Serialize() ([]byte, error)
- func (p *FlowSpecDestinationPrefix) String() string
- func (p *FlowSpecDestinationPrefix) Type() BGPFlowSpecType
- type FlowSpecDestinationPrefix6
- func (p *FlowSpecDestinationPrefix6) DecodeFromBytes(data []byte) error
- func (p *FlowSpecDestinationPrefix6) Len() int
- func (p *FlowSpecDestinationPrefix6) MarshalJSON() ([]byte, error)
- func (p *FlowSpecDestinationPrefix6) Serialize() ([]byte, error)
- func (p *FlowSpecDestinationPrefix6) String() string
- func (p *FlowSpecDestinationPrefix6) Type() BGPFlowSpecType
- type FlowSpecIPv4Unicast
- type FlowSpecIPv4VPN
- type FlowSpecIPv6Unicast
- type FlowSpecIPv6VPN
- type FlowSpecL2VPN
- type FlowSpecNLRI
- func (n *FlowSpecNLRI) AFI() uint16
- func (n *FlowSpecNLRI) Len() int
- func (n *FlowSpecNLRI) MarshalJSON() ([]byte, error)
- func (n *FlowSpecNLRI) RD() RouteDistinguisherInterface
- func (n *FlowSpecNLRI) SAFI() uint8
- func (n *FlowSpecNLRI) Serialize() ([]byte, error)
- func (n *FlowSpecNLRI) String() string
- type FlowSpecSourceMac
- func (p *FlowSpecSourceMac) DecodeFromBytes(data []byte) error
- func (p *FlowSpecSourceMac) Len() int
- func (p *FlowSpecSourceMac) MarshalJSON() ([]byte, error)
- func (p *FlowSpecSourceMac) Serialize() ([]byte, error)
- func (p *FlowSpecSourceMac) String() string
- func (p *FlowSpecSourceMac) Type() BGPFlowSpecType
- type FlowSpecSourcePrefix
- func (p *FlowSpecSourcePrefix) DecodeFromBytes(data []byte) error
- func (p *FlowSpecSourcePrefix) Len() int
- func (p *FlowSpecSourcePrefix) MarshalJSON() ([]byte, error)
- func (p *FlowSpecSourcePrefix) Serialize() ([]byte, error)
- func (p *FlowSpecSourcePrefix) String() string
- func (p *FlowSpecSourcePrefix) Type() BGPFlowSpecType
- type FlowSpecSourcePrefix6
- func (p *FlowSpecSourcePrefix6) DecodeFromBytes(data []byte) error
- func (p *FlowSpecSourcePrefix6) Len() int
- func (p *FlowSpecSourcePrefix6) MarshalJSON() ([]byte, error)
- func (p *FlowSpecSourcePrefix6) Serialize() ([]byte, error)
- func (p *FlowSpecSourcePrefix6) String() string
- func (p *FlowSpecSourcePrefix6) Type() BGPFlowSpecType
- type FlowSpecUnknown
- type FourOctetAsSpecificExtended
- func (e *FourOctetAsSpecificExtended) Flat() map[string]string
- func (e *FourOctetAsSpecificExtended) GetTypes() (ExtendedCommunityAttrType, ExtendedCommunityAttrSubType)
- func (e *FourOctetAsSpecificExtended) MarshalJSON() ([]byte, error)
- func (e *FourOctetAsSpecificExtended) Serialize() ([]byte, error)
- func (e *FourOctetAsSpecificExtended) String() string
- type IPAddrPrefix
- type IPAddrPrefixDefault
- type IPv4AddressSpecificExtended
- func (e *IPv4AddressSpecificExtended) Flat() map[string]string
- func (e *IPv4AddressSpecificExtended) GetTypes() (ExtendedCommunityAttrType, ExtendedCommunityAttrSubType)
- func (e *IPv4AddressSpecificExtended) MarshalJSON() ([]byte, error)
- func (e *IPv4AddressSpecificExtended) Serialize() ([]byte, error)
- func (e *IPv4AddressSpecificExtended) String() string
- type IPv6AddrPrefix
- type IngressReplTunnelID
- type LabeledIPAddrPrefix
- type LabeledIPv6AddrPrefix
- type LabeledVPNIPAddrPrefix
- func (l *LabeledVPNIPAddrPrefix) AFI() uint16
- func (l *LabeledVPNIPAddrPrefix) DecodeFromBytes(data []byte) error
- func (l *LabeledVPNIPAddrPrefix) Flat() map[string]string
- func (l *LabeledVPNIPAddrPrefix) MarshalJSON() ([]byte, error)
- func (l *LabeledVPNIPAddrPrefix) SAFI() uint8
- func (l *LabeledVPNIPAddrPrefix) Serialize() ([]byte, error)
- func (l *LabeledVPNIPAddrPrefix) String() string
- type LabeledVPNIPv6AddrPrefix
- type MPLSLabelStack
- type MacMobilityExtended
- func (e *MacMobilityExtended) Flat() map[string]string
- func (e *MacMobilityExtended) GetTypes() (ExtendedCommunityAttrType, ExtendedCommunityAttrSubType)
- func (e *MacMobilityExtended) MarshalJSON() ([]byte, error)
- func (e *MacMobilityExtended) Serialize() ([]byte, error)
- func (e *MacMobilityExtended) String() string
- type MessageError
- type NotificationErrorCode
- type OpaqueExtended
- func (e *OpaqueExtended) DecodeFromBytes(data []byte) error
- func (e *OpaqueExtended) Flat() map[string]string
- func (e *OpaqueExtended) GetTypes() (ExtendedCommunityAttrType, ExtendedCommunityAttrSubType)
- func (e *OpaqueExtended) MarshalJSON() ([]byte, error)
- func (e *OpaqueExtended) Serialize() ([]byte, error)
- func (e *OpaqueExtended) String() string
- type OpaqueExtendedValueInterface
- type OpaqueNLRI
- func (n *OpaqueNLRI) AFI() uint16
- func (n *OpaqueNLRI) DecodeFromBytes(data []byte) error
- func (l *OpaqueNLRI) Flat() map[string]string
- func (n *OpaqueNLRI) Len() int
- func (n *OpaqueNLRI) MarshalJSON() ([]byte, error)
- func (n *OpaqueNLRI) SAFI() uint8
- func (n *OpaqueNLRI) Serialize() ([]byte, error)
- func (n *OpaqueNLRI) String() string
- type OptionParameterCapability
- type OptionParameterInterface
- type OptionParameterUnknown
- type ParameterCapabilityInterface
- type PathAttribute
- func (p *PathAttribute) DecodeFromBytes(data []byte) error
- func (p *PathAttribute) Flat() map[string]string
- func (p *PathAttribute) GetFlags() BGPAttrFlag
- func (p *PathAttribute) GetType() BGPAttrType
- func (p *PathAttribute) Len() int
- func (p *PathAttribute) MarshalJSON() ([]byte, error)
- func (p *PathAttribute) Serialize() ([]byte, error)
- func (p *PathAttribute) String() string
- type PathAttributeAggregator
- type PathAttributeAggregatorParam
- type PathAttributeAigp
- type PathAttributeAs4Aggregator
- type PathAttributeAs4Path
- type PathAttributeAsPath
- type PathAttributeAtomicAggregate
- type PathAttributeClusterList
- type PathAttributeCommunities
- type PathAttributeExtendedCommunities
- func (p *PathAttributeExtendedCommunities) DecodeFromBytes(data []byte) error
- func (p *PathAttributeExtendedCommunities) Flat() map[string]string
- func (p *PathAttributeExtendedCommunities) MarshalJSON() ([]byte, error)
- func (p *PathAttributeExtendedCommunities) Serialize() ([]byte, error)
- func (p *PathAttributeExtendedCommunities) String() string
- type PathAttributeInterface
- type PathAttributeLocalPref
- type PathAttributeMpReachNLRI
- type PathAttributeMpUnreachNLRI
- type PathAttributeMultiExitDisc
- type PathAttributeNextHop
- type PathAttributeOpaqueValue
- type PathAttributeOrigin
- type PathAttributeOriginatorId
- type PathAttributePmsiTunnel
- type PathAttributeTunnelEncap
- type PathAttributeUnknown
- type PmsiTunnelIDInterface
- type PmsiTunnelType
- type Protocol
- type RedirectFourOctetAsSpecificExtended
- func (e *RedirectFourOctetAsSpecificExtended) Flat() map[string]string
- func (e *RedirectFourOctetAsSpecificExtended) GetTypes() (ExtendedCommunityAttrType, ExtendedCommunityAttrSubType)
- func (e *RedirectFourOctetAsSpecificExtended) MarshalJSON() ([]byte, error)
- func (e *RedirectFourOctetAsSpecificExtended) Serialize() ([]byte, error)
- func (e *RedirectFourOctetAsSpecificExtended) String() string
- type RedirectIPv4AddressSpecificExtended
- func (e *RedirectIPv4AddressSpecificExtended) Flat() map[string]string
- func (e *RedirectIPv4AddressSpecificExtended) GetTypes() (ExtendedCommunityAttrType, ExtendedCommunityAttrSubType)
- func (e *RedirectIPv4AddressSpecificExtended) MarshalJSON() ([]byte, error)
- func (e *RedirectIPv4AddressSpecificExtended) Serialize() ([]byte, error)
- func (e *RedirectIPv4AddressSpecificExtended) String() string
- type RedirectTwoOctetAsSpecificExtended
- func (e *RedirectTwoOctetAsSpecificExtended) GetTypes() (ExtendedCommunityAttrType, ExtendedCommunityAttrSubType)
- func (e *RedirectTwoOctetAsSpecificExtended) MarshalJSON() ([]byte, error)
- func (e *RedirectTwoOctetAsSpecificExtended) Serialize() ([]byte, error)
- func (e *RedirectTwoOctetAsSpecificExtended) String() string
- type RouteDistinguisherFourOctetAS
- type RouteDistinguisherIPAddressAS
- type RouteDistinguisherInterface
- type RouteDistinguisherTwoOctetAS
- type RouteDistinguisherUnknown
- type RouteFamily
- type RouteTargetMembershipNLRI
- func (n *RouteTargetMembershipNLRI) AFI() uint16
- func (n *RouteTargetMembershipNLRI) DecodeFromBytes(data []byte) error
- func (l *RouteTargetMembershipNLRI) Flat() map[string]string
- func (n *RouteTargetMembershipNLRI) Len() int
- func (n *RouteTargetMembershipNLRI) MarshalJSON() ([]byte, error)
- func (n *RouteTargetMembershipNLRI) SAFI() uint8
- func (n *RouteTargetMembershipNLRI) Serialize() ([]byte, error)
- func (n *RouteTargetMembershipNLRI) String() string
- type TCPFlag
- type TrafficActionExtended
- func (e *TrafficActionExtended) Flat() map[string]string
- func (e *TrafficActionExtended) GetTypes() (ExtendedCommunityAttrType, ExtendedCommunityAttrSubType)
- func (e *TrafficActionExtended) MarshalJSON() ([]byte, error)
- func (e *TrafficActionExtended) Serialize() ([]byte, error)
- func (e *TrafficActionExtended) String() string
- type TrafficRateExtended
- func (e *TrafficRateExtended) Flat() map[string]string
- func (e *TrafficRateExtended) GetTypes() (ExtendedCommunityAttrType, ExtendedCommunityAttrSubType)
- func (e *TrafficRateExtended) MarshalJSON() ([]byte, error)
- func (e *TrafficRateExtended) Serialize() ([]byte, error)
- func (e *TrafficRateExtended) String() string
- type TrafficRemarkExtended
- func (e *TrafficRemarkExtended) Flat() map[string]string
- func (e *TrafficRemarkExtended) GetTypes() (ExtendedCommunityAttrType, ExtendedCommunityAttrSubType)
- func (e *TrafficRemarkExtended) MarshalJSON() ([]byte, error)
- func (e *TrafficRemarkExtended) Serialize() ([]byte, error)
- func (e *TrafficRemarkExtended) String() string
- type TunnelEncapSubTLV
- type TunnelEncapSubTLVColor
- type TunnelEncapSubTLVDefault
- type TunnelEncapSubTLVEncapuslation
- type TunnelEncapSubTLVProtocol
- type TunnelEncapSubTLVValue
- type TunnelEncapTLV
- type TunnelType
- type TwoOctetAsSpecificExtended
- func (e *TwoOctetAsSpecificExtended) Flat() map[string]string
- func (e *TwoOctetAsSpecificExtended) GetTypes() (ExtendedCommunityAttrType, ExtendedCommunityAttrSubType)
- func (e *TwoOctetAsSpecificExtended) MarshalJSON() ([]byte, error)
- func (e *TwoOctetAsSpecificExtended) Serialize() ([]byte, error)
- func (e *TwoOctetAsSpecificExtended) String() string
- type UnknownExtended
- type ValidationExtended
- type ValidationState
- type WellKnownCommunity
Constants ¶
const ( AFI_IP = 1 AFI_IP6 = 2 AFI_L2VPN = 25 AFI_OPAQUE = 16397 )
const ( SAFI_UNICAST = 1 SAFI_MULTICAST = 2 SAFI_MPLS_LABEL = 4 SAFI_ENCAPSULATION = 7 SAFI_VPLS = 65 SAFI_EVPN = 70 SAFI_MPLS_VPN = 128 SAFI_MPLS_VPN_MULTICAST = 129 SAFI_ROUTE_TARGET_CONSTRTAINS = 132 SAFI_FLOW_SPEC_UNICAST = 133 SAFI_FLOW_SPEC_VPN = 134 SAFI_KEY_VALUE = 241 )
const ( BGP_ORIGIN_ATTR_TYPE_IGP = 0 BGP_ORIGIN_ATTR_TYPE_EGP = 1 BGP_ORIGIN_ATTR_TYPE_INCOMPLETE = 2 )
const ( BGP_ASPATH_ATTR_TYPE_SET = 1 BGP_ASPATH_ATTR_TYPE_SEQ = 2 BGP_ASPATH_ATTR_TYPE_CONFED_SEQ = 3 BGP_ASPATH_ATTR_TYPE_CONFED_SET = 4 )
const ( BGP_MSG_OPEN BGP_MSG_UPDATE BGP_MSG_NOTIFICATION BGP_MSG_KEEPALIVE BGP_MSG_ROUTE_REFRESH )
const ( BGP_RD_TWO_OCTET_AS = iota BGP_RD_IPV4_ADDRESS BGP_RD_FOUR_OCTET_AS )
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 )
const ( BGP_ERROR_MESSAGE_HEADER_ERROR BGP_ERROR_OPEN_MESSAGE_ERROR BGP_ERROR_UPDATE_MESSAGE_ERROR BGP_ERROR_HOLD_TIMER_EXPIRED BGP_ERROR_FSM_ERROR BGP_ERROR_CEASE BGP_ERROR_ROUTE_REFRESH_MESSAGE_ERROR )
NOTIFICATION Error Code RFC 4271 4.5.
const ( BGP_ERROR_SUB_CONNECTION_NOT_SYNCHRONIZED BGP_ERROR_SUB_BAD_MESSAGE_LENGTH BGP_ERROR_SUB_BAD_MESSAGE_TYPE )
NOTIFICATION Error Subcode for BGP_ERROR_MESSAGE_HEADER_ERROR
const ( BGP_ERROR_SUB_UNSUPPORTED_VERSION_NUMBER BGP_ERROR_SUB_BAD_PEER_AS BGP_ERROR_SUB_BAD_BGP_IDENTIFIER BGP_ERROR_SUB_UNSUPPORTED_OPTIONAL_PARAMETER BGP_ERROR_SUB_DEPRECATED_AUTHENTICATION_FAILURE BGP_ERROR_SUB_UNACCEPTABLE_HOLD_TIME BGP_ERROR_SUB_UNSUPPORTED_CAPABILITY )
NOTIFICATION Error Subcode for BGP_ERROR_OPEN_MESSAGE_ERROR
const ( BGP_ERROR_SUB_MALFORMED_ATTRIBUTE_LIST BGP_ERROR_SUB_UNRECOGNIZED_WELL_KNOWN_ATTRIBUTE BGP_ERROR_SUB_MISSING_WELL_KNOWN_ATTRIBUTE BGP_ERROR_SUB_ATTRIBUTE_FLAGS_ERROR BGP_ERROR_SUB_ATTRIBUTE_LENGTH_ERROR BGP_ERROR_SUB_INVALID_ORIGIN_ATTRIBUTE BGP_ERROR_SUB_DEPRECATED_ROUTING_LOOP BGP_ERROR_SUB_INVALID_NEXT_HOP_ATTRIBUTE BGP_ERROR_SUB_OPTIONAL_ATTRIBUTE_ERROR BGP_ERROR_SUB_INVALID_NETWORK_FIELD BGP_ERROR_SUB_MALFORMED_AS_PATH )
NOTIFICATION Error Subcode for BGP_ERROR_UPDATE_MESSAGE_ERROR
const ( BGP_ERROR_SUB_RECEIVE_UNEXPECTED_MESSAGE_IN_OPENSENT_STATE BGP_ERROR_SUB_RECEIVE_UNEXPECTED_MESSAGE_IN_OPENCONFIRM_STATE BGP_ERROR_SUB_RECEIVE_UNEXPECTED_MESSAGE_IN_ESTABLISHED_STATE )
NOTIFICATION Error Subcode for BGP_ERROR_FSM_ERROR
const ( BGP_ERROR_SUB_MAXIMUM_NUMBER_OF_PREFIXES_REACHED BGP_ERROR_SUB_ADMINISTRATIVE_SHUTDOWN BGP_ERROR_SUB_PEER_DECONFIGURED BGP_ERROR_SUB_ADMINISTRATIVE_RESET BGP_ERROR_SUB_CONNECTION_REJECTED BGP_ERROR_SUB_OTHER_CONFIGURATION_CHANGE BGP_ERROR_SUB_CONNECTION_COLLISION_RESOLUTION BGP_ERROR_SUB_OUT_OF_RESOURCES )
NOTIFICATION Error Subcode for BGP_ERROR_CEASE (RFC 4486)
const ( COMMUNITY_INTERNET WellKnownCommunity = 0x00000000 COMMUNITY_PLANNED_SHUT = 0xffff0000 COMMUNITY_ACCEPT_OWN = 0xffff0001 COMMUNITY_ROUTE_FILTER_TRANSLATED_v4 = 0xffff0002 COMMUNITY_ROUTE_FILTER_v4 = 0xffff0003 COMMUNITY_ROUTE_FILTER_TRANSLATED_v6 = 0xffff0004 COMMUNITY_ROUTE_FILTER_v6 = 0xffff0005 COMMUNITY_LLGR_STALE = 0xffff0006 COMMUNITY_NO_LLGR = 0xffff0007 COMMUNITY_NO_EXPORT = 0xffffff01 COMMUNITY_NO_ADVERTISE = 0xffffff02 COMMUNITY_NO_EXPORT_SUBCONFED = 0xffffff03 COMMUNITY_NO_PEER = 0xffffff04 )
const ( BGP_HEADER_LENGTH = 19 BGP_MAX_MESSAGE_LENGTH = 4096 )
const ( Unknown Protocol = iota ICMP = 0x01 IGMP = 0x02 TCP = 0x06 EGP = 0x08 IGP = 0x09 UDP = 0x11 RSVP = 0x2e GRE = 0x2f OSPF = 0x59 IPIP = 0x5e PIM = 0x67 SCTP = 0x84 )
const ( TCP_FLAG_FIN = 0x01 TCP_FLAG_SYN = 0x02 TCP_FLAG_RST = 0x04 TCP_FLAG_PUSH = 0x08 TCP_FLAG_ACK = 0x10 TCP_FLAG_URGENT = 0x20 )
const AS_TRANS = 23456
const (
BGP_ERROR_SUB_HOLD_TIMER_EXPIRED
)
NOTIFICATION Error Subcode for BGP_ERROR_HOLD_TIMER_EXPIRED
const (
BGP_ERROR_SUB_INVALID_MESSAGE_LENGTH
)
NOTIFICATION Error Subcode for BGP_ERROR_ROUTE_REFRESH
const (
BGP_OPT_CAPABILITY = 2
)
const BGP_PORT = 179
const WITHDRAW_LABEL = uint32(0x800000)
RFC3107 Carrying Label Information in BGP-4
3. Carrying Label Mapping Information
The label information carried (as part of NLRI) in the Withdrawn Routes field should be set to 0x800000.
const ZERO_LABEL = uint32(0) // some platform uses this as withdraw label
Variables ¶
var AddressFamilyNameMap = map[RouteFamily]string{ RF_IPv4_UC: "ipv4-unicast", RF_IPv6_UC: "ipv6-unicast", RF_IPv4_MC: "ipv4-multicast", RF_IPv6_MC: "ipv6-multicast", RF_IPv4_MPLS: "ipv4-labelled-unicast", RF_IPv6_MPLS: "ipv6-labelled-unicast", RF_IPv4_VPN: "l3vpn-ipv4-unicast", RF_IPv6_VPN: "l3vpn-ipv6-unicast", RF_IPv4_VPN_MC: "l3vpn-ipv4-multicast", RF_IPv6_VPN_MC: "l3vpn-ipv6-multicast", RF_VPLS: "l2vpn-vpls", RF_EVPN: "l2vpn-evpn", RF_RTC_UC: "rtc", RF_IPv4_ENCAP: "ipv4-encap", RF_IPv6_ENCAP: "ipv6-encap", RF_FS_IPv4_UC: "ipv4-flowspec", RF_FS_IPv4_VPN: "l3vpn-ipv4-flowspec", RF_FS_IPv6_UC: "ipv6-flowspec", RF_FS_IPv6_VPN: "l3vpn-ipv6-flowspec", RF_FS_L2_VPN: "l2vpn-flowspec", RF_OPAQUE: "opaque", }
var AddressFamilyValueMap = map[string]RouteFamily{ AddressFamilyNameMap[RF_IPv4_UC]: RF_IPv4_UC, AddressFamilyNameMap[RF_IPv6_UC]: RF_IPv6_UC, AddressFamilyNameMap[RF_IPv4_MC]: RF_IPv4_MC, AddressFamilyNameMap[RF_IPv6_MC]: RF_IPv6_MC, AddressFamilyNameMap[RF_IPv4_MPLS]: RF_IPv4_MPLS, AddressFamilyNameMap[RF_IPv6_MPLS]: RF_IPv6_MPLS, AddressFamilyNameMap[RF_IPv4_VPN]: RF_IPv4_VPN, AddressFamilyNameMap[RF_IPv6_VPN]: RF_IPv6_VPN, AddressFamilyNameMap[RF_IPv4_VPN_MC]: RF_IPv4_VPN_MC, AddressFamilyNameMap[RF_IPv6_VPN_MC]: RF_IPv6_VPN_MC, AddressFamilyNameMap[RF_VPLS]: RF_VPLS, AddressFamilyNameMap[RF_EVPN]: RF_EVPN, AddressFamilyNameMap[RF_RTC_UC]: RF_RTC_UC, AddressFamilyNameMap[RF_IPv4_ENCAP]: RF_IPv4_ENCAP, AddressFamilyNameMap[RF_IPv6_ENCAP]: RF_IPv6_ENCAP, AddressFamilyNameMap[RF_FS_IPv4_UC]: RF_FS_IPv4_UC, AddressFamilyNameMap[RF_FS_IPv4_VPN]: RF_FS_IPv4_VPN, AddressFamilyNameMap[RF_FS_IPv6_UC]: RF_FS_IPv6_UC, AddressFamilyNameMap[RF_FS_IPv6_VPN]: RF_FS_IPv6_VPN, AddressFamilyNameMap[RF_FS_L2_VPN]: RF_FS_L2_VPN, AddressFamilyNameMap[RF_OPAQUE]: RF_OPAQUE, }
var EthernetTypeNameMap = map[EthernetType]string{ IPv4: "ipv4", ARP: "arp", RARP: "rarp", VMTP: "vmtp", APPLE_TALK: "apple-talk", AARP: "aarp", IPX: "ipx", SNMP: "snmp", NET_BIOS: "net-bios", XTP: "xtp", IPv6: "ipv6", PPPoE_DISCOVERY: "pppoe-discovery", PPPoE_SESSION: "pppoe-session", LOOPBACK: "loopback", }
var EthernetTypeValueMap = map[string]EthernetType{ EthernetTypeNameMap[IPv4]: IPv4, EthernetTypeNameMap[ARP]: ARP, EthernetTypeNameMap[RARP]: RARP, EthernetTypeNameMap[VMTP]: VMTP, EthernetTypeNameMap[APPLE_TALK]: APPLE_TALK, EthernetTypeNameMap[AARP]: AARP, EthernetTypeNameMap[IPX]: IPX, EthernetTypeNameMap[SNMP]: SNMP, EthernetTypeNameMap[NET_BIOS]: NET_BIOS, EthernetTypeNameMap[XTP]: XTP, EthernetTypeNameMap[IPv6]: IPv6, EthernetTypeNameMap[PPPoE_DISCOVERY]: PPPoE_DISCOVERY, EthernetTypeNameMap[PPPoE_SESSION]: PPPoE_SESSION, EthernetTypeNameMap[LOOPBACK]: LOOPBACK, }
var FlowSpecNameMap = map[BGPFlowSpecType]string{ FLOW_SPEC_TYPE_UNKNOWN: "unknown", FLOW_SPEC_TYPE_DST_PREFIX: "destination", FLOW_SPEC_TYPE_SRC_PREFIX: "source", FLOW_SPEC_TYPE_IP_PROTO: "protocol", FLOW_SPEC_TYPE_PORT: "port", FLOW_SPEC_TYPE_DST_PORT: "destination-port", FLOW_SPEC_TYPE_SRC_PORT: "source-port", FLOW_SPEC_TYPE_ICMP_TYPE: "icmp-type", FLOW_SPEC_TYPE_ICMP_CODE: "icmp-code", FLOW_SPEC_TYPE_TCP_FLAG: "tcp-flags", FLOW_SPEC_TYPE_PKT_LEN: "packet-length", FLOW_SPEC_TYPE_DSCP: "dscp", FLOW_SPEC_TYPE_FRAGMENT: "fragment", FLOW_SPEC_TYPE_LABEL: "label", FLOW_SPEC_TYPE_ETHERNET_TYPE: "ether-type", FLOW_SPEC_TYPE_SRC_MAC: "source-mac", FLOW_SPEC_TYPE_DST_MAC: "destination-mac", FLOW_SPEC_TYPE_LLC_DSAP: "llc-dsap", FLOW_SPEC_TYPE_LLC_SSAP: "llc-ssap", FLOW_SPEC_TYPE_LLC_CONTROL: "llc-control", FLOW_SPEC_TYPE_SNAP: "snap", FLOW_SPEC_TYPE_VID: "vid", FLOW_SPEC_TYPE_COS: "cos", FLOW_SPEC_TYPE_INNER_VID: "inner-vid", FLOW_SPEC_TYPE_INNER_COS: "inner-cos", }
var FlowSpecValueMap = map[string]BGPFlowSpecType{ FlowSpecNameMap[FLOW_SPEC_TYPE_DST_PREFIX]: FLOW_SPEC_TYPE_DST_PREFIX, FlowSpecNameMap[FLOW_SPEC_TYPE_SRC_PREFIX]: FLOW_SPEC_TYPE_SRC_PREFIX, FlowSpecNameMap[FLOW_SPEC_TYPE_IP_PROTO]: FLOW_SPEC_TYPE_IP_PROTO, FlowSpecNameMap[FLOW_SPEC_TYPE_PORT]: FLOW_SPEC_TYPE_PORT, FlowSpecNameMap[FLOW_SPEC_TYPE_DST_PORT]: FLOW_SPEC_TYPE_DST_PORT, FlowSpecNameMap[FLOW_SPEC_TYPE_SRC_PORT]: FLOW_SPEC_TYPE_SRC_PORT, FlowSpecNameMap[FLOW_SPEC_TYPE_ICMP_TYPE]: FLOW_SPEC_TYPE_ICMP_TYPE, FlowSpecNameMap[FLOW_SPEC_TYPE_ICMP_CODE]: FLOW_SPEC_TYPE_ICMP_CODE, FlowSpecNameMap[FLOW_SPEC_TYPE_TCP_FLAG]: FLOW_SPEC_TYPE_TCP_FLAG, FlowSpecNameMap[FLOW_SPEC_TYPE_PKT_LEN]: FLOW_SPEC_TYPE_PKT_LEN, FlowSpecNameMap[FLOW_SPEC_TYPE_DSCP]: FLOW_SPEC_TYPE_DSCP, FlowSpecNameMap[FLOW_SPEC_TYPE_FRAGMENT]: FLOW_SPEC_TYPE_FRAGMENT, FlowSpecNameMap[FLOW_SPEC_TYPE_LABEL]: FLOW_SPEC_TYPE_LABEL, FlowSpecNameMap[FLOW_SPEC_TYPE_ETHERNET_TYPE]: FLOW_SPEC_TYPE_ETHERNET_TYPE, FlowSpecNameMap[FLOW_SPEC_TYPE_SRC_MAC]: FLOW_SPEC_TYPE_SRC_MAC, FlowSpecNameMap[FLOW_SPEC_TYPE_DST_MAC]: FLOW_SPEC_TYPE_DST_MAC, FlowSpecNameMap[FLOW_SPEC_TYPE_LLC_DSAP]: FLOW_SPEC_TYPE_LLC_DSAP, FlowSpecNameMap[FLOW_SPEC_TYPE_LLC_SSAP]: FLOW_SPEC_TYPE_LLC_SSAP, FlowSpecNameMap[FLOW_SPEC_TYPE_LLC_CONTROL]: FLOW_SPEC_TYPE_LLC_CONTROL, FlowSpecNameMap[FLOW_SPEC_TYPE_SNAP]: FLOW_SPEC_TYPE_SNAP, FlowSpecNameMap[FLOW_SPEC_TYPE_VID]: FLOW_SPEC_TYPE_VID, FlowSpecNameMap[FLOW_SPEC_TYPE_COS]: FLOW_SPEC_TYPE_COS, FlowSpecNameMap[FLOW_SPEC_TYPE_INNER_VID]: FLOW_SPEC_TYPE_INNER_VID, FlowSpecNameMap[FLOW_SPEC_TYPE_INNER_COS]: FLOW_SPEC_TYPE_INNER_COS, }
var PathAttrFlags map[BGPAttrType]BGPAttrFlag = map[BGPAttrType]BGPAttrFlag{ BGP_ATTR_TYPE_ORIGIN: BGP_ATTR_FLAG_TRANSITIVE, BGP_ATTR_TYPE_AS_PATH: BGP_ATTR_FLAG_TRANSITIVE, BGP_ATTR_TYPE_NEXT_HOP: BGP_ATTR_FLAG_TRANSITIVE, BGP_ATTR_TYPE_MULTI_EXIT_DISC: BGP_ATTR_FLAG_OPTIONAL, BGP_ATTR_TYPE_LOCAL_PREF: BGP_ATTR_FLAG_TRANSITIVE, BGP_ATTR_TYPE_ATOMIC_AGGREGATE: BGP_ATTR_FLAG_TRANSITIVE, BGP_ATTR_TYPE_AGGREGATOR: BGP_ATTR_FLAG_TRANSITIVE | BGP_ATTR_FLAG_OPTIONAL, BGP_ATTR_TYPE_COMMUNITIES: BGP_ATTR_FLAG_TRANSITIVE | BGP_ATTR_FLAG_OPTIONAL, BGP_ATTR_TYPE_ORIGINATOR_ID: BGP_ATTR_FLAG_OPTIONAL, BGP_ATTR_TYPE_CLUSTER_LIST: BGP_ATTR_FLAG_OPTIONAL, BGP_ATTR_TYPE_MP_REACH_NLRI: BGP_ATTR_FLAG_OPTIONAL, BGP_ATTR_TYPE_MP_UNREACH_NLRI: BGP_ATTR_FLAG_OPTIONAL, BGP_ATTR_TYPE_EXTENDED_COMMUNITIES: BGP_ATTR_FLAG_TRANSITIVE | BGP_ATTR_FLAG_OPTIONAL, BGP_ATTR_TYPE_AS4_PATH: BGP_ATTR_FLAG_TRANSITIVE | BGP_ATTR_FLAG_OPTIONAL, BGP_ATTR_TYPE_AS4_AGGREGATOR: BGP_ATTR_FLAG_TRANSITIVE | BGP_ATTR_FLAG_OPTIONAL, BGP_ATTR_TYPE_PMSI_TUNNEL: BGP_ATTR_FLAG_TRANSITIVE | BGP_ATTR_FLAG_OPTIONAL, BGP_ATTR_TYPE_TUNNEL_ENCAP: BGP_ATTR_FLAG_TRANSITIVE | BGP_ATTR_FLAG_OPTIONAL, BGP_ATTR_TYPE_AIGP: BGP_ATTR_FLAG_OPTIONAL, BGP_ATTR_TYPE_OPAQUE_VALUE: BGP_ATTR_FLAG_TRANSITIVE | BGP_ATTR_FLAG_OPTIONAL, }
var ProtocolNameMap = map[Protocol]string{ Unknown: "unknown", ICMP: "icmp", IGMP: "igmp", TCP: "tcp", EGP: "egp", IGP: "igp", UDP: "udp", RSVP: "rsvp", GRE: "gre", OSPF: "ospf", IPIP: "ipip", PIM: "pim", SCTP: "sctp", }
var ProtocolValueMap = map[string]Protocol{ ProtocolNameMap[ICMP]: ICMP, ProtocolNameMap[IGMP]: IGMP, ProtocolNameMap[TCP]: TCP, ProtocolNameMap[EGP]: EGP, ProtocolNameMap[IGP]: IGP, ProtocolNameMap[UDP]: UDP, ProtocolNameMap[RSVP]: RSVP, ProtocolNameMap[GRE]: GRE, ProtocolNameMap[OSPF]: OSPF, ProtocolNameMap[IPIP]: IPIP, ProtocolNameMap[PIM]: PIM, ProtocolNameMap[SCTP]: SCTP, }
var TCPFlagNameMap = map[TCPFlag]string{ TCP_FLAG_FIN: "fin", TCP_FLAG_SYN: "syn", TCP_FLAG_RST: "rst", TCP_FLAG_PUSH: "push", TCP_FLAG_ACK: "ack", TCP_FLAG_URGENT: "urgent", }
var TCPFlagValueMap = map[string]TCPFlag{ TCPFlagNameMap[TCP_FLAG_FIN]: TCP_FLAG_FIN, TCPFlagNameMap[TCP_FLAG_SYN]: TCP_FLAG_SYN, TCPFlagNameMap[TCP_FLAG_RST]: TCP_FLAG_RST, TCPFlagNameMap[TCP_FLAG_PUSH]: TCP_FLAG_PUSH, TCPFlagNameMap[TCP_FLAG_ACK]: TCP_FLAG_ACK, TCPFlagNameMap[TCP_FLAG_URGENT]: TCP_FLAG_URGENT, }
var WellKnownCommunityNameMap = map[WellKnownCommunity]string{ COMMUNITY_INTERNET: "internet", COMMUNITY_PLANNED_SHUT: "planned-shut", COMMUNITY_ACCEPT_OWN: "accept-own", COMMUNITY_ROUTE_FILTER_TRANSLATED_v4: "route-filter-translated-v4", COMMUNITY_ROUTE_FILTER_v4: "route-filter-v4", COMMUNITY_ROUTE_FILTER_TRANSLATED_v6: "route-filter-translated-v6", COMMUNITY_ROUTE_FILTER_v6: "route-filter-v6", COMMUNITY_LLGR_STALE: "llgr-stale", COMMUNITY_NO_LLGR: "no-llgr", COMMUNITY_NO_EXPORT: "no-export", COMMUNITY_NO_ADVERTISE: "no-advertise", COMMUNITY_NO_EXPORT_SUBCONFED: "no-export-subconfed", COMMUNITY_NO_PEER: "no-peer", }
var WellKnownCommunityValueMap = map[string]WellKnownCommunity{ WellKnownCommunityNameMap[COMMUNITY_INTERNET]: COMMUNITY_INTERNET, WellKnownCommunityNameMap[COMMUNITY_PLANNED_SHUT]: COMMUNITY_PLANNED_SHUT, WellKnownCommunityNameMap[COMMUNITY_ACCEPT_OWN]: COMMUNITY_ACCEPT_OWN, WellKnownCommunityNameMap[COMMUNITY_ROUTE_FILTER_TRANSLATED_v4]: COMMUNITY_ROUTE_FILTER_TRANSLATED_v4, WellKnownCommunityNameMap[COMMUNITY_ROUTE_FILTER_v4]: COMMUNITY_ROUTE_FILTER_v4, WellKnownCommunityNameMap[COMMUNITY_ROUTE_FILTER_TRANSLATED_v6]: COMMUNITY_ROUTE_FILTER_TRANSLATED_v6, WellKnownCommunityNameMap[COMMUNITY_ROUTE_FILTER_v6]: COMMUNITY_ROUTE_FILTER_v6, WellKnownCommunityNameMap[COMMUNITY_LLGR_STALE]: COMMUNITY_LLGR_STALE, WellKnownCommunityNameMap[COMMUNITY_NO_LLGR]: COMMUNITY_NO_LLGR, WellKnownCommunityNameMap[COMMUNITY_NO_EXPORT]: COMMUNITY_NO_EXPORT, WellKnownCommunityNameMap[COMMUNITY_NO_ADVERTISE]: COMMUNITY_NO_ADVERTISE, WellKnownCommunityNameMap[COMMUNITY_NO_EXPORT_SUBCONFED]: COMMUNITY_NO_EXPORT_SUBCONFED, WellKnownCommunityNameMap[COMMUNITY_NO_PEER]: COMMUNITY_NO_PEER, }
Functions ¶
func CompareFlowSpecNLRI ¶
func CompareFlowSpecNLRI(n, m *FlowSpecNLRI) (int, error)
CompareFlowSpecNLRI(n, m) returns -1 when m has precedence
0 when n and m have same precedence 1 when n has precedence
func FlatUpdate ¶
Update a Flat representation by adding elements of the second one. If two elements use same keys, values are separated with ';'. In this case, it returns an error but the update has been realized.
func NewMessageError ¶
func RouteFamilyToAfiSafi ¶
func RouteFamilyToAfiSafi(rf RouteFamily) (uint16, uint8)
func ValidateAttribute ¶
func ValidateAttribute(a PathAttributeInterface, rfs map[RouteFamily]bool, doConfedCheck bool) (bool, error)
func ValidateBGPMessage ¶
func ValidateBGPMessage(m *BGPMessage) error
func ValidateFlags ¶
func ValidateFlags(t BGPAttrType, flags BGPAttrFlag) (bool, string)
validator for PathAttribute
func ValidateOpenMsg ¶
func ValidateUpdateMsg ¶
Validator for BGPUpdate
Types ¶
type AddrPrefixInterface ¶
type AddrPrefixInterface interface { DecodeFromBytes([]byte) error Serialize() ([]byte, error) AFI() uint16 SAFI() uint8 Len() int String() string MarshalJSON() ([]byte, error) // Create a flat map to describe attributes and their // values. This can be used to create structured outputs. Flat() map[string]string }
func NewPrefixFromRouteFamily ¶
func NewPrefixFromRouteFamily(afi uint16, safi uint8) (prefix AddrPrefixInterface, err error)
type AigpTLVDefault ¶
type AigpTLVDefault struct { Value []byte // contains filtered or unexported fields }
func (*AigpTLVDefault) MarshalJSON ¶
func (t *AigpTLVDefault) MarshalJSON() ([]byte, error)
func (*AigpTLVDefault) Serialize ¶
func (t *AigpTLVDefault) Serialize() ([]byte, error)
func (*AigpTLVDefault) String ¶
func (t *AigpTLVDefault) String() string
func (*AigpTLVDefault) Type ¶
func (t *AigpTLVDefault) Type() AigpTLVType
type AigpTLVIgpMetric ¶
type AigpTLVIgpMetric struct {
Metric uint64
}
func NewAigpTLVIgpMetric ¶
func NewAigpTLVIgpMetric(metric uint64) *AigpTLVIgpMetric
func (*AigpTLVIgpMetric) MarshalJSON ¶
func (t *AigpTLVIgpMetric) MarshalJSON() ([]byte, error)
func (*AigpTLVIgpMetric) Serialize ¶
func (t *AigpTLVIgpMetric) Serialize() ([]byte, error)
func (*AigpTLVIgpMetric) String ¶
func (t *AigpTLVIgpMetric) String() string
func (*AigpTLVIgpMetric) Type ¶
func (t *AigpTLVIgpMetric) Type() AigpTLVType
type AigpTLVType ¶
type AigpTLVType uint8
const ( AIGP_TLV_UNKNOWN AigpTLVType = iota AIGP_TLV_IGP_METRIC )
type As4PathParam ¶
func NewAs4PathParam ¶
func NewAs4PathParam(segType uint8, as []uint32) *As4PathParam
func (*As4PathParam) ASLen ¶
func (a *As4PathParam) ASLen() int
func (*As4PathParam) DecodeFromBytes ¶
func (a *As4PathParam) DecodeFromBytes(data []byte) error
func (*As4PathParam) Len ¶
func (a *As4PathParam) Len() int
func (*As4PathParam) MarshalJSON ¶
func (a *As4PathParam) MarshalJSON() ([]byte, error)
func (*As4PathParam) Serialize ¶
func (a *As4PathParam) Serialize() ([]byte, error)
func (*As4PathParam) String ¶
func (a *As4PathParam) String() string
type AsPathParam ¶
func NewAsPathParam ¶
func NewAsPathParam(segType uint8, as []uint16) *AsPathParam
func (*AsPathParam) ASLen ¶
func (a *AsPathParam) ASLen() int
func (*AsPathParam) DecodeFromBytes ¶
func (a *AsPathParam) DecodeFromBytes(data []byte) error
func (*AsPathParam) Len ¶
func (a *AsPathParam) Len() int
func (*AsPathParam) MarshalJSON ¶
func (a *AsPathParam) MarshalJSON() ([]byte, error)
func (*AsPathParam) Serialize ¶
func (a *AsPathParam) Serialize() ([]byte, error)
func (*AsPathParam) String ¶
func (a *AsPathParam) String() string
type AsPathParamFormat ¶
type AsPathParamFormat struct {
// contains filtered or unexported fields
}
type AsPathParamInterface ¶
type BGPAddPathMode ¶
type BGPAddPathMode uint8
const ( BGP_ADD_PATH_RECEIVE BGPAddPathMode = 1 BGP_ADD_PATH_SEND BGPAddPathMode = 2 BGP_ADD_PATH_BOTH BGPAddPathMode = 3 )
func (BGPAddPathMode) String ¶
func (m BGPAddPathMode) String() string
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) String ¶
func (f BGPAttrFlag) String() string
type BGPAttrType ¶
type BGPAttrType uint8
const ( BGP_ATTR_TYPE_ORIGIN BGPAttrType BGP_ATTR_TYPE_AS_PATH BGP_ATTR_TYPE_NEXT_HOP BGP_ATTR_TYPE_MULTI_EXIT_DISC BGP_ATTR_TYPE_LOCAL_PREF BGP_ATTR_TYPE_ATOMIC_AGGREGATE BGP_ATTR_TYPE_AGGREGATOR BGP_ATTR_TYPE_COMMUNITIES BGP_ATTR_TYPE_ORIGINATOR_ID BGP_ATTR_TYPE_CLUSTER_LIST BGP_ATTR_TYPE_MP_REACH_NLRI // = 14 BGP_ATTR_TYPE_MP_UNREACH_NLRI BGP_ATTR_TYPE_EXTENDED_COMMUNITIES BGP_ATTR_TYPE_AS4_PATH BGP_ATTR_TYPE_AS4_AGGREGATOR BGP_ATTR_TYPE_PMSI_TUNNEL // = 22 BGP_ATTR_TYPE_TUNNEL_ENCAP BGP_ATTR_TYPE_AIGP // = 26 BGP_ATTR_TYPE_OPAQUE_VALUE BGPAttrType = 41 )
func (BGPAttrType) String ¶
func (i BGPAttrType) String() string
type BGPCapabilityCode ¶
type BGPCapabilityCode uint8
const ( BGP_CAP_MULTIPROTOCOL BGPCapabilityCode = 1 BGP_CAP_ROUTE_REFRESH BGPCapabilityCode = 2 BGP_CAP_CARRYING_LABEL_INFO BGPCapabilityCode = 4 BGP_CAP_GRACEFUL_RESTART BGPCapabilityCode = 64 BGP_CAP_FOUR_OCTET_AS_NUMBER BGPCapabilityCode = 65 BGP_CAP_ADD_PATH BGPCapabilityCode = 69 BGP_CAP_ENHANCED_ROUTE_REFRESH BGPCapabilityCode = 70 BGP_CAP_ROUTE_REFRESH_CISCO BGPCapabilityCode = 128 )
func (BGPCapabilityCode) String ¶
func (i BGPCapabilityCode) String() string
type BGPFlowSpecType ¶
type BGPFlowSpecType uint8
const ( FLOW_SPEC_TYPE_UNKNOWN BGPFlowSpecType = iota FLOW_SPEC_TYPE_DST_PREFIX FLOW_SPEC_TYPE_SRC_PREFIX FLOW_SPEC_TYPE_IP_PROTO FLOW_SPEC_TYPE_PORT FLOW_SPEC_TYPE_DST_PORT FLOW_SPEC_TYPE_SRC_PORT FLOW_SPEC_TYPE_ICMP_TYPE FLOW_SPEC_TYPE_ICMP_CODE FLOW_SPEC_TYPE_TCP_FLAG FLOW_SPEC_TYPE_PKT_LEN FLOW_SPEC_TYPE_DSCP FLOW_SPEC_TYPE_FRAGMENT FLOW_SPEC_TYPE_LABEL FLOW_SPEC_TYPE_ETHERNET_TYPE // 14 FLOW_SPEC_TYPE_SRC_MAC FLOW_SPEC_TYPE_DST_MAC FLOW_SPEC_TYPE_LLC_DSAP FLOW_SPEC_TYPE_LLC_SSAP FLOW_SPEC_TYPE_LLC_CONTROL FLOW_SPEC_TYPE_SNAP FLOW_SPEC_TYPE_VID FLOW_SPEC_TYPE_COS FLOW_SPEC_TYPE_INNER_VID FLOW_SPEC_TYPE_INNER_COS )
func (BGPFlowSpecType) String ¶
func (t BGPFlowSpecType) String() string
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 NewBGPKeepAliveMessage ¶
func NewBGPKeepAliveMessage() *BGPMessage
func NewBGPNotificationMessage ¶
func NewBGPNotificationMessage(errcode uint8, errsubcode uint8, data []byte) *BGPMessage
func NewBGPOpenMessage ¶
func NewBGPOpenMessage(myas uint16, holdtime uint16, id string, optparams []OptionParameterInterface) *BGPMessage
func NewBGPRouteRefreshMessage ¶
func NewBGPRouteRefreshMessage(afi uint16, demarcation uint8, safi uint8) *BGPMessage
func NewBGPUpdateMessage ¶
func NewBGPUpdateMessage(withdrawnRoutes []*IPAddrPrefix, pathattrs []PathAttributeInterface, nlri []*IPAddrPrefix) *BGPMessage
func NewEndOfRib ¶
func NewEndOfRib(family RouteFamily) *BGPMessage
func NewTestBGPOpenMessage ¶
func NewTestBGPOpenMessage() *BGPMessage
func NewTestBGPUpdateMessage ¶
func NewTestBGPUpdateMessage() *BGPMessage
func ParseBGPBody ¶
func ParseBGPBody(h *BGPHeader, data []byte) (*BGPMessage, error)
func ParseBGPMessage ¶
func ParseBGPMessage(data []byte) (*BGPMessage, error)
func (*BGPMessage) Serialize ¶
func (msg *BGPMessage) Serialize() ([]byte, error)
type BGPNotification ¶
func (*BGPNotification) DecodeFromBytes ¶
func (msg *BGPNotification) DecodeFromBytes(data []byte) error
func (*BGPNotification) Serialize ¶
func (msg *BGPNotification) Serialize() ([]byte, error)
type BGPOpen ¶
type BGPOpen struct { Version uint8 MyAS uint16 HoldTime uint16 ID net.IP OptParamLen uint8 OptParams []OptionParameterInterface }
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 { WithdrawnRoutesLen uint16 WithdrawnRoutes []*IPAddrPrefix TotalPathAttributeLen uint16 PathAttributes []PathAttributeInterface NLRI []*IPAddrPrefix }
func (*BGPUpdate) DecodeFromBytes ¶
func (*BGPUpdate) IsEndOfRib ¶
func (msg *BGPUpdate) IsEndOfRib() (bool, RouteFamily)
type CapAddPath ¶
type CapAddPath struct { DefaultParameterCapability RouteFamily RouteFamily Mode BGPAddPathMode }
func NewCapAddPath ¶
func NewCapAddPath(rf RouteFamily, mode BGPAddPathMode) *CapAddPath
func (*CapAddPath) DecodeFromBytes ¶
func (c *CapAddPath) DecodeFromBytes(data []byte) error
func (*CapAddPath) MarshalJSON ¶
func (c *CapAddPath) MarshalJSON() ([]byte, error)
func (*CapAddPath) Serialize ¶
func (c *CapAddPath) Serialize() ([]byte, error)
type CapCarryingLabelInfo ¶
type CapCarryingLabelInfo struct {
DefaultParameterCapability
}
type CapEnhancedRouteRefresh ¶
type CapEnhancedRouteRefresh struct {
DefaultParameterCapability
}
func NewCapEnhancedRouteRefresh ¶
func NewCapEnhancedRouteRefresh() *CapEnhancedRouteRefresh
type CapFourOctetASNumber ¶
type CapFourOctetASNumber struct { DefaultParameterCapability CapValue uint32 }
func NewCapFourOctetASNumber ¶
func NewCapFourOctetASNumber(asnum uint32) *CapFourOctetASNumber
func (*CapFourOctetASNumber) DecodeFromBytes ¶
func (c *CapFourOctetASNumber) DecodeFromBytes(data []byte) error
func (*CapFourOctetASNumber) MarshalJSON ¶
func (c *CapFourOctetASNumber) MarshalJSON() ([]byte, error)
func (*CapFourOctetASNumber) Serialize ¶
func (c *CapFourOctetASNumber) Serialize() ([]byte, error)
type CapGracefulRestart ¶
type CapGracefulRestart struct { DefaultParameterCapability Flags uint8 Time uint16 Tuples []*CapGracefulRestartTuple }
func NewCapGracefulRestart ¶
func NewCapGracefulRestart(restarting bool, time uint16, tuples []*CapGracefulRestartTuple) *CapGracefulRestart
func (*CapGracefulRestart) DecodeFromBytes ¶
func (c *CapGracefulRestart) DecodeFromBytes(data []byte) error
func (*CapGracefulRestart) MarshalJSON ¶
func (c *CapGracefulRestart) MarshalJSON() ([]byte, error)
func (*CapGracefulRestart) Serialize ¶
func (c *CapGracefulRestart) Serialize() ([]byte, error)
type CapGracefulRestartTuple ¶
func NewCapGracefulRestartTuple ¶
func NewCapGracefulRestartTuple(rf RouteFamily, forward bool) *CapGracefulRestartTuple
func (*CapGracefulRestartTuple) MarshalJSON ¶
func (c *CapGracefulRestartTuple) MarshalJSON() ([]byte, error)
type CapMultiProtocol ¶
type CapMultiProtocol struct { DefaultParameterCapability CapValue RouteFamily }
func NewCapMultiProtocol ¶
func NewCapMultiProtocol(rf RouteFamily) *CapMultiProtocol
func (*CapMultiProtocol) DecodeFromBytes ¶
func (c *CapMultiProtocol) DecodeFromBytes(data []byte) error
func (*CapMultiProtocol) MarshalJSON ¶
func (c *CapMultiProtocol) MarshalJSON() ([]byte, error)
func (*CapMultiProtocol) Serialize ¶
func (c *CapMultiProtocol) Serialize() ([]byte, error)
type CapRouteRefresh ¶
type CapRouteRefresh struct {
DefaultParameterCapability
}
func NewCapRouteRefresh ¶
func NewCapRouteRefresh() *CapRouteRefresh
type CapRouteRefreshCisco ¶
type CapRouteRefreshCisco struct {
DefaultParameterCapability
}
func NewCapRouteRefreshCisco ¶
func NewCapRouteRefreshCisco() *CapRouteRefreshCisco
type CapUnknown ¶
type CapUnknown struct {
DefaultParameterCapability
}
type ColorExtended ¶
type ColorExtended struct {
Value uint32
}
func (*ColorExtended) Serialize ¶
func (e *ColorExtended) Serialize() ([]byte, error)
func (*ColorExtended) String ¶
func (e *ColorExtended) String() string
type DefaultAsPath ¶
type DefaultAsPath struct { }
type DefaultOpaqueExtendedValue ¶
type DefaultOpaqueExtendedValue struct {
Value []byte
}
func (*DefaultOpaqueExtendedValue) Serialize ¶
func (v *DefaultOpaqueExtendedValue) Serialize() ([]byte, error)
func (*DefaultOpaqueExtendedValue) String ¶
func (v *DefaultOpaqueExtendedValue) String() string
type DefaultParameterCapability ¶
type DefaultParameterCapability struct { CapCode BGPCapabilityCode `json:"code"` CapLen uint8 `json:"-"` CapValue []byte `json:"value,omitempty"` }
func (*DefaultParameterCapability) Code ¶
func (c *DefaultParameterCapability) Code() BGPCapabilityCode
func (*DefaultParameterCapability) DecodeFromBytes ¶
func (c *DefaultParameterCapability) DecodeFromBytes(data []byte) error
func (*DefaultParameterCapability) Len ¶
func (c *DefaultParameterCapability) Len() int
func (*DefaultParameterCapability) Serialize ¶
func (c *DefaultParameterCapability) Serialize() ([]byte, error)
type DefaultPmsiTunnelID ¶
type DefaultPmsiTunnelID struct {
Value []byte
}
func (*DefaultPmsiTunnelID) Serialize ¶
func (i *DefaultPmsiTunnelID) Serialize() ([]byte, error)
func (*DefaultPmsiTunnelID) String ¶
func (i *DefaultPmsiTunnelID) String() string
type DefaultRouteDistinguisher ¶
func (*DefaultRouteDistinguisher) DecodeFromBytes ¶
func (rd *DefaultRouteDistinguisher) DecodeFromBytes(data []byte) error
func (*DefaultRouteDistinguisher) Len ¶
func (rd *DefaultRouteDistinguisher) Len() int
func (*DefaultRouteDistinguisher) MarshalJSON ¶
func (rd *DefaultRouteDistinguisher) MarshalJSON() ([]byte, error)
func (*DefaultRouteDistinguisher) Serialize ¶
func (rd *DefaultRouteDistinguisher) Serialize() ([]byte, error)
func (*DefaultRouteDistinguisher) String ¶
func (rd *DefaultRouteDistinguisher) String() string
type ESILabelExtended ¶
func NewESILabelExtended ¶
func NewESILabelExtended(label uint32, isSingleActive bool) *ESILabelExtended
func (*ESILabelExtended) Flat ¶
func (e *ESILabelExtended) Flat() map[string]string
func (*ESILabelExtended) GetTypes ¶
func (e *ESILabelExtended) GetTypes() (ExtendedCommunityAttrType, ExtendedCommunityAttrSubType)
func (*ESILabelExtended) MarshalJSON ¶
func (e *ESILabelExtended) MarshalJSON() ([]byte, error)
func (*ESILabelExtended) Serialize ¶
func (e *ESILabelExtended) Serialize() ([]byte, error)
func (*ESILabelExtended) String ¶
func (e *ESILabelExtended) String() string
type ESImportRouteTarget ¶
type ESImportRouteTarget struct {
ESImport net.HardwareAddr
}
func NewESImportRouteTarget ¶
func NewESImportRouteTarget(mac string) *ESImportRouteTarget
func (*ESImportRouteTarget) Flat ¶
func (e *ESImportRouteTarget) Flat() map[string]string
func (*ESImportRouteTarget) GetTypes ¶
func (e *ESImportRouteTarget) GetTypes() (ExtendedCommunityAttrType, ExtendedCommunityAttrSubType)
func (*ESImportRouteTarget) MarshalJSON ¶
func (e *ESImportRouteTarget) MarshalJSON() ([]byte, error)
func (*ESImportRouteTarget) Serialize ¶
func (e *ESImportRouteTarget) Serialize() ([]byte, error)
func (*ESImportRouteTarget) String ¶
func (e *ESImportRouteTarget) String() string
type EVPNEthernetAutoDiscoveryRoute ¶
type EVPNEthernetAutoDiscoveryRoute struct { RD RouteDistinguisherInterface ESI EthernetSegmentIdentifier ETag uint32 Label uint32 }
func (*EVPNEthernetAutoDiscoveryRoute) DecodeFromBytes ¶
func (er *EVPNEthernetAutoDiscoveryRoute) DecodeFromBytes(data []byte) error
func (*EVPNEthernetAutoDiscoveryRoute) MarshalJSON ¶
func (er *EVPNEthernetAutoDiscoveryRoute) MarshalJSON() ([]byte, error)
func (*EVPNEthernetAutoDiscoveryRoute) Serialize ¶
func (er *EVPNEthernetAutoDiscoveryRoute) Serialize() ([]byte, error)
func (*EVPNEthernetAutoDiscoveryRoute) String ¶
func (er *EVPNEthernetAutoDiscoveryRoute) String() string
type EVPNEthernetSegmentRoute ¶
type EVPNEthernetSegmentRoute struct { RD RouteDistinguisherInterface ESI EthernetSegmentIdentifier IPAddressLength uint8 IPAddress net.IP }
func (*EVPNEthernetSegmentRoute) DecodeFromBytes ¶
func (er *EVPNEthernetSegmentRoute) DecodeFromBytes(data []byte) error
func (*EVPNEthernetSegmentRoute) MarshalJSON ¶
func (er *EVPNEthernetSegmentRoute) MarshalJSON() ([]byte, error)
func (*EVPNEthernetSegmentRoute) Serialize ¶
func (er *EVPNEthernetSegmentRoute) Serialize() ([]byte, error)
func (*EVPNEthernetSegmentRoute) String ¶
func (er *EVPNEthernetSegmentRoute) String() string
type EVPNMacIPAdvertisementRoute ¶
type EVPNMacIPAdvertisementRoute struct { RD RouteDistinguisherInterface ESI EthernetSegmentIdentifier ETag uint32 MacAddressLength uint8 MacAddress net.HardwareAddr IPAddressLength uint8 IPAddress net.IP Labels []uint32 }
func (*EVPNMacIPAdvertisementRoute) DecodeFromBytes ¶
func (er *EVPNMacIPAdvertisementRoute) DecodeFromBytes(data []byte) error
func (*EVPNMacIPAdvertisementRoute) MarshalJSON ¶
func (er *EVPNMacIPAdvertisementRoute) MarshalJSON() ([]byte, error)
func (*EVPNMacIPAdvertisementRoute) Serialize ¶
func (er *EVPNMacIPAdvertisementRoute) Serialize() ([]byte, error)
func (*EVPNMacIPAdvertisementRoute) String ¶
func (er *EVPNMacIPAdvertisementRoute) String() string
type EVPNMulticastEthernetTagRoute ¶
type EVPNMulticastEthernetTagRoute struct { RD RouteDistinguisherInterface ETag uint32 IPAddressLength uint8 IPAddress net.IP }
func (*EVPNMulticastEthernetTagRoute) DecodeFromBytes ¶
func (er *EVPNMulticastEthernetTagRoute) DecodeFromBytes(data []byte) error
func (*EVPNMulticastEthernetTagRoute) MarshalJSON ¶
func (er *EVPNMulticastEthernetTagRoute) MarshalJSON() ([]byte, error)
func (*EVPNMulticastEthernetTagRoute) Serialize ¶
func (er *EVPNMulticastEthernetTagRoute) Serialize() ([]byte, error)
func (*EVPNMulticastEthernetTagRoute) String ¶
func (er *EVPNMulticastEthernetTagRoute) String() string
type EVPNNLRI ¶
type EVPNNLRI struct { RouteType uint8 Length uint8 RouteTypeData EVPNRouteTypeInterface }
func NewEVPNNLRI ¶
func NewEVPNNLRI(routetype uint8, length uint8, routetypedata EVPNRouteTypeInterface) *EVPNNLRI
func (*EVPNNLRI) DecodeFromBytes ¶
func (*EVPNNLRI) MarshalJSON ¶
func (*EVPNNLRI) RD ¶
func (n *EVPNNLRI) RD() RouteDistinguisherInterface
type EVPNRouteTypeInterface ¶
type EncapExtended ¶
type EncapExtended struct {
TunnelType TunnelType
}
func (*EncapExtended) Serialize ¶
func (e *EncapExtended) Serialize() ([]byte, error)
func (*EncapExtended) String ¶
func (e *EncapExtended) String() string
type EncapNLRI ¶
type EncapNLRI struct { IPAddrPrefixDefault // contains filtered or unexported fields }
func NewEncapNLRI ¶
func (*EncapNLRI) DecodeFromBytes ¶
type EncapSubTLVType ¶
type EncapSubTLVType uint8
const ( ENCAP_SUBTLV_TYPE_ENCAPSULATION EncapSubTLVType = 1 ENCAP_SUBTLV_TYPE_PROTOCOL EncapSubTLVType = 2 ENCAP_SUBTLV_TYPE_COLOR EncapSubTLVType = 4 )
type Encapv6NLRI ¶
type Encapv6NLRI struct {
EncapNLRI
}
func NewEncapv6NLRI ¶
func NewEncapv6NLRI(endpoint string) *Encapv6NLRI
func (*Encapv6NLRI) AFI ¶
func (n *Encapv6NLRI) AFI() uint16
type EthernetSegmentIdentifier ¶
func (*EthernetSegmentIdentifier) DecodeFromBytes ¶
func (esi *EthernetSegmentIdentifier) DecodeFromBytes(data []byte) error
func (*EthernetSegmentIdentifier) Serialize ¶
func (esi *EthernetSegmentIdentifier) Serialize() ([]byte, error)
func (*EthernetSegmentIdentifier) String ¶
func (esi *EthernetSegmentIdentifier) String() string
type EthernetType ¶
type EthernetType int
const ( IPv4 EthernetType = 0x0800 ARP EthernetType = 0x0806 RARP EthernetType = 0x8035 VMTP EthernetType = 0x805B APPLE_TALK EthernetType = 0x809B AARP EthernetType = 0x80F3 IPX EthernetType = 0x8137 SNMP EthernetType = 0x814C NET_BIOS EthernetType = 0x8191 XTP EthernetType = 0x817D IPv6 EthernetType = 0x86DD PPPoE_DISCOVERY EthernetType = 0x8863 PPPoE_SESSION EthernetType = 0x8864 LOOPBACK EthernetType = 0x9000 )
func (EthernetType) String ¶
func (t EthernetType) String() string
type ExtendedCommunityAttrSubType ¶
type ExtendedCommunityAttrSubType uint8
RFC7153 5.2. Registraction for the "Sub-Type" Field RANGE REGISTRACTION PROCEDURES 0x00-0xBF First Come First Served 0xC0-0xFF IETF Review
const ( EC_SUBTYPE_ROUTE_TARGET ExtendedCommunityAttrSubType = 0x02 // EC_TYPE: 0x00, 0x01, 0x02 EC_SUBTYPE_ROUTE_ORIGIN ExtendedCommunityAttrSubType = 0x03 // EC_TYPE: 0x00, 0x01, 0x02 EC_SUBTYPE_LINK_BANDWIDTH ExtendedCommunityAttrSubType = 0x04 // EC_TYPE: 0x40 EC_SUBTYPE_GENERIC ExtendedCommunityAttrSubType = 0x04 // EC_TYPE: 0x02, 0x42 EC_SUBTYPE_OSPF_DOMAIN_ID ExtendedCommunityAttrSubType = 0x05 // EC_TYPE: 0x00, 0x01, 0x02 EC_SUBTYPE_OSPF_ROUTE_ID ExtendedCommunityAttrSubType = 0x07 // EC_TYPE: 0x01 EC_SUBTYPE_BGP_DATA_COLLECTION ExtendedCommunityAttrSubType = 0x08 // EC_TYPE: 0x00, 0x02 EC_SUBTYPE_SOURCE_AS ExtendedCommunityAttrSubType = 0x09 // EC_TYPE: 0x00, 0x02 EC_SUBTYPE_L2VPN_ID ExtendedCommunityAttrSubType = 0x0A // EC_TYPE: 0x00, 0x01 EC_SUBTYPE_VRF_ROUTE_IMPORT ExtendedCommunityAttrSubType = 0x0B // EC_TYPE: 0x01 EC_SUBTYPE_CISCO_VPN_DISTINGUISHER ExtendedCommunityAttrSubType = 0x10 // EC_TYPE: 0x00, 0x01, 0x02 EC_SUBTYPE_OSPF_ROUTE_TYPE ExtendedCommunityAttrSubType = 0x06 // EC_TYPE: 0x03 EC_SUBTYPE_COLOR ExtendedCommunityAttrSubType = 0x0B // EC_TYPE: 0x03 EC_SUBTYPE_ENCAPSULATION ExtendedCommunityAttrSubType = 0x0C // EC_TYPE: 0x03 EC_SUBTYPE_DEFAULT_GATEWAY ExtendedCommunityAttrSubType = 0x0D // EC_TYPE: 0x03 EC_SUBTYPE_ORIGIN_VALIDATION ExtendedCommunityAttrSubType = 0x00 // EC_TYPE: 0x43 EC_SUBTYPE_FLOWSPEC_TRAFFIC_RATE ExtendedCommunityAttrSubType = 0x06 // EC_TYPE: 0x80 EC_SUBTYPE_FLOWSPEC_TRAFFIC_ACTION ExtendedCommunityAttrSubType = 0x07 // EC_TYPE: 0x80 EC_SUBTYPE_FLOWSPEC_REDIRECT ExtendedCommunityAttrSubType = 0x08 // EC_TYPE: 0x80 EC_SUBTYPE_FLOWSPEC_TRAFFIC_REMARK ExtendedCommunityAttrSubType = 0x09 // EC_TYPE: 0x80 EC_SUBTYPE_L2_INFO ExtendedCommunityAttrSubType = 0x0A // EC_TYPE: 0x80 EC_SUBTYPE_MAC_MOBILITY ExtendedCommunityAttrSubType = 0x00 // EC_TYPE: 0x06 EC_SUBTYPE_ESI_LABEL ExtendedCommunityAttrSubType = 0x01 // EC_TYPE: 0x06 EC_SUBTYPE_ES_IMPORT ExtendedCommunityAttrSubType = 0x02 // EC_TYPE: 0x06 EC_SUBTYPE_UUID_BASED_RT ExtendedCommunityAttrSubType = 0x11 )
type ExtendedCommunityAttrType ¶
type ExtendedCommunityAttrType uint8
RFC7153 5.1. Registries for the "Type" Field RANGE REGISTRACTION PROCEDURES 0x00-0x3F Transitive First Come First Served 0x40-0x7F Non-Transitive First Come First Served 0x80-0x8F Transitive Experimental Use 0x90-0xBF Transitive Standards Action 0xC0-0xCF Non-Transitive Experimental Use 0xD0-0xFF Non-Transitive Standards Action
const ( EC_TYPE_TRANSITIVE_TWO_OCTET_AS_SPECIFIC ExtendedCommunityAttrType = 0x00 EC_TYPE_TRANSITIVE_IP4_SPECIFIC ExtendedCommunityAttrType = 0x01 EC_TYPE_TRANSITIVE_FOUR_OCTET_AS_SPECIFIC ExtendedCommunityAttrType = 0x02 EC_TYPE_TRANSITIVE_OPAQUE ExtendedCommunityAttrType = 0x03 EC_TYPE_TRANSITIVE_QOS_MARKING ExtendedCommunityAttrType = 0x04 EC_TYPE_COS_CAPABILITY ExtendedCommunityAttrType = 0x05 EC_TYPE_EVPN ExtendedCommunityAttrType = 0x06 EC_TYPE_FLOWSPEC_REDIRECT_MIRROR ExtendedCommunityAttrType = 0x08 EC_TYPE_NON_TRANSITIVE_TWO_OCTET_AS_SPECIFIC ExtendedCommunityAttrType = 0x40 EC_TYPE_NON_TRANSITIVE_IP4_SPECIFIC ExtendedCommunityAttrType = 0x41 EC_TYPE_NON_TRANSITIVE_FOUR_OCTET_AS_SPECIFIC ExtendedCommunityAttrType = 0x42 EC_TYPE_NON_TRANSITIVE_OPAQUE ExtendedCommunityAttrType = 0x43 EC_TYPE_NON_TRANSITIVE_QOS_MARKING ExtendedCommunityAttrType = 0x44 EC_TYPE_GENERIC_TRANSITIVE_EXPERIMENTAL ExtendedCommunityAttrType = 0x80 EC_TYPE_GENERIC_TRANSITIVE_EXPERIMENTAL2 ExtendedCommunityAttrType = 0x81 // RFC7674 EC_TYPE_GENERIC_TRANSITIVE_EXPERIMENTAL3 ExtendedCommunityAttrType = 0x82 // RFC7674 )
type ExtendedCommunityInterface ¶
type ExtendedCommunityInterface interface { Serialize() ([]byte, error) String() string GetTypes() (ExtendedCommunityAttrType, ExtendedCommunityAttrSubType) MarshalJSON() ([]byte, error) Flat() map[string]string }
func ParseExtended ¶
func ParseExtended(data []byte) (ExtendedCommunityInterface, error)
func ParseExtendedCommunity ¶
func ParseExtendedCommunity(subtype ExtendedCommunityAttrSubType, com string) (ExtendedCommunityInterface, error)
func ParseRouteTarget ¶
func ParseRouteTarget(rt string) (ExtendedCommunityInterface, error)
type FlowSpecComponent ¶
type FlowSpecComponent struct { Items []*FlowSpecComponentItem // contains filtered or unexported fields }
func NewFlowSpecComponent ¶
func NewFlowSpecComponent(type_ BGPFlowSpecType, items []*FlowSpecComponentItem) *FlowSpecComponent
func (*FlowSpecComponent) DecodeFromBytes ¶
func (p *FlowSpecComponent) DecodeFromBytes(data []byte) error
func (*FlowSpecComponent) Len ¶
func (p *FlowSpecComponent) Len() int
func (*FlowSpecComponent) MarshalJSON ¶
func (p *FlowSpecComponent) MarshalJSON() ([]byte, error)
func (*FlowSpecComponent) Serialize ¶
func (p *FlowSpecComponent) Serialize() ([]byte, error)
func (*FlowSpecComponent) String ¶
func (p *FlowSpecComponent) String() string
func (*FlowSpecComponent) Type ¶
func (p *FlowSpecComponent) Type() BGPFlowSpecType
type FlowSpecComponentInterface ¶
type FlowSpecComponentInterface interface { DecodeFromBytes([]byte) error Serialize() ([]byte, error) Len() int Type() BGPFlowSpecType String() string }
func ParseFlowSpecComponents ¶
func ParseFlowSpecComponents(rf RouteFamily, input string) ([]FlowSpecComponentInterface, error)
type FlowSpecComponentItem ¶
func NewFlowSpecComponentItem ¶
func NewFlowSpecComponentItem(op int, value int) *FlowSpecComponentItem
func (*FlowSpecComponentItem) Len ¶
func (v *FlowSpecComponentItem) Len() int
func (*FlowSpecComponentItem) Serialize ¶
func (v *FlowSpecComponentItem) Serialize() ([]byte, error)
type FlowSpecDestinationMac ¶
type FlowSpecDestinationMac struct {
// contains filtered or unexported fields
}
func NewFlowSpecDestinationMac ¶
func NewFlowSpecDestinationMac(mac net.HardwareAddr) *FlowSpecDestinationMac
func (*FlowSpecDestinationMac) DecodeFromBytes ¶
func (*FlowSpecDestinationMac) MarshalJSON ¶
func (*FlowSpecDestinationMac) Type ¶
func (p *FlowSpecDestinationMac) Type() BGPFlowSpecType
type FlowSpecDestinationPrefix ¶
type FlowSpecDestinationPrefix struct {
// contains filtered or unexported fields
}
func NewFlowSpecDestinationPrefix ¶
func NewFlowSpecDestinationPrefix(prefix AddrPrefixInterface) *FlowSpecDestinationPrefix
func (*FlowSpecDestinationPrefix) DecodeFromBytes ¶
func (*FlowSpecDestinationPrefix) MarshalJSON ¶
func (*FlowSpecDestinationPrefix) Type ¶
func (p *FlowSpecDestinationPrefix) Type() BGPFlowSpecType
type FlowSpecDestinationPrefix6 ¶
type FlowSpecDestinationPrefix6 struct {
// contains filtered or unexported fields
}
func NewFlowSpecDestinationPrefix6 ¶
func NewFlowSpecDestinationPrefix6(prefix AddrPrefixInterface, offset uint8) *FlowSpecDestinationPrefix6
func (*FlowSpecDestinationPrefix6) DecodeFromBytes ¶
draft-ietf-idr-flow-spec-v6-06 <type (1 octet), prefix length (1 octet), prefix offset(1 octet), prefix>
func (*FlowSpecDestinationPrefix6) MarshalJSON ¶
func (*FlowSpecDestinationPrefix6) Type ¶
func (p *FlowSpecDestinationPrefix6) Type() BGPFlowSpecType
type FlowSpecIPv4Unicast ¶
type FlowSpecIPv4Unicast struct {
FlowSpecNLRI
}
func NewFlowSpecIPv4Unicast ¶
func NewFlowSpecIPv4Unicast(value []FlowSpecComponentInterface) *FlowSpecIPv4Unicast
func (*FlowSpecIPv4Unicast) DecodeFromBytes ¶
func (n *FlowSpecIPv4Unicast) DecodeFromBytes(data []byte) error
func (*FlowSpecIPv4Unicast) Flat ¶
func (l *FlowSpecIPv4Unicast) Flat() map[string]string
type FlowSpecIPv4VPN ¶
type FlowSpecIPv4VPN struct {
FlowSpecNLRI
}
func NewFlowSpecIPv4VPN ¶
func NewFlowSpecIPv4VPN(rd RouteDistinguisherInterface, value []FlowSpecComponentInterface) *FlowSpecIPv4VPN
func (*FlowSpecIPv4VPN) DecodeFromBytes ¶
func (n *FlowSpecIPv4VPN) DecodeFromBytes(data []byte) error
func (*FlowSpecIPv4VPN) Flat ¶
func (l *FlowSpecIPv4VPN) Flat() map[string]string
type FlowSpecIPv6Unicast ¶
type FlowSpecIPv6Unicast struct {
FlowSpecNLRI
}
func NewFlowSpecIPv6Unicast ¶
func NewFlowSpecIPv6Unicast(value []FlowSpecComponentInterface) *FlowSpecIPv6Unicast
func (*FlowSpecIPv6Unicast) DecodeFromBytes ¶
func (n *FlowSpecIPv6Unicast) DecodeFromBytes(data []byte) error
func (*FlowSpecIPv6Unicast) Flat ¶
func (l *FlowSpecIPv6Unicast) Flat() map[string]string
type FlowSpecIPv6VPN ¶
type FlowSpecIPv6VPN struct {
FlowSpecNLRI
}
func NewFlowSpecIPv6VPN ¶
func NewFlowSpecIPv6VPN(rd RouteDistinguisherInterface, value []FlowSpecComponentInterface) *FlowSpecIPv6VPN
func (*FlowSpecIPv6VPN) DecodeFromBytes ¶
func (n *FlowSpecIPv6VPN) DecodeFromBytes(data []byte) error
func (*FlowSpecIPv6VPN) Flat ¶
func (l *FlowSpecIPv6VPN) Flat() map[string]string
type FlowSpecL2VPN ¶
type FlowSpecL2VPN struct {
FlowSpecNLRI
}
func NewFlowSpecL2VPN ¶
func NewFlowSpecL2VPN(rd RouteDistinguisherInterface, value []FlowSpecComponentInterface) *FlowSpecL2VPN
func (*FlowSpecL2VPN) DecodeFromBytes ¶
func (n *FlowSpecL2VPN) DecodeFromBytes(data []byte) error
func (*FlowSpecL2VPN) Flat ¶
func (l *FlowSpecL2VPN) Flat() map[string]string
type FlowSpecNLRI ¶
type FlowSpecNLRI struct { Value []FlowSpecComponentInterface // contains filtered or unexported fields }
func (*FlowSpecNLRI) AFI ¶
func (n *FlowSpecNLRI) AFI() uint16
func (*FlowSpecNLRI) Len ¶
func (n *FlowSpecNLRI) Len() int
func (*FlowSpecNLRI) MarshalJSON ¶
func (n *FlowSpecNLRI) MarshalJSON() ([]byte, error)
func (*FlowSpecNLRI) RD ¶
func (n *FlowSpecNLRI) RD() RouteDistinguisherInterface
func (*FlowSpecNLRI) SAFI ¶
func (n *FlowSpecNLRI) SAFI() uint8
func (*FlowSpecNLRI) Serialize ¶
func (n *FlowSpecNLRI) Serialize() ([]byte, error)
func (*FlowSpecNLRI) String ¶
func (n *FlowSpecNLRI) String() string
type FlowSpecSourceMac ¶
type FlowSpecSourceMac struct {
// contains filtered or unexported fields
}
func NewFlowSpecSourceMac ¶
func NewFlowSpecSourceMac(mac net.HardwareAddr) *FlowSpecSourceMac
func (*FlowSpecSourceMac) DecodeFromBytes ¶
func (*FlowSpecSourceMac) MarshalJSON ¶
func (*FlowSpecSourceMac) Type ¶
func (p *FlowSpecSourceMac) Type() BGPFlowSpecType
type FlowSpecSourcePrefix ¶
type FlowSpecSourcePrefix struct {
// contains filtered or unexported fields
}
func NewFlowSpecSourcePrefix ¶
func NewFlowSpecSourcePrefix(prefix AddrPrefixInterface) *FlowSpecSourcePrefix
func (*FlowSpecSourcePrefix) DecodeFromBytes ¶
func (*FlowSpecSourcePrefix) MarshalJSON ¶
func (*FlowSpecSourcePrefix) Type ¶
func (p *FlowSpecSourcePrefix) Type() BGPFlowSpecType
type FlowSpecSourcePrefix6 ¶
type FlowSpecSourcePrefix6 struct {
// contains filtered or unexported fields
}
func NewFlowSpecSourcePrefix6 ¶
func NewFlowSpecSourcePrefix6(prefix AddrPrefixInterface, offset uint8) *FlowSpecSourcePrefix6
func (*FlowSpecSourcePrefix6) DecodeFromBytes ¶
draft-ietf-idr-flow-spec-v6-06 <type (1 octet), prefix length (1 octet), prefix offset(1 octet), prefix>
func (*FlowSpecSourcePrefix6) MarshalJSON ¶
func (*FlowSpecSourcePrefix6) Type ¶
func (p *FlowSpecSourcePrefix6) Type() BGPFlowSpecType
type FlowSpecUnknown ¶
type FlowSpecUnknown struct {
Value []byte
}
func (*FlowSpecUnknown) DecodeFromBytes ¶
func (p *FlowSpecUnknown) DecodeFromBytes(data []byte) error
func (*FlowSpecUnknown) Len ¶
func (p *FlowSpecUnknown) Len() int
func (*FlowSpecUnknown) MarshalJSON ¶
func (p *FlowSpecUnknown) MarshalJSON() ([]byte, error)
func (*FlowSpecUnknown) Serialize ¶
func (p *FlowSpecUnknown) Serialize() ([]byte, error)
func (*FlowSpecUnknown) String ¶
func (p *FlowSpecUnknown) String() string
func (*FlowSpecUnknown) Type ¶
func (p *FlowSpecUnknown) Type() BGPFlowSpecType
type FourOctetAsSpecificExtended ¶
type FourOctetAsSpecificExtended struct { SubType ExtendedCommunityAttrSubType AS uint32 LocalAdmin uint16 IsTransitive bool }
func NewFourOctetAsSpecificExtended ¶
func NewFourOctetAsSpecificExtended(subtype ExtendedCommunityAttrSubType, as uint32, localAdmin uint16, isTransitive bool) *FourOctetAsSpecificExtended
func (*FourOctetAsSpecificExtended) Flat ¶
func (e *FourOctetAsSpecificExtended) Flat() map[string]string
func (*FourOctetAsSpecificExtended) GetTypes ¶
func (e *FourOctetAsSpecificExtended) GetTypes() (ExtendedCommunityAttrType, ExtendedCommunityAttrSubType)
func (*FourOctetAsSpecificExtended) MarshalJSON ¶
func (e *FourOctetAsSpecificExtended) MarshalJSON() ([]byte, error)
func (*FourOctetAsSpecificExtended) Serialize ¶
func (e *FourOctetAsSpecificExtended) Serialize() ([]byte, error)
func (*FourOctetAsSpecificExtended) String ¶
func (e *FourOctetAsSpecificExtended) String() string
type IPAddrPrefix ¶
type IPAddrPrefix struct { IPAddrPrefixDefault // contains filtered or unexported fields }
func NewIPAddrPrefix ¶
func NewIPAddrPrefix(length uint8, prefix string) *IPAddrPrefix
func (*IPAddrPrefix) AFI ¶
func (r *IPAddrPrefix) AFI() uint16
func (*IPAddrPrefix) DecodeFromBytes ¶
func (r *IPAddrPrefix) DecodeFromBytes(data []byte) error
func (*IPAddrPrefix) SAFI ¶
func (r *IPAddrPrefix) SAFI() uint8
func (*IPAddrPrefix) Serialize ¶
func (r *IPAddrPrefix) Serialize() ([]byte, error)
type IPAddrPrefixDefault ¶
func (*IPAddrPrefixDefault) Flat ¶
func (p *IPAddrPrefixDefault) Flat() map[string]string
func (*IPAddrPrefixDefault) Len ¶
func (r *IPAddrPrefixDefault) Len() int
func (*IPAddrPrefixDefault) MarshalJSON ¶
func (r *IPAddrPrefixDefault) MarshalJSON() ([]byte, error)
func (*IPAddrPrefixDefault) String ¶
func (r *IPAddrPrefixDefault) String() string
type IPv4AddressSpecificExtended ¶
type IPv4AddressSpecificExtended struct { SubType ExtendedCommunityAttrSubType IPv4 net.IP LocalAdmin uint16 IsTransitive bool }
func NewIPv4AddressSpecificExtended ¶
func NewIPv4AddressSpecificExtended(subtype ExtendedCommunityAttrSubType, ip string, localAdmin uint16, isTransitive bool) *IPv4AddressSpecificExtended
func (*IPv4AddressSpecificExtended) Flat ¶
func (e *IPv4AddressSpecificExtended) Flat() map[string]string
func (*IPv4AddressSpecificExtended) GetTypes ¶
func (e *IPv4AddressSpecificExtended) GetTypes() (ExtendedCommunityAttrType, ExtendedCommunityAttrSubType)
func (*IPv4AddressSpecificExtended) MarshalJSON ¶
func (e *IPv4AddressSpecificExtended) MarshalJSON() ([]byte, error)
func (*IPv4AddressSpecificExtended) Serialize ¶
func (e *IPv4AddressSpecificExtended) Serialize() ([]byte, error)
func (*IPv4AddressSpecificExtended) String ¶
func (e *IPv4AddressSpecificExtended) String() string
type IPv6AddrPrefix ¶
type IPv6AddrPrefix struct {
IPAddrPrefix
}
func NewIPv6AddrPrefix ¶
func NewIPv6AddrPrefix(length uint8, prefix string) *IPv6AddrPrefix
func (*IPv6AddrPrefix) AFI ¶
func (r *IPv6AddrPrefix) AFI() uint16
func (*IPv6AddrPrefix) String ¶
func (r *IPv6AddrPrefix) String() string
type IngressReplTunnelID ¶
func (*IngressReplTunnelID) Serialize ¶
func (i *IngressReplTunnelID) Serialize() ([]byte, error)
func (*IngressReplTunnelID) String ¶
func (i *IngressReplTunnelID) String() string
type LabeledIPAddrPrefix ¶
type LabeledIPAddrPrefix struct { IPAddrPrefixDefault Labels MPLSLabelStack // contains filtered or unexported fields }
func NewLabeledIPAddrPrefix ¶
func NewLabeledIPAddrPrefix(length uint8, prefix string, label MPLSLabelStack) *LabeledIPAddrPrefix
func (*LabeledIPAddrPrefix) AFI ¶
func (r *LabeledIPAddrPrefix) AFI() uint16
func (*LabeledIPAddrPrefix) DecodeFromBytes ¶
func (l *LabeledIPAddrPrefix) DecodeFromBytes(data []byte) error
func (*LabeledIPAddrPrefix) SAFI ¶
func (r *LabeledIPAddrPrefix) SAFI() uint8
func (*LabeledIPAddrPrefix) Serialize ¶
func (l *LabeledIPAddrPrefix) Serialize() ([]byte, error)
func (*LabeledIPAddrPrefix) String ¶
func (l *LabeledIPAddrPrefix) String() string
type LabeledIPv6AddrPrefix ¶
type LabeledIPv6AddrPrefix struct {
LabeledIPAddrPrefix
}
func NewLabeledIPv6AddrPrefix ¶
func NewLabeledIPv6AddrPrefix(length uint8, prefix string, label MPLSLabelStack) *LabeledIPv6AddrPrefix
func (*LabeledIPv6AddrPrefix) AFI ¶
func (l *LabeledIPv6AddrPrefix) AFI() uint16
type LabeledVPNIPAddrPrefix ¶
type LabeledVPNIPAddrPrefix struct { IPAddrPrefixDefault Labels MPLSLabelStack RD RouteDistinguisherInterface // contains filtered or unexported fields }
func NewLabeledVPNIPAddrPrefix ¶
func NewLabeledVPNIPAddrPrefix(length uint8, prefix string, label MPLSLabelStack, rd RouteDistinguisherInterface) *LabeledVPNIPAddrPrefix
func (*LabeledVPNIPAddrPrefix) AFI ¶
func (l *LabeledVPNIPAddrPrefix) AFI() uint16
func (*LabeledVPNIPAddrPrefix) DecodeFromBytes ¶
func (l *LabeledVPNIPAddrPrefix) DecodeFromBytes(data []byte) error
func (*LabeledVPNIPAddrPrefix) Flat ¶
func (l *LabeledVPNIPAddrPrefix) Flat() map[string]string
func (*LabeledVPNIPAddrPrefix) MarshalJSON ¶
func (l *LabeledVPNIPAddrPrefix) MarshalJSON() ([]byte, error)
func (*LabeledVPNIPAddrPrefix) SAFI ¶
func (l *LabeledVPNIPAddrPrefix) SAFI() uint8
func (*LabeledVPNIPAddrPrefix) Serialize ¶
func (l *LabeledVPNIPAddrPrefix) Serialize() ([]byte, error)
func (*LabeledVPNIPAddrPrefix) String ¶
func (l *LabeledVPNIPAddrPrefix) String() string
type LabeledVPNIPv6AddrPrefix ¶
type LabeledVPNIPv6AddrPrefix struct {
LabeledVPNIPAddrPrefix
}
func NewLabeledVPNIPv6AddrPrefix ¶
func NewLabeledVPNIPv6AddrPrefix(length uint8, prefix string, label MPLSLabelStack, rd RouteDistinguisherInterface) *LabeledVPNIPv6AddrPrefix
func (*LabeledVPNIPv6AddrPrefix) AFI ¶
func (l *LabeledVPNIPv6AddrPrefix) AFI() uint16
type MPLSLabelStack ¶
type MPLSLabelStack struct {
Labels []uint32
}
func NewMPLSLabelStack ¶
func NewMPLSLabelStack(labels ...uint32) *MPLSLabelStack
func ParseMPLSLabelStack ¶
func ParseMPLSLabelStack(buf string) (*MPLSLabelStack, error)
func (*MPLSLabelStack) DecodeFromBytes ¶
func (l *MPLSLabelStack) DecodeFromBytes(data []byte) error
func (*MPLSLabelStack) Len ¶
func (l *MPLSLabelStack) Len() int
func (*MPLSLabelStack) Serialize ¶
func (l *MPLSLabelStack) Serialize() ([]byte, error)
func (*MPLSLabelStack) String ¶
func (l *MPLSLabelStack) String() string
type MacMobilityExtended ¶
func NewMacMobilityExtended ¶
func NewMacMobilityExtended(seq uint32, isSticky bool) *MacMobilityExtended
func (*MacMobilityExtended) Flat ¶
func (e *MacMobilityExtended) Flat() map[string]string
func (*MacMobilityExtended) GetTypes ¶
func (e *MacMobilityExtended) GetTypes() (ExtendedCommunityAttrType, ExtendedCommunityAttrSubType)
func (*MacMobilityExtended) MarshalJSON ¶
func (e *MacMobilityExtended) MarshalJSON() ([]byte, error)
func (*MacMobilityExtended) Serialize ¶
func (e *MacMobilityExtended) Serialize() ([]byte, error)
func (*MacMobilityExtended) String ¶
func (e *MacMobilityExtended) String() string
type MessageError ¶
func (*MessageError) Error ¶
func (e *MessageError) Error() string
type NotificationErrorCode ¶
type NotificationErrorCode uint16
func NewNotificationErrorCode ¶
func NewNotificationErrorCode(code, subcode uint8) NotificationErrorCode
func (NotificationErrorCode) String ¶
func (c NotificationErrorCode) String() string
type OpaqueExtended ¶
type OpaqueExtended struct { IsTransitive bool Value OpaqueExtendedValueInterface SubType ExtendedCommunityAttrSubType }
func NewOpaqueExtended ¶
func NewOpaqueExtended(isTransitive bool) *OpaqueExtended
func (*OpaqueExtended) DecodeFromBytes ¶
func (e *OpaqueExtended) DecodeFromBytes(data []byte) error
func (*OpaqueExtended) Flat ¶
func (e *OpaqueExtended) Flat() map[string]string
func (*OpaqueExtended) GetTypes ¶
func (e *OpaqueExtended) GetTypes() (ExtendedCommunityAttrType, ExtendedCommunityAttrSubType)
func (*OpaqueExtended) MarshalJSON ¶
func (e *OpaqueExtended) MarshalJSON() ([]byte, error)
func (*OpaqueExtended) Serialize ¶
func (e *OpaqueExtended) Serialize() ([]byte, error)
func (*OpaqueExtended) String ¶
func (e *OpaqueExtended) String() string
type OpaqueNLRI ¶
func NewOpaqueNLRI ¶
func NewOpaqueNLRI(key []byte) *OpaqueNLRI
func (*OpaqueNLRI) AFI ¶
func (n *OpaqueNLRI) AFI() uint16
func (*OpaqueNLRI) DecodeFromBytes ¶
func (n *OpaqueNLRI) DecodeFromBytes(data []byte) error
func (*OpaqueNLRI) Flat ¶
func (l *OpaqueNLRI) Flat() map[string]string
func (*OpaqueNLRI) Len ¶
func (n *OpaqueNLRI) Len() int
func (*OpaqueNLRI) MarshalJSON ¶
func (n *OpaqueNLRI) MarshalJSON() ([]byte, error)
func (*OpaqueNLRI) SAFI ¶
func (n *OpaqueNLRI) SAFI() uint8
func (*OpaqueNLRI) Serialize ¶
func (n *OpaqueNLRI) Serialize() ([]byte, error)
func (*OpaqueNLRI) String ¶
func (n *OpaqueNLRI) String() string
type OptionParameterCapability ¶
type OptionParameterCapability struct { ParamType uint8 ParamLen uint8 Capability []ParameterCapabilityInterface }
func NewOptionParameterCapability ¶
func NewOptionParameterCapability(capability []ParameterCapabilityInterface) *OptionParameterCapability
func (*OptionParameterCapability) DecodeFromBytes ¶
func (o *OptionParameterCapability) DecodeFromBytes(data []byte) error
func (*OptionParameterCapability) Serialize ¶
func (o *OptionParameterCapability) Serialize() ([]byte, error)
type OptionParameterUnknown ¶
func (*OptionParameterUnknown) Serialize ¶
func (o *OptionParameterUnknown) Serialize() ([]byte, error)
type ParameterCapabilityInterface ¶
type ParameterCapabilityInterface interface { DecodeFromBytes([]byte) error Serialize() ([]byte, error) Len() int Code() BGPCapabilityCode }
func DecodeCapability ¶
func DecodeCapability(data []byte) (ParameterCapabilityInterface, error)
type PathAttribute ¶
type PathAttribute struct { Flags BGPAttrFlag Type BGPAttrType Length uint16 Value []byte }
func (*PathAttribute) DecodeFromBytes ¶
func (p *PathAttribute) DecodeFromBytes(data []byte) error
func (*PathAttribute) Flat ¶
func (p *PathAttribute) Flat() map[string]string
func (*PathAttribute) GetFlags ¶
func (p *PathAttribute) GetFlags() BGPAttrFlag
func (*PathAttribute) GetType ¶
func (p *PathAttribute) GetType() BGPAttrType
func (*PathAttribute) Len ¶
func (p *PathAttribute) Len() int
func (*PathAttribute) MarshalJSON ¶
func (p *PathAttribute) MarshalJSON() ([]byte, error)
func (*PathAttribute) Serialize ¶
func (p *PathAttribute) Serialize() ([]byte, error)
func (*PathAttribute) String ¶
func (p *PathAttribute) String() string
type PathAttributeAggregator ¶
type PathAttributeAggregator struct { PathAttribute Value PathAttributeAggregatorParam }
func NewPathAttributeAggregator ¶
func NewPathAttributeAggregator(as interface{}, address string) *PathAttributeAggregator
func (*PathAttributeAggregator) DecodeFromBytes ¶
func (p *PathAttributeAggregator) DecodeFromBytes(data []byte) error
func (*PathAttributeAggregator) MarshalJSON ¶
func (p *PathAttributeAggregator) MarshalJSON() ([]byte, error)
func (*PathAttributeAggregator) Serialize ¶
func (p *PathAttributeAggregator) Serialize() ([]byte, error)
func (*PathAttributeAggregator) String ¶
func (p *PathAttributeAggregator) String() string
type PathAttributeAigp ¶
type PathAttributeAigp struct { PathAttribute Values []AigpTLV }
func NewPathAttributeAigp ¶
func NewPathAttributeAigp(values []AigpTLV) *PathAttributeAigp
func (*PathAttributeAigp) DecodeFromBytes ¶
func (p *PathAttributeAigp) DecodeFromBytes(data []byte) error
func (*PathAttributeAigp) MarshalJSON ¶
func (p *PathAttributeAigp) MarshalJSON() ([]byte, error)
func (*PathAttributeAigp) Serialize ¶
func (p *PathAttributeAigp) Serialize() ([]byte, error)
func (*PathAttributeAigp) String ¶
func (p *PathAttributeAigp) String() string
type PathAttributeAs4Aggregator ¶
type PathAttributeAs4Aggregator struct { PathAttribute Value PathAttributeAggregatorParam }
func NewPathAttributeAs4Aggregator ¶
func NewPathAttributeAs4Aggregator(as uint32, address string) *PathAttributeAs4Aggregator
func (*PathAttributeAs4Aggregator) DecodeFromBytes ¶
func (p *PathAttributeAs4Aggregator) DecodeFromBytes(data []byte) error
func (*PathAttributeAs4Aggregator) Serialize ¶
func (p *PathAttributeAs4Aggregator) Serialize() ([]byte, error)
type PathAttributeAs4Path ¶
type PathAttributeAs4Path struct { PathAttribute Value []*As4PathParam DefaultAsPath }
func NewPathAttributeAs4Path ¶
func NewPathAttributeAs4Path(value []*As4PathParam) *PathAttributeAs4Path
func (*PathAttributeAs4Path) DecodeFromBytes ¶
func (p *PathAttributeAs4Path) DecodeFromBytes(data []byte) error
func (*PathAttributeAs4Path) Serialize ¶
func (p *PathAttributeAs4Path) Serialize() ([]byte, error)
func (*PathAttributeAs4Path) String ¶
func (p *PathAttributeAs4Path) String() string
type PathAttributeAsPath ¶
type PathAttributeAsPath struct { DefaultAsPath PathAttribute Value []AsPathParamInterface }
func NewPathAttributeAsPath ¶
func NewPathAttributeAsPath(value []AsPathParamInterface) *PathAttributeAsPath
func (*PathAttributeAsPath) DecodeFromBytes ¶
func (p *PathAttributeAsPath) DecodeFromBytes(data []byte) error
func (*PathAttributeAsPath) MarshalJSON ¶
func (p *PathAttributeAsPath) MarshalJSON() ([]byte, error)
func (*PathAttributeAsPath) Serialize ¶
func (p *PathAttributeAsPath) Serialize() ([]byte, error)
func (*PathAttributeAsPath) String ¶
func (p *PathAttributeAsPath) String() string
type PathAttributeAtomicAggregate ¶
type PathAttributeAtomicAggregate struct {
PathAttribute
}
func NewPathAttributeAtomicAggregate ¶
func NewPathAttributeAtomicAggregate() *PathAttributeAtomicAggregate
func (*PathAttributeAtomicAggregate) MarshalJSON ¶
func (p *PathAttributeAtomicAggregate) MarshalJSON() ([]byte, error)
func (*PathAttributeAtomicAggregate) String ¶
func (p *PathAttributeAtomicAggregate) String() string
type PathAttributeClusterList ¶
type PathAttributeClusterList struct { PathAttribute Value []net.IP }
func NewPathAttributeClusterList ¶
func NewPathAttributeClusterList(value []string) *PathAttributeClusterList
func (*PathAttributeClusterList) DecodeFromBytes ¶
func (p *PathAttributeClusterList) DecodeFromBytes(data []byte) error
func (*PathAttributeClusterList) MarshalJSON ¶
func (p *PathAttributeClusterList) MarshalJSON() ([]byte, error)
func (*PathAttributeClusterList) Serialize ¶
func (p *PathAttributeClusterList) Serialize() ([]byte, error)
func (*PathAttributeClusterList) String ¶
func (p *PathAttributeClusterList) String() string
type PathAttributeCommunities ¶
type PathAttributeCommunities struct { PathAttribute Value []uint32 }
func NewPathAttributeCommunities ¶
func NewPathAttributeCommunities(value []uint32) *PathAttributeCommunities
func (*PathAttributeCommunities) DecodeFromBytes ¶
func (p *PathAttributeCommunities) DecodeFromBytes(data []byte) error
func (*PathAttributeCommunities) MarshalJSON ¶
func (p *PathAttributeCommunities) MarshalJSON() ([]byte, error)
func (*PathAttributeCommunities) Serialize ¶
func (p *PathAttributeCommunities) Serialize() ([]byte, error)
func (*PathAttributeCommunities) String ¶
func (p *PathAttributeCommunities) String() string
type PathAttributeExtendedCommunities ¶
type PathAttributeExtendedCommunities struct { PathAttribute Value []ExtendedCommunityInterface }
func NewPathAttributeExtendedCommunities ¶
func NewPathAttributeExtendedCommunities(value []ExtendedCommunityInterface) *PathAttributeExtendedCommunities
func (*PathAttributeExtendedCommunities) DecodeFromBytes ¶
func (p *PathAttributeExtendedCommunities) DecodeFromBytes(data []byte) error
func (*PathAttributeExtendedCommunities) Flat ¶
func (p *PathAttributeExtendedCommunities) Flat() map[string]string
func (*PathAttributeExtendedCommunities) MarshalJSON ¶
func (p *PathAttributeExtendedCommunities) MarshalJSON() ([]byte, error)
func (*PathAttributeExtendedCommunities) Serialize ¶
func (p *PathAttributeExtendedCommunities) Serialize() ([]byte, error)
func (*PathAttributeExtendedCommunities) String ¶
func (p *PathAttributeExtendedCommunities) String() string
type PathAttributeInterface ¶
type PathAttributeInterface interface { DecodeFromBytes([]byte) error Serialize() ([]byte, error) Len() int GetFlags() BGPAttrFlag GetType() BGPAttrType String() string MarshalJSON() ([]byte, error) Flat() map[string]string }
func GetPathAttribute ¶
func GetPathAttribute(data []byte) (PathAttributeInterface, error)
type PathAttributeLocalPref ¶
type PathAttributeLocalPref struct { PathAttribute Value uint32 }
func NewPathAttributeLocalPref ¶
func NewPathAttributeLocalPref(value uint32) *PathAttributeLocalPref
func (*PathAttributeLocalPref) DecodeFromBytes ¶
func (p *PathAttributeLocalPref) DecodeFromBytes(data []byte) error
func (*PathAttributeLocalPref) MarshalJSON ¶
func (p *PathAttributeLocalPref) MarshalJSON() ([]byte, error)
func (*PathAttributeLocalPref) Serialize ¶
func (p *PathAttributeLocalPref) Serialize() ([]byte, error)
func (*PathAttributeLocalPref) String ¶
func (p *PathAttributeLocalPref) String() string
type PathAttributeMpReachNLRI ¶
type PathAttributeMpReachNLRI struct { PathAttribute Nexthop net.IP LinkLocalNexthop net.IP AFI uint16 SAFI uint8 Value []AddrPrefixInterface }
func NewPathAttributeMpReachNLRI ¶
func NewPathAttributeMpReachNLRI(nexthop string, nlri []AddrPrefixInterface) *PathAttributeMpReachNLRI
func (*PathAttributeMpReachNLRI) DecodeFromBytes ¶
func (p *PathAttributeMpReachNLRI) DecodeFromBytes(data []byte) error
func (*PathAttributeMpReachNLRI) MarshalJSON ¶
func (p *PathAttributeMpReachNLRI) MarshalJSON() ([]byte, error)
func (*PathAttributeMpReachNLRI) Serialize ¶
func (p *PathAttributeMpReachNLRI) Serialize() ([]byte, error)
func (*PathAttributeMpReachNLRI) String ¶
func (p *PathAttributeMpReachNLRI) String() string
type PathAttributeMpUnreachNLRI ¶
type PathAttributeMpUnreachNLRI struct { PathAttribute AFI uint16 SAFI uint8 Value []AddrPrefixInterface }
func NewPathAttributeMpUnreachNLRI ¶
func NewPathAttributeMpUnreachNLRI(nlri []AddrPrefixInterface) *PathAttributeMpUnreachNLRI
func (*PathAttributeMpUnreachNLRI) DecodeFromBytes ¶
func (p *PathAttributeMpUnreachNLRI) DecodeFromBytes(data []byte) error
func (*PathAttributeMpUnreachNLRI) Serialize ¶
func (p *PathAttributeMpUnreachNLRI) Serialize() ([]byte, error)
func (*PathAttributeMpUnreachNLRI) String ¶
func (p *PathAttributeMpUnreachNLRI) String() string
type PathAttributeMultiExitDisc ¶
type PathAttributeMultiExitDisc struct { PathAttribute Value uint32 }
func NewPathAttributeMultiExitDisc ¶
func NewPathAttributeMultiExitDisc(value uint32) *PathAttributeMultiExitDisc
func (*PathAttributeMultiExitDisc) DecodeFromBytes ¶
func (p *PathAttributeMultiExitDisc) DecodeFromBytes(data []byte) error
func (*PathAttributeMultiExitDisc) MarshalJSON ¶
func (p *PathAttributeMultiExitDisc) MarshalJSON() ([]byte, error)
func (*PathAttributeMultiExitDisc) Serialize ¶
func (p *PathAttributeMultiExitDisc) Serialize() ([]byte, error)
func (*PathAttributeMultiExitDisc) String ¶
func (p *PathAttributeMultiExitDisc) String() string
type PathAttributeNextHop ¶
type PathAttributeNextHop struct { PathAttribute Value net.IP }
func NewPathAttributeNextHop ¶
func NewPathAttributeNextHop(value string) *PathAttributeNextHop
func (*PathAttributeNextHop) DecodeFromBytes ¶
func (p *PathAttributeNextHop) DecodeFromBytes(data []byte) error
func (*PathAttributeNextHop) MarshalJSON ¶
func (p *PathAttributeNextHop) MarshalJSON() ([]byte, error)
func (*PathAttributeNextHop) Serialize ¶
func (p *PathAttributeNextHop) Serialize() ([]byte, error)
func (*PathAttributeNextHop) String ¶
func (p *PathAttributeNextHop) String() string
type PathAttributeOpaqueValue ¶
type PathAttributeOpaqueValue struct {
PathAttribute
}
func NewPathAttributeOpaqueValue ¶
func NewPathAttributeOpaqueValue(value []byte) *PathAttributeOpaqueValue
func (*PathAttributeOpaqueValue) MarshalJSON ¶
func (p *PathAttributeOpaqueValue) MarshalJSON() ([]byte, error)
func (*PathAttributeOpaqueValue) String ¶
func (p *PathAttributeOpaqueValue) String() string
type PathAttributeOrigin ¶
type PathAttributeOrigin struct {
PathAttribute
}
func NewPathAttributeOrigin ¶
func NewPathAttributeOrigin(value uint8) *PathAttributeOrigin
func (*PathAttributeOrigin) MarshalJSON ¶
func (p *PathAttributeOrigin) MarshalJSON() ([]byte, error)
func (*PathAttributeOrigin) String ¶
func (p *PathAttributeOrigin) String() string
type PathAttributeOriginatorId ¶
type PathAttributeOriginatorId struct { PathAttribute Value net.IP }
func NewPathAttributeOriginatorId ¶
func NewPathAttributeOriginatorId(value string) *PathAttributeOriginatorId
func (*PathAttributeOriginatorId) DecodeFromBytes ¶
func (p *PathAttributeOriginatorId) DecodeFromBytes(data []byte) error
func (*PathAttributeOriginatorId) MarshalJSON ¶
func (p *PathAttributeOriginatorId) MarshalJSON() ([]byte, error)
func (*PathAttributeOriginatorId) Serialize ¶
func (p *PathAttributeOriginatorId) Serialize() ([]byte, error)
func (*PathAttributeOriginatorId) String ¶
func (p *PathAttributeOriginatorId) String() string
type PathAttributePmsiTunnel ¶
type PathAttributePmsiTunnel struct { PathAttribute IsLeafInfoRequired bool TunnelType PmsiTunnelType Label uint32 TunnelID PmsiTunnelIDInterface }
func NewPathAttributePmsiTunnel ¶
func NewPathAttributePmsiTunnel(typ PmsiTunnelType, isLeafInfoRequired bool, label uint32, id PmsiTunnelIDInterface) *PathAttributePmsiTunnel
func (*PathAttributePmsiTunnel) DecodeFromBytes ¶
func (p *PathAttributePmsiTunnel) DecodeFromBytes(data []byte) error
func (*PathAttributePmsiTunnel) MarshalJSON ¶
func (p *PathAttributePmsiTunnel) MarshalJSON() ([]byte, error)
func (*PathAttributePmsiTunnel) Serialize ¶
func (p *PathAttributePmsiTunnel) Serialize() ([]byte, error)
func (*PathAttributePmsiTunnel) String ¶
func (p *PathAttributePmsiTunnel) String() string
type PathAttributeTunnelEncap ¶
type PathAttributeTunnelEncap struct { PathAttribute Value []*TunnelEncapTLV }
func NewPathAttributeTunnelEncap ¶
func NewPathAttributeTunnelEncap(value []*TunnelEncapTLV) *PathAttributeTunnelEncap
func (*PathAttributeTunnelEncap) DecodeFromBytes ¶
func (p *PathAttributeTunnelEncap) DecodeFromBytes(data []byte) error
func (*PathAttributeTunnelEncap) Serialize ¶
func (p *PathAttributeTunnelEncap) Serialize() ([]byte, error)
type PathAttributeUnknown ¶
type PathAttributeUnknown struct {
PathAttribute
}
type PmsiTunnelIDInterface ¶
type PmsiTunnelType ¶
type PmsiTunnelType uint8
const ( PMSI_TUNNEL_TYPE_NO_TUNNEL PmsiTunnelType = 0 PMSI_TUNNEL_TYPE_RSVP_TE_P2MP PmsiTunnelType = 1 PMSI_TUNNEL_TYPE_MLDP_P2MP PmsiTunnelType = 2 PMSI_TUNNEL_TYPE_PIM_SSM_TREE PmsiTunnelType = 3 PMSI_TUNNEL_TYPE_PIM_SM_TREE PmsiTunnelType = 4 PMSI_TUNNEL_TYPE_BIDIR_PIM_TREE PmsiTunnelType = 5 PMSI_TUNNEL_TYPE_INGRESS_REPL PmsiTunnelType = 6 PMSI_TUNNEL_TYPE_MLDP_MP2MP PmsiTunnelType = 7 )
func (PmsiTunnelType) String ¶
func (p PmsiTunnelType) String() string
type Protocol ¶
type Protocol int
partially taken from http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml
type RedirectFourOctetAsSpecificExtended ¶
type RedirectFourOctetAsSpecificExtended struct {
FourOctetAsSpecificExtended
}
func NewRedirectFourOctetAsSpecificExtended ¶
func NewRedirectFourOctetAsSpecificExtended(as uint32, localAdmin uint16) *RedirectFourOctetAsSpecificExtended
func (*RedirectFourOctetAsSpecificExtended) Flat ¶
func (e *RedirectFourOctetAsSpecificExtended) Flat() map[string]string
func (*RedirectFourOctetAsSpecificExtended) GetTypes ¶
func (e *RedirectFourOctetAsSpecificExtended) GetTypes() (ExtendedCommunityAttrType, ExtendedCommunityAttrSubType)
func (*RedirectFourOctetAsSpecificExtended) MarshalJSON ¶
func (e *RedirectFourOctetAsSpecificExtended) MarshalJSON() ([]byte, error)
func (*RedirectFourOctetAsSpecificExtended) Serialize ¶
func (e *RedirectFourOctetAsSpecificExtended) Serialize() ([]byte, error)
func (*RedirectFourOctetAsSpecificExtended) String ¶
func (e *RedirectFourOctetAsSpecificExtended) String() string
type RedirectIPv4AddressSpecificExtended ¶
type RedirectIPv4AddressSpecificExtended struct {
IPv4AddressSpecificExtended
}
func NewRedirectIPv4AddressSpecificExtended ¶
func NewRedirectIPv4AddressSpecificExtended(ipv4 string, localAdmin uint16) *RedirectIPv4AddressSpecificExtended
func (*RedirectIPv4AddressSpecificExtended) Flat ¶
func (e *RedirectIPv4AddressSpecificExtended) Flat() map[string]string
func (*RedirectIPv4AddressSpecificExtended) GetTypes ¶
func (e *RedirectIPv4AddressSpecificExtended) GetTypes() (ExtendedCommunityAttrType, ExtendedCommunityAttrSubType)
func (*RedirectIPv4AddressSpecificExtended) MarshalJSON ¶
func (e *RedirectIPv4AddressSpecificExtended) MarshalJSON() ([]byte, error)
func (*RedirectIPv4AddressSpecificExtended) Serialize ¶
func (e *RedirectIPv4AddressSpecificExtended) Serialize() ([]byte, error)
func (*RedirectIPv4AddressSpecificExtended) String ¶
func (e *RedirectIPv4AddressSpecificExtended) String() string
type RedirectTwoOctetAsSpecificExtended ¶
type RedirectTwoOctetAsSpecificExtended struct {
TwoOctetAsSpecificExtended
}
func NewRedirectTwoOctetAsSpecificExtended ¶
func NewRedirectTwoOctetAsSpecificExtended(as uint16, localAdmin uint32) *RedirectTwoOctetAsSpecificExtended
func (*RedirectTwoOctetAsSpecificExtended) GetTypes ¶
func (e *RedirectTwoOctetAsSpecificExtended) GetTypes() (ExtendedCommunityAttrType, ExtendedCommunityAttrSubType)
func (*RedirectTwoOctetAsSpecificExtended) MarshalJSON ¶
func (e *RedirectTwoOctetAsSpecificExtended) MarshalJSON() ([]byte, error)
func (*RedirectTwoOctetAsSpecificExtended) Serialize ¶
func (e *RedirectTwoOctetAsSpecificExtended) Serialize() ([]byte, error)
func (*RedirectTwoOctetAsSpecificExtended) String ¶
func (e *RedirectTwoOctetAsSpecificExtended) String() string
type RouteDistinguisherFourOctetAS ¶
type RouteDistinguisherFourOctetAS struct { DefaultRouteDistinguisher Admin uint32 Assigned uint16 }
func NewRouteDistinguisherFourOctetAS ¶
func NewRouteDistinguisherFourOctetAS(admin uint32, assigned uint16) *RouteDistinguisherFourOctetAS
func (*RouteDistinguisherFourOctetAS) MarshalJSON ¶
func (rd *RouteDistinguisherFourOctetAS) MarshalJSON() ([]byte, error)
func (*RouteDistinguisherFourOctetAS) Serialize ¶
func (rd *RouteDistinguisherFourOctetAS) Serialize() ([]byte, error)
func (*RouteDistinguisherFourOctetAS) String ¶
func (rd *RouteDistinguisherFourOctetAS) String() string
type RouteDistinguisherIPAddressAS ¶
type RouteDistinguisherIPAddressAS struct { DefaultRouteDistinguisher Admin net.IP Assigned uint16 }
func NewRouteDistinguisherIPAddressAS ¶
func NewRouteDistinguisherIPAddressAS(admin string, assigned uint16) *RouteDistinguisherIPAddressAS
func (*RouteDistinguisherIPAddressAS) MarshalJSON ¶
func (rd *RouteDistinguisherIPAddressAS) MarshalJSON() ([]byte, error)
func (*RouteDistinguisherIPAddressAS) Serialize ¶
func (rd *RouteDistinguisherIPAddressAS) Serialize() ([]byte, error)
func (*RouteDistinguisherIPAddressAS) String ¶
func (rd *RouteDistinguisherIPAddressAS) String() string
type RouteDistinguisherInterface ¶
type RouteDistinguisherInterface interface { DecodeFromBytes([]byte) error Serialize() ([]byte, error) Len() int String() string MarshalJSON() ([]byte, error) }
func GetRouteDistinguisher ¶
func GetRouteDistinguisher(data []byte) RouteDistinguisherInterface
func ParseRouteDistinguisher ¶
func ParseRouteDistinguisher(rd string) (RouteDistinguisherInterface, error)
type RouteDistinguisherTwoOctetAS ¶
type RouteDistinguisherTwoOctetAS struct { DefaultRouteDistinguisher Admin uint16 Assigned uint32 }
func NewRouteDistinguisherTwoOctetAS ¶
func NewRouteDistinguisherTwoOctetAS(admin uint16, assigned uint32) *RouteDistinguisherTwoOctetAS
func (*RouteDistinguisherTwoOctetAS) MarshalJSON ¶
func (rd *RouteDistinguisherTwoOctetAS) MarshalJSON() ([]byte, error)
func (*RouteDistinguisherTwoOctetAS) Serialize ¶
func (rd *RouteDistinguisherTwoOctetAS) Serialize() ([]byte, error)
func (*RouteDistinguisherTwoOctetAS) String ¶
func (rd *RouteDistinguisherTwoOctetAS) String() string
type RouteDistinguisherUnknown ¶
type RouteDistinguisherUnknown struct {
DefaultRouteDistinguisher
}
type RouteFamily ¶
type RouteFamily int
const ( RF_IPv4_UC RouteFamily = AFI_IP<<16 | SAFI_UNICAST RF_IPv6_UC RouteFamily = AFI_IP6<<16 | SAFI_UNICAST RF_IPv4_MC RouteFamily = AFI_IP<<16 | SAFI_MULTICAST RF_IPv6_MC RouteFamily = AFI_IP6<<16 | SAFI_MULTICAST RF_IPv4_VPN RouteFamily = AFI_IP<<16 | SAFI_MPLS_VPN RF_IPv6_VPN RouteFamily = AFI_IP6<<16 | SAFI_MPLS_VPN RF_IPv4_VPN_MC RouteFamily = AFI_IP<<16 | SAFI_MPLS_VPN_MULTICAST RF_IPv6_VPN_MC RouteFamily = AFI_IP6<<16 | SAFI_MPLS_VPN_MULTICAST RF_IPv4_MPLS RouteFamily = AFI_IP<<16 | SAFI_MPLS_LABEL RF_IPv6_MPLS RouteFamily = AFI_IP6<<16 | SAFI_MPLS_LABEL RF_VPLS RouteFamily = AFI_L2VPN<<16 | SAFI_VPLS RF_EVPN RouteFamily = AFI_L2VPN<<16 | SAFI_EVPN RF_RTC_UC RouteFamily = AFI_IP<<16 | SAFI_ROUTE_TARGET_CONSTRTAINS RF_IPv4_ENCAP RouteFamily = AFI_IP<<16 | SAFI_ENCAPSULATION RF_IPv6_ENCAP RouteFamily = AFI_IP6<<16 | SAFI_ENCAPSULATION RF_FS_IPv4_UC RouteFamily = AFI_IP<<16 | SAFI_FLOW_SPEC_UNICAST RF_FS_IPv4_VPN RouteFamily = AFI_IP<<16 | SAFI_FLOW_SPEC_VPN RF_FS_IPv6_UC RouteFamily = AFI_IP6<<16 | SAFI_FLOW_SPEC_UNICAST RF_FS_IPv6_VPN RouteFamily = AFI_IP6<<16 | SAFI_FLOW_SPEC_VPN RF_FS_L2_VPN RouteFamily = AFI_L2VPN<<16 | SAFI_FLOW_SPEC_VPN RF_OPAQUE RouteFamily = AFI_OPAQUE<<16 | SAFI_KEY_VALUE )
func AfiSafiToRouteFamily ¶
func AfiSafiToRouteFamily(afi uint16, safi uint8) RouteFamily
func GetRouteFamily ¶
func GetRouteFamily(name string) (RouteFamily, error)
func (RouteFamily) String ¶
func (f RouteFamily) String() string
type RouteTargetMembershipNLRI ¶
type RouteTargetMembershipNLRI struct { Length uint8 AS uint32 RouteTarget ExtendedCommunityInterface }
func NewRouteTargetMembershipNLRI ¶
func NewRouteTargetMembershipNLRI(as uint32, target ExtendedCommunityInterface) *RouteTargetMembershipNLRI
func (*RouteTargetMembershipNLRI) AFI ¶
func (n *RouteTargetMembershipNLRI) AFI() uint16
func (*RouteTargetMembershipNLRI) DecodeFromBytes ¶
func (n *RouteTargetMembershipNLRI) DecodeFromBytes(data []byte) error
func (*RouteTargetMembershipNLRI) Flat ¶
func (l *RouteTargetMembershipNLRI) Flat() map[string]string
func (*RouteTargetMembershipNLRI) Len ¶
func (n *RouteTargetMembershipNLRI) Len() int
func (*RouteTargetMembershipNLRI) MarshalJSON ¶
func (n *RouteTargetMembershipNLRI) MarshalJSON() ([]byte, error)
func (*RouteTargetMembershipNLRI) SAFI ¶
func (n *RouteTargetMembershipNLRI) SAFI() uint8
func (*RouteTargetMembershipNLRI) Serialize ¶
func (n *RouteTargetMembershipNLRI) Serialize() ([]byte, error)
func (*RouteTargetMembershipNLRI) String ¶
func (n *RouteTargetMembershipNLRI) String() string
type TrafficActionExtended ¶
func NewTrafficActionExtended ¶
func NewTrafficActionExtended(terminal bool, sample bool) *TrafficActionExtended
func (*TrafficActionExtended) Flat ¶
func (e *TrafficActionExtended) Flat() map[string]string
func (*TrafficActionExtended) GetTypes ¶
func (e *TrafficActionExtended) GetTypes() (ExtendedCommunityAttrType, ExtendedCommunityAttrSubType)
func (*TrafficActionExtended) MarshalJSON ¶
func (e *TrafficActionExtended) MarshalJSON() ([]byte, error)
func (*TrafficActionExtended) Serialize ¶
func (e *TrafficActionExtended) Serialize() ([]byte, error)
func (*TrafficActionExtended) String ¶
func (e *TrafficActionExtended) String() string
type TrafficRateExtended ¶
func NewTrafficRateExtended ¶
func NewTrafficRateExtended(as uint16, rate float32) *TrafficRateExtended
func (*TrafficRateExtended) Flat ¶
func (e *TrafficRateExtended) Flat() map[string]string
func (*TrafficRateExtended) GetTypes ¶
func (e *TrafficRateExtended) GetTypes() (ExtendedCommunityAttrType, ExtendedCommunityAttrSubType)
func (*TrafficRateExtended) MarshalJSON ¶
func (e *TrafficRateExtended) MarshalJSON() ([]byte, error)
func (*TrafficRateExtended) Serialize ¶
func (e *TrafficRateExtended) Serialize() ([]byte, error)
func (*TrafficRateExtended) String ¶
func (e *TrafficRateExtended) String() string
type TrafficRemarkExtended ¶
type TrafficRemarkExtended struct {
DSCP uint8
}
func NewTrafficRemarkExtended ¶
func NewTrafficRemarkExtended(dscp uint8) *TrafficRemarkExtended
func (*TrafficRemarkExtended) Flat ¶
func (e *TrafficRemarkExtended) Flat() map[string]string
func (*TrafficRemarkExtended) GetTypes ¶
func (e *TrafficRemarkExtended) GetTypes() (ExtendedCommunityAttrType, ExtendedCommunityAttrSubType)
func (*TrafficRemarkExtended) MarshalJSON ¶
func (e *TrafficRemarkExtended) MarshalJSON() ([]byte, error)
func (*TrafficRemarkExtended) Serialize ¶
func (e *TrafficRemarkExtended) Serialize() ([]byte, error)
func (*TrafficRemarkExtended) String ¶
func (e *TrafficRemarkExtended) String() string
type TunnelEncapSubTLV ¶
type TunnelEncapSubTLV struct { Type EncapSubTLVType Len int Value TunnelEncapSubTLVValue }
func (*TunnelEncapSubTLV) DecodeFromBytes ¶
func (p *TunnelEncapSubTLV) DecodeFromBytes(data []byte) error
func (*TunnelEncapSubTLV) Serialize ¶
func (p *TunnelEncapSubTLV) Serialize() ([]byte, error)
type TunnelEncapSubTLVColor ¶
type TunnelEncapSubTLVColor struct {
Color uint32
}
func (*TunnelEncapSubTLVColor) Serialize ¶
func (t *TunnelEncapSubTLVColor) Serialize() ([]byte, error)
type TunnelEncapSubTLVDefault ¶
type TunnelEncapSubTLVDefault struct {
Value []byte
}
func (*TunnelEncapSubTLVDefault) Serialize ¶
func (t *TunnelEncapSubTLVDefault) Serialize() ([]byte, error)
type TunnelEncapSubTLVEncapuslation ¶
type TunnelEncapSubTLVEncapuslation struct { Key uint32 // this represent both SessionID for L2TPv3 case and GRE-key for GRE case (RFC5512 4.) Cookie []byte }
func (*TunnelEncapSubTLVEncapuslation) Serialize ¶
func (t *TunnelEncapSubTLVEncapuslation) Serialize() ([]byte, error)
type TunnelEncapSubTLVProtocol ¶
type TunnelEncapSubTLVProtocol struct {
Protocol uint16
}
func (*TunnelEncapSubTLVProtocol) Serialize ¶
func (t *TunnelEncapSubTLVProtocol) Serialize() ([]byte, error)
type TunnelEncapSubTLVValue ¶
type TunnelEncapTLV ¶
type TunnelEncapTLV struct { Type TunnelType Len int Value []*TunnelEncapSubTLV }
func (*TunnelEncapTLV) DecodeFromBytes ¶
func (t *TunnelEncapTLV) DecodeFromBytes(data []byte) error
func (*TunnelEncapTLV) Serialize ¶
func (p *TunnelEncapTLV) Serialize() ([]byte, error)
type TunnelType ¶
type TunnelType uint16
const ( TUNNEL_TYPE_L2TP3 TunnelType = 1 TUNNEL_TYPE_GRE TunnelType = 2 TUNNEL_TYPE_IP_IN_IP TunnelType = 7 TUNNEL_TYPE_VXLAN TunnelType = 8 TUNNEL_TYPE_NVGRE TunnelType = 9 TUNNEL_TYPE_MPLS TunnelType = 10 TUNNEL_TYPE_MPLS_IN_GRE TunnelType = 11 TUNNEL_TYPE_VXLAN_GRE TunnelType = 12 TUNNEL_TYPE_MPLS_IN_UDP TunnelType = 13 )
type TwoOctetAsSpecificExtended ¶
type TwoOctetAsSpecificExtended struct { SubType ExtendedCommunityAttrSubType AS uint16 LocalAdmin uint32 IsTransitive bool }
func NewTwoOctetAsSpecificExtended ¶
func NewTwoOctetAsSpecificExtended(subtype ExtendedCommunityAttrSubType, as uint16, localAdmin uint32, isTransitive bool) *TwoOctetAsSpecificExtended
func (*TwoOctetAsSpecificExtended) Flat ¶
func (e *TwoOctetAsSpecificExtended) Flat() map[string]string
func (*TwoOctetAsSpecificExtended) GetTypes ¶
func (e *TwoOctetAsSpecificExtended) GetTypes() (ExtendedCommunityAttrType, ExtendedCommunityAttrSubType)
func (*TwoOctetAsSpecificExtended) MarshalJSON ¶
func (e *TwoOctetAsSpecificExtended) MarshalJSON() ([]byte, error)
func (*TwoOctetAsSpecificExtended) Serialize ¶
func (e *TwoOctetAsSpecificExtended) Serialize() ([]byte, error)
func (*TwoOctetAsSpecificExtended) String ¶
func (e *TwoOctetAsSpecificExtended) String() string
type UnknownExtended ¶
type UnknownExtended struct { Type ExtendedCommunityAttrType Value []byte }
func (*UnknownExtended) Flat ¶
func (e *UnknownExtended) Flat() map[string]string
func (*UnknownExtended) GetTypes ¶
func (e *UnknownExtended) GetTypes() (ExtendedCommunityAttrType, ExtendedCommunityAttrSubType)
func (*UnknownExtended) MarshalJSON ¶
func (e *UnknownExtended) MarshalJSON() ([]byte, error)
func (*UnknownExtended) Serialize ¶
func (e *UnknownExtended) Serialize() ([]byte, error)
func (*UnknownExtended) String ¶
func (e *UnknownExtended) String() string
type ValidationExtended ¶
type ValidationExtended struct {
Value ValidationState
}
func (*ValidationExtended) Serialize ¶
func (e *ValidationExtended) Serialize() ([]byte, error)
func (*ValidationExtended) String ¶
func (e *ValidationExtended) String() string
type ValidationState ¶
type ValidationState uint8
const ( VALIDATION_STATE_VALID ValidationState = 0 VALIDATION_STATE_NOT_FOUND ValidationState = 1 VALIDATION_STATE_INVALID ValidationState = 2 )
func (ValidationState) String ¶
func (s ValidationState) String() string
type WellKnownCommunity ¶
type WellKnownCommunity uint32