bgp

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: Apache-2.0 Imports: 13 Imported by: 41

Documentation

Index

Constants

View Source
const (
	AFI_IP     = 1
	AFI_IP6    = 2
	AFI_L2VPN  = 25
	AFI_LS     = 16388
	AFI_OPAQUE = 16397
)
View Source
const (
	SAFI_UNICAST                  = 1
	SAFI_MULTICAST                = 2
	SAFI_MPLS_LABEL               = 4
	SAFI_ENCAPSULATION            = 7
	SAFI_VPLS                     = 65
	SAFI_EVPN                     = 70
	SAFI_LS                       = 71
	SAFI_SRPOLICY                 = 73
	SAFI_MPLS_VPN                 = 128
	SAFI_MPLS_VPN_MULTICAST       = 129
	SAFI_ROUTE_TARGET_CONSTRAINTS = 132
	SAFI_FLOW_SPEC_UNICAST        = 133
	SAFI_FLOW_SPEC_VPN            = 134
	SAFI_KEY_VALUE                = 241
)
View Source
const (
	BGP_ORIGIN_ATTR_TYPE_IGP        uint8 = 0
	BGP_ORIGIN_ATTR_TYPE_EGP        uint8 = 1
	BGP_ORIGIN_ATTR_TYPE_INCOMPLETE uint8 = 2
)
View Source
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
)
View Source
const (
	BGP_ATTR_NHLEN_IPV6_GLOBAL        = 16
	BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL = 32
)
View Source
const (
	BGP_MSG_OPEN
	BGP_MSG_UPDATE
	BGP_MSG_NOTIFICATION
	BGP_MSG_KEEPALIVE
	BGP_MSG_ROUTE_REFRESH
)
View Source
const (
	BGP_RD_TWO_OCTET_AS = iota
	BGP_RD_IPV4_ADDRESS
	BGP_RD_FOUR_OCTET_AS
)
View Source
const (
	EVPN_ROUTE_TYPE_ETHERNET_AUTO_DISCOVERY = 1
	EVPN_ROUTE_TYPE_MAC_IP_ADVERTISEMENT    = 2
	EVPN_INCLUSIVE_MULTICAST_ETHERNET_TAG   = 3
	EVPN_ETHERNET_SEGMENT_ROUTE             = 4
	EVPN_IP_PREFIX                          = 5
	EVPN_I_PMSI                             = 9
)
View Source
const (
	LS_PROTOCOL_UNKNOWN = iota
	LS_PROTOCOL_ISIS_L1
	LS_PROTOCOL_ISIS_L2
	LS_PROTOCOL_OSPF_V2
	LS_PROTOCOL_DIRECT
	LS_PROTOCOL_STATIC
	LS_PROTOCOL_OSPF_V3
)
View Source
const (
	LS_TLV_UNKNOWN LsTLVType = iota

	LS_TLV_LOCAL_NODE_DESC     = 256
	LS_TLV_REMOTE_NODE_DESC    = 257
	LS_TLV_LINK_ID             = 258
	LS_TLV_IPV4_INTERFACE_ADDR = 259
	LS_TLV_IPV4_NEIGHBOR_ADDR  = 260
	LS_TLV_IPV6_INTERFACE_ADDR = 261
	LS_TLV_IPV6_NEIGHBOR_ADDR  = 262
	LS_TLV_MULTI_TOPO_ID       = 263
	LS_TLV_OSPF_ROUTE_TYPE     = 264
	LS_TLV_IP_REACH_INFO       = 265

	LS_TLV_AS                       = 512
	LS_TLV_BGP_LS_ID                = 513
	LS_TLV_OSPF_AREA                = 514
	LS_TLV_IGP_ROUTER_ID            = 515
	LS_TLV_BGP_ROUTER_ID            = 516 // draft-ietf-idr-bgpls-segment-routing-epe, TODO
	LS_TLV_BGP_CONFEDERATION_MEMBER = 517 // draft-ietf-idr-bgpls-segment-routing-epe, TODO

	LS_TLV_NODE_FLAG_BITS        = 1024
	LS_TLV_OPAQUE_NODE_ATTR      = 1025
	LS_TLV_NODE_NAME             = 1026
	LS_TLV_ISIS_AREA             = 1027
	LS_TLV_IPV4_LOCAL_ROUTER_ID  = 1028
	LS_TLV_IPV6_LOCAL_ROUTER_ID  = 1029
	LS_TLV_IPV4_REMOTE_ROUTER_ID = 1030
	LS_TLV_IPV6_REMOTE_ROUTER_ID = 1031

	LS_TLV_SR_CAPABILITIES = 1034 // draft-ietf-idr-bgp-ls-segment-routing-ext
	LS_TLV_SR_ALGORITHM    = 1035 // draft-ietf-idr-bgp-ls-segment-routing-ext
	LS_TLV_SR_LOCAL_BLOCK  = 1036 // draft-ietf-idr-bgp-ls-segment-routing-ext
	LS_TLV_SRMS_PREFERENCE = 1037 // draft-ietf-idr-bgp-ls-segment-routing-ext, TODO

	LS_TLV_ADMIN_GROUP              = 1088
	LS_TLV_MAX_LINK_BANDWIDTH       = 1089
	LS_TLV_MAX_RESERVABLE_BANDWIDTH = 1090
	LS_TLV_UNRESERVED_BANDWIDTH     = 1091
	LS_TLV_TE_DEFAULT_METRIC        = 1092
	LS_TLV_LINK_PROTECTION_TYPE     = 1093 // TODO
	LS_TLV_MPLS_PROTOCOL_MASK       = 1094 // TODO
	LS_TLV_IGP_METRIC               = 1095
	LS_TLV_SRLG                     = 1096
	LS_TLV_OPAQUE_LINK_ATTR         = 1097
	LS_TLV_LINK_NAME                = 1098
	LS_TLV_ADJACENCY_SID            = 1099 // draft-ietf-idr-bgp-ls-segment-routing-ext
	LS_TLV_LAN_ADJACENCY_SID        = 1100 // draft-ietf-idr-bgp-ls-segment-routing-ext, TODO
	LS_TLV_PEER_NODE_SID            = 1101 // draft-ietf-idr-bgpls-segment-routing-epe, TODO
	LS_TLV_PEER_ADJACENCY_SID       = 1102 // draft-ietf-idr-bgpls-segment-routing-epe, TODO
	LS_TLV_PEER_SET_SID             = 1103 // draft-ietf-idr-bgpls-segment-routing-epe, TODO

	LS_TLV_RTM_CAPABILITY = 1105 // RFC8169, TODO

	LS_TLV_IGP_FLAGS              = 1152
	LS_TLV_IGP_ROUTE_TAG          = 1153 // TODO
	LS_TLV_EXTENDED_ROUTE_TAG     = 1154 // TODO
	LS_TLV_PREFIX_METRIC          = 1155 // TODO
	LS_TLV_OSPF_FORWARDING_ADDR   = 1156 // TODO
	LS_TLV_OPAQUE_PREFIX_ATTR     = 1157
	LS_TLV_PREFIX_SID             = 1158 // draft-ietf-idr-bgp-ls-segment-routing-ext
	LS_TLV_RANGE                  = 1159 // draft-ietf-idr-bgp-ls-segment-routing-ext, TODO
	LS_TLV_SID_LABEL_TLV          = 1161 // draft-ietf-idr-bgp-ls-segment-routing-ext
	LS_TLV_PREFIX_ATTRIBUTE_FLAGS = 1170 // draft-ietf-idr-bgp-ls-segment-routing-ext, TODO
	LS_TLV_SOURCE_ROUTER_ID       = 1171 // draft-ietf-idr-bgp-ls-segment-routing-ext, TODO
	LS_TLV_L2_BUNDLE_MEMBER_TLV   = 1172 // draft-ietf-idr-bgp-ls-segment-routing-ext, TODO
)

Based on https://www.iana.org/assignments/bgp-ls-parameters/bgp-ls-parameters.xhtml

View Source
const (
	LS_OSPF_ROUTE_TYPE_UNKNOWN = iota
	LS_OSPF_ROUTE_TYPE_INTRA_AREA
	LS_OSPF_ROUTE_TYPE_INTER_AREA
	LS_OSPF_ROUTE_TYPE_EXTERNAL1
	LS_OSPF_ROUTE_TYPE_EXTERNAL2
	LS_OSPF_ROUTE_TYPE_NSSA1
	LS_OSPF_ROUTE_TYPE_NSSA2
)
View Source
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.

View Source
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

View Source
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

View Source
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

View Source
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

View Source
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
	BGP_ERROR_SUB_HARD_RESET //draft-ietf-idr-bgp-gr-notification-07
)

NOTIFICATION Error Subcode for BGP_ERROR_CEASE (RFC 4486)

View Source
const (
	EGRESS_ENDPOINT_RESERVED_POS = 0
	EGRESS_ENDPOINT_FAMILY_POS   = 4
	EGRESS_ENDPOINT_ADDRESS_POS  = 6
)

Tunnel Egress Endpoint Sub-TLV subfield positions

View Source
const (
	BGP_HEADER_LENGTH      = 19
	BGP_MAX_MESSAGE_LENGTH = 4096
)
View Source
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
)
View Source
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
	TCP_FLAG_ECE    = 0x40
	TCP_FLAG_CWR    = 0x80
)
View Source
const (
	BITMASK_FLAG_OP_OR        BitmaskFlagOp = iota
	BITMASK_FLAG_OP_MATCH                   = 0x01
	BITMASK_FLAG_OP_NOT                     = 0x02
	BITMASK_FLAG_OP_NOT_MATCH               = 0x03
	BITMASK_FLAG_OP_AND                     = 0x40
	BITMASK_FLAG_OP_END                     = 0x80
)
View Source
const (
	FRAG_FLAG_NOT   FragmentFlag = iota
	FRAG_FLAG_DONT               = 0x01
	FRAG_FLAG_IS                 = 0x02
	FRAG_FLAG_FIRST              = 0x04
	FRAG_FLAG_LAST               = 0x08
)
View Source
const (
	DEC_NUM_OP_TRUE   DECNumOp = iota // true always with END bit set
	DEC_NUM_OP_EQ              = 0x01
	DEC_NUM_OP_GT              = 0x02
	DEC_NUM_OP_GT_EQ           = 0x03
	DEC_NUM_OP_LT              = 0x04
	DEC_NUM_OP_LT_EQ           = 0x05
	DEC_NUM_OP_NOT_EQ          = 0x06
	DEC_NUM_OP_FALSE           = 0x07 // false always with END bit set
	DEC_NUM_OP_OR              = 0x00
	DEC_NUM_OP_AND             = 0x40
	DEC_NUM_OP_END             = 0x80
)
View Source
const (
	// SRPolicyIPv4NLRILen defines IPv4 SR Policy NLRI portion length in bits
	SRPolicyIPv4NLRILen = 96
	// SRPolicyIPv6NLRILen defines IPv6 SR Policy NLRI portion length in bits
	SRPolicyIPv6NLRILen = 192
)
View Source
const AS_TRANS = 23456
View Source
const (
	BGP_ERROR_ADMINISTRATIVE_COMMUNICATION_MAX = 128
)

Constants for BGP_ERROR_SUB_ADMINISTRATIVE_SHUTDOWN and BGP_ERROR_SUB_ADMINISTRATIVE_RESET

View Source
const (
	BGP_ERROR_SUB_HOLD_TIMER_EXPIRED
)

NOTIFICATION Error Subcode for BGP_ERROR_HOLD_TIMER_EXPIRED

View Source
const (
	BGP_ERROR_SUB_INVALID_MESSAGE_LENGTH
)

NOTIFICATION Error Subcode for BGP_ERROR_ROUTE_REFRESH

View Source
const (
	BGP_OPT_CAPABILITY = 2
)
View Source
const BGP_PORT = 179
View Source
const (
	// SegmentListSubTLVWeight defines code for Segment List's Weight sub-TLV
	SegmentListSubTLVWeight = 9
)
View Source
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.

View Source
const ZERO_LABEL = uint32(0) // some platform uses this as withdraw label

Variables

View Source
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",
	RF_LS:             "ls",
	RF_SR_POLICY_IPv4: "ipv4-srpolicy",
	RF_SR_POLICY_IPv6: "ipv6-srpolicy",
}

Note: Meaning of "" is different from that of the numeric operator because RFC5575 says if the Match bit in the bitmask operand is set, it should be "strictly" matching against the given value.

View Source
var CapNameMap = map[BGPCapabilityCode]string{
	BGP_CAP_MULTIPROTOCOL:               "multiprotocol",
	BGP_CAP_ROUTE_REFRESH:               "route-refresh",
	BGP_CAP_CARRYING_LABEL_INFO:         "carrying-label-info",
	BGP_CAP_GRACEFUL_RESTART:            "graceful-restart",
	BGP_CAP_EXTENDED_NEXTHOP:            "extended-nexthop",
	BGP_CAP_FOUR_OCTET_AS_NUMBER:        "4-octet-as",
	BGP_CAP_ADD_PATH:                    "add-path",
	BGP_CAP_ENHANCED_ROUTE_REFRESH:      "enhanced-route-refresh",
	BGP_CAP_ROUTE_REFRESH_CISCO:         "cisco-route-refresh",
	BGP_CAP_LONG_LIVED_GRACEFUL_RESTART: "long-lived-graceful-restart",
	BGP_CAP_FQDN:                        "fqdn",
}
View Source
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",
}
View Source
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,
}
View Source
var FragmentFlagNameMap = map[FragmentFlag]string{
	FRAG_FLAG_NOT:   "not-a-fragment",
	FRAG_FLAG_DONT:  "dont-fragment",
	FRAG_FLAG_IS:    "is-fragment",
	FRAG_FLAG_FIRST: "first-fragment",
	FRAG_FLAG_LAST:  "last-fragment",
}

Prepares a sorted list of flags because map iterations does not happen in a consistent order in Golang.

View Source
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_IP6_EXTENDED_COMMUNITIES: BGP_ATTR_FLAG_TRANSITIVE | BGP_ATTR_FLAG_OPTIONAL,
	BGP_ATTR_TYPE_AIGP:                     BGP_ATTR_FLAG_OPTIONAL,
	BGP_ATTR_TYPE_LARGE_COMMUNITY:          BGP_ATTR_FLAG_TRANSITIVE | BGP_ATTR_FLAG_OPTIONAL,
	BGP_ATTR_TYPE_LS:                       BGP_ATTR_FLAG_OPTIONAL,
	BGP_ATTR_TYPE_PREFIX_SID:               BGP_ATTR_FLAG_TRANSITIVE | BGP_ATTR_FLAG_OPTIONAL,
}
View Source
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",
}
View Source
var TCPFlagNameMap = map[TCPFlag]string{
	TCP_FLAG_FIN:    "F",
	TCP_FLAG_SYN:    "S",
	TCP_FLAG_RST:    "R",
	TCP_FLAG_PUSH:   "P",
	TCP_FLAG_ACK:    "A",
	TCP_FLAG_URGENT: "U",
	TCP_FLAG_CWR:    "C",
	TCP_FLAG_ECE:    "E",
}

Prepares a sorted list of flags because map iterations does not happen in a consistent order in Golang.

View Source
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_BLACKHOLE:                  "blackhole",
	COMMUNITY_NO_EXPORT:                  "no-export",
	COMMUNITY_NO_ADVERTISE:               "no-advertise",
	COMMUNITY_NO_EXPORT_SUBCONFED:        "no-export-subconfed",
	COMMUNITY_NO_PEER:                    "no-peer",
}

Functions

func AsPathString

func AsPathString(aspath *PathAttributeAsPath) string

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

func FlatUpdate(f1, f2 map[string]string) error

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 GetBGPUpdateAttributes

func GetBGPUpdateAttributes(data []byte) map[BGPAttrType]bool

func GetBGPUpdateAttributesFromMsg

func GetBGPUpdateAttributesFromMsg(msg *BGPUpdate) map[BGPAttrType]bool

func IsAddPathEnabled

func IsAddPathEnabled(decode bool, f RouteFamily, options []*MarshallingOption) bool

func IsAttributePresent

func IsAttributePresent(attr BGPAttrType, options []*MarshallingOption) bool

func LabelString

func LabelString(nlri AddrPrefixInterface) string

func NewMessageError

func NewMessageError(typeCode, subTypeCode uint8, data []byte, msg string) error

func NewMessageErrorWithErrorHandling

func NewMessageErrorWithErrorHandling(typeCode, subTypeCode uint8, data []byte, errorHandling ErrorHandling, errorAttribute *PathAttributeInterface, msg string) error

func RouteFamilyToAfiSafi

func RouteFamilyToAfiSafi(rf RouteFamily) (uint16, uint8)

func SerializeExtendedCommunities

func SerializeExtendedCommunities(comms []ExtendedCommunityInterface) ([][]byte, error)

func ValidateAttribute

func ValidateAttribute(a PathAttributeInterface, rfs map[RouteFamily]BGPAddPathMode, isEBGP bool, isConfed bool) (bool, error)

func ValidateBGPMessage

func ValidateBGPMessage(m *BGPMessage) error

func ValidateOpenMsg

func ValidateOpenMsg(m *BGPOpen, expectedAS uint32, myAS uint32, myId net.IP) (uint32, error)

func ValidateUpdateMsg

func ValidateUpdateMsg(m *BGPUpdate, rfs map[RouteFamily]BGPAddPathMode, isEBGP bool, isConfed bool) (bool, error)

Validator for BGPUpdate

Types

type AddrPrefixInterface

type AddrPrefixInterface interface {
	DecodeFromBytes([]byte, ...*MarshallingOption) error
	Serialize(...*MarshallingOption) ([]byte, error)
	AFI() uint16
	SAFI() uint8
	Len(...*MarshallingOption) 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
	PathIdentifier() uint32
	SetPathIdentifier(uint32)
	PathLocalIdentifier() uint32
	SetPathLocalIdentifier(uint32)
}

func NewPrefixFromRouteFamily

func NewPrefixFromRouteFamily(afi uint16, safi uint8, prefixStr ...string) (prefix AddrPrefixInterface, err error)

type AigpTLVDefault

type AigpTLVDefault struct {
	Value []byte
	// contains filtered or unexported fields
}

func NewAigpTLVDefault

func NewAigpTLVDefault(typ AigpTLVType, value []byte) *AigpTLVDefault

func (*AigpTLVDefault) Len

func (t *AigpTLVDefault) Len() int

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) Len

func (t *AigpTLVIgpMetric) Len() int

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 AigpTLVInterface

type AigpTLVInterface interface {
	Serialize() ([]byte, error)
	String() string
	MarshalJSON() ([]byte, error)
	Type() AigpTLVType
	Len() int
}

type AigpTLVType

type AigpTLVType uint8
const (
	AIGP_TLV_UNKNOWN AigpTLVType = iota
	AIGP_TLV_IGP_METRIC
)

type As4PathParam

type As4PathParam struct {
	Type uint8
	Num  uint8
	AS   []uint32
}

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) GetAS

func (a *As4PathParam) GetAS() []uint32

func (*As4PathParam) GetType

func (a *As4PathParam) GetType() uint8

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

type AsPathParam struct {
	Type uint8
	Num  uint8
	AS   []uint16
}

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) GetAS

func (a *AsPathParam) GetAS() []uint32

func (*AsPathParam) GetType

func (a *AsPathParam) GetType() uint8

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 AsPathParamInterface interface {
	GetType() uint8
	GetAS() []uint32
	Serialize() ([]byte, error)
	DecodeFromBytes([]byte) error
	Len() int
	ASLen() int
	MarshalJSON() ([]byte, error)
	String() string
}

type BGPAddPathMode

type BGPAddPathMode uint8
const (
	BGP_ADD_PATH_NONE BGPAddPathMode = iota
	BGP_ADD_PATH_RECEIVE
	BGP_ADD_PATH_SEND
	BGP_ADD_PATH_BOTH
)

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_IP6_EXTENDED_COMMUNITIES // = 25
	BGP_ATTR_TYPE_AIGP                     // = 26

	BGP_ATTR_TYPE_LS                          // = 29
	BGP_ATTR_TYPE_LARGE_COMMUNITY BGPAttrType = 32
	BGP_ATTR_TYPE_PREFIX_SID      BGPAttrType = 40
)

func (BGPAttrType) String

func (i BGPAttrType) String() string

type BGPBody

type BGPBody interface {
	DecodeFromBytes([]byte, ...*MarshallingOption) error
	Serialize(...*MarshallingOption) ([]byte, error)
}

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_EXTENDED_NEXTHOP            BGPCapabilityCode = 5
	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_LONG_LIVED_GRACEFUL_RESTART BGPCapabilityCode = 71
	BGP_CAP_FQDN                        BGPCapabilityCode = 73
	BGP_CAP_ROUTE_REFRESH_CISCO         BGPCapabilityCode = 128
)

func (BGPCapabilityCode) String

func (c 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

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

func (*BGPHeader) DecodeFromBytes

func (msg *BGPHeader) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*BGPHeader) Serialize

func (msg *BGPHeader) Serialize(options ...*MarshallingOption) ([]byte, error)

type BGPKeepAlive

type BGPKeepAlive struct {
}

func (*BGPKeepAlive) DecodeFromBytes

func (msg *BGPKeepAlive) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*BGPKeepAlive) Serialize

func (msg *BGPKeepAlive) Serialize(options ...*MarshallingOption) ([]byte, error)

type BGPMessage

type BGPMessage struct {
	Header BGPHeader
	Body   BGPBody
}

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, options ...*MarshallingOption) (*BGPMessage, error)

func ParseBGPMessage

func ParseBGPMessage(data []byte, options ...*MarshallingOption) (*BGPMessage, error)

func (*BGPMessage) Serialize

func (msg *BGPMessage) Serialize(options ...*MarshallingOption) ([]byte, error)

type BGPNotification

type BGPNotification struct {
	ErrorCode    uint8
	ErrorSubcode uint8
	Data         []byte
}

func (*BGPNotification) DecodeFromBytes

func (msg *BGPNotification) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*BGPNotification) Serialize

func (msg *BGPNotification) Serialize(options ...*MarshallingOption) ([]byte, error)

type BGPOpen

type BGPOpen struct {
	Version     uint8
	MyAS        uint16
	HoldTime    uint16
	ID          net.IP
	OptParamLen uint8
	OptParams   []OptionParameterInterface
}

func (*BGPOpen) DecodeFromBytes

func (msg *BGPOpen) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*BGPOpen) Serialize

func (msg *BGPOpen) Serialize(options ...*MarshallingOption) ([]byte, error)

type BGPRouteRefresh

type BGPRouteRefresh struct {
	AFI         uint16
	Demarcation uint8
	SAFI        uint8
}

func (*BGPRouteRefresh) DecodeFromBytes

func (msg *BGPRouteRefresh) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*BGPRouteRefresh) Serialize

func (msg *BGPRouteRefresh) Serialize(options ...*MarshallingOption) ([]byte, error)

type BGPUpdate

type BGPUpdate struct {
	WithdrawnRoutesLen    uint16
	WithdrawnRoutes       []*IPAddrPrefix
	TotalPathAttributeLen uint16
	PathAttributes        []PathAttributeInterface
	NLRI                  []*IPAddrPrefix
}

func TreatAsWithdraw

func TreatAsWithdraw(msg *BGPUpdate) *BGPUpdate

func (*BGPUpdate) DecodeFromBytes

func (msg *BGPUpdate) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*BGPUpdate) IsEndOfRib

func (msg *BGPUpdate) IsEndOfRib() (bool, RouteFamily)

func (*BGPUpdate) Serialize

func (msg *BGPUpdate) Serialize(options ...*MarshallingOption) ([]byte, error)

type BGPUpdateAttributes

type BGPUpdateAttributes struct {
	Attribute map[BGPAttrType]bool
}

BGPUpdateAttributes defines a map with a key as bgp attribute type and value as bool. Value set to true indicates that the attribute specified by the key exists in the bgp update.

type BSID

type BSID struct {
	Value []byte
}

func NewBSID

func NewBSID(v []byte) (*BSID, error)

func (*BSID) Len

func (b *BSID) Len() int

func (*BSID) Serialize

func (b *BSID) Serialize() []byte

func (*BSID) String

func (b *BSID) String() string

type BitmaskFlagOp

type BitmaskFlagOp uint8

func (BitmaskFlagOp) String

func (f BitmaskFlagOp) String() string

type CapAddPath

type CapAddPath struct {
	DefaultParameterCapability
	Tuples []*CapAddPathTuple
}

func NewCapAddPath

func NewCapAddPath(tuples []*CapAddPathTuple) *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 CapAddPathTuple

type CapAddPathTuple struct {
	RouteFamily RouteFamily
	Mode        BGPAddPathMode
}

func NewCapAddPathTuple

func NewCapAddPathTuple(family RouteFamily, mode BGPAddPathMode) *CapAddPathTuple

func (*CapAddPathTuple) MarshalJSON

func (t *CapAddPathTuple) MarshalJSON() ([]byte, error)

type CapCarryingLabelInfo

type CapCarryingLabelInfo struct {
	DefaultParameterCapability
}

func NewCapCarryingLabelInfo

func NewCapCarryingLabelInfo() *CapCarryingLabelInfo

type CapEnhancedRouteRefresh

type CapEnhancedRouteRefresh struct {
	DefaultParameterCapability
}

func NewCapEnhancedRouteRefresh

func NewCapEnhancedRouteRefresh() *CapEnhancedRouteRefresh

type CapExtendedNexthop

type CapExtendedNexthop struct {
	DefaultParameterCapability
	Tuples []*CapExtendedNexthopTuple
}

func NewCapExtendedNexthop

func NewCapExtendedNexthop(tuples []*CapExtendedNexthopTuple) *CapExtendedNexthop

func (*CapExtendedNexthop) DecodeFromBytes

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

func (*CapExtendedNexthop) MarshalJSON

func (c *CapExtendedNexthop) MarshalJSON() ([]byte, error)

func (*CapExtendedNexthop) Serialize

func (c *CapExtendedNexthop) Serialize() ([]byte, error)

type CapExtendedNexthopTuple

type CapExtendedNexthopTuple struct {
	NLRIAFI    uint16
	NLRISAFI   uint16
	NexthopAFI uint16
}

func NewCapExtendedNexthopTuple

func NewCapExtendedNexthopTuple(af RouteFamily, nexthop uint16) *CapExtendedNexthopTuple

func (*CapExtendedNexthopTuple) MarshalJSON

func (c *CapExtendedNexthopTuple) MarshalJSON() ([]byte, error)

type CapFQDN

type CapFQDN struct {
	DefaultParameterCapability
	HostNameLen   uint8
	HostName      string
	DomainNameLen uint8
	DomainName    string
}

func NewCapFQDN

func NewCapFQDN(hostname string, domainname string) *CapFQDN

func (*CapFQDN) DecodeFromBytes

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

func (*CapFQDN) MarshalJSON

func (c *CapFQDN) MarshalJSON() ([]byte, error)

func (*CapFQDN) Serialize

func (c *CapFQDN) Serialize() ([]byte, error)

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, notification 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

type CapGracefulRestartTuple struct {
	AFI   uint16
	SAFI  uint8
	Flags uint8
}

func NewCapGracefulRestartTuple

func NewCapGracefulRestartTuple(rf RouteFamily, forward bool) *CapGracefulRestartTuple

func (*CapGracefulRestartTuple) MarshalJSON

func (c *CapGracefulRestartTuple) MarshalJSON() ([]byte, error)

type CapLongLivedGracefulRestart

type CapLongLivedGracefulRestart struct {
	DefaultParameterCapability
	Tuples []*CapLongLivedGracefulRestartTuple
}

func (*CapLongLivedGracefulRestart) DecodeFromBytes

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

func (*CapLongLivedGracefulRestart) MarshalJSON

func (c *CapLongLivedGracefulRestart) MarshalJSON() ([]byte, error)

func (*CapLongLivedGracefulRestart) Serialize

func (c *CapLongLivedGracefulRestart) Serialize() ([]byte, error)

type CapLongLivedGracefulRestartTuple

type CapLongLivedGracefulRestartTuple struct {
	AFI         uint16
	SAFI        uint8
	Flags       uint8
	RestartTime uint32
}

func NewCapLongLivedGracefulRestartTuple

func NewCapLongLivedGracefulRestartTuple(rf RouteFamily, forward bool, restartTime uint32) *CapLongLivedGracefulRestartTuple

func (*CapLongLivedGracefulRestartTuple) MarshalJSON

func (c *CapLongLivedGracefulRestartTuple) 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
}

func NewCapUnknown

func NewCapUnknown(code BGPCapabilityCode, value []byte) *CapUnknown

type ColorExtended

type ColorExtended struct {
	Color uint32
}

func NewColorExtended

func NewColorExtended(color uint32) *ColorExtended

func (*ColorExtended) Flat

func (e *ColorExtended) Flat() map[string]string

func (*ColorExtended) GetTypes

func (*ColorExtended) MarshalJSON

func (e *ColorExtended) MarshalJSON() ([]byte, error)

func (*ColorExtended) Serialize

func (e *ColorExtended) Serialize() ([]byte, error)

func (*ColorExtended) String

func (e *ColorExtended) String() string

type DECNumOp

type DECNumOp uint8

func (DECNumOp) String

func (f DECNumOp) String() string

type DefaultGatewayExtended

type DefaultGatewayExtended struct {
}

func NewDefaultGatewayExtended

func NewDefaultGatewayExtended() *DefaultGatewayExtended

func (*DefaultGatewayExtended) Flat

func (e *DefaultGatewayExtended) Flat() map[string]string

func (*DefaultGatewayExtended) GetTypes

func (*DefaultGatewayExtended) MarshalJSON

func (e *DefaultGatewayExtended) MarshalJSON() ([]byte, error)

func (*DefaultGatewayExtended) Serialize

func (e *DefaultGatewayExtended) Serialize() ([]byte, error)

func (*DefaultGatewayExtended) String

func (e *DefaultGatewayExtended) String() string

type DefaultParameterCapability

type DefaultParameterCapability struct {
	CapCode  BGPCapabilityCode `json:"code"`
	CapLen   uint8             `json:"-"`
	CapValue []byte            `json:"value,omitempty"`
}

func (*DefaultParameterCapability) Code

func (*DefaultParameterCapability) DecodeFromBytes

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

func (*DefaultParameterCapability) Len

func (*DefaultParameterCapability) Serialize

func (c *DefaultParameterCapability) Serialize() ([]byte, error)

type DefaultPmsiTunnelID

type DefaultPmsiTunnelID struct {
	Value []byte
}

func NewDefaultPmsiTunnelID

func NewDefaultPmsiTunnelID(value []byte) *DefaultPmsiTunnelID

func (*DefaultPmsiTunnelID) Len

func (i *DefaultPmsiTunnelID) Len() int

func (*DefaultPmsiTunnelID) Serialize

func (i *DefaultPmsiTunnelID) Serialize() ([]byte, error)

func (*DefaultPmsiTunnelID) String

func (i *DefaultPmsiTunnelID) String() string

type DefaultRouteDistinguisher

type DefaultRouteDistinguisher struct {
	Type uint16
}

func (*DefaultRouteDistinguisher) Len

func (rd *DefaultRouteDistinguisher) Len() int

type ESILabelExtended

type ESILabelExtended struct {
	Label          uint32
	IsSingleActive bool
}

func NewESILabelExtended

func NewESILabelExtended(label uint32, isSingleActive bool) *ESILabelExtended

func (*ESILabelExtended) Flat

func (e *ESILabelExtended) Flat() map[string]string

func (*ESILabelExtended) GetTypes

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 ESIType

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

func (ESIType) String

func (i ESIType) 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 (*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) Len

func (*EVPNEthernetAutoDiscoveryRoute) MarshalJSON

func (er *EVPNEthernetAutoDiscoveryRoute) MarshalJSON() ([]byte, error)

func (*EVPNEthernetAutoDiscoveryRoute) Serialize

func (er *EVPNEthernetAutoDiscoveryRoute) Serialize() ([]byte, error)

func (*EVPNEthernetAutoDiscoveryRoute) 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) Len

func (er *EVPNEthernetSegmentRoute) Len() int

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 EVPNIPMSIRoute

type EVPNIPMSIRoute struct {
	RD   RouteDistinguisherInterface
	ETag uint32
	EC   ExtendedCommunityInterface
}

func (*EVPNIPMSIRoute) DecodeFromBytes

func (er *EVPNIPMSIRoute) DecodeFromBytes(data []byte) error

func (*EVPNIPMSIRoute) Len

func (er *EVPNIPMSIRoute) Len() int

func (*EVPNIPMSIRoute) MarshalJSON

func (er *EVPNIPMSIRoute) MarshalJSON() ([]byte, error)

func (*EVPNIPMSIRoute) Serialize

func (er *EVPNIPMSIRoute) Serialize() ([]byte, error)

func (*EVPNIPMSIRoute) String

func (er *EVPNIPMSIRoute) String() string

type EVPNIPPrefixRoute

type EVPNIPPrefixRoute struct {
	RD             RouteDistinguisherInterface
	ESI            EthernetSegmentIdentifier
	ETag           uint32
	IPPrefixLength uint8
	IPPrefix       net.IP
	GWIPAddress    net.IP
	Label          uint32
}

func (*EVPNIPPrefixRoute) DecodeFromBytes

func (er *EVPNIPPrefixRoute) DecodeFromBytes(data []byte) error

func (*EVPNIPPrefixRoute) Len

func (er *EVPNIPPrefixRoute) Len() int

func (*EVPNIPPrefixRoute) MarshalJSON

func (er *EVPNIPPrefixRoute) MarshalJSON() ([]byte, error)

func (*EVPNIPPrefixRoute) Serialize

func (er *EVPNIPPrefixRoute) Serialize() ([]byte, error)

func (*EVPNIPPrefixRoute) String

func (er *EVPNIPPrefixRoute) 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) Len

func (er *EVPNMacIPAdvertisementRoute) Len() int

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) Len

func (*EVPNMulticastEthernetTagRoute) MarshalJSON

func (er *EVPNMulticastEthernetTagRoute) MarshalJSON() ([]byte, error)

func (*EVPNMulticastEthernetTagRoute) Serialize

func (er *EVPNMulticastEthernetTagRoute) Serialize() ([]byte, error)

func (*EVPNMulticastEthernetTagRoute) String

type EVPNNLRI

type EVPNNLRI struct {
	PrefixDefault
	RouteType     uint8
	Length        uint8
	RouteTypeData EVPNRouteTypeInterface
}

func NewEVPNEthernetAutoDiscoveryRoute

func NewEVPNEthernetAutoDiscoveryRoute(rd RouteDistinguisherInterface, esi EthernetSegmentIdentifier, etag uint32, label uint32) *EVPNNLRI

func NewEVPNEthernetSegmentRoute

func NewEVPNEthernetSegmentRoute(rd RouteDistinguisherInterface, esi EthernetSegmentIdentifier, ipAddress string) *EVPNNLRI

func NewEVPNIPPrefixRoute

func NewEVPNIPPrefixRoute(rd RouteDistinguisherInterface, esi EthernetSegmentIdentifier, etag uint32, ipPrefixLength uint8, ipPrefix string, gateway string, label uint32) *EVPNNLRI

func NewEVPNMacIPAdvertisementRoute

func NewEVPNMacIPAdvertisementRoute(rd RouteDistinguisherInterface, esi EthernetSegmentIdentifier, etag uint32, macAddress string, ipAddress string, labels []uint32) *EVPNNLRI

func NewEVPNMulticastEthernetTagRoute

func NewEVPNMulticastEthernetTagRoute(rd RouteDistinguisherInterface, etag uint32, ipAddress string) *EVPNNLRI

func NewEVPNNLRI

func NewEVPNNLRI(routeType uint8, routeTypeData EVPNRouteTypeInterface) *EVPNNLRI

func (*EVPNNLRI) AFI

func (n *EVPNNLRI) AFI() uint16

func (*EVPNNLRI) DecodeFromBytes

func (n *EVPNNLRI) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*EVPNNLRI) Flat

func (l *EVPNNLRI) Flat() map[string]string

func (*EVPNNLRI) Len

func (n *EVPNNLRI) Len(options ...*MarshallingOption) int

func (*EVPNNLRI) MarshalJSON

func (n *EVPNNLRI) MarshalJSON() ([]byte, error)

func (*EVPNNLRI) RD

func (*EVPNNLRI) SAFI

func (n *EVPNNLRI) SAFI() uint8

func (*EVPNNLRI) Serialize

func (n *EVPNNLRI) Serialize(options ...*MarshallingOption) ([]byte, error)

func (*EVPNNLRI) String

func (n *EVPNNLRI) String() string

type EVPNRouteTypeInterface

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

	MarshalJSON() ([]byte, error)
	// contains filtered or unexported methods
}

type EncapExtended

type EncapExtended struct {
	TunnelType TunnelType
}

func NewEncapExtended

func NewEncapExtended(tunnelType TunnelType) *EncapExtended

func (*EncapExtended) Flat

func (e *EncapExtended) Flat() map[string]string

func (*EncapExtended) GetTypes

func (*EncapExtended) MarshalJSON

func (e *EncapExtended) MarshalJSON() ([]byte, error)

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 NewEncapNLRI(endpoint string) *EncapNLRI

func (*EncapNLRI) AFI

func (n *EncapNLRI) AFI() uint16

func (*EncapNLRI) DecodeFromBytes

func (n *EncapNLRI) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*EncapNLRI) Len

func (n *EncapNLRI) Len(options ...*MarshallingOption) int

func (*EncapNLRI) SAFI

func (n *EncapNLRI) SAFI() uint8

func (*EncapNLRI) Serialize

func (n *EncapNLRI) Serialize(options ...*MarshallingOption) ([]byte, error)

func (*EncapNLRI) String

func (n *EncapNLRI) String() string

type EncapSubTLVType

type EncapSubTLVType uint8
const (
	ENCAP_SUBTLV_TYPE_ENCAPSULATION         EncapSubTLVType = 1
	ENCAP_SUBTLV_TYPE_PROTOCOL              EncapSubTLVType = 2
	ENCAP_SUBTLV_TYPE_COLOR                 EncapSubTLVType = 4
	ENCAP_SUBTLV_TYPE_EGRESS_ENDPOINT       EncapSubTLVType = 6
	ENCAP_SUBTLV_TYPE_UDP_DEST_PORT         EncapSubTLVType = 8
	ENCAP_SUBTLV_TYPE_SRPREFERENCE          EncapSubTLVType = 12
	ENCAP_SUBTLV_TYPE_SRBINDING_SID         EncapSubTLVType = 13
	ENCAP_SUBTLV_TYPE_SRENLP                EncapSubTLVType = 14
	ENCAP_SUBTLV_TYPE_SRPRIORITY            EncapSubTLVType = 15
	ENCAP_SUBTLV_TYPE_SRSEGMENT_LIST        EncapSubTLVType = 128
	ENCAP_SUBTLV_TYPE_SRCANDIDATE_PATH_NAME EncapSubTLVType = 129
)

type Encapv6NLRI

type Encapv6NLRI struct {
	EncapNLRI
}

func NewEncapv6NLRI

func NewEncapv6NLRI(endpoint string) *Encapv6NLRI

func (*Encapv6NLRI) AFI

func (n *Encapv6NLRI) AFI() uint16

type ErrorHandling

type ErrorHandling int
const (
	ERROR_HANDLING_NONE ErrorHandling = iota
	ERROR_HANDLING_ATTRIBUTE_DISCARD
	ERROR_HANDLING_TREAT_AS_WITHDRAW
	ERROR_HANDLING_AFISAFI_DISABLE
	ERROR_HANDLING_SESSION_RESET
)

type EthernetSegmentIdentifier

type EthernetSegmentIdentifier struct {
	Type  ESIType
	Value []byte
}

func ParseEthernetSegmentIdentifier

func ParseEthernetSegmentIdentifier(args []string) (EthernetSegmentIdentifier, error)

Decode Ethernet Segment Identifier (ESI) from string slice.

The first element of args should be the Type field (e.g., "ARBITRARY", "arbitrary", "ESI_ARBITRARY" or "esi_arbitrary") and "single-homed" is the special keyword for all zeroed ESI. For the "ARBITRARY" Value field (Type 0), it should be the colon separated hex values and the number of elements should be 9 at most.

e.g.) args := []string{"ARBITRARY", "11:22:33:44:55:66:77:88:99"}

For the other types, the Value field format is the similar to the string format of ESI.

e.g.) args := []string{"lacp", "aa:bb:cc:dd:ee:ff", "100"}

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

Potentially taken from https://www.iana.org/assignments/ieee-802-numbers/ieee-802-numbers.xhtml

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. Registries for the "Sub-Type" Field RANGE REGISTRATION 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_FLOWSPEC_REDIRECT_IP6   ExtendedCommunityAttrSubType = 0x0B // 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_ROUTER_MAC   ExtendedCommunityAttrSubType = 0x03 // EC_TYPE: 0x06

	EC_SUBTYPE_UUID_BASED_RT ExtendedCommunityAttrSubType = 0x11
)

type ExtendedCommunityAttrType

type ExtendedCommunityAttrType uint8

RFC7153 5.1. Registries for the "Type" Field RANGE REGISTRATION 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_IP6_SPECIFIC               ExtendedCommunityAttrType = 0x00 // RFC5701
	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_LINK_BANDWIDTH         ExtendedCommunityAttrType = 0x40
	EC_TYPE_NON_TRANSITIVE_IP6_SPECIFIC           ExtendedCommunityAttrType = 0x40 // RFC5701
	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 ParseIP6Extended

func ParseIP6Extended(data []byte) (ExtendedCommunityInterface, error)

func ParseRouteTarget

func ParseRouteTarget(rt string) (ExtendedCommunityInterface, error)

type FSMState

type FSMState int
const (
	BGP_FSM_IDLE FSMState = iota
	BGP_FSM_CONNECT
	BGP_FSM_ACTIVE
	BGP_FSM_OPENSENT
	BGP_FSM_OPENCONFIRM
	BGP_FSM_ESTABLISHED
)

func (FSMState) String

func (i FSMState) String() string

type FlowSpecComponent

type FlowSpecComponent struct {
	Items []*FlowSpecComponentItem
	// contains filtered or unexported fields
}

func NewFlowSpecComponent

func NewFlowSpecComponent(typ BGPFlowSpecType, items []*FlowSpecComponentItem) *FlowSpecComponent

func (*FlowSpecComponent) DecodeFromBytes

func (p *FlowSpecComponent) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*FlowSpecComponent) Len

func (p *FlowSpecComponent) Len(options ...*MarshallingOption) int

func (*FlowSpecComponent) MarshalJSON

func (p *FlowSpecComponent) MarshalJSON() ([]byte, error)

func (*FlowSpecComponent) Serialize

func (p *FlowSpecComponent) Serialize(options ...*MarshallingOption) ([]byte, error)

func (*FlowSpecComponent) String

func (p *FlowSpecComponent) String() string

func (*FlowSpecComponent) Type

type FlowSpecComponentInterface

type FlowSpecComponentInterface interface {
	DecodeFromBytes([]byte, ...*MarshallingOption) error
	Serialize(...*MarshallingOption) ([]byte, error)
	Len(...*MarshallingOption) int
	Type() BGPFlowSpecType
	String() string
}

func ParseFlowSpecComponents

func ParseFlowSpecComponents(rf RouteFamily, arg string) ([]FlowSpecComponentInterface, error)

type FlowSpecComponentItem

type FlowSpecComponentItem struct {
	Op    uint8  `json:"op"`
	Value uint64 `json:"value"`
}

func NewFlowSpecComponentItem

func NewFlowSpecComponentItem(op uint8, value uint64) *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 (p *FlowSpecDestinationMac) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*FlowSpecDestinationMac) Len

func (p *FlowSpecDestinationMac) Len(options ...*MarshallingOption) int

func (*FlowSpecDestinationMac) MarshalJSON

func (p *FlowSpecDestinationMac) MarshalJSON() ([]byte, error)

func (*FlowSpecDestinationMac) Serialize

func (p *FlowSpecDestinationMac) Serialize(options ...*MarshallingOption) ([]byte, error)

func (*FlowSpecDestinationMac) String

func (p *FlowSpecDestinationMac) String() string

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 (p *FlowSpecDestinationPrefix) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*FlowSpecDestinationPrefix) Len

func (p *FlowSpecDestinationPrefix) Len(options ...*MarshallingOption) int

func (*FlowSpecDestinationPrefix) MarshalJSON

func (p *FlowSpecDestinationPrefix) MarshalJSON() ([]byte, error)

func (*FlowSpecDestinationPrefix) Serialize

func (p *FlowSpecDestinationPrefix) Serialize(options ...*MarshallingOption) ([]byte, error)

func (*FlowSpecDestinationPrefix) String

func (p *FlowSpecDestinationPrefix) String() string

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

func (p *FlowSpecDestinationPrefix6) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

draft-ietf-idr-flow-spec-v6-06 <type (1 octet), prefix length (1 octet), prefix offset(1 octet), prefix>

func (*FlowSpecDestinationPrefix6) Len

func (p *FlowSpecDestinationPrefix6) Len(options ...*MarshallingOption) int

func (*FlowSpecDestinationPrefix6) MarshalJSON

func (p *FlowSpecDestinationPrefix6) MarshalJSON() ([]byte, error)

func (*FlowSpecDestinationPrefix6) Serialize

func (p *FlowSpecDestinationPrefix6) Serialize(options ...*MarshallingOption) ([]byte, error)

func (*FlowSpecDestinationPrefix6) String

func (p *FlowSpecDestinationPrefix6) String() string

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, options ...*MarshallingOption) error

func (*FlowSpecIPv4Unicast) Flat

func (l *FlowSpecIPv4Unicast) Flat() map[string]string

type FlowSpecIPv4VPN

type FlowSpecIPv4VPN struct {
	FlowSpecNLRI
}

func (*FlowSpecIPv4VPN) DecodeFromBytes

func (n *FlowSpecIPv4VPN) DecodeFromBytes(data []byte, options ...*MarshallingOption) 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, options ...*MarshallingOption) error

func (*FlowSpecIPv6Unicast) Flat

func (l *FlowSpecIPv6Unicast) Flat() map[string]string

type FlowSpecIPv6VPN

type FlowSpecIPv6VPN struct {
	FlowSpecNLRI
}

func (*FlowSpecIPv6VPN) DecodeFromBytes

func (n *FlowSpecIPv6VPN) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*FlowSpecIPv6VPN) Flat

func (l *FlowSpecIPv6VPN) Flat() map[string]string

type FlowSpecL2VPN

type FlowSpecL2VPN struct {
	FlowSpecNLRI
}

func (*FlowSpecL2VPN) DecodeFromBytes

func (n *FlowSpecL2VPN) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*FlowSpecL2VPN) Flat

func (l *FlowSpecL2VPN) Flat() map[string]string

type FlowSpecNLRI

type FlowSpecNLRI struct {
	PrefixDefault
	Value []FlowSpecComponentInterface
	// contains filtered or unexported fields
}

func (*FlowSpecNLRI) AFI

func (n *FlowSpecNLRI) AFI() uint16

func (*FlowSpecNLRI) Len

func (n *FlowSpecNLRI) Len(options ...*MarshallingOption) int

func (*FlowSpecNLRI) MarshalJSON

func (n *FlowSpecNLRI) MarshalJSON() ([]byte, error)

func (*FlowSpecNLRI) RD

func (*FlowSpecNLRI) SAFI

func (n *FlowSpecNLRI) SAFI() uint8

func (*FlowSpecNLRI) Serialize

func (n *FlowSpecNLRI) Serialize(options ...*MarshallingOption) ([]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 (p *FlowSpecSourceMac) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*FlowSpecSourceMac) Len

func (p *FlowSpecSourceMac) Len(options ...*MarshallingOption) int

func (*FlowSpecSourceMac) MarshalJSON

func (p *FlowSpecSourceMac) MarshalJSON() ([]byte, error)

func (*FlowSpecSourceMac) Serialize

func (p *FlowSpecSourceMac) Serialize(options ...*MarshallingOption) ([]byte, error)

func (*FlowSpecSourceMac) String

func (p *FlowSpecSourceMac) String() string

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 (p *FlowSpecSourcePrefix) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*FlowSpecSourcePrefix) Len

func (p *FlowSpecSourcePrefix) Len(options ...*MarshallingOption) int

func (*FlowSpecSourcePrefix) MarshalJSON

func (p *FlowSpecSourcePrefix) MarshalJSON() ([]byte, error)

func (*FlowSpecSourcePrefix) Serialize

func (p *FlowSpecSourcePrefix) Serialize(options ...*MarshallingOption) ([]byte, error)

func (*FlowSpecSourcePrefix) String

func (p *FlowSpecSourcePrefix) String() string

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

func (p *FlowSpecSourcePrefix6) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

draft-ietf-idr-flow-spec-v6-06 <type (1 octet), prefix length (1 octet), prefix offset(1 octet), prefix>

func (*FlowSpecSourcePrefix6) Len

func (p *FlowSpecSourcePrefix6) Len(options ...*MarshallingOption) int

func (*FlowSpecSourcePrefix6) MarshalJSON

func (p *FlowSpecSourcePrefix6) MarshalJSON() ([]byte, error)

func (*FlowSpecSourcePrefix6) Serialize

func (p *FlowSpecSourcePrefix6) Serialize(options ...*MarshallingOption) ([]byte, error)

func (*FlowSpecSourcePrefix6) String

func (p *FlowSpecSourcePrefix6) String() string

func (*FlowSpecSourcePrefix6) Type

func (p *FlowSpecSourcePrefix6) Type() BGPFlowSpecType

type FlowSpecUnknown

type FlowSpecUnknown struct {
	Value []byte
}

func (*FlowSpecUnknown) DecodeFromBytes

func (p *FlowSpecUnknown) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*FlowSpecUnknown) Len

func (p *FlowSpecUnknown) Len(options ...*MarshallingOption) int

func (*FlowSpecUnknown) MarshalJSON

func (p *FlowSpecUnknown) MarshalJSON() ([]byte, error)

func (*FlowSpecUnknown) Serialize

func (p *FlowSpecUnknown) Serialize(options ...*MarshallingOption) ([]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 (*FourOctetAsSpecificExtended) GetTypes

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 FragmentFlag

type FragmentFlag int

func (FragmentFlag) String

func (f FragmentFlag) 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, options ...*MarshallingOption) error

func (*IPAddrPrefix) Len

func (r *IPAddrPrefix) Len(options ...*MarshallingOption) int

func (*IPAddrPrefix) SAFI

func (r *IPAddrPrefix) SAFI() uint8

func (*IPAddrPrefix) Serialize

func (r *IPAddrPrefix) Serialize(options ...*MarshallingOption) ([]byte, error)

type IPAddrPrefixDefault

type IPAddrPrefixDefault struct {
	PrefixDefault
	Length uint8
	Prefix net.IP
}

func (*IPAddrPrefixDefault) Flat

func (p *IPAddrPrefixDefault) Flat() map[string]string

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 (*IPv4AddressSpecificExtended) GetTypes

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 IPv6AddressSpecificExtended

type IPv6AddressSpecificExtended struct {
	SubType      ExtendedCommunityAttrSubType
	IPv6         net.IP
	LocalAdmin   uint16
	IsTransitive bool
}

func NewIPv6AddressSpecificExtended

func NewIPv6AddressSpecificExtended(subtype ExtendedCommunityAttrSubType, ip string, localAdmin uint16, isTransitive bool) *IPv6AddressSpecificExtended

func (*IPv6AddressSpecificExtended) Flat

func (*IPv6AddressSpecificExtended) GetTypes

func (*IPv6AddressSpecificExtended) MarshalJSON

func (e *IPv6AddressSpecificExtended) MarshalJSON() ([]byte, error)

func (*IPv6AddressSpecificExtended) Serialize

func (e *IPv6AddressSpecificExtended) Serialize() ([]byte, error)

func (*IPv6AddressSpecificExtended) String

func (e *IPv6AddressSpecificExtended) String() string

type IngressReplTunnelID

type IngressReplTunnelID struct {
	Value net.IP
}

func NewIngressReplTunnelID

func NewIngressReplTunnelID(value string) *IngressReplTunnelID

func (*IngressReplTunnelID) Len

func (i *IngressReplTunnelID) Len() int

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, options ...*MarshallingOption) error

func (*LabeledIPAddrPrefix) IPPrefixLen

func (l *LabeledIPAddrPrefix) IPPrefixLen() uint8

func (*LabeledIPAddrPrefix) Len

func (l *LabeledIPAddrPrefix) Len(options ...*MarshallingOption) int

func (*LabeledIPAddrPrefix) MarshalJSON

func (l *LabeledIPAddrPrefix) MarshalJSON() ([]byte, error)

func (*LabeledIPAddrPrefix) SAFI

func (r *LabeledIPAddrPrefix) SAFI() uint8

func (*LabeledIPAddrPrefix) Serialize

func (l *LabeledIPAddrPrefix) Serialize(options ...*MarshallingOption) ([]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, options ...*MarshallingOption) error

func (*LabeledVPNIPAddrPrefix) Flat

func (l *LabeledVPNIPAddrPrefix) Flat() map[string]string

func (*LabeledVPNIPAddrPrefix) IPPrefix

func (l *LabeledVPNIPAddrPrefix) IPPrefix() string

func (*LabeledVPNIPAddrPrefix) IPPrefixLen

func (l *LabeledVPNIPAddrPrefix) IPPrefixLen() uint8

func (*LabeledVPNIPAddrPrefix) Len

func (l *LabeledVPNIPAddrPrefix) Len(options ...*MarshallingOption) int

func (*LabeledVPNIPAddrPrefix) MarshalJSON

func (l *LabeledVPNIPAddrPrefix) MarshalJSON() ([]byte, error)

func (*LabeledVPNIPAddrPrefix) SAFI

func (l *LabeledVPNIPAddrPrefix) SAFI() uint8

func (*LabeledVPNIPAddrPrefix) Serialize

func (l *LabeledVPNIPAddrPrefix) Serialize(options ...*MarshallingOption) ([]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

type LargeCommunity

type LargeCommunity struct {
	ASN        uint32
	LocalData1 uint32
	LocalData2 uint32
}

func NewLargeCommunity

func NewLargeCommunity(asn, data1, data2 uint32) *LargeCommunity

func ParseLargeCommunity

func ParseLargeCommunity(value string) (*LargeCommunity, error)

func (*LargeCommunity) Eq

func (c *LargeCommunity) Eq(rhs *LargeCommunity) bool

func (*LargeCommunity) Serialize

func (c *LargeCommunity) Serialize() ([]byte, error)

func (*LargeCommunity) String

func (c *LargeCommunity) String() string

type LinkBandwidthExtended

type LinkBandwidthExtended struct {
	AS        uint16
	Bandwidth float32
}

func NewLinkBandwidthExtended

func NewLinkBandwidthExtended(as uint16, bw float32) *LinkBandwidthExtended

func (*LinkBandwidthExtended) Flat

func (e *LinkBandwidthExtended) Flat() map[string]string

func (*LinkBandwidthExtended) GetTypes

func (*LinkBandwidthExtended) MarshalJSON

func (e *LinkBandwidthExtended) MarshalJSON() ([]byte, error)

func (*LinkBandwidthExtended) Serialize

func (e *LinkBandwidthExtended) Serialize() ([]byte, error)

func (*LinkBandwidthExtended) String

func (e *LinkBandwidthExtended) String() string

type LsAddrPrefix

type LsAddrPrefix struct {
	PrefixDefault
	Type   LsNLRIType
	Length uint16
	NLRI   LsNLRIInterface
}

func (*LsAddrPrefix) AFI

func (l *LsAddrPrefix) AFI() uint16

func (*LsAddrPrefix) DecodeFromBytes

func (l *LsAddrPrefix) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*LsAddrPrefix) Flat

func (l *LsAddrPrefix) Flat() map[string]string

func (*LsAddrPrefix) Len

func (l *LsAddrPrefix) Len(...*MarshallingOption) int

func (*LsAddrPrefix) MarshalJSON

func (l *LsAddrPrefix) MarshalJSON() ([]byte, error)

func (*LsAddrPrefix) SAFI

func (l *LsAddrPrefix) SAFI() uint8

func (*LsAddrPrefix) Serialize

func (l *LsAddrPrefix) Serialize(options ...*MarshallingOption) ([]byte, error)

func (*LsAddrPrefix) String

func (l *LsAddrPrefix) String() string

type LsAttribute

type LsAttribute struct {
	Node   LsAttributeNode   `json:"node"`
	Link   LsAttributeLink   `json:"link"`
	Prefix LsAttributePrefix `json:"prefix"`
}
type LsAttributeLink struct {
	Name             *string `json:"name,omitempty"`
	LocalRouterID    *net.IP `json:"local_router_id_ipv4,omitempty"`
	LocalRouterIDv6  *net.IP `json:"local_router_id_ipv6,omitempty"`
	RemoteRouterID   *net.IP `json:"remote_router_id_ipv4,omitempty"`
	RemoteRouterIDv6 *net.IP `json:"remote_router_id_ipv6,omitempty"`
	AdminGroup       *uint32 `json:"admin_group,omitempty"`
	DefaultTEMetric  *uint32 `json:"default_te_metric,omitempty"`
	IGPMetric        *uint32 `json:"igp_metric,omitempty"`
	Opaque           *[]byte `json:"opaque,omitempty"`

	// Bandwidth is expressed in bytes (not bits) per second.
	Bandwidth           *float32    `json:"bandwidth,omitempty"`
	ReservableBandwidth *float32    `json:"reservable_bandwidth,omitempty"`
	UnreservedBandwidth *[8]float32 `json:"unreserved_bandwidth,omitempty"`
	Srlgs               *[]uint32   `json:"srlgs,omitempty"`

	SrAdjacencySID *uint32 `json:"adjacency_sid,omitempty"`
}

type LsAttributeNode

type LsAttributeNode struct {
	Flags           *LsNodeFlags `json:"flags,omitempty"`
	Opaque          *[]byte      `json:"opaque,omitempty"`
	Name            *string      `json:"name,omitempty"`
	IsisArea        *[]byte      `json:"isis_area,omitempty"`
	LocalRouterID   *net.IP      `json:"local_router_id_ipv4,omitempty"`
	LocalRouterIDv6 *net.IP      `json:"local_router_id_ipv6,omitempty"`

	// Segment Routing
	SrCapabilties *LsSrCapabilities `json:"sr_capabilities,omitempty"`
	SrAlgorithms  *[]byte           `json:"sr_algorithms,omitempty"`
	SrLocalBlock  *LsSrLocalBlock   `json:"sr_local_block,omitempty"`
}

type LsAttributePrefix

type LsAttributePrefix struct {
	IGPFlags *LsIGPFlags `json:"igp_flags,omitempty"`
	Opaque   *[]byte     `json:"opaque,omitempty"`

	SrPrefixSID *uint32 `json:"sr_prefix_sid,omitempty"`
}

type LsIGPFlags

type LsIGPFlags struct {
	Down          bool `json:"down"`
	NoUnicast     bool `json:"no_unicast"`
	LocalAddress  bool `json:"local_address"`
	PropagateNSSA bool `json:"propagate_nssa"`
}

https://tools.ietf.org/html/rfc7752#section-3.3.3.1

type LsLinkDescriptor

type LsLinkDescriptor struct {
	LinkLocalID       *uint32
	LinkRemoteID      *uint32
	InterfaceAddrIPv4 *net.IP
	NeighborAddrIPv4  *net.IP
	InterfaceAddrIPv6 *net.IP
	NeighborAddrIPv6  *net.IP
}

func (*LsLinkDescriptor) ParseTLVs

func (l *LsLinkDescriptor) ParseTLVs(tlvs []LsTLVInterface)

func (*LsLinkDescriptor) String

func (l *LsLinkDescriptor) String() string

type LsLinkNLRI

type LsLinkNLRI struct {
	LsNLRI
	LocalNodeDesc  LsTLVInterface
	RemoteNodeDesc LsTLVInterface
	LinkDesc       []LsTLVInterface
}

func (*LsLinkNLRI) DecodeFromBytes

func (l *LsLinkNLRI) DecodeFromBytes(data []byte) error

func (*LsLinkNLRI) MarshalJSON

func (l *LsLinkNLRI) MarshalJSON() ([]byte, error)

func (*LsLinkNLRI) Serialize

func (l *LsLinkNLRI) Serialize() ([]byte, error)

func (*LsLinkNLRI) String

func (l *LsLinkNLRI) String() string

type LsNLRI

type LsNLRI struct {
	NLRIType   LsNLRIType
	Length     uint16
	ProtocolID LsProtocolID
	Identifier uint64
}

func (*LsNLRI) DecodeFromBytes

func (l *LsNLRI) DecodeFromBytes(data []byte) error

func (*LsNLRI) Len

func (l *LsNLRI) Len() int

func (*LsNLRI) Serialize

func (l *LsNLRI) Serialize(value []byte) ([]byte, error)

func (*LsNLRI) Type

func (l *LsNLRI) Type() LsNLRIType

type LsNLRIInterface

type LsNLRIInterface interface {
	DecodeFromBytes([]byte) error
	Serialize() ([]byte, error)
	Len() int
	Type() LsNLRIType
	String() string
}

type LsNLRIType

type LsNLRIType uint16
const (
	LS_NLRI_TYPE_UNKNOWN LsNLRIType = iota
	LS_NLRI_TYPE_NODE
	LS_NLRI_TYPE_LINK
	LS_NLRI_TYPE_PREFIX_IPV4
	LS_NLRI_TYPE_PREFIX_IPV6
)

type LsNodeDescriptor

type LsNodeDescriptor struct {
	Asn         uint32 `json:"asn"`
	BGPLsID     uint32 `json:"bgp_ls_id"`
	OspfAreaID  uint32 `json:"ospf_area_id"`
	PseudoNode  bool   `json:"pseudo_node"`
	IGPRouterID string `json:"igp_router_id"`
}

type LsNodeFlags

type LsNodeFlags struct {
	Overload bool `json:"overload"`
	Attached bool `json:"attached"`
	External bool `json:"external"`
	ABR      bool `json:"abr"`
	Router   bool `json:"router"`
	V6       bool `json:"v6"`
}

https://tools.ietf.org/html/rfc7752#section-3.3.1.1

type LsNodeNLRI

type LsNodeNLRI struct {
	LsNLRI
	LocalNodeDesc LsTLVInterface
}

func (*LsNodeNLRI) DecodeFromBytes

func (l *LsNodeNLRI) DecodeFromBytes(data []byte) error

func (*LsNodeNLRI) MarshalJSON

func (l *LsNodeNLRI) MarshalJSON() ([]byte, error)

func (*LsNodeNLRI) Serialize

func (l *LsNodeNLRI) Serialize() ([]byte, error)

func (*LsNodeNLRI) String

func (l *LsNodeNLRI) String() string

type LsOspfRouteType

type LsOspfRouteType uint8

func (LsOspfRouteType) String

func (l LsOspfRouteType) String() string

type LsPrefixDescriptor

type LsPrefixDescriptor struct {
	IPReachability []net.IPNet
	OSPFRouteType  LsOspfRouteType
}

func (*LsPrefixDescriptor) ParseTLVs

func (l *LsPrefixDescriptor) ParseTLVs(tlvs []LsTLVInterface, ipv6 bool)

type LsPrefixV4NLRI

type LsPrefixV4NLRI struct {
	LsNLRI
	LocalNodeDesc LsTLVInterface
	PrefixDesc    []LsTLVInterface
}

func (*LsPrefixV4NLRI) DecodeFromBytes

func (l *LsPrefixV4NLRI) DecodeFromBytes(data []byte) error

func (*LsPrefixV4NLRI) MarshalJSON

func (l *LsPrefixV4NLRI) MarshalJSON() ([]byte, error)

func (*LsPrefixV4NLRI) Serialize

func (l *LsPrefixV4NLRI) Serialize() ([]byte, error)

func (*LsPrefixV4NLRI) String

func (l *LsPrefixV4NLRI) String() string

type LsPrefixV6NLRI

type LsPrefixV6NLRI struct {
	LsNLRI
	LocalNodeDesc LsTLVInterface
	PrefixDesc    []LsTLVInterface
}

func (*LsPrefixV6NLRI) DecodeFromBytes

func (l *LsPrefixV6NLRI) DecodeFromBytes(data []byte) error

func (*LsPrefixV6NLRI) MarshalJSON

func (l *LsPrefixV6NLRI) MarshalJSON() ([]byte, error)

func (*LsPrefixV6NLRI) Serialize

func (l *LsPrefixV6NLRI) Serialize() ([]byte, error)

func (*LsPrefixV6NLRI) String

func (l *LsPrefixV6NLRI) String() string

type LsProtocolID

type LsProtocolID uint8

func (LsProtocolID) String

func (l LsProtocolID) String() string

type LsSrCapabilities

type LsSrCapabilities struct {
	IPv4Supported bool        `json:"ipv4_supported"`
	IPv6Supported bool        `json:"ipv6_supported"`
	Ranges        []LsSrRange `json:"ranges"`
}

type LsSrLabelRange

type LsSrLabelRange struct {
	Range      uint32
	FirstLabel LsTLVSIDLabel
}

type LsSrLocalBlock

type LsSrLocalBlock struct {
	Ranges []LsSrRange `json:"ranges"`
}

type LsSrRange

type LsSrRange struct {
	Begin uint32 `json:"begin"`
	End   uint32 `json:"end"`
}

type LsTLV

type LsTLV struct {
	Type   LsTLVType
	Length uint16
}

func (*LsTLV) DecodeFromBytes

func (l *LsTLV) DecodeFromBytes(data []byte) ([]byte, error)

func (*LsTLV) Len

func (l *LsTLV) Len() int

func (*LsTLV) Serialize

func (l *LsTLV) Serialize(value []byte) ([]byte, error)

type LsTLVAdjacencySID

type LsTLVAdjacencySID struct {
	LsTLV
	Flags  uint8
	Weight uint8
	SID    uint32
}

func (*LsTLVAdjacencySID) DecodeFromBytes

func (l *LsTLVAdjacencySID) DecodeFromBytes(data []byte) error

func (*LsTLVAdjacencySID) MarshalJSON

func (l *LsTLVAdjacencySID) MarshalJSON() ([]byte, error)

func (*LsTLVAdjacencySID) Serialize

func (l *LsTLVAdjacencySID) Serialize() ([]byte, error)

func (*LsTLVAdjacencySID) String

func (l *LsTLVAdjacencySID) String() string

type LsTLVAdminGroup

type LsTLVAdminGroup struct {
	LsTLV
	AdminGroup uint32
}

func (*LsTLVAdminGroup) DecodeFromBytes

func (l *LsTLVAdminGroup) DecodeFromBytes(data []byte) error

func (*LsTLVAdminGroup) MarshalJSON

func (l *LsTLVAdminGroup) MarshalJSON() ([]byte, error)

func (*LsTLVAdminGroup) Serialize

func (l *LsTLVAdminGroup) Serialize() ([]byte, error)

func (*LsTLVAdminGroup) String

func (l *LsTLVAdminGroup) String() string

type LsTLVAutonomousSystem

type LsTLVAutonomousSystem struct {
	LsTLV
	ASN uint32
}

func (*LsTLVAutonomousSystem) DecodeFromBytes

func (l *LsTLVAutonomousSystem) DecodeFromBytes(data []byte) error

func (*LsTLVAutonomousSystem) MarshalJSON

func (l *LsTLVAutonomousSystem) MarshalJSON() ([]byte, error)

func (*LsTLVAutonomousSystem) Serialize

func (l *LsTLVAutonomousSystem) Serialize() ([]byte, error)

func (*LsTLVAutonomousSystem) String

func (l *LsTLVAutonomousSystem) String() string

type LsTLVBgpLsID

type LsTLVBgpLsID struct {
	LsTLV
	BGPLsID uint32
}

func (*LsTLVBgpLsID) DecodeFromBytes

func (l *LsTLVBgpLsID) DecodeFromBytes(data []byte) error

func (*LsTLVBgpLsID) MarshalJSON

func (l *LsTLVBgpLsID) MarshalJSON() ([]byte, error)

func (*LsTLVBgpLsID) Serialize

func (l *LsTLVBgpLsID) Serialize() ([]byte, error)

func (*LsTLVBgpLsID) String

func (l *LsTLVBgpLsID) String() string

type LsTLVIGPFlags

type LsTLVIGPFlags struct {
	LsTLV
	Flags uint8
}

func (*LsTLVIGPFlags) DecodeFromBytes

func (l *LsTLVIGPFlags) DecodeFromBytes(data []byte) error

func (*LsTLVIGPFlags) Extract

func (l *LsTLVIGPFlags) Extract() *LsIGPFlags

func (*LsTLVIGPFlags) MarshalJSON

func (l *LsTLVIGPFlags) MarshalJSON() ([]byte, error)

func (*LsTLVIGPFlags) Serialize

func (l *LsTLVIGPFlags) Serialize() ([]byte, error)

func (*LsTLVIGPFlags) String

func (l *LsTLVIGPFlags) String() string

type LsTLVIGPMetric

type LsTLVIGPMetric struct {
	LsTLV
	Metric uint32
}

func (*LsTLVIGPMetric) DecodeFromBytes

func (l *LsTLVIGPMetric) DecodeFromBytes(data []byte) error

func (*LsTLVIGPMetric) MarshalJSON

func (l *LsTLVIGPMetric) MarshalJSON() ([]byte, error)

func (*LsTLVIGPMetric) Serialize

func (l *LsTLVIGPMetric) Serialize() ([]byte, error)

func (*LsTLVIGPMetric) String

func (l *LsTLVIGPMetric) String() string

type LsTLVIPReachability

type LsTLVIPReachability struct {
	LsTLV
	PrefixLength uint8
	Prefix       []byte
}

func (*LsTLVIPReachability) DecodeFromBytes

func (l *LsTLVIPReachability) DecodeFromBytes(data []byte) error

func (*LsTLVIPReachability) MarshalJSON

func (l *LsTLVIPReachability) MarshalJSON() ([]byte, error)

func (*LsTLVIPReachability) Serialize

func (l *LsTLVIPReachability) Serialize() ([]byte, error)

func (*LsTLVIPReachability) String

func (l *LsTLVIPReachability) String() string

func (*LsTLVIPReachability) ToIPNet

func (l *LsTLVIPReachability) ToIPNet(ipv6 bool) net.IPNet

type LsTLVIPv4InterfaceAddr

type LsTLVIPv4InterfaceAddr struct {
	LsTLV
	IP net.IP
}

func (*LsTLVIPv4InterfaceAddr) DecodeFromBytes

func (l *LsTLVIPv4InterfaceAddr) DecodeFromBytes(data []byte) error

func (*LsTLVIPv4InterfaceAddr) MarshalJSON

func (l *LsTLVIPv4InterfaceAddr) MarshalJSON() ([]byte, error)

func (*LsTLVIPv4InterfaceAddr) Serialize

func (l *LsTLVIPv4InterfaceAddr) Serialize() ([]byte, error)

func (*LsTLVIPv4InterfaceAddr) String

func (l *LsTLVIPv4InterfaceAddr) String() string

type LsTLVIPv4NeighborAddr

type LsTLVIPv4NeighborAddr struct {
	LsTLV
	IP net.IP
}

func (*LsTLVIPv4NeighborAddr) DecodeFromBytes

func (l *LsTLVIPv4NeighborAddr) DecodeFromBytes(data []byte) error

func (*LsTLVIPv4NeighborAddr) MarshalJSON

func (l *LsTLVIPv4NeighborAddr) MarshalJSON() ([]byte, error)

func (*LsTLVIPv4NeighborAddr) Serialize

func (l *LsTLVIPv4NeighborAddr) Serialize() ([]byte, error)

func (*LsTLVIPv4NeighborAddr) String

func (l *LsTLVIPv4NeighborAddr) String() string

type LsTLVIPv6InterfaceAddr

type LsTLVIPv6InterfaceAddr struct {
	LsTLV
	IP net.IP
}

func (*LsTLVIPv6InterfaceAddr) DecodeFromBytes

func (l *LsTLVIPv6InterfaceAddr) DecodeFromBytes(data []byte) error

func (*LsTLVIPv6InterfaceAddr) MarshalJSON

func (l *LsTLVIPv6InterfaceAddr) MarshalJSON() ([]byte, error)

func (*LsTLVIPv6InterfaceAddr) Serialize

func (l *LsTLVIPv6InterfaceAddr) Serialize() ([]byte, error)

func (*LsTLVIPv6InterfaceAddr) String

func (l *LsTLVIPv6InterfaceAddr) String() string

type LsTLVIPv6NeighborAddr

type LsTLVIPv6NeighborAddr struct {
	LsTLV
	IP net.IP
}

func (*LsTLVIPv6NeighborAddr) DecodeFromBytes

func (l *LsTLVIPv6NeighborAddr) DecodeFromBytes(data []byte) error

func (*LsTLVIPv6NeighborAddr) MarshalJSON

func (l *LsTLVIPv6NeighborAddr) MarshalJSON() ([]byte, error)

func (*LsTLVIPv6NeighborAddr) Serialize

func (l *LsTLVIPv6NeighborAddr) Serialize() ([]byte, error)

func (*LsTLVIPv6NeighborAddr) String

func (l *LsTLVIPv6NeighborAddr) String() string

type LsTLVIgpRouterID

type LsTLVIgpRouterID struct {
	LsTLV
	RouterID []byte
}

func (*LsTLVIgpRouterID) DecodeFromBytes

func (l *LsTLVIgpRouterID) DecodeFromBytes(data []byte) error

func (*LsTLVIgpRouterID) MarshalJSON

func (l *LsTLVIgpRouterID) MarshalJSON() ([]byte, error)

func (*LsTLVIgpRouterID) Serialize

func (l *LsTLVIgpRouterID) Serialize() ([]byte, error)

func (*LsTLVIgpRouterID) String

func (l *LsTLVIgpRouterID) String() string

type LsTLVInterface

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

type LsTLVIsisArea

type LsTLVIsisArea struct {
	LsTLV
	Area []byte
}

func (*LsTLVIsisArea) DecodeFromBytes

func (l *LsTLVIsisArea) DecodeFromBytes(data []byte) error

func (*LsTLVIsisArea) MarshalJSON

func (l *LsTLVIsisArea) MarshalJSON() ([]byte, error)

func (*LsTLVIsisArea) Serialize

func (l *LsTLVIsisArea) Serialize() ([]byte, error)

func (*LsTLVIsisArea) String

func (l *LsTLVIsisArea) String() string

type LsTLVLinkID

type LsTLVLinkID struct {
	LsTLV
	Local  uint32
	Remote uint32
}

func (*LsTLVLinkID) DecodeFromBytes

func (l *LsTLVLinkID) DecodeFromBytes(data []byte) error

func (*LsTLVLinkID) MarshalJSON

func (l *LsTLVLinkID) MarshalJSON() ([]byte, error)

func (*LsTLVLinkID) Serialize

func (l *LsTLVLinkID) Serialize() ([]byte, error)

func (*LsTLVLinkID) String

func (l *LsTLVLinkID) String() string

type LsTLVLinkName

type LsTLVLinkName struct {
	LsTLV
	Name string
}

func (*LsTLVLinkName) DecodeFromBytes

func (l *LsTLVLinkName) DecodeFromBytes(data []byte) error

func (*LsTLVLinkName) MarshalJSON

func (l *LsTLVLinkName) MarshalJSON() ([]byte, error)

func (*LsTLVLinkName) Serialize

func (l *LsTLVLinkName) Serialize() ([]byte, error)

func (*LsTLVLinkName) String

func (l *LsTLVLinkName) String() string

type LsTLVLocalIPv4RouterID

type LsTLVLocalIPv4RouterID struct {
	LsTLV
	IP net.IP
}

func (*LsTLVLocalIPv4RouterID) DecodeFromBytes

func (l *LsTLVLocalIPv4RouterID) DecodeFromBytes(data []byte) error

func (*LsTLVLocalIPv4RouterID) MarshalJSON

func (l *LsTLVLocalIPv4RouterID) MarshalJSON() ([]byte, error)

func (*LsTLVLocalIPv4RouterID) Serialize

func (l *LsTLVLocalIPv4RouterID) Serialize() ([]byte, error)

func (*LsTLVLocalIPv4RouterID) String

func (l *LsTLVLocalIPv4RouterID) String() string

type LsTLVLocalIPv6RouterID

type LsTLVLocalIPv6RouterID struct {
	LsTLV
	IP net.IP
}

func (*LsTLVLocalIPv6RouterID) DecodeFromBytes

func (l *LsTLVLocalIPv6RouterID) DecodeFromBytes(data []byte) error

func (*LsTLVLocalIPv6RouterID) MarshalJSON

func (l *LsTLVLocalIPv6RouterID) MarshalJSON() ([]byte, error)

func (*LsTLVLocalIPv6RouterID) Serialize

func (l *LsTLVLocalIPv6RouterID) Serialize() ([]byte, error)

func (*LsTLVLocalIPv6RouterID) String

func (l *LsTLVLocalIPv6RouterID) String() string

type LsTLVMaxLinkBw

type LsTLVMaxLinkBw struct {
	LsTLV
	Bandwidth float32
}

func (*LsTLVMaxLinkBw) DecodeFromBytes

func (l *LsTLVMaxLinkBw) DecodeFromBytes(data []byte) error

func (*LsTLVMaxLinkBw) MarshalJSON

func (l *LsTLVMaxLinkBw) MarshalJSON() ([]byte, error)

func (*LsTLVMaxLinkBw) Serialize

func (l *LsTLVMaxLinkBw) Serialize() ([]byte, error)

func (*LsTLVMaxLinkBw) String

func (l *LsTLVMaxLinkBw) String() string

type LsTLVMaxReservableLinkBw

type LsTLVMaxReservableLinkBw struct {
	LsTLV
	Bandwidth float32
}

func (*LsTLVMaxReservableLinkBw) DecodeFromBytes

func (l *LsTLVMaxReservableLinkBw) DecodeFromBytes(data []byte) error

func (*LsTLVMaxReservableLinkBw) MarshalJSON

func (l *LsTLVMaxReservableLinkBw) MarshalJSON() ([]byte, error)

func (*LsTLVMaxReservableLinkBw) Serialize

func (l *LsTLVMaxReservableLinkBw) Serialize() ([]byte, error)

func (*LsTLVMaxReservableLinkBw) String

func (l *LsTLVMaxReservableLinkBw) String() string

type LsTLVNodeDescriptor

type LsTLVNodeDescriptor struct {
	LsTLV
	SubTLVs []LsTLVInterface
}

func (*LsTLVNodeDescriptor) DecodeFromBytes

func (l *LsTLVNodeDescriptor) DecodeFromBytes(data []byte) error

func (*LsTLVNodeDescriptor) Extract

func (l *LsTLVNodeDescriptor) Extract() *LsNodeDescriptor

func (*LsTLVNodeDescriptor) MarshalJSON

func (l *LsTLVNodeDescriptor) MarshalJSON() ([]byte, error)

func (*LsTLVNodeDescriptor) Serialize

func (l *LsTLVNodeDescriptor) Serialize() ([]byte, error)

func (*LsTLVNodeDescriptor) String

func (l *LsTLVNodeDescriptor) String() string

type LsTLVNodeFlagBits

type LsTLVNodeFlagBits struct {
	LsTLV
	Flags uint8
}

func (*LsTLVNodeFlagBits) DecodeFromBytes

func (l *LsTLVNodeFlagBits) DecodeFromBytes(data []byte) error

func (*LsTLVNodeFlagBits) Extract

func (l *LsTLVNodeFlagBits) Extract() *LsNodeFlags

func (*LsTLVNodeFlagBits) MarshalJSON

func (l *LsTLVNodeFlagBits) MarshalJSON() ([]byte, error)

func (*LsTLVNodeFlagBits) Serialize

func (l *LsTLVNodeFlagBits) Serialize() ([]byte, error)

func (*LsTLVNodeFlagBits) String

func (l *LsTLVNodeFlagBits) String() string

type LsTLVNodeName

type LsTLVNodeName struct {
	LsTLV
	Name string
}

func (*LsTLVNodeName) DecodeFromBytes

func (l *LsTLVNodeName) DecodeFromBytes(data []byte) error

func (*LsTLVNodeName) MarshalJSON

func (l *LsTLVNodeName) MarshalJSON() ([]byte, error)

func (*LsTLVNodeName) Serialize

func (l *LsTLVNodeName) Serialize() ([]byte, error)

func (*LsTLVNodeName) String

func (l *LsTLVNodeName) String() string

type LsTLVOpaqueLinkAttr

type LsTLVOpaqueLinkAttr struct {
	LsTLV
	Attr []byte
}

func (*LsTLVOpaqueLinkAttr) DecodeFromBytes

func (l *LsTLVOpaqueLinkAttr) DecodeFromBytes(data []byte) error

func (*LsTLVOpaqueLinkAttr) MarshalJSON

func (l *LsTLVOpaqueLinkAttr) MarshalJSON() ([]byte, error)

func (*LsTLVOpaqueLinkAttr) Serialize

func (l *LsTLVOpaqueLinkAttr) Serialize() ([]byte, error)

func (*LsTLVOpaqueLinkAttr) String

func (l *LsTLVOpaqueLinkAttr) String() string

type LsTLVOpaqueNodeAttr

type LsTLVOpaqueNodeAttr struct {
	LsTLV
	Attr []byte
}

func (*LsTLVOpaqueNodeAttr) DecodeFromBytes

func (l *LsTLVOpaqueNodeAttr) DecodeFromBytes(data []byte) error

func (*LsTLVOpaqueNodeAttr) MarshalJSON

func (l *LsTLVOpaqueNodeAttr) MarshalJSON() ([]byte, error)

func (*LsTLVOpaqueNodeAttr) Serialize

func (l *LsTLVOpaqueNodeAttr) Serialize() ([]byte, error)

func (*LsTLVOpaqueNodeAttr) String

func (l *LsTLVOpaqueNodeAttr) String() string

type LsTLVOpaquePrefixAttr

type LsTLVOpaquePrefixAttr struct {
	LsTLV
	Attr []byte
}

func (*LsTLVOpaquePrefixAttr) DecodeFromBytes

func (l *LsTLVOpaquePrefixAttr) DecodeFromBytes(data []byte) error

func (*LsTLVOpaquePrefixAttr) MarshalJSON

func (l *LsTLVOpaquePrefixAttr) MarshalJSON() ([]byte, error)

func (*LsTLVOpaquePrefixAttr) Serialize

func (l *LsTLVOpaquePrefixAttr) Serialize() ([]byte, error)

func (*LsTLVOpaquePrefixAttr) String

func (l *LsTLVOpaquePrefixAttr) String() string

type LsTLVOspfAreaID

type LsTLVOspfAreaID struct {
	LsTLV
	AreaID uint32
}

func (*LsTLVOspfAreaID) DecodeFromBytes

func (l *LsTLVOspfAreaID) DecodeFromBytes(data []byte) error

func (*LsTLVOspfAreaID) MarshalJSON

func (l *LsTLVOspfAreaID) MarshalJSON() ([]byte, error)

func (*LsTLVOspfAreaID) Serialize

func (l *LsTLVOspfAreaID) Serialize() ([]byte, error)

func (*LsTLVOspfAreaID) String

func (l *LsTLVOspfAreaID) String() string

type LsTLVOspfRouteType

type LsTLVOspfRouteType struct {
	LsTLV
	RouteType LsOspfRouteType
}

func (*LsTLVOspfRouteType) DecodeFromBytes

func (l *LsTLVOspfRouteType) DecodeFromBytes(data []byte) error

func (*LsTLVOspfRouteType) MarshalJSON

func (l *LsTLVOspfRouteType) MarshalJSON() ([]byte, error)

func (*LsTLVOspfRouteType) Serialize

func (l *LsTLVOspfRouteType) Serialize() ([]byte, error)

func (*LsTLVOspfRouteType) String

func (l *LsTLVOspfRouteType) String() string

type LsTLVPrefixSID

type LsTLVPrefixSID struct {
	LsTLV
	Flags     uint8
	Algorithm uint8
	SID       uint32
}

func (*LsTLVPrefixSID) DecodeFromBytes

func (l *LsTLVPrefixSID) DecodeFromBytes(data []byte) error

func (*LsTLVPrefixSID) MarshalJSON

func (l *LsTLVPrefixSID) MarshalJSON() ([]byte, error)

func (*LsTLVPrefixSID) Serialize

func (l *LsTLVPrefixSID) Serialize() ([]byte, error)

func (*LsTLVPrefixSID) String

func (l *LsTLVPrefixSID) String() string

type LsTLVRemoteIPv4RouterID

type LsTLVRemoteIPv4RouterID struct {
	LsTLV
	IP net.IP
}

func (*LsTLVRemoteIPv4RouterID) DecodeFromBytes

func (l *LsTLVRemoteIPv4RouterID) DecodeFromBytes(data []byte) error

func (*LsTLVRemoteIPv4RouterID) MarshalJSON

func (l *LsTLVRemoteIPv4RouterID) MarshalJSON() ([]byte, error)

func (*LsTLVRemoteIPv4RouterID) Serialize

func (l *LsTLVRemoteIPv4RouterID) Serialize() ([]byte, error)

func (*LsTLVRemoteIPv4RouterID) String

func (l *LsTLVRemoteIPv4RouterID) String() string

type LsTLVRemoteIPv6RouterID

type LsTLVRemoteIPv6RouterID struct {
	LsTLV
	IP net.IP
}

func (*LsTLVRemoteIPv6RouterID) DecodeFromBytes

func (l *LsTLVRemoteIPv6RouterID) DecodeFromBytes(data []byte) error

func (*LsTLVRemoteIPv6RouterID) MarshalJSON

func (l *LsTLVRemoteIPv6RouterID) MarshalJSON() ([]byte, error)

func (*LsTLVRemoteIPv6RouterID) Serialize

func (l *LsTLVRemoteIPv6RouterID) Serialize() ([]byte, error)

func (*LsTLVRemoteIPv6RouterID) String

func (l *LsTLVRemoteIPv6RouterID) String() string

type LsTLVSIDLabel

type LsTLVSIDLabel struct {
	LsTLV
	SID uint32
}

func (*LsTLVSIDLabel) DecodeFromBytes

func (l *LsTLVSIDLabel) DecodeFromBytes(data []byte) error

func (*LsTLVSIDLabel) MarshalJSON

func (l *LsTLVSIDLabel) MarshalJSON() ([]byte, error)

func (*LsTLVSIDLabel) Serialize

func (l *LsTLVSIDLabel) Serialize() ([]byte, error)

func (*LsTLVSIDLabel) String

func (l *LsTLVSIDLabel) String() string

type LsTLVSourceRouterID

type LsTLVSourceRouterID struct {
	LsTLV
	RouterID []byte
}

func (*LsTLVSourceRouterID) DecodeFromBytes

func (l *LsTLVSourceRouterID) DecodeFromBytes(data []byte) error

func (*LsTLVSourceRouterID) MarshalJSON

func (l *LsTLVSourceRouterID) MarshalJSON() ([]byte, error)

func (*LsTLVSourceRouterID) Serialize

func (l *LsTLVSourceRouterID) Serialize() ([]byte, error)

func (*LsTLVSourceRouterID) String

func (l *LsTLVSourceRouterID) String() string

type LsTLVSrAlgorithm

type LsTLVSrAlgorithm struct {
	LsTLV
	Algorithm []byte
}

func (*LsTLVSrAlgorithm) DecodeFromBytes

func (l *LsTLVSrAlgorithm) DecodeFromBytes(data []byte) error

func (*LsTLVSrAlgorithm) MarshalJSON

func (l *LsTLVSrAlgorithm) MarshalJSON() ([]byte, error)

func (*LsTLVSrAlgorithm) Serialize

func (l *LsTLVSrAlgorithm) Serialize() ([]byte, error)

func (*LsTLVSrAlgorithm) String

func (l *LsTLVSrAlgorithm) String() string

type LsTLVSrCapabilities

type LsTLVSrCapabilities struct {
	LsTLV
	Flags  uint8
	Ranges []LsSrLabelRange
}

func (*LsTLVSrCapabilities) DecodeFromBytes

func (l *LsTLVSrCapabilities) DecodeFromBytes(data []byte) error

func (*LsTLVSrCapabilities) Extract

func (l *LsTLVSrCapabilities) Extract() *LsSrCapabilities

func (*LsTLVSrCapabilities) MarshalJSON

func (l *LsTLVSrCapabilities) MarshalJSON() ([]byte, error)

func (*LsTLVSrCapabilities) Serialize

func (l *LsTLVSrCapabilities) Serialize() ([]byte, error)

func (*LsTLVSrCapabilities) String

func (l *LsTLVSrCapabilities) String() string

type LsTLVSrLocalBlock

type LsTLVSrLocalBlock struct {
	LsTLV
	Flags  uint8
	Ranges []LsSrLabelRange
}

func (*LsTLVSrLocalBlock) DecodeFromBytes

func (l *LsTLVSrLocalBlock) DecodeFromBytes(data []byte) error

func (*LsTLVSrLocalBlock) Extract

func (l *LsTLVSrLocalBlock) Extract() *LsSrLocalBlock

func (*LsTLVSrLocalBlock) MarshalJSON

func (l *LsTLVSrLocalBlock) MarshalJSON() ([]byte, error)

func (*LsTLVSrLocalBlock) Serialize

func (l *LsTLVSrLocalBlock) Serialize() ([]byte, error)

func (*LsTLVSrLocalBlock) String

func (l *LsTLVSrLocalBlock) String() string

type LsTLVSrlg

type LsTLVSrlg struct {
	LsTLV
	Srlgs []uint32
}

func (*LsTLVSrlg) DecodeFromBytes

func (l *LsTLVSrlg) DecodeFromBytes(data []byte) error

func (*LsTLVSrlg) MarshalJSON

func (l *LsTLVSrlg) MarshalJSON() ([]byte, error)

func (*LsTLVSrlg) Serialize

func (l *LsTLVSrlg) Serialize() ([]byte, error)

func (*LsTLVSrlg) String

func (l *LsTLVSrlg) String() string

type LsTLVTEDefaultMetric

type LsTLVTEDefaultMetric struct {
	LsTLV
	Metric uint32
}

func (*LsTLVTEDefaultMetric) DecodeFromBytes

func (l *LsTLVTEDefaultMetric) DecodeFromBytes(data []byte) error

func (*LsTLVTEDefaultMetric) MarshalJSON

func (l *LsTLVTEDefaultMetric) MarshalJSON() ([]byte, error)

func (*LsTLVTEDefaultMetric) Serialize

func (l *LsTLVTEDefaultMetric) Serialize() ([]byte, error)

func (*LsTLVTEDefaultMetric) String

func (l *LsTLVTEDefaultMetric) String() string

type LsTLVType

type LsTLVType uint16

type LsTLVUnreservedBw

type LsTLVUnreservedBw struct {
	LsTLV
	Bandwidth [8]float32
}

func (*LsTLVUnreservedBw) DecodeFromBytes

func (l *LsTLVUnreservedBw) DecodeFromBytes(data []byte) error

func (*LsTLVUnreservedBw) MarshalJSON

func (l *LsTLVUnreservedBw) MarshalJSON() ([]byte, error)

func (*LsTLVUnreservedBw) Serialize

func (l *LsTLVUnreservedBw) Serialize() ([]byte, error)

func (*LsTLVUnreservedBw) String

func (l *LsTLVUnreservedBw) String() string

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, options ...*MarshallingOption) error

func (*MPLSLabelStack) Len

func (l *MPLSLabelStack) Len() int

func (*MPLSLabelStack) Serialize

func (l *MPLSLabelStack) Serialize(options ...*MarshallingOption) ([]byte, error)

func (*MPLSLabelStack) String

func (l *MPLSLabelStack) String() string

type MacMobilityExtended

type MacMobilityExtended struct {
	Sequence uint32
	IsSticky bool
}

func NewMacMobilityExtended

func NewMacMobilityExtended(seq uint32, isSticky bool) *MacMobilityExtended

func (*MacMobilityExtended) Flat

func (e *MacMobilityExtended) Flat() map[string]string

func (*MacMobilityExtended) GetTypes

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 MarshallingOption

type MarshallingOption struct {
	AddPath    map[RouteFamily]BGPAddPathMode
	Attributes map[BGPAttrType]bool
}

type MessageError

type MessageError struct {
	TypeCode       uint8
	SubTypeCode    uint8
	Data           []byte
	Message        string
	ErrorHandling  ErrorHandling
	ErrorAttribute *PathAttributeInterface
}

func (*MessageError) Error

func (e *MessageError) Error() string

func (*MessageError) Stronger

func (e *MessageError) Stronger(err error) bool

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        []byte
}

func NewOpaqueExtended

func NewOpaqueExtended(isTransitive bool, value []byte) *OpaqueExtended

func (*OpaqueExtended) Flat

func (e *OpaqueExtended) Flat() map[string]string

func (*OpaqueExtended) GetTypes

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

type OpaqueNLRI struct {
	PrefixDefault
	Length uint16
	Key    []byte
	Value  []byte
}

func NewOpaqueNLRI

func NewOpaqueNLRI(key, value []byte) *OpaqueNLRI

func (*OpaqueNLRI) AFI

func (n *OpaqueNLRI) AFI() uint16

func (*OpaqueNLRI) DecodeFromBytes

func (n *OpaqueNLRI) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*OpaqueNLRI) Flat

func (l *OpaqueNLRI) Flat() map[string]string

func (*OpaqueNLRI) Len

func (n *OpaqueNLRI) Len(options ...*MarshallingOption) 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(options ...*MarshallingOption) ([]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 OptionParameterInterface

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

type OptionParameterUnknown

type OptionParameterUnknown struct {
	ParamType uint8
	ParamLen  uint8
	Value     []byte
}

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 // length of Value
}

func (*PathAttribute) DecodeFromBytes

func (p *PathAttribute) DecodeFromBytes(data []byte, options ...*MarshallingOption) (value []byte, err 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(options ...*MarshallingOption) int

func (*PathAttribute) Serialize

func (p *PathAttribute) Serialize(value []byte, options ...*MarshallingOption) ([]byte, error)

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, options ...*MarshallingOption) error

func (*PathAttributeAggregator) MarshalJSON

func (p *PathAttributeAggregator) MarshalJSON() ([]byte, error)

func (*PathAttributeAggregator) Serialize

func (p *PathAttributeAggregator) Serialize(options ...*MarshallingOption) ([]byte, error)

func (*PathAttributeAggregator) String

func (p *PathAttributeAggregator) String() string

type PathAttributeAggregatorParam

type PathAttributeAggregatorParam struct {
	AS      uint32
	Askind  reflect.Kind
	Address net.IP
}

type PathAttributeAigp

type PathAttributeAigp struct {
	PathAttribute
	Values []AigpTLVInterface
}

func NewPathAttributeAigp

func NewPathAttributeAigp(values []AigpTLVInterface) *PathAttributeAigp

func (*PathAttributeAigp) DecodeFromBytes

func (p *PathAttributeAigp) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*PathAttributeAigp) MarshalJSON

func (p *PathAttributeAigp) MarshalJSON() ([]byte, error)

func (*PathAttributeAigp) Serialize

func (p *PathAttributeAigp) Serialize(options ...*MarshallingOption) ([]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, options ...*MarshallingOption) error

func (*PathAttributeAs4Aggregator) MarshalJSON

func (p *PathAttributeAs4Aggregator) MarshalJSON() ([]byte, error)

func (*PathAttributeAs4Aggregator) Serialize

func (p *PathAttributeAs4Aggregator) Serialize(options ...*MarshallingOption) ([]byte, error)

func (*PathAttributeAs4Aggregator) String

func (p *PathAttributeAs4Aggregator) String() string

type PathAttributeAs4Path

type PathAttributeAs4Path struct {
	PathAttribute
	Value []*As4PathParam
}

func NewPathAttributeAs4Path

func NewPathAttributeAs4Path(value []*As4PathParam) *PathAttributeAs4Path

func (*PathAttributeAs4Path) DecodeFromBytes

func (p *PathAttributeAs4Path) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*PathAttributeAs4Path) MarshalJSON

func (p *PathAttributeAs4Path) MarshalJSON() ([]byte, error)

func (*PathAttributeAs4Path) Serialize

func (p *PathAttributeAs4Path) Serialize(options ...*MarshallingOption) ([]byte, error)

func (*PathAttributeAs4Path) String

func (p *PathAttributeAs4Path) String() string

type PathAttributeAsPath

type PathAttributeAsPath struct {
	PathAttribute
	Value []AsPathParamInterface
}

func NewPathAttributeAsPath

func NewPathAttributeAsPath(value []AsPathParamInterface) *PathAttributeAsPath

func (*PathAttributeAsPath) DecodeFromBytes

func (p *PathAttributeAsPath) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*PathAttributeAsPath) MarshalJSON

func (p *PathAttributeAsPath) MarshalJSON() ([]byte, error)

func (*PathAttributeAsPath) Serialize

func (p *PathAttributeAsPath) Serialize(options ...*MarshallingOption) ([]byte, error)

func (*PathAttributeAsPath) String

func (p *PathAttributeAsPath) String() string

type PathAttributeAtomicAggregate

type PathAttributeAtomicAggregate struct {
	PathAttribute
}

func NewPathAttributeAtomicAggregate

func NewPathAttributeAtomicAggregate() *PathAttributeAtomicAggregate

func (*PathAttributeAtomicAggregate) DecodeFromBytes

func (p *PathAttributeAtomicAggregate) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*PathAttributeAtomicAggregate) MarshalJSON

func (p *PathAttributeAtomicAggregate) MarshalJSON() ([]byte, error)

func (*PathAttributeAtomicAggregate) Serialize

func (p *PathAttributeAtomicAggregate) Serialize(options ...*MarshallingOption) ([]byte, error)

func (*PathAttributeAtomicAggregate) 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, options ...*MarshallingOption) error

func (*PathAttributeClusterList) MarshalJSON

func (p *PathAttributeClusterList) MarshalJSON() ([]byte, error)

func (*PathAttributeClusterList) Serialize

func (p *PathAttributeClusterList) Serialize(options ...*MarshallingOption) ([]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, options ...*MarshallingOption) error

func (*PathAttributeCommunities) MarshalJSON

func (p *PathAttributeCommunities) MarshalJSON() ([]byte, error)

func (*PathAttributeCommunities) Serialize

func (p *PathAttributeCommunities) Serialize(options ...*MarshallingOption) ([]byte, error)

func (*PathAttributeCommunities) String

func (p *PathAttributeCommunities) String() string

type PathAttributeExtendedCommunities

type PathAttributeExtendedCommunities struct {
	PathAttribute
	Value []ExtendedCommunityInterface
}

func (*PathAttributeExtendedCommunities) DecodeFromBytes

func (p *PathAttributeExtendedCommunities) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*PathAttributeExtendedCommunities) Flat

func (*PathAttributeExtendedCommunities) MarshalJSON

func (p *PathAttributeExtendedCommunities) MarshalJSON() ([]byte, error)

func (*PathAttributeExtendedCommunities) Serialize

func (p *PathAttributeExtendedCommunities) Serialize(options ...*MarshallingOption) ([]byte, error)

func (*PathAttributeExtendedCommunities) String

type PathAttributeIP6ExtendedCommunities

type PathAttributeIP6ExtendedCommunities struct {
	PathAttribute
	Value []ExtendedCommunityInterface
}

func (*PathAttributeIP6ExtendedCommunities) DecodeFromBytes

func (p *PathAttributeIP6ExtendedCommunities) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*PathAttributeIP6ExtendedCommunities) MarshalJSON

func (p *PathAttributeIP6ExtendedCommunities) MarshalJSON() ([]byte, error)

func (*PathAttributeIP6ExtendedCommunities) Serialize

func (p *PathAttributeIP6ExtendedCommunities) Serialize(options ...*MarshallingOption) ([]byte, error)

func (*PathAttributeIP6ExtendedCommunities) String

type PathAttributeInterface

type PathAttributeInterface interface {
	DecodeFromBytes([]byte, ...*MarshallingOption) error
	Serialize(...*MarshallingOption) ([]byte, error)
	Len(...*MarshallingOption) int
	GetFlags() BGPAttrFlag
	GetType() BGPAttrType
	String() string
	MarshalJSON() ([]byte, error)
	Flat() map[string]string
}

func GetPathAttribute

func GetPathAttribute(data []byte) (PathAttributeInterface, error)

type PathAttributeLargeCommunities

type PathAttributeLargeCommunities struct {
	PathAttribute
	Values []*LargeCommunity
}

func NewPathAttributeLargeCommunities

func NewPathAttributeLargeCommunities(values []*LargeCommunity) *PathAttributeLargeCommunities

func (*PathAttributeLargeCommunities) DecodeFromBytes

func (p *PathAttributeLargeCommunities) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*PathAttributeLargeCommunities) MarshalJSON

func (p *PathAttributeLargeCommunities) MarshalJSON() ([]byte, error)

func (*PathAttributeLargeCommunities) Serialize

func (p *PathAttributeLargeCommunities) Serialize(options ...*MarshallingOption) ([]byte, error)

func (*PathAttributeLargeCommunities) String

type PathAttributeLocalPref

type PathAttributeLocalPref struct {
	PathAttribute
	Value uint32
}

func NewPathAttributeLocalPref

func NewPathAttributeLocalPref(value uint32) *PathAttributeLocalPref

func (*PathAttributeLocalPref) DecodeFromBytes

func (p *PathAttributeLocalPref) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*PathAttributeLocalPref) MarshalJSON

func (p *PathAttributeLocalPref) MarshalJSON() ([]byte, error)

func (*PathAttributeLocalPref) Serialize

func (p *PathAttributeLocalPref) Serialize(options ...*MarshallingOption) ([]byte, error)

func (*PathAttributeLocalPref) String

func (p *PathAttributeLocalPref) String() string

type PathAttributeLs

type PathAttributeLs struct {
	PathAttribute
	TLVs []LsTLVInterface
}

func (*PathAttributeLs) DecodeFromBytes

func (p *PathAttributeLs) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*PathAttributeLs) Extract

func (p *PathAttributeLs) Extract() *LsAttribute

func (*PathAttributeLs) MarshalJSON

func (p *PathAttributeLs) MarshalJSON() ([]byte, error)

func (*PathAttributeLs) Serialize

func (p *PathAttributeLs) Serialize(options ...*MarshallingOption) ([]byte, error)

func (*PathAttributeLs) String

func (p *PathAttributeLs) 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, options ...*MarshallingOption) error

func (*PathAttributeMpReachNLRI) MarshalJSON

func (p *PathAttributeMpReachNLRI) MarshalJSON() ([]byte, error)

func (*PathAttributeMpReachNLRI) Serialize

func (p *PathAttributeMpReachNLRI) Serialize(options ...*MarshallingOption) ([]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, options ...*MarshallingOption) error

func (*PathAttributeMpUnreachNLRI) MarshalJSON

func (p *PathAttributeMpUnreachNLRI) MarshalJSON() ([]byte, error)

func (*PathAttributeMpUnreachNLRI) Serialize

func (p *PathAttributeMpUnreachNLRI) Serialize(options ...*MarshallingOption) ([]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, options ...*MarshallingOption) error

func (*PathAttributeMultiExitDisc) MarshalJSON

func (p *PathAttributeMultiExitDisc) MarshalJSON() ([]byte, error)

func (*PathAttributeMultiExitDisc) Serialize

func (p *PathAttributeMultiExitDisc) Serialize(options ...*MarshallingOption) ([]byte, error)

func (*PathAttributeMultiExitDisc) String

func (p *PathAttributeMultiExitDisc) String() string

type PathAttributeNextHop

type PathAttributeNextHop struct {
	PathAttribute
	Value net.IP
}

func NewPathAttributeNextHop

func NewPathAttributeNextHop(addr string) *PathAttributeNextHop

func (*PathAttributeNextHop) DecodeFromBytes

func (p *PathAttributeNextHop) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*PathAttributeNextHop) MarshalJSON

func (p *PathAttributeNextHop) MarshalJSON() ([]byte, error)

func (*PathAttributeNextHop) Serialize

func (p *PathAttributeNextHop) Serialize(options ...*MarshallingOption) ([]byte, error)

func (*PathAttributeNextHop) String

func (p *PathAttributeNextHop) String() string

type PathAttributeOrigin

type PathAttributeOrigin struct {
	PathAttribute
	Value uint8
}

func NewPathAttributeOrigin

func NewPathAttributeOrigin(value uint8) *PathAttributeOrigin

func (*PathAttributeOrigin) DecodeFromBytes

func (p *PathAttributeOrigin) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*PathAttributeOrigin) MarshalJSON

func (p *PathAttributeOrigin) MarshalJSON() ([]byte, error)

func (*PathAttributeOrigin) Serialize

func (p *PathAttributeOrigin) Serialize(options ...*MarshallingOption) ([]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, options ...*MarshallingOption) error

func (*PathAttributeOriginatorId) MarshalJSON

func (p *PathAttributeOriginatorId) MarshalJSON() ([]byte, error)

func (*PathAttributeOriginatorId) Serialize

func (p *PathAttributeOriginatorId) Serialize(options ...*MarshallingOption) ([]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 ParsePmsiTunnel

func ParsePmsiTunnel(args []string) (*PathAttributePmsiTunnel, error)

func (*PathAttributePmsiTunnel) DecodeFromBytes

func (p *PathAttributePmsiTunnel) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*PathAttributePmsiTunnel) MarshalJSON

func (p *PathAttributePmsiTunnel) MarshalJSON() ([]byte, error)

func (*PathAttributePmsiTunnel) Serialize

func (p *PathAttributePmsiTunnel) Serialize(options ...*MarshallingOption) ([]byte, error)

func (*PathAttributePmsiTunnel) String

func (p *PathAttributePmsiTunnel) String() string

type PathAttributePrefixSID

type PathAttributePrefixSID struct {
	PathAttribute
	TLVs []PrefixSIDTLVInterface
}

func (*PathAttributePrefixSID) DecodeFromBytes

func (p *PathAttributePrefixSID) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*PathAttributePrefixSID) Extract

func (*PathAttributePrefixSID) MarshalJSON

func (p *PathAttributePrefixSID) MarshalJSON() ([]byte, error)

func (*PathAttributePrefixSID) Serialize

func (p *PathAttributePrefixSID) Serialize(options ...*MarshallingOption) ([]byte, error)

func (*PathAttributePrefixSID) String

func (p *PathAttributePrefixSID) 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, options ...*MarshallingOption) error

func (*PathAttributeTunnelEncap) MarshalJSON

func (p *PathAttributeTunnelEncap) MarshalJSON() ([]byte, error)

func (*PathAttributeTunnelEncap) Serialize

func (p *PathAttributeTunnelEncap) Serialize(options ...*MarshallingOption) ([]byte, error)

func (*PathAttributeTunnelEncap) String

func (p *PathAttributeTunnelEncap) String() string

type PathAttributeUnknown

type PathAttributeUnknown struct {
	PathAttribute
	Value []byte
}

func NewPathAttributeUnknown

func NewPathAttributeUnknown(flags BGPAttrFlag, typ BGPAttrType, value []byte) *PathAttributeUnknown

func (*PathAttributeUnknown) DecodeFromBytes

func (p *PathAttributeUnknown) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*PathAttributeUnknown) MarshalJSON

func (p *PathAttributeUnknown) MarshalJSON() ([]byte, error)

func (*PathAttributeUnknown) Serialize

func (p *PathAttributeUnknown) Serialize(options ...*MarshallingOption) ([]byte, error)

func (*PathAttributeUnknown) String

func (p *PathAttributeUnknown) String() string

type PmsiTunnelIDInterface

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

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 PrefixDefault

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

func (*PrefixDefault) PathIdentifier

func (p *PrefixDefault) PathIdentifier() uint32

func (*PrefixDefault) PathLocalIdentifier

func (p *PrefixDefault) PathLocalIdentifier() uint32

func (*PrefixDefault) SetPathIdentifier

func (p *PrefixDefault) SetPathIdentifier(id uint32)

func (*PrefixDefault) SetPathLocalIdentifier

func (p *PrefixDefault) SetPathLocalIdentifier(id uint32)

type PrefixSIDAttribute

type PrefixSIDAttribute struct {
	TLVs []PrefixSIDTLVInterface
}

type PrefixSIDTLVInterface

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

PrefixSIDTLVInterface defines standard set of methods to handle Prefix SID attribute's TLVs

type Protocol

type Protocol int

partially taken from http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml

func (Protocol) String

func (p Protocol) String() string

type RedirectFourOctetAsSpecificExtended

type RedirectFourOctetAsSpecificExtended struct {
	FourOctetAsSpecificExtended
}

func NewRedirectFourOctetAsSpecificExtended

func NewRedirectFourOctetAsSpecificExtended(as uint32, localAdmin uint16) *RedirectFourOctetAsSpecificExtended

func (*RedirectFourOctetAsSpecificExtended) Flat

func (*RedirectFourOctetAsSpecificExtended) GetTypes

func (*RedirectFourOctetAsSpecificExtended) MarshalJSON

func (e *RedirectFourOctetAsSpecificExtended) MarshalJSON() ([]byte, error)

func (*RedirectFourOctetAsSpecificExtended) Serialize

func (e *RedirectFourOctetAsSpecificExtended) Serialize() ([]byte, error)

func (*RedirectFourOctetAsSpecificExtended) String

type RedirectIPv4AddressSpecificExtended

type RedirectIPv4AddressSpecificExtended struct {
	IPv4AddressSpecificExtended
}

func NewRedirectIPv4AddressSpecificExtended

func NewRedirectIPv4AddressSpecificExtended(ipv4 string, localAdmin uint16) *RedirectIPv4AddressSpecificExtended

func (*RedirectIPv4AddressSpecificExtended) Flat

func (*RedirectIPv4AddressSpecificExtended) GetTypes

func (*RedirectIPv4AddressSpecificExtended) MarshalJSON

func (e *RedirectIPv4AddressSpecificExtended) MarshalJSON() ([]byte, error)

func (*RedirectIPv4AddressSpecificExtended) Serialize

func (e *RedirectIPv4AddressSpecificExtended) Serialize() ([]byte, error)

func (*RedirectIPv4AddressSpecificExtended) String

type RedirectIPv6AddressSpecificExtended

type RedirectIPv6AddressSpecificExtended struct {
	IPv6AddressSpecificExtended
}

func NewRedirectIPv6AddressSpecificExtended

func NewRedirectIPv6AddressSpecificExtended(ipv6 string, localAdmin uint16) *RedirectIPv6AddressSpecificExtended

func (*RedirectIPv6AddressSpecificExtended) Flat

func (*RedirectIPv6AddressSpecificExtended) GetTypes

func (*RedirectIPv6AddressSpecificExtended) MarshalJSON

func (e *RedirectIPv6AddressSpecificExtended) MarshalJSON() ([]byte, error)

func (*RedirectIPv6AddressSpecificExtended) Serialize

func (e *RedirectIPv6AddressSpecificExtended) Serialize() ([]byte, error)

func (*RedirectIPv6AddressSpecificExtended) String

type RedirectTwoOctetAsSpecificExtended

type RedirectTwoOctetAsSpecificExtended struct {
	TwoOctetAsSpecificExtended
}

func NewRedirectTwoOctetAsSpecificExtended

func NewRedirectTwoOctetAsSpecificExtended(as uint16, localAdmin uint32) *RedirectTwoOctetAsSpecificExtended

func (*RedirectTwoOctetAsSpecificExtended) GetTypes

func (*RedirectTwoOctetAsSpecificExtended) MarshalJSON

func (e *RedirectTwoOctetAsSpecificExtended) MarshalJSON() ([]byte, error)

func (*RedirectTwoOctetAsSpecificExtended) Serialize

func (e *RedirectTwoOctetAsSpecificExtended) Serialize() ([]byte, error)

func (*RedirectTwoOctetAsSpecificExtended) String

type RouteDistinguisherFourOctetAS

type RouteDistinguisherFourOctetAS struct {
	DefaultRouteDistinguisher
	Admin    uint32
	Assigned uint16
}

func NewRouteDistinguisherFourOctetAS

func NewRouteDistinguisherFourOctetAS(admin uint32, assigned uint16) *RouteDistinguisherFourOctetAS

func (*RouteDistinguisherFourOctetAS) DecodeFromBytes

func (rd *RouteDistinguisherFourOctetAS) DecodeFromBytes(data []byte) error

func (*RouteDistinguisherFourOctetAS) MarshalJSON

func (rd *RouteDistinguisherFourOctetAS) MarshalJSON() ([]byte, error)

func (*RouteDistinguisherFourOctetAS) Serialize

func (rd *RouteDistinguisherFourOctetAS) Serialize() ([]byte, error)

func (*RouteDistinguisherFourOctetAS) String

type RouteDistinguisherIPAddressAS

type RouteDistinguisherIPAddressAS struct {
	DefaultRouteDistinguisher
	Admin    net.IP
	Assigned uint16
}

func NewRouteDistinguisherIPAddressAS

func NewRouteDistinguisherIPAddressAS(admin string, assigned uint16) *RouteDistinguisherIPAddressAS

func (*RouteDistinguisherIPAddressAS) DecodeFromBytes

func (rd *RouteDistinguisherIPAddressAS) DecodeFromBytes(data []byte) error

func (*RouteDistinguisherIPAddressAS) MarshalJSON

func (rd *RouteDistinguisherIPAddressAS) MarshalJSON() ([]byte, error)

func (*RouteDistinguisherIPAddressAS) Serialize

func (rd *RouteDistinguisherIPAddressAS) Serialize() ([]byte, error)

func (*RouteDistinguisherIPAddressAS) 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) DecodeFromBytes

func (rd *RouteDistinguisherTwoOctetAS) DecodeFromBytes(data []byte) error

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
	Value []byte
}

func (*RouteDistinguisherUnknown) DecodeFromBytes

func (rd *RouteDistinguisherUnknown) DecodeFromBytes(data []byte) error

func (*RouteDistinguisherUnknown) MarshalJSON

func (rd *RouteDistinguisherUnknown) MarshalJSON() ([]byte, error)

func (*RouteDistinguisherUnknown) Serialize

func (rd *RouteDistinguisherUnknown) Serialize() ([]byte, error)

func (*RouteDistinguisherUnknown) String

func (rd *RouteDistinguisherUnknown) String() string

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_CONSTRAINTS
	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
	RF_LS             RouteFamily = AFI_LS<<16 | SAFI_LS
	RF_SR_POLICY_IPv4 RouteFamily = AFI_IP<<16 | SAFI_SRPOLICY
	RF_SR_POLICY_IPv6 RouteFamily = AFI_IP6<<16 | SAFI_SRPOLICY
)

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 {
	PrefixDefault
	Length      uint8
	AS          uint32
	RouteTarget ExtendedCommunityInterface
}

func NewRouteTargetMembershipNLRI

func NewRouteTargetMembershipNLRI(as uint32, target ExtendedCommunityInterface) *RouteTargetMembershipNLRI

func (*RouteTargetMembershipNLRI) AFI

func (*RouteTargetMembershipNLRI) DecodeFromBytes

func (n *RouteTargetMembershipNLRI) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

func (*RouteTargetMembershipNLRI) Flat

func (l *RouteTargetMembershipNLRI) Flat() map[string]string

func (*RouteTargetMembershipNLRI) Len

func (n *RouteTargetMembershipNLRI) Len(options ...*MarshallingOption) 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(options ...*MarshallingOption) ([]byte, error)

func (*RouteTargetMembershipNLRI) String

func (n *RouteTargetMembershipNLRI) String() string

type RouterMacExtended

type RouterMacExtended struct {
	Mac net.HardwareAddr
}

func NewRoutersMacExtended

func NewRoutersMacExtended(mac string) *RouterMacExtended

func (*RouterMacExtended) Flat

func (e *RouterMacExtended) Flat() map[string]string

func (*RouterMacExtended) GetTypes

func (*RouterMacExtended) MarshalJSON

func (e *RouterMacExtended) MarshalJSON() ([]byte, error)

func (*RouterMacExtended) Serialize

func (e *RouterMacExtended) Serialize() ([]byte, error)

func (*RouterMacExtended) String

func (e *RouterMacExtended) String() string

type SRBehavior

type SRBehavior int32
const (
	RESERVED              SRBehavior = 0
	END                   SRBehavior = 1
	END_WITH_PSP          SRBehavior = 2
	END_WITH_USP          SRBehavior = 3
	END_WITH_PSP_USP      SRBehavior = 4
	ENDX                  SRBehavior = 5
	ENDX_WITH_PSP         SRBehavior = 6
	ENDX_WITH_USP         SRBehavior = 7
	ENDX_WITH_PSP_USP     SRBehavior = 8
	ENDT                  SRBehavior = 9
	ENDT_WITH_PSP         SRBehavior = 10
	ENDT_WITH_USP         SRBehavior = 11
	ENDT_WITH_PSP_USP     SRBehavior = 12
	END_B6_ENCAPS         SRBehavior = 14
	END_BM                SRBehavior = 15
	END_DX6               SRBehavior = 16
	END_DX4               SRBehavior = 17
	END_DT6               SRBehavior = 18
	END_DT4               SRBehavior = 19
	END_DT46              SRBehavior = 20
	END_DX2               SRBehavior = 21
	END_DX2V              SRBehavior = 22
	END_DT2U              SRBehavior = 23
	END_DT2M              SRBehavior = 24
	END_B6_ENCAPS_Red     SRBehavior = 27
	END_WITH_USD          SRBehavior = 28
	END_WITH_PSP_USD      SRBehavior = 29
	END_WITH_USP_USD      SRBehavior = 30
	END_WITH_PSP_USP_USD  SRBehavior = 31
	ENDX_WITH_USD         SRBehavior = 32
	ENDX_WITH_PSP_USD     SRBehavior = 33
	ENDX_WITH_USP_USD     SRBehavior = 34
	ENDX_WITH_PSP_USP_USD SRBehavior = 35
	ENDT_WITH_USD         SRBehavior = 36
	ENDT_WITH_PSP_USD     SRBehavior = 37
	ENDT_WITH_USP_USD     SRBehavior = 38
	ENDT_WITH_PSP_USP_USD SRBehavior = 39
)

func (SRBehavior) String

func (i SRBehavior) String() string

type SRENLPValue

type SRENLPValue uint8
const (
	// ENLPType1 Indicates to push an IPv4 Explicit NULL label on an unlabeled IPv4
	// packet, but do not push an IPv6 Explicit NULL label on an
	// unlabeled IPv6 packet.
	ENLPType1 SRENLPValue = 1
	// ENLPType2 Indicates to push an IPv6 Explicit NULL label on an unlabeled IPv6
	// packet, but do not push an IPv4 Explicit NULL label on an
	// unlabeled IPv4 packet.
	ENLPType2 SRENLPValue = 2
	// ENLPType3 Indicates to push an IPv4 Explicit NULL label on an unlabeled IPv4
	// packet, and push an IPv6 Explicit NULL label on an unlabeled
	// IPv6 packet.
	ENLPType3 SRENLPValue = 3
	// ENLPType4 Indicates to not push an Explicit NULL label.
	ENLPType4 SRENLPValue = 4
)

type SRPolicyIPv4

type SRPolicyIPv4 struct {
	SRPolicyNLRI
}

func NewSRPolicyIPv4

func NewSRPolicyIPv4(l uint32, d uint32, c uint32, ep []byte) *SRPolicyIPv4

func (*SRPolicyIPv4) DecodeFromBytes

func (s *SRPolicyIPv4) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

type SRPolicyIPv6

type SRPolicyIPv6 struct {
	SRPolicyNLRI
}

func NewSRPolicyIPv6

func NewSRPolicyIPv6(l uint32, d uint32, c uint32, ep []byte) *SRPolicyIPv6

func (*SRPolicyIPv6) DecodeFromBytes

func (s *SRPolicyIPv6) DecodeFromBytes(data []byte, options ...*MarshallingOption) error

type SRPolicyNLRI

type SRPolicyNLRI struct {
	PrefixDefault

	Length        uint8
	Distinguisher uint32
	Color         uint32
	Endpoint      []byte
	// contains filtered or unexported fields
}

func (*SRPolicyNLRI) AFI

func (s *SRPolicyNLRI) AFI() uint16

func (*SRPolicyNLRI) Flat

func (s *SRPolicyNLRI) Flat() map[string]string

func (*SRPolicyNLRI) Len

func (s *SRPolicyNLRI) Len(options ...*MarshallingOption) int

func (*SRPolicyNLRI) MarshalJSON

func (s *SRPolicyNLRI) MarshalJSON() ([]byte, error)

func (*SRPolicyNLRI) SAFI

func (s *SRPolicyNLRI) SAFI() uint8

func (*SRPolicyNLRI) Serialize

func (s *SRPolicyNLRI) Serialize(options ...*MarshallingOption) ([]byte, error)

func (*SRPolicyNLRI) String

func (s *SRPolicyNLRI) String() string

type SRv6EndpointBehaviorStructure

type SRv6EndpointBehaviorStructure struct {
	Behavior SRBehavior
	BlockLen uint8
	NodeLen  uint8
	FuncLen  uint8
	ArgLen   uint8
}

func (*SRv6EndpointBehaviorStructure) DecodeFromBytes

func (s *SRv6EndpointBehaviorStructure) DecodeFromBytes(data []byte) error

func (*SRv6EndpointBehaviorStructure) MarshalJSON

func (s *SRv6EndpointBehaviorStructure) MarshalJSON() ([]byte, error)

func (*SRv6EndpointBehaviorStructure) Serialize

func (s *SRv6EndpointBehaviorStructure) Serialize() ([]byte, error)

func (*SRv6EndpointBehaviorStructure) String

type SRv6InformationSTLV

type SRv6InformationSTLV struct {
	SID              []byte                  `json:"sid"`
	Flags            uint8                   `json:"flags"`
	EndpointBehavior uint16                  `json:"endpoint_behavior"`
	SubSubTLVs       []PrefixSIDTLVInterface `json:"sub_sub_tlvs,omitempty"`
}

type SRv6InformationSubTLV

type SRv6InformationSubTLV struct {
	SubTLV
	SID              []byte
	Flags            uint8
	EndpointBehavior uint16
	SubSubTLVs       []PrefixSIDTLVInterface
}

SRv6InformationSubTLV defines a structure of SRv6 Information Sub TLV (type 1) object https://tools.ietf.org/html/draft-dawra-bess-srv6-services-02#section-2.1.1

func (*SRv6InformationSubTLV) DecodeFromBytes

func (s *SRv6InformationSubTLV) DecodeFromBytes(data []byte) error

func (*SRv6InformationSubTLV) Extract

func (*SRv6InformationSubTLV) Len

func (s *SRv6InformationSubTLV) Len() int

func (*SRv6InformationSubTLV) MarshalJSON

func (s *SRv6InformationSubTLV) MarshalJSON() ([]byte, error)

func (*SRv6InformationSubTLV) Serialize

func (s *SRv6InformationSubTLV) Serialize() ([]byte, error)

func (*SRv6InformationSubTLV) String

func (s *SRv6InformationSubTLV) String() string

type SRv6L3Service

type SRv6L3Service struct {
	SubTLVs []PrefixSIDTLVInterface
}

SRv6L3Service defines the structure of SRv6 L3 Service object

type SRv6L3ServiceAttribute

type SRv6L3ServiceAttribute struct {
	TLV
	SubTLVs []PrefixSIDTLVInterface
}

SRv6L3ServiceAttribute defines the structure of SRv6 L3 Service attribute

func (*SRv6L3ServiceAttribute) DecodeFromBytes

func (s *SRv6L3ServiceAttribute) DecodeFromBytes(data []byte) error

func (*SRv6L3ServiceAttribute) Extract

func (s *SRv6L3ServiceAttribute) Extract() *SRv6L3Service

func (*SRv6L3ServiceAttribute) Len

func (s *SRv6L3ServiceAttribute) Len() int

func (*SRv6L3ServiceAttribute) MarshalJSON

func (s *SRv6L3ServiceAttribute) MarshalJSON() ([]byte, error)

func (*SRv6L3ServiceAttribute) Serialize

func (s *SRv6L3ServiceAttribute) Serialize() ([]byte, error)

func (*SRv6L3ServiceAttribute) String

func (s *SRv6L3ServiceAttribute) String() string

type SRv6SIDStructureSubSubTLV

type SRv6SIDStructureSubSubTLV struct {
	SubSubTLV
	LocalBlockLength    uint8
	LocatorNodeLength   uint8
	FunctionLength      uint8
	ArgumentLength      uint8
	TranspositionLength uint8
	TranspositionOffset uint8
}

SRv6SIDStructureSubSubTLV defines a structure of SRv6 SID Structure Sub Sub TLV (type 1) object https://tools.ietf.org/html/draft-dawra-bess-srv6-services-02#section-2.1.2.1

func (*SRv6SIDStructureSubSubTLV) DecodeFromBytes

func (s *SRv6SIDStructureSubSubTLV) DecodeFromBytes(data []byte) error

func (*SRv6SIDStructureSubSubTLV) Len

func (s *SRv6SIDStructureSubSubTLV) Len() int

func (*SRv6SIDStructureSubSubTLV) MarshalJSON

func (s *SRv6SIDStructureSubSubTLV) MarshalJSON() ([]byte, error)

func (*SRv6SIDStructureSubSubTLV) Serialize

func (s *SRv6SIDStructureSubSubTLV) Serialize() ([]byte, error)

func (*SRv6SIDStructureSubSubTLV) String

func (s *SRv6SIDStructureSubSubTLV) String() string

type SegmentListWeight

type SegmentListWeight struct {
	TunnelEncapSubTLV
	Flags  uint8
	Weight uint32
}

Weight sub-TLV specifies the weight associated to a given segment list.

func (*SegmentListWeight) DecodeFromBytes

func (s *SegmentListWeight) DecodeFromBytes(data []byte) error

func (*SegmentListWeight) MarshalJSON

func (s *SegmentListWeight) MarshalJSON() ([]byte, error)

func (*SegmentListWeight) Serialize

func (s *SegmentListWeight) Serialize() ([]byte, error)

func (*SegmentListWeight) String

func (s *SegmentListWeight) String() string

type SegmentType

type SegmentType int

SegmentType defines a type of Segment in Segment List

const (
	// TypeA Segment Sub-TLV encodes a single SR-MPLS SID
	TypeA SegmentType = 1
	// TypeB Segment Sub-TLV encodes a single SRv6 SID.
	TypeB SegmentType = 13
	// TypeC Segment Sub-TLV encodes an IPv4 node address, SR Algorithm
	// and an optional SR-MPLS SID
	TypeC SegmentType = 3
	// TypeD Segment Sub-TLV encodes an IPv6 node address, SR Algorithm
	// and an optional SR-MPLS SID.
	TypeD SegmentType = 4
	// TypeE Segment Sub-TLV encodes an IPv4 node address, a local
	// interface Identifier (Local Interface ID) and an optional SR-MPLS
	// SID.
	TypeE SegmentType = 5
	// TypeF Segment Sub-TLV encodes an adjacency local address, an
	// adjacency remote address and an optional SR-MPLS SID.
	TypeF SegmentType = 6
	// TypeG Segment Sub-TLV encodes an IPv6 Link Local adjacency with
	// IPv6 local node address, a local interface identifier (Local
	// Interface ID), IPv6 remote node address , a remote interface
	// identifier (Remote Interface ID) and an optional SR-MPLS SID.
	TypeG SegmentType = 7
	// TypeH Segment Sub-TLV encodes an adjacency local address, an
	// adjacency remote address and an optional SR-MPLS SID.
	TypeH SegmentType = 8
	// TypeI Segment Sub-TLV encodes an IPv6 node address, SR Algorithm
	// and an optional SRv6 SID.
	TypeI SegmentType = 14
	// TypeJ Segment Sub-TLV encodes an IPv6 Link Local adjacency with
	// local node address, a local interface identifier (Local Interface
	// ID), remote IPv6 node address, a remote interface identifier (Remote
	// Interface ID) and an optional SRv6 SID.
	TypeJ SegmentType = 15
	// TypeK Segment Sub-TLV encodes an adjacency local address, an
	// adjacency remote address and an optional SRv6 SID.
	TypeK SegmentType = 16
)

type SegmentTypeA

type SegmentTypeA struct {
	TunnelEncapSubTLV
	Flags uint8
	Label uint32
}

func (*SegmentTypeA) DecodeFromBytes

func (s *SegmentTypeA) DecodeFromBytes(data []byte) error

func (*SegmentTypeA) MarshalJSON

func (s *SegmentTypeA) MarshalJSON() ([]byte, error)

func (*SegmentTypeA) Serialize

func (s *SegmentTypeA) Serialize() ([]byte, error)

func (*SegmentTypeA) String

func (s *SegmentTypeA) String() string

type SegmentTypeB

type SegmentTypeB struct {
	TunnelEncapSubTLV
	Flags   uint8
	SID     []byte
	SRv6EBS *SRv6EndpointBehaviorStructure
}

func (*SegmentTypeB) DecodeFromBytes

func (s *SegmentTypeB) DecodeFromBytes(data []byte) error

func (*SegmentTypeB) MarshalJSON

func (s *SegmentTypeB) MarshalJSON() ([]byte, error)

func (*SegmentTypeB) Serialize

func (s *SegmentTypeB) Serialize() ([]byte, error)

func (*SegmentTypeB) String

func (s *SegmentTypeB) String() string

type SubSubTLV

type SubSubTLV struct {
	Type   SubSubTLVType
	Length uint16
}

func (*SubSubTLV) DecodeFromBytes

func (s *SubSubTLV) DecodeFromBytes(data []byte) ([]byte, error)

func (*SubSubTLV) Len

func (s *SubSubTLV) Len() int

func (*SubSubTLV) Serialize

func (s *SubSubTLV) Serialize(value []byte) ([]byte, error)

type SubSubTLVType

type SubSubTLVType uint8

type SubTLV

type SubTLV struct {
	Type   SubTLVType
	Length uint16
}

func (*SubTLV) DecodeFromBytes

func (s *SubTLV) DecodeFromBytes(data []byte) ([]byte, error)

func (*SubTLV) Len

func (s *SubTLV) Len() int

func (*SubTLV) Serialize

func (s *SubTLV) Serialize(value []byte) ([]byte, error)

type SubTLVType

type SubTLVType uint8

type TCPFlag

type TCPFlag int

func (TCPFlag) String

func (f TCPFlag) String() string

type TLV

type TLV struct {
	Type   TLVType
	Length uint16
}

func (*TLV) DecodeFromBytes

func (s *TLV) DecodeFromBytes(data []byte) ([]byte, error)

func (*TLV) Len

func (s *TLV) Len() int

func (*TLV) Serialize

func (s *TLV) Serialize(value []byte) ([]byte, error)

type TLVType

type TLVType uint8

type TrafficActionExtended

type TrafficActionExtended struct {
	Terminal bool
	Sample   bool
}

func NewTrafficActionExtended

func NewTrafficActionExtended(terminal bool, sample bool) *TrafficActionExtended

func (*TrafficActionExtended) Flat

func (e *TrafficActionExtended) Flat() map[string]string

func (*TrafficActionExtended) GetTypes

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

type TrafficRateExtended struct {
	AS   uint16
	Rate float32
}

func NewTrafficRateExtended

func NewTrafficRateExtended(as uint16, rate float32) *TrafficRateExtended

func (*TrafficRateExtended) Flat

func (e *TrafficRateExtended) Flat() map[string]string

func (*TrafficRateExtended) GetTypes

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 (*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
	Length uint16
}

func (*TunnelEncapSubTLV) DecodeFromBytes

func (t *TunnelEncapSubTLV) DecodeFromBytes(data []byte) (value []byte, err error)

func (*TunnelEncapSubTLV) Len

func (t *TunnelEncapSubTLV) Len() int

func (*TunnelEncapSubTLV) Serialize

func (t *TunnelEncapSubTLV) Serialize(value []byte) (buf []byte, err error)

type TunnelEncapSubTLVColor

type TunnelEncapSubTLVColor struct {
	TunnelEncapSubTLV
	Color uint32
}

func NewTunnelEncapSubTLVColor

func NewTunnelEncapSubTLVColor(color uint32) *TunnelEncapSubTLVColor

func (*TunnelEncapSubTLVColor) DecodeFromBytes

func (t *TunnelEncapSubTLVColor) DecodeFromBytes(data []byte) error

func (*TunnelEncapSubTLVColor) MarshalJSON

func (t *TunnelEncapSubTLVColor) MarshalJSON() ([]byte, error)

func (*TunnelEncapSubTLVColor) Serialize

func (t *TunnelEncapSubTLVColor) Serialize() ([]byte, error)

func (*TunnelEncapSubTLVColor) String

func (t *TunnelEncapSubTLVColor) String() string

type TunnelEncapSubTLVEgressEndpoint

type TunnelEncapSubTLVEgressEndpoint struct {
	TunnelEncapSubTLV
	Address net.IP
}

func NewTunnelEncapSubTLVEgressEndpoint

func NewTunnelEncapSubTLVEgressEndpoint(address string) *TunnelEncapSubTLVEgressEndpoint

func (*TunnelEncapSubTLVEgressEndpoint) DecodeFromBytes

func (t *TunnelEncapSubTLVEgressEndpoint) DecodeFromBytes(data []byte) error

func (*TunnelEncapSubTLVEgressEndpoint) MarshalJSON

func (t *TunnelEncapSubTLVEgressEndpoint) MarshalJSON() ([]byte, error)

func (*TunnelEncapSubTLVEgressEndpoint) Serialize

func (t *TunnelEncapSubTLVEgressEndpoint) Serialize() ([]byte, error)

func (*TunnelEncapSubTLVEgressEndpoint) String

type TunnelEncapSubTLVEncapsulation

type TunnelEncapSubTLVEncapsulation struct {
	TunnelEncapSubTLV
	Key    uint32 // this represent both SessionID for L2TPv3 case and GRE-key for GRE case (RFC5512 4.)
	Cookie []byte
}

func NewTunnelEncapSubTLVEncapsulation

func NewTunnelEncapSubTLVEncapsulation(key uint32, cookie []byte) *TunnelEncapSubTLVEncapsulation

func (*TunnelEncapSubTLVEncapsulation) DecodeFromBytes

func (t *TunnelEncapSubTLVEncapsulation) DecodeFromBytes(data []byte) error

func (*TunnelEncapSubTLVEncapsulation) MarshalJSON

func (t *TunnelEncapSubTLVEncapsulation) MarshalJSON() ([]byte, error)

func (*TunnelEncapSubTLVEncapsulation) Serialize

func (t *TunnelEncapSubTLVEncapsulation) Serialize() ([]byte, error)

func (*TunnelEncapSubTLVEncapsulation) String

type TunnelEncapSubTLVInterface

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

type TunnelEncapSubTLVProtocol

type TunnelEncapSubTLVProtocol struct {
	TunnelEncapSubTLV
	Protocol uint16
}

func NewTunnelEncapSubTLVProtocol

func NewTunnelEncapSubTLVProtocol(protocol uint16) *TunnelEncapSubTLVProtocol

func (*TunnelEncapSubTLVProtocol) DecodeFromBytes

func (t *TunnelEncapSubTLVProtocol) DecodeFromBytes(data []byte) error

func (*TunnelEncapSubTLVProtocol) MarshalJSON

func (t *TunnelEncapSubTLVProtocol) MarshalJSON() ([]byte, error)

func (*TunnelEncapSubTLVProtocol) Serialize

func (t *TunnelEncapSubTLVProtocol) Serialize() ([]byte, error)

func (*TunnelEncapSubTLVProtocol) String

func (t *TunnelEncapSubTLVProtocol) String() string

type TunnelEncapSubTLVSRBSID

type TunnelEncapSubTLVSRBSID struct {
	TunnelEncapSubTLV
	Flags uint8
	BSID  *BSID
}

func (*TunnelEncapSubTLVSRBSID) DecodeFromBytes

func (t *TunnelEncapSubTLVSRBSID) DecodeFromBytes(data []byte) error

func (*TunnelEncapSubTLVSRBSID) MarshalJSON

func (t *TunnelEncapSubTLVSRBSID) MarshalJSON() ([]byte, error)

func (*TunnelEncapSubTLVSRBSID) Serialize

func (t *TunnelEncapSubTLVSRBSID) Serialize() ([]byte, error)

func (*TunnelEncapSubTLVSRBSID) String

func (t *TunnelEncapSubTLVSRBSID) String() string

type TunnelEncapSubTLVSRCandidatePathName

type TunnelEncapSubTLVSRCandidatePathName struct {
	TunnelEncapSubTLV
	CandidatePathName string
}

func NewTunnelEncapSubTLVSRCandidatePathName

func NewTunnelEncapSubTLVSRCandidatePathName(cpn string) *TunnelEncapSubTLVSRCandidatePathName

func (*TunnelEncapSubTLVSRCandidatePathName) DecodeFromBytes

func (t *TunnelEncapSubTLVSRCandidatePathName) DecodeFromBytes(data []byte) error

func (*TunnelEncapSubTLVSRCandidatePathName) MarshalJSON

func (t *TunnelEncapSubTLVSRCandidatePathName) MarshalJSON() ([]byte, error)

func (*TunnelEncapSubTLVSRCandidatePathName) Serialize

func (t *TunnelEncapSubTLVSRCandidatePathName) Serialize() ([]byte, error)

func (*TunnelEncapSubTLVSRCandidatePathName) String

type TunnelEncapSubTLVSRENLP

type TunnelEncapSubTLVSRENLP struct {
	TunnelEncapSubTLV
	Flags uint8
	ENLP  SRENLPValue
}

func NewTunnelEncapSubTLVSRENLP

func NewTunnelEncapSubTLVSRENLP(flags uint32, enlp SRENLPValue) *TunnelEncapSubTLVSRENLP

func (*TunnelEncapSubTLVSRENLP) DecodeFromBytes

func (t *TunnelEncapSubTLVSRENLP) DecodeFromBytes(data []byte) error

func (*TunnelEncapSubTLVSRENLP) MarshalJSON

func (t *TunnelEncapSubTLVSRENLP) MarshalJSON() ([]byte, error)

func (*TunnelEncapSubTLVSRENLP) Serialize

func (t *TunnelEncapSubTLVSRENLP) Serialize() ([]byte, error)

func (*TunnelEncapSubTLVSRENLP) String

func (t *TunnelEncapSubTLVSRENLP) String() string

type TunnelEncapSubTLVSRPreference

type TunnelEncapSubTLVSRPreference struct {
	TunnelEncapSubTLV
	Flags      uint8
	Preference uint32
}

func NewTunnelEncapSubTLVSRPreference

func NewTunnelEncapSubTLVSRPreference(flags uint32, preference uint32) *TunnelEncapSubTLVSRPreference

func (*TunnelEncapSubTLVSRPreference) DecodeFromBytes

func (t *TunnelEncapSubTLVSRPreference) DecodeFromBytes(data []byte) error

func (*TunnelEncapSubTLVSRPreference) MarshalJSON

func (t *TunnelEncapSubTLVSRPreference) MarshalJSON() ([]byte, error)

func (*TunnelEncapSubTLVSRPreference) Serialize

func (t *TunnelEncapSubTLVSRPreference) Serialize() ([]byte, error)

func (*TunnelEncapSubTLVSRPreference) String

type TunnelEncapSubTLVSRPriority

type TunnelEncapSubTLVSRPriority struct {
	TunnelEncapSubTLV
	Priority uint8
}

func NewTunnelEncapSubTLVSRPriority

func NewTunnelEncapSubTLVSRPriority(priority uint8) *TunnelEncapSubTLVSRPriority

func (*TunnelEncapSubTLVSRPriority) DecodeFromBytes

func (t *TunnelEncapSubTLVSRPriority) DecodeFromBytes(data []byte) error

func (*TunnelEncapSubTLVSRPriority) MarshalJSON

func (t *TunnelEncapSubTLVSRPriority) MarshalJSON() ([]byte, error)

func (*TunnelEncapSubTLVSRPriority) Serialize

func (t *TunnelEncapSubTLVSRPriority) Serialize() ([]byte, error)

func (*TunnelEncapSubTLVSRPriority) String

func (t *TunnelEncapSubTLVSRPriority) String() string

type TunnelEncapSubTLVSRSegmentList

type TunnelEncapSubTLVSRSegmentList struct {
	TunnelEncapSubTLV
	Weight   *SegmentListWeight
	Segments []TunnelEncapSubTLVInterface
}

func (*TunnelEncapSubTLVSRSegmentList) DecodeFromBytes

func (t *TunnelEncapSubTLVSRSegmentList) DecodeFromBytes(data []byte) error

func (*TunnelEncapSubTLVSRSegmentList) MarshalJSON

func (t *TunnelEncapSubTLVSRSegmentList) MarshalJSON() ([]byte, error)

func (*TunnelEncapSubTLVSRSegmentList) Serialize

func (t *TunnelEncapSubTLVSRSegmentList) Serialize() ([]byte, error)

func (*TunnelEncapSubTLVSRSegmentList) String

type TunnelEncapSubTLVSRv6BSID

type TunnelEncapSubTLVSRv6BSID struct {
	TunnelEncapSubTLV
	Flags uint8
	BSID  *BSID
	EPBAS *SRv6EndpointBehaviorStructure
}

func (*TunnelEncapSubTLVSRv6BSID) DecodeFromBytes

func (t *TunnelEncapSubTLVSRv6BSID) DecodeFromBytes(data []byte) error

func (*TunnelEncapSubTLVSRv6BSID) MarshalJSON

func (t *TunnelEncapSubTLVSRv6BSID) MarshalJSON() ([]byte, error)

func (*TunnelEncapSubTLVSRv6BSID) Serialize

func (t *TunnelEncapSubTLVSRv6BSID) Serialize() ([]byte, error)

func (*TunnelEncapSubTLVSRv6BSID) String

func (t *TunnelEncapSubTLVSRv6BSID) String() string

type TunnelEncapSubTLVUDPDestPort

type TunnelEncapSubTLVUDPDestPort struct {
	TunnelEncapSubTLV
	UDPDestPort uint16
}

func NewTunnelEncapSubTLVUDPDestPort

func NewTunnelEncapSubTLVUDPDestPort(port uint16) *TunnelEncapSubTLVUDPDestPort

func (*TunnelEncapSubTLVUDPDestPort) DecodeFromBytes

func (t *TunnelEncapSubTLVUDPDestPort) DecodeFromBytes(data []byte) error

func (*TunnelEncapSubTLVUDPDestPort) MarshalJSON

func (t *TunnelEncapSubTLVUDPDestPort) MarshalJSON() ([]byte, error)

func (*TunnelEncapSubTLVUDPDestPort) Serialize

func (t *TunnelEncapSubTLVUDPDestPort) Serialize() ([]byte, error)

func (*TunnelEncapSubTLVUDPDestPort) String

type TunnelEncapSubTLVUnknown

type TunnelEncapSubTLVUnknown struct {
	TunnelEncapSubTLV
	Value []byte
}

func NewTunnelEncapSubTLVUnknown

func NewTunnelEncapSubTLVUnknown(typ EncapSubTLVType, value []byte) *TunnelEncapSubTLVUnknown

func (*TunnelEncapSubTLVUnknown) DecodeFromBytes

func (t *TunnelEncapSubTLVUnknown) DecodeFromBytes(data []byte) error

func (*TunnelEncapSubTLVUnknown) MarshalJSON

func (t *TunnelEncapSubTLVUnknown) MarshalJSON() ([]byte, error)

func (*TunnelEncapSubTLVUnknown) Serialize

func (t *TunnelEncapSubTLVUnknown) Serialize() ([]byte, error)

func (*TunnelEncapSubTLVUnknown) String

func (t *TunnelEncapSubTLVUnknown) String() string

type TunnelEncapTLV

type TunnelEncapTLV struct {
	Type   TunnelType
	Length uint16
	Value  []TunnelEncapSubTLVInterface
}

func NewTunnelEncapTLV

func NewTunnelEncapTLV(typ TunnelType, value []TunnelEncapSubTLVInterface) *TunnelEncapTLV

func (*TunnelEncapTLV) DecodeFromBytes

func (t *TunnelEncapTLV) DecodeFromBytes(data []byte) error

func (*TunnelEncapTLV) Len

func (t *TunnelEncapTLV) Len() int

func (*TunnelEncapTLV) MarshalJSON

func (p *TunnelEncapTLV) MarshalJSON() ([]byte, error)

func (*TunnelEncapTLV) Serialize

func (p *TunnelEncapTLV) Serialize() ([]byte, error)

func (*TunnelEncapTLV) String

func (p *TunnelEncapTLV) String() string

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
	TUNNEL_TYPE_SR_POLICY   TunnelType = 15
	TUNNEL_TYPE_GENEVE      TunnelType = 19
)

func (TunnelType) String

func (p TunnelType) String() string

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 (*TwoOctetAsSpecificExtended) GetTypes

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 NewUnknownExtended

func NewUnknownExtended(typ ExtendedCommunityAttrType, value []byte) *UnknownExtended

func (*UnknownExtended) Flat

func (e *UnknownExtended) Flat() map[string]string

func (*UnknownExtended) GetTypes

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 {
	State ValidationState
}

func NewValidationExtended

func NewValidationExtended(state ValidationState) *ValidationExtended

func (*ValidationExtended) Flat

func (e *ValidationExtended) Flat() map[string]string

func (*ValidationExtended) GetTypes

func (*ValidationExtended) MarshalJSON

func (e *ValidationExtended) MarshalJSON() ([]byte, error)

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
const (
	COMMUNITY_INTERNET                   WellKnownCommunity = 0x00000000
	COMMUNITY_PLANNED_SHUT               WellKnownCommunity = 0xffff0000
	COMMUNITY_ACCEPT_OWN                 WellKnownCommunity = 0xffff0001
	COMMUNITY_ROUTE_FILTER_TRANSLATED_v4 WellKnownCommunity = 0xffff0002
	COMMUNITY_ROUTE_FILTER_v4            WellKnownCommunity = 0xffff0003
	COMMUNITY_ROUTE_FILTER_TRANSLATED_v6 WellKnownCommunity = 0xffff0004
	COMMUNITY_ROUTE_FILTER_v6            WellKnownCommunity = 0xffff0005
	COMMUNITY_LLGR_STALE                 WellKnownCommunity = 0xffff0006
	COMMUNITY_NO_LLGR                    WellKnownCommunity = 0xffff0007
	COMMUNITY_BLACKHOLE                  WellKnownCommunity = 0xffff029a
	COMMUNITY_NO_EXPORT                  WellKnownCommunity = 0xffffff01
	COMMUNITY_NO_ADVERTISE               WellKnownCommunity = 0xffffff02
	COMMUNITY_NO_EXPORT_SUBCONFED        WellKnownCommunity = 0xffffff03
	COMMUNITY_NO_PEER                    WellKnownCommunity = 0xffffff04
)

Jump to

Keyboard shortcuts

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