bcm

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MCLAG_DOMAIN_ID                            = 100
	MCLAG_PEER_LINK_PORT_CHANNEL_ID            = 250
	MCLAG_SESSION_LINK_PORT_CHANNEL_ID         = 251
	MCLAG_PEER_LINK_TRUNK_VLAN_RANGE           = "2..4094"    // TODO do we need to configure it?
	MCLAG_SESSION_IP_1                         = "172.30.5.0" // TODO move to config
	MCLAG_SESSION_IP_2                         = "172.30.5.1" // TODO move to config
	MCLAG_SESSION_IP_PREFIX_LEN                = 31           // TODO move to config
	AGENT_USER                                 = "hhagent"
	NAT_INSTANCE_ID                            = 0
	NAT_ZONE_EXTERNAL                          = 1
	NAT_ANCHOR_VLAN                     uint16 = 500
	VPC_ACL_ENTRY_SEQ_DHCP              uint32 = 10
	VPC_ACL_ENTRY_SEQ_SUBNET            uint32 = 20
	VPC_ACL_ENTRY_VLAN_SHIFT            uint32 = 10000
	VPC_ACL_ENTRY_DENY_ALL_VPC          uint32 = 30000
	VPC_ACL_ENTRY_PERMIT_ANY            uint32 = 40000
	LO_SWITCH                                  = "Loopback0"
	LO_PROTO                                   = "Loopback1"
	LO_VTEP                                    = "Loopback2"
	VRF_DEFAULT                                = "default"
	VTEP_FABRIC                                = "vtepfabric"
	EVPN_NVO                                   = "nvo1"
	ANYCAST_MAC                                = "00:00:00:11:11:11"
	ROUTE_MAP_MAX_STATEMENT                    = 65535
	ROUTE_MAP_BLOCK_EVPN_DEFAULT_REMOTE        = "evpn-default-remote-block"
	PREFIX_LIST_ANY                            = "any-prefix"
	PREFIX_LIST_VPC_LOOPBACK                   = "vpc-loopback-prefix"
	NO_COMMUNITY                               = "no-community"
	LST_GROUP_SPINELINK                        = "spinelink"
	BGP_COMM_LIST_ALL_EXTERNALS                = "all-externals"
)
View Source
const (
	INTERFACE_PREFIX_MANAGEMENT    = "Management"
	INTERFACE_PREFIX_PHYSICAL      = "Ethernet"
	INTERFACE_PREFIX_VLAN          = "Vlan"
	INTERFACE_PREFIX_PORT_CHANNEL  = "PortChannel"
	INTERFACE_DISABLED_DESCRIPTION = "Disabled by Fabric"
)

Variables

This section is empty.

Functions

func Processor

func Processor(client *gnmi.Client) *broadcomProcessor

func SafeSprintf

func SafeSprintf(format string, key any) string

func UnmarshalPortBreakout

func UnmarshalPortBreakout(mode string) string

func UnmarshalPortSpeed

func UnmarshalPortSpeed(speedRaw oc.E_OpenconfigIfEthernet_ETHERNET_SPEED) *string

func ValueOrNil

func ValueOrNil[Value dozer.SpecPart, Result any](actual, desired Value, getter func(Value) Result) (Result, Result)

Types

type Action

type Action struct {
	Weight         ActionWeight           `json:"weight,omitempty"`
	ASummary       string                 `json:"summary,omitempty"`
	Type           ActionType             `json:"type,omitempty"`
	Path           string                 `json:"path,omitempty"`
	Value          ygot.ValidatedGoStruct `json:"value,omitempty"`
	CustomFunc     func() error
	WarningOnError bool
}

func (*Action) Summary

func (a *Action) Summary() string

type ActionQueue

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

func (*ActionQueue) Add

func (q *ActionQueue) Add(action *Action) error

func (*ActionQueue) Sort

func (q *ActionQueue) Sort()

type ActionType

type ActionType string
const (
	ActionTypeUpdate  ActionType = "update"
	ActionTypeReplace ActionType = "replace"
	ActionTypeDelete  ActionType = "delete"
)

type ActionWeight

type ActionWeight uint8
const (
	ActionWeightUnset ActionWeight = iota // keep it first

	ActionWeightSystemZTP
	ActionWeightSystemHostname
	ActionWeightLLDP
	ActionWeightUser
	ActionWeightUserAuthorizedKeys
	ActionWeightPortGroup
	ActionWeightPortBreakout

	ActionWeightPrefixListUpdate
	ActionWeightPrefixListEntryDelete
	ActionWeightPrefixListEntryUpdate

	ActionWeightCommunityListUpdate

	ActionWeightInterfaceBasePortChannelsUpdate
	ActionWeightInterfaceBaseUpdate

	ActionWeightVRFBaseUpdate
	ActionWeightVRFVNIUpdate

	ActionWeightRouteMapUpdate
	ActionWeightRouteMapStatementDelete
	ActionWeightRouteMapStatementUpdate

	ActionWeightInterfaceVLANIPsUpdate
	ActionWeightInterfacePortChannelSwitchedAccessUpdate
	ActionWeightInterfacePortChannelSwitchedTrunkUpdate
	ActionWeightInterfaceEthernetBaseUpdate
	ActionWeightInterfaceEthernetSwitchedAccessUpdate
	ActionWeightInterfaceEthernetSwitchedTrunkUpdate
	ActionWeightInterfaceVLANAnycastGatewayUpdate
	ActionWeightInterfaceNATZoneUpdate
	ActionWeightPortChannelConfigMACUpdate
	ActionWeightPortChannelConfigFallbackUpdate

	ActionWeightInterfaceSubinterfaceIPsDelete
	ActionWeightVRFInterfaceDelete
	ActionWeightACLInterfaceDelete
	ActionWeightInterfaceSubinterfaceDelete
	ActionWeightInterfaceSubinterfaceUpdate
	ActionWeightVRFInterfaceUpdate
	ActionWeightInterfaceSubinterfaceIPsUpdate

	ActionWeightLLDPInterfaceUpdate
	ActionWeightNTP
	ActionWeightNTPServerUpdate

	ActionWeightMCLAGDomainUpdate
	ActionWeightMCLAGInterfaceUpdate

	ActionWeightACLBaseUpdate
	ActionWeightACLInterfaceUpdate
	ActionWeightACLEntryDelete
	ActionWeightACLEntryUpdate

	ActionWeightNATBaseUpdate
	ActionWeightNATPoolUpdate
	ActionWeightNATBindingUpdate
	ActionWeightNATEntryUpdate

	ActionWeightSuppressVLANNeighUpdate

	ActionWeightVRFStaticRouteDelete // it seems like it's better to first remove routes and then add new ones
	ActionWeightVRFStaticRouteUpdate

	ActionWeightVRFBGPBaseUpdate
	ActionWeightVRFSAGUpdate
	ActionWeightVRFEVPNMHUpdate
	ActionWeightVRFEthernetSegmentUpdate

	ActionWeightLSTGroupUpdate
	ActionWeightLSTInterfaceUpdate

	ActionWeightVXLANTunnelMapDelete
	ActionWeightVXLANTunnelUpdate
	ActionWeightVXLANEVPNNVODelete
	ActionWeightVXLANEVPNNVOUpdate
	ActionWeightVXLANTunnelDelete
	ActionWeightVXLANTunnelMapUpdate

	ActionWeightVRFBGPNeighborUpdate
	ActionWeightVRFBGPNetworkUpdate
	ActionWrightVRFTableConnectionUpdate

	ActionWeightVRFBGPImportVRFPolicyUpdate
	ActionWeightVRFBGPImportVRFUpdate

	ActionWeightDHCPRelayUpdate

	ActionWeightDHCPRelayDelete

	ActionWeightVRFBGPImportVRFDelete
	ActionWeightVRFBGPImportVRFPolicyDelete

	ActionWeightVRFVNIDelete

	ActionWeightLSTInterfaceDelete
	ActionWeightLSTGroupDelete

	ActionWeightVRFEthernetSegmentDelete
	ActionWeightVRFEVPNMHDelete
	ActionWrightVRFTableConnectionDelete
	ActionWeightVRFBGPNetworkDelete
	ActionWeightVRFBGPNeighborDelete
	ActionWeightVRFSAGDelete
	ActionWeightVRFBGPBaseDelete
	ActionWeightVRFBaseDelete

	ActionWeightSuppressVLANNeighDelete

	ActionWeightNATEntryDelete
	ActionWeightNATBindingDelete
	ActionWeightNATPoolDelete
	ActionWeightNATBaseDelete

	ActionWeightLLDPInterfaceDelete
	ActionWeightNTPServerDelete

	ActionWeightMCLAGInterfaceDelete
	ActionWeightMCLAGDomainDelete

	ActionWeightPortChannelConfigMACDelete
	ActionWeightPortChannelConfigFallbackDelete
	ActionWeightInterfaceEthernetSwitchedAccessDelete
	ActionWeightInterfaceEthernetSwitchedTrunkDelete
	ActionWeightInterfaceEthernetBaseDelete
	ActionWeightInterfacePortChannelSwitchedAccessDelete
	ActionWeightInterfacePortChannelSwitchedTrunkDelete
	ActionWeightInterfaceNATZoneDelete
	ActionWeightInterfaceVLANIPsDelete
	ActionWeightInterfaceVLANAnycastGatewayDelete

	ActionWeightACLBaseDelete

	ActionWeightInterfaceBaseDelete

	ActionWeightRouteMapDelete
	ActionWeightPrefixListDelete
	ActionWeightCommunityListDelete

	ActionWeightMax // keep it last
)

type DefaultMapEnforcer

type DefaultMapEnforcer[Key cmp.Ordered, Value dozer.SpecPart] struct {
	Summary       string
	CustomHandler func(basePath string, actual, desired map[Key]Value, actions *ActionQueue) error
	ValueHandler  ValueEnforcer[Key, Value] // used by default map handler
}

func (*DefaultMapEnforcer[Key, Value]) Handle

func (h *DefaultMapEnforcer[Key, Value]) Handle(basePath string, actualMap, desiredMap map[Key]Value, actions *ActionQueue) error

type DefaultValueEnforcer

type DefaultValueEnforcer[Key comparable, Value dozer.SpecPart] struct {
	Summary       string
	Skip          func(key Key, actual, desired Value) bool // skip if true
	Getter        func(key Key, value Value) any            // nil to use Value for comparision or it should return values to compart
	NoReplace     bool                                      // replace instead of update
	MutateActual  func(key Key, actual Value) Value         // Mutates actual value before comparision
	MutateDesired func(key Key, desired Value) Value        // Mutates desired value before comparision

	CustomHandler func(basePath string, key Key, actual, desired Value, actions *ActionQueue) error // will be used instead of default one

	Path             string // used by default value handler
	CreatePath       string
	PathFunc         func(key Key, value Value) string
	Marshal          func(key Key, value Value) (ygot.ValidatedGoStruct, error) // used by default value handler
	Weight           ActionWeight
	UpdateWeight     ActionWeight
	DeleteWeight     ActionWeight
	WarningOnError   bool
	SkipDelete       bool
	RecreateOnUpdate bool
}

func (*DefaultValueEnforcer[Key, Value]) Handle

func (h *DefaultValueEnforcer[Key, Value]) Handle(basePath string, key Key, actual, desired Value, actions *ActionQueue) error

type ValueEnforcer

type ValueEnforcer[Key cmp.Ordered, Value dozer.SpecPart] interface {
	Handle(basePath string, key Key, actual, desired Value, actions *ActionQueue) error
}

Directories

Path Synopsis
oc
Package oc is a generated package which contains definitions of structs which represent a YANG schema.
Package oc is a generated package which contains definitions of structs which represent a YANG schema.

Jump to

Keyboard shortcuts

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