Documentation ¶
Index ¶
- Constants
- Variables
- func DeepCopyMap(theMap interface{}) interface{}
- func ExcuteCommand(cmdStr, arg string) error
- func FlowKeyFromRuleName(ruleName string) string
- func InitializeVDS(ctx context.Context, datapathManager *DpManager, vdsID string, ...)
- func NewVDSForConfig(datapathManager *DpManager, vdsID, ovsbrname string)
- func NewVDSForConfigBase(datapathManager *DpManager, vdsID, ovsbrname string)
- func NewVDSForConfigProxy(datapathManager *DpManager, vdsID, ovsbrname string)
- func ParseIPAddrMaskString(ipAddr string) (*net.IP, *net.IP, error)
- func ParseMacToUint64(b []byte) uint64
- func RuleIsSame(r1, r2 *EveroutePolicyRule) bool
- func SetGroupIDInfo(brName string, gpIDs *GroupIDInfo) error
- func SetPortNoFlood(bridge string, ofport int) error
- type ArpInfo
- type BaseBridge
- func (b *BaseBridge) AddIPPoolGW(string) error
- func (b *BaseBridge) AddIPPoolSubnet(string) error
- func (b *BaseBridge) AddLocalEndpoint(*Endpoint) error
- func (b *BaseBridge) AddMicroSegmentRule(context.Context, *EveroutePolicyRule, uint8, uint8, string) (*FlowEntry, error)
- func (b *BaseBridge) AddSFCRule() error
- func (b *BaseBridge) AddVNFInstance() error
- func (b *BaseBridge) BridgeInit()
- func (b *BaseBridge) BridgeReset()
- func (b *BaseBridge) DelIPPoolGW(string) error
- func (b *BaseBridge) DelIPPoolSubnet(string) error
- func (b *BaseBridge) DisconnectedNotify() chan struct{}
- func (b *BaseBridge) GetName() string
- func (b *BaseBridge) IsSwitchConnected() bool
- func (b *BaseBridge) MultipartReply(*ofctrl.OFSwitch, *openflow13.MultipartReply)
- func (b *BaseBridge) PacketRcvd(*ofctrl.OFSwitch, *ofctrl.PacketIn)
- func (b *BaseBridge) RemoveLocalEndpoint(*Endpoint) error
- func (b *BaseBridge) RemoveSFCRule() error
- func (b *BaseBridge) RemoveVNFInstance() error
- func (b *BaseBridge) SwitchConnected(sw *ofctrl.OFSwitch)
- func (b *BaseBridge) SwitchDisconnected(_ *ofctrl.OFSwitch)
- func (b *BaseBridge) WaitForSwitchConnection()
- type Bridge
- type ClsBridge
- func (c *ClsBridge) AddLocalEndpoint(_ *Endpoint) error
- func (c *ClsBridge) AddSFCRule() error
- func (c *ClsBridge) AddVNFInstance() error
- func (c *ClsBridge) BridgeInit()
- func (c *ClsBridge) BridgeInitCNI()
- func (c *ClsBridge) BridgeReset()
- func (c *ClsBridge) InitVlanMacLearningAction(learnAction *ofctrl.LearnAction, learnedDstField string, ...) error
- func (c *ClsBridge) MultipartReply(_ *ofctrl.OFSwitch, _ *openflow13.MultipartReply)
- func (c *ClsBridge) PacketRcvd(_ *ofctrl.OFSwitch, _ *ofctrl.PacketIn)
- func (c *ClsBridge) RemoveLocalEndpoint(_ *Endpoint) error
- func (c *ClsBridge) RemoveSFCRule() error
- func (c *ClsBridge) RemoveVNFInstance() error
- type ClsBridgeOverlay
- type DpManager
- func (dp *DpManager) AddEveroutePolicyRule(ctx context.Context, rule *EveroutePolicyRule, ruleBase RuleBaseInfo) error
- func (dp *DpManager) AddIPPoolGW(gw string) error
- func (dp *DpManager) AddIPPoolSubnet(subnet string) error
- func (dp *DpManager) AddLocalEndpoint(endpoint *Endpoint) error
- func (dp *DpManager) DelIPPoolGW(gw string) error
- func (dp *DpManager) DelIPPoolSubnet(subnet string) error
- func (dp *DpManager) GetAllRules() []*v1alpha1.RuleEntry
- func (dp *DpManager) GetChainBridge() []string
- func (dp *DpManager) GetNatBridges() []*NatBridge
- func (dp *DpManager) GetPolicyByFlowID(flowID ...uint64) []*PolicyInfo
- func (dp *DpManager) GetRulesByFlowIDs(flowIDs ...uint64) []*v1alpha1.RuleEntry
- func (dp *DpManager) GetRulesByRuleIDs(ruleIDs ...string) []*v1alpha1.RuleEntry
- func (dp *DpManager) GetUplinkBridgeOverlay() *UplinkBridgeOverlay
- func (dp *DpManager) HandleEndpointIPTimeout(_ context.Context, endpointIP *types.EndpointIP) error
- func (dp *DpManager) InitializeCNI()
- func (dp *DpManager) InitializeDatapath(ctx context.Context)
- func (dp *DpManager) IsBridgesConnected() bool
- func (dp *DpManager) IsEnableCNI() bool
- func (dp *DpManager) IsEnableKubeProxyReplace() bool
- func (dp *DpManager) IsEnableOverlay() bool
- func (dp *DpManager) IsEnableProxy() bool
- func (dm *DpManager) PolicyRuleLimit(_ []string, _, _ []*policycache.PolicyRule) bool
- func (dm *DpManager) PolicyRuleMetricsUpdate(policyIDs []string, limited bool)
- func (dp *DpManager) RemoveEveroutePolicyRule(ctx context.Context, ruleID string, ruleBase RuleBaseInfo) error
- func (dp *DpManager) RemoveLocalEndpoint(endpoint *Endpoint) error
- func (dp *DpManager) ReplayEverouteIPAMFlow(vdsID string, brKey string) error
- func (dp *DpManager) ReplayVDSLocalEndpointFlow(vdsID string, keyWord string) error
- func (dp *DpManager) ReplayVDSMicroSegmentFlow(vdsID string) error
- func (dp *DpManager) SetOverlaySyncFunc(f func())
- func (dp *DpManager) SetProxySyncFunc(f func())
- func (dp *DpManager) UpdateLocalEndpoint(newEndpoint, oldEndpoint *Endpoint) error
- func (dp *DpManager) UseEverouteIPAM() bool
- func (dp *DpManager) WaitForBridgeConnected()
- type DpManagerCNIConfig
- type DpManagerConfig
- type DpManagerInfo
- type Endpoint
- type EveroutePolicyRule
- type EveroutePolicyRuleEntry
- type EveroutePolicyRuleForCT
- type EveroutePolicyRuleList
- type FlowEntry
- type GroupIDAllocator
- type GroupIDInfo
- type IPAddressReference
- type LocalBridge
- func (l *LocalBridge) AddLocalEndpoint(endpoint *Endpoint) error
- func (l *LocalBridge) AddSFCRule() error
- func (l *LocalBridge) AddVNFInstance() error
- func (l *LocalBridge) BridgeInit()
- func (l *LocalBridge) BridgeInitCNI()
- func (l *LocalBridge) BridgeReset()
- func (l *LocalBridge) InitFromLocalLearnAction(fromLocalLearnAction *ofctrl.LearnAction) error
- func (l *LocalBridge) InitFromLocalTrunkPortLearnAction(fromLocalLearnAction *ofctrl.LearnAction) error
- func (l *LocalBridge) MultipartReply(*ofctrl.OFSwitch, *openflow13.MultipartReply)
- func (l *LocalBridge) PacketRcvd(_ *ofctrl.OFSwitch, pkt *ofctrl.PacketIn)
- func (l *LocalBridge) RemoveLocalEndpoint(endpoint *Endpoint) error
- func (l *LocalBridge) RemoveSFCRule() error
- func (l *LocalBridge) RemoveVNFInstance() error
- type LocalBridgeOverlay
- func (l *LocalBridgeOverlay) AddIPPoolGW(gw string) error
- func (l *LocalBridgeOverlay) AddIPPoolSubnet(subnetStr string) error
- func (l *LocalBridgeOverlay) AddLocalEndpoint(endpoint *Endpoint) error
- func (l *LocalBridgeOverlay) BridgeInitCNI()
- func (l *LocalBridgeOverlay) DelIPPoolGW(gw string) error
- func (l *LocalBridgeOverlay) DelIPPoolSubnet(subnetStr string) error
- func (l *LocalBridgeOverlay) RemoveLocalEndpoint(endpoint *Endpoint) error
- type NatBridge
- func (n *NatBridge) AddDnatFlow(ip string, protocol corev1.Protocol, port int32) error
- func (n *NatBridge) AddLBFlow(svcLB *proxycache.SvcLB) error
- func (n *NatBridge) AddLocalEndpoint(endpoint *Endpoint) error
- func (n *NatBridge) AddSessionAffinityFlow(svcLB *proxycache.SvcLB) error
- func (n *NatBridge) BridgeInit()
- func (n *NatBridge) BridgeInitCNI()
- func (n *NatBridge) BridgeReset()
- func (n *NatBridge) DelDnatFlow(ip string, protocol corev1.Protocol, port int32) error
- func (n *NatBridge) DelLBFlow(svcLB *proxycache.SvcLB) error
- func (n *NatBridge) DelLBGroup(svcID, portName string) error
- func (n *NatBridge) DelSessionAffinityFlow(svcLB *proxycache.SvcLB) error
- func (n *NatBridge) GetSvcIndexCache() *cache.SvcIndex
- func (n *NatBridge) PacketRcvd(_ *ofctrl.OFSwitch, pkt *ofctrl.PacketIn)
- func (n *NatBridge) RemoveLocalEndpoint(endpoint *Endpoint) error
- func (n *NatBridge) ResetLBGroup(svcID, portName string) error
- func (n *NatBridge) UpdateLBGroup(svcID, portName string, backends []everoutesvc.Backend, ...) error
- type PolicyBridge
- func (p *PolicyBridge) AddLocalEndpoint(_ *Endpoint) error
- func (p *PolicyBridge) AddMicroSegmentRule(ctx context.Context, rule *EveroutePolicyRule, direction uint8, tier uint8, ...) (*FlowEntry, error)
- func (p *PolicyBridge) AddSFCRule() error
- func (p *PolicyBridge) AddVNFInstance() error
- func (p *PolicyBridge) BridgeInit()
- func (p *PolicyBridge) BridgeInitCNI()
- func (p *PolicyBridge) BridgeReset()
- func (p *PolicyBridge) GetTierTable(direction uint8, tier uint8, mode string) (*ofctrl.Table, *ofctrl.Table, error)
- func (p *PolicyBridge) MultipartReply(_ *ofctrl.OFSwitch, _ *openflow13.MultipartReply)
- func (p *PolicyBridge) PacketRcvd(_ *ofctrl.OFSwitch, _ *ofctrl.PacketIn)
- func (p *PolicyBridge) RemoveLocalEndpoint(_ *Endpoint) error
- func (p *PolicyBridge) RemoveSFCRule() error
- func (p *PolicyBridge) RemoveVNFInstance() error
- type PolicyInfo
- type PolicyItem
- type PolicyRuleRef
- type RoundInfo
- type RuleBaseInfo
- type UplinkBridge
- func (u *UplinkBridge) AddLocalEndpoint(_ *Endpoint) error
- func (u *UplinkBridge) AddSFCRule() error
- func (u *UplinkBridge) AddVNFInstance() error
- func (u *UplinkBridge) BridgeInit()
- func (u *UplinkBridge) BridgeInitCNI()
- func (u *UplinkBridge) BridgeReset()
- func (u *UplinkBridge) MultipartReply(_ *ofctrl.OFSwitch, _ *openflow13.MultipartReply)
- func (u *UplinkBridge) PacketRcvd(_ *ofctrl.OFSwitch, _ *ofctrl.PacketIn)
- func (u *UplinkBridge) RemoveLocalEndpoint(_ *Endpoint) error
- func (u *UplinkBridge) RemoveSFCRule() error
- func (u *UplinkBridge) RemoveVNFInstance() error
- type UplinkBridgeOverlay
- func (u *UplinkBridgeOverlay) AddIPPoolSubnet(subnetStr string) error
- func (u *UplinkBridgeOverlay) AddLocalEndpoint(endpoint *Endpoint) error
- func (u *UplinkBridgeOverlay) AddRemoteEndpoint(epIP, remoteNodeIP net.IP) error
- func (u *UplinkBridgeOverlay) BridgeInitCNI()
- func (u *UplinkBridgeOverlay) DelIPPoolSubnet(subnetStr string) error
- func (u *UplinkBridgeOverlay) RemoveLocalEndpoint(endpoint *Endpoint) error
- func (u *UplinkBridgeOverlay) RemoveRemoteEndpoint(epIPStr string) error
Constants ¶
View Source
const ( CLSBRIDGE_LEARNING_TABLE_ID = 0 CLSBRIDGE_FORWARDING_TABLE_ID = 2 CLSBRIDGE_OUTPUT_TABLE_ID = 3 )
View Source
const ( VLAN_INPUT_TABLE = 0 VLAN_FILTER_TABLE = 1 L2_FORWARDING_TABLE = 5 L2_LEARNING_TABLE = 10 FROM_LOCAL_REDIRECT_TABLE = 15 FROM_LOCAL_PASS_TABLE = 20 FROM_LOCAL_TO_CONTROLLER_TABLE = 25 CNI_CT_COMMIT_TABLE = 100 CNI_CT_REDIRECT_TABLE = 105 FACK_MAC = "ee:ee:ee:ee:ee:ee" P_NONE = 0xffff InternalSvcPktMark uint32 = 1 << cniconst.InternalSvcPktMarkBit )
View Source
const ( HIGH_MATCH_FLOW_PRIORITY = 300 MID_MATCH_FLOW_PRIORITY = 200 NORMAL_MATCH_FLOW_PRIORITY = 100 DEFAULT_DROP_FLOW_PRIORITY = 70 GLOBAL_DEFAULT_POLICY_FLOW_PRIORITY = 40 DEFAULT_FLOW_MISS_PRIORITY = 10 FLOW_MATCH_OFFSET = 3 )
View Source
const ( POLICY_TIER1 = 50 POLICY_TIER2 = 100 POLICY_TIER_ECP = 130 POLICY_TIER3 = 150 )
View Source
const ( POLICY_DIRECTION_OUT = 0 POLICY_DIRECTION_IN = 1 )
View Source
const ( IP_BROADCAST_ADDR = "255.255.255.255" LOOP_BACK_ADDR = "127.0.0.1" )
View Source
const ( FLOW_ROUND_NUM_LENGTH = 4 FLOW_SEQ_NUM_LENGTH = 28 FLOW_ROUND_NUM_MASK = 0xf0000000 FLOW_SEQ_NUM_MASK = 0x0fffffff DEFAULT_POLICY_ENFORCEMENT_MODE = "work" )
View Source
const ( PROTOCOL_ARP = 0x0806 PROTOCOL_IP = 0x0800 PROTOCOL_UDP = 0x11 PROTOCOL_TCP = 0x06 PROTOCOL_ICMP = 0x01 )
View Source
const ( LOCAL_BRIDGE_KEYWORD = "local" POLICY_BRIDGE_KEYWORD = "policy" CLS_BRIDGE_KEYWORD = "cls" UPLINK_BRIDGE_KEYWORD = "uplink" NAT_BRIDGE_KEYWORD = "nat" )
View Source
const ( IPAddressTimeout = 60 IPAddressCacheUpdateInterval = 5 LocalBridgeL2ForwardingTableHardTimeout = 300 LocalBridgeL2ForwardingTableIdleTimeout = 300 ClsBridgeL2ForwardingTableHardTimeout = 300 ClsBridgeL2ForwardingTableIdleTimeout = 300 MaxIPAddressLearningFrenquency = 5 LocalToPolicySuffix = "local-to-policy" PolicyToLocalSuffix = "policy-to-local" PolicyToClsSuffix = "policy-to-cls" ClsToPolicySuffix = "cls-to-policy" ClsToUplinkSuffix = "cls-to-uplink" UplinkToClsSuffix = "uplink-to-cls" LocalToNatSuffix = "local-to-nat" NatToLocalSuffix = "nat-to-local" NatToUplinkSuffix = "nat-to-uplink" UplinkToNatSuffix = "uplink-to-nat" InternalIngressPolicy = "/INTERNAL_INGRESS_POLICY" InternalEgressPolicy = "/INTERNAL_EGRESS_POLICY" InternalIngressRulePrefix = "/INTERNAL_INGRESS_POLICY/internal/ingress/-" InternalEgressRulePrefix = "/INTERNAL_EGRESS_POLICY/internal/egress/-" MaxRoundNum = 15 MaxArpChanCache = 100 ArpLimiterRate = 5000 MaxCleanConntrackChanSize = 5000 RuleEntryCap = 10000 )
View Source
const ( PortMaskMatchFullBit uint16 = 65535 FTPPort uint16 = 21 TFTPPort uint16 = 69 )
View Source
const ( SelectGroupWeight = 100 LbFlowForIPPri uint16 = MID_MATCH_FLOW_PRIORITY LbFlowForNPPri uint16 = NORMAL_MATCH_FLOW_PRIORITY )
View Source
const ( INPUT_TABLE = 0 CT_STATE_TABLE = 1 PASSTHROUGH_TABLE = 5 DIRECTION_SELECTION_TABLE = 10 EGRESS_TIER1_TABLE = 20 EGRESS_TIER2_MONITOR_TABLE = 24 EGRESS_TIER2_TABLE = 25 EGRESS_TIER_ECP_TABLE = 28 EGRESS_TIER3_MONITOR_TABLE = 29 EGRESS_TIER3_TABLE = 30 INGRESS_TIER1_TABLE = 50 INGRESS_TIER2_MONITOR_TABLE = 54 INGRESS_TIER2_TABLE = 55 INGRESS_TIER_ECP_TABLE = 58 INGRESS_TIER3_MONITOR_TABLE = 59 INGRESS_TIER3_TABLE = 60 CT_COMMIT_TABLE = 70 CT_DROP_TABLE = 71 SFC_POLICY_TABLE = 80 POLICY_FORWARDING_TABLE = 90 RoundNumXXREG0BitStart = 0 // codepoint0 bit start RoundNumXXREG0BitEnd = 3 // codepoint0 bit end RoundNumXXREG0BitSize = RoundNumXXREG0BitEnd - RoundNumXXREG0BitStart + 1 MonitorTier2FlowSpaceXXREG0BitStart = 4 // codepoint1 bit start MonitorTier2FlowSpaceXXREG0BitEnd = 31 // codepoint1 bit end MonitorTier3FlowSpaceXXREG0BitStart = 32 // codepoint2 bit start MonitorTier3FlowSpaceXXREG0BitEnd = 59 // codepoint2 bit end MonitorTier3FlowSpaceXXREG0BitSize = MonitorTier3FlowSpaceXXREG0BitEnd - MonitorTier3FlowSpaceXXREG0BitStart + 1 WorkPolicyActionXXREG0Bit = 127 // codepoint6 MonitorTier3PolicyActionXXREG0Bit = 126 // codepoint5 )
//nolint
View Source
const ( EveroutePolicyAllow string = "allow" EveroutePolicyDeny string = "deny" )
View Source
const ( SetupBridgeChain = `` /* 1772-byte string literal not displayed */ CleanBridgeChain = `` /* 287-byte string literal not displayed */ SetupCNIBridgeChain = `` /* 392-byte string literal not displayed */ SetupProxyBridgeChain = `` /* 680-byte string literal not displayed */ SetupTunnelBridgeChain = `` /* 298-byte string literal not displayed */ CleanProxyBridgeChain = ` NAT_BRIDGE="%s-nat" ovs-vsctl -- del-br ${NAT_BRIDGE} ` )
View Source
const (
BROADCAST_MAC_ADDRESS_MASK = "01:00:00:00:00:00"
)
View Source
const InvalidGroupID uint32 = 0
Variables ¶
View Source
var ( VlanFlagMask uint16 = 0x1000 InternalSvcPktMarkMask uint32 = 1 << cniconst.InternalSvcPktMarkBit InternalSvcPktMarkRange *openflow13.NXRange = openflow13.NewNXRange(cniconst.InternalSvcPktMarkBit, cniconst.InternalSvcPktMarkBit) )
View Source
var ( LBOArpProxyTable uint8 = 10 LBOInPortTable uint8 = 30 LBOFromNatTable uint8 = 40 LBOFromPolicyTable uint8 = 50 LBOFromLocalTable uint8 = 60 LBOForwardToLocalTable uint8 = 80 LBOPaddingL2Table uint8 = 90 LBOOutputTable uint8 = 110 )
View Source
var ( LBOOutputPortReg = "nxm_nx_reg2" LBOOutputPortStart = 0 LBOOutputPortRange *openflow.NXRange = openflow.NewNXRange(LBOOutputPortStart, 15) IcmpTypeRange *openflow.NXRange = openflow.NewNXRange(0, 7) )
View Source
var ( EtherTypeLength uint16 = 16 ProtocolLength uint16 = 8 MacLength uint16 = 48 IPv4Lenth uint16 = 32 PortLength uint16 = 16 ArpOperRequest uint16 = 1 ArpOperReply uint64 = 2 IcmpTypeRequest uint8 = 8 IcmpTypeReply uint8 )
View Source
var ( NatBrInputTable uint8 NatBrInPortTable uint8 = 4 NatBrCTZoneTable uint8 = 5 NatBrCTStateTable uint8 = 10 NatBrSessionAffinityTable uint8 = 30 NatBrServiceLBTable uint8 = 35 NatBrSessionAffinityLearnTable uint8 = 40 NatBrDnatTable uint8 = 50 NatBrL3ForwardTable uint8 = 90 NatBrOutputTable uint8 = 100 NatBrSvcEmptyTable uint8 = 200 )
View Source
var ( CTZoneReg = "nxm_nx_reg0" CTZoneRange *openflow13.NXRange = openflow13.NewNXRange(0, 15) ChooseBackendFlagReg = "nxm_nx_reg0" ChooseBackendFlagRange *openflow13.NXRange = openflow13.NewNXRange(16, 16) ChooseBackendFlagStart = 16 NeedChoose uint8 NoNeedChoose uint8 = 1 BackendIPReg = "nxm_nx_reg1" BackendIPRegNumber = 1 BackendIPRange *openflow13.NXRange = openflow13.NewNXRange(0, 31) BackendPortReg = "nxm_nx_reg2" BackendPortRegNumber = 2 BackendPortRange *openflow13.NXRange = openflow13.NewNXRange(0, 15) ChooseBackendFlagLength uint16 = 1 )
View Source
var ( WorkPolicyActionDenyMatchCTLabel = [16]byte{0x80} // 1 << WorkPolicyActionXXREG0Bit WorkPolicyActionDenyMatchCTLabelMask = [16]byte{0x80} // 1 << WorkPolicyActionXXREG0Bit MonitorTier3PolicyActionDenyMatchCTLabel = [16]byte{0x40} // 1 << MonitorTier3PolicyActionXXREG0Bit MonitorTier3PolicyActionDenyMatchCTLabelMask = [16]byte{0x40} // 1 << MonitorTier3PolicyActionXXREG0Bit RoundNumNXRange = openflow13.NewNXRange(RoundNumXXREG0BitStart, RoundNumXXREG0BitEnd) MonitorTier2FlowSpaceNXRange = openflow13.NewNXRange(MonitorTier2FlowSpaceXXREG0BitStart, MonitorTier2FlowSpaceXXREG0BitEnd) MonitorTier3FlowSpaceNXRange = openflow13.NewNXRange(MonitorTier3FlowSpaceXXREG0BitStart, MonitorTier3FlowSpaceXXREG0BitEnd) WorkPolicyActionNXRange = openflow13.NewNXRange(WorkPolicyActionXXREG0Bit, WorkPolicyActionXXREG0Bit) MonitorTier3PolicyActionNXRange = openflow13.NewNXRange(MonitorTier3PolicyActionXXREG0Bit, MonitorTier3PolicyActionXXREG0Bit) )
View Source
var ( UBOArpProxyTable uint8 = 10 UBOSvcForwardTable uint8 = 15 UBOSvcMatchTable uint8 = 20 UBOResetSvcMarkTable uint8 = 24 UBOSvcSnatTable uint8 = 25 UBOForwardToLocalTable uint8 = 30 UBOForwardToGwTable uint8 = 40 UBOForwardToTunnelTable uint8 = 35 UBOSetRemoteIPTable uint8 = 70 UBOSetTunnelOutPortTable uint8 = 75 UBOSetSvcMarkTable uint8 = 90 UBOPaddingL2Table uint8 = 100 UBOOutputTable uint8 = 110 )
View Source
var ( UBOOutputPortReg = "nxm_nx_reg2" UBOOutputPortStart = 0 UBOOutputPortRange *openflow.NXRange = openflow.NewNXRange(UBOOutputPortStart, 15) TunnelDstReg = "nxm_nx_tun_ipv4_dst" )
View Source
var IPv6AllFF = net.IP{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}
Functions ¶
func DeepCopyMap ¶
func DeepCopyMap(theMap interface{}) interface{}
func ExcuteCommand ¶
func FlowKeyFromRuleName ¶
func InitializeVDS ¶
func NewVDSForConfig ¶
func NewVDSForConfigBase ¶
func NewVDSForConfigProxy ¶
func ParseIPAddrMaskString ¶
ParseIPAddrMaskString Parse IP addr string
func ParseMacToUint64 ¶
func RuleIsSame ¶
func RuleIsSame(r1, r2 *EveroutePolicyRule) bool
func SetGroupIDInfo ¶
func SetGroupIDInfo(brName string, gpIDs *GroupIDInfo) error
func SetPortNoFlood ¶
Types ¶
type BaseBridge ¶
func (*BaseBridge) AddIPPoolGW ¶
func (b *BaseBridge) AddIPPoolGW(string) error
func (*BaseBridge) AddIPPoolSubnet ¶
func (b *BaseBridge) AddIPPoolSubnet(string) error
func (*BaseBridge) AddLocalEndpoint ¶
func (b *BaseBridge) AddLocalEndpoint(*Endpoint) error
func (*BaseBridge) AddMicroSegmentRule ¶
func (b *BaseBridge) AddMicroSegmentRule(context.Context, *EveroutePolicyRule, uint8, uint8, string) (*FlowEntry, error)
func (*BaseBridge) AddSFCRule ¶
func (b *BaseBridge) AddSFCRule() error
func (*BaseBridge) AddVNFInstance ¶
func (b *BaseBridge) AddVNFInstance() error
func (*BaseBridge) BridgeInit ¶
func (b *BaseBridge) BridgeInit()
func (*BaseBridge) BridgeReset ¶
func (b *BaseBridge) BridgeReset()
func (*BaseBridge) DelIPPoolGW ¶
func (b *BaseBridge) DelIPPoolGW(string) error
func (*BaseBridge) DelIPPoolSubnet ¶
func (b *BaseBridge) DelIPPoolSubnet(string) error
func (*BaseBridge) DisconnectedNotify ¶
func (b *BaseBridge) DisconnectedNotify() chan struct{}
func (*BaseBridge) GetName ¶
func (b *BaseBridge) GetName() string
func (*BaseBridge) IsSwitchConnected ¶
func (b *BaseBridge) IsSwitchConnected() bool
func (*BaseBridge) MultipartReply ¶
func (b *BaseBridge) MultipartReply(*ofctrl.OFSwitch, *openflow13.MultipartReply)
Controller received a multi-part reply from the switch
func (*BaseBridge) PacketRcvd ¶
func (b *BaseBridge) PacketRcvd(*ofctrl.OFSwitch, *ofctrl.PacketIn)
Controller received a packet from the switch
func (*BaseBridge) RemoveLocalEndpoint ¶
func (b *BaseBridge) RemoveLocalEndpoint(*Endpoint) error
func (*BaseBridge) RemoveSFCRule ¶
func (b *BaseBridge) RemoveSFCRule() error
func (*BaseBridge) RemoveVNFInstance ¶
func (b *BaseBridge) RemoveVNFInstance() error
func (*BaseBridge) SwitchConnected ¶
func (b *BaseBridge) SwitchConnected(sw *ofctrl.OFSwitch)
func (*BaseBridge) SwitchDisconnected ¶
func (b *BaseBridge) SwitchDisconnected(_ *ofctrl.OFSwitch)
func (*BaseBridge) WaitForSwitchConnection ¶
func (b *BaseBridge) WaitForSwitchConnection()
type Bridge ¶
type Bridge interface { BridgeInit() BridgeReset() BridgeInitCNI() AddLocalEndpoint(endpoint *Endpoint) error RemoveLocalEndpoint(endpoint *Endpoint) error AddVNFInstance() error RemoveVNFInstance() error AddSFCRule() error RemoveSFCRule() error AddMicroSegmentRule(ctx context.Context, rule *EveroutePolicyRule, direction uint8, tier uint8, mode string) (*FlowEntry, error) IsSwitchConnected() bool DisconnectedNotify() chan struct{} // of control app interface // A Switch connected to the controller SwitchConnected(sw *ofctrl.OFSwitch) // Switch disconnected from the controller SwitchDisconnected(sw *ofctrl.OFSwitch) // Controller received a packet from the switch PacketRcvd(sw *ofctrl.OFSwitch, pkt *ofctrl.PacketIn) // Controller received a multi-part reply from the switch MultipartReply(sw *ofctrl.OFSwitch, rep *openflow13.MultipartReply) // Everoute IPAM AddIPPoolSubnet(string) error DelIPPoolSubnet(string) error AddIPPoolGW(string) error DelIPPoolGW(string) error GetName() string // contains filtered or unexported methods }
func NewClsBridge ¶
func NewLocalBridge ¶
func NewUplinkBridge ¶
type ClsBridge ¶
type ClsBridge struct { BaseBridge // contains filtered or unexported fields }
func (*ClsBridge) AddLocalEndpoint ¶
func (*ClsBridge) AddSFCRule ¶
func (*ClsBridge) AddVNFInstance ¶
func (*ClsBridge) BridgeInit ¶
func (c *ClsBridge) BridgeInit()
func (*ClsBridge) BridgeInitCNI ¶
func (c *ClsBridge) BridgeInitCNI()
func (*ClsBridge) BridgeReset ¶
func (c *ClsBridge) BridgeReset()
func (*ClsBridge) InitVlanMacLearningAction ¶
func (*ClsBridge) MultipartReply ¶
func (c *ClsBridge) MultipartReply(_ *ofctrl.OFSwitch, _ *openflow13.MultipartReply)
func (*ClsBridge) PacketRcvd ¶
func (*ClsBridge) RemoveLocalEndpoint ¶
func (*ClsBridge) RemoveSFCRule ¶
func (*ClsBridge) RemoveVNFInstance ¶
type ClsBridgeOverlay ¶
type ClsBridgeOverlay struct {
BaseBridge
}
func (*ClsBridgeOverlay) BridgeInitCNI ¶
func (c *ClsBridgeOverlay) BridgeInitCNI()
type DpManager ¶
type DpManager struct { DpManagerMutex sync.Mutex BridgeChainMap map[string]map[string]Bridge // map vds to bridge instance map OvsdbDriverMap map[string]map[string]*ovsdbDriver.OvsDriver // map vds to bridge ovsdbDriver map ControllerMap map[string]map[string]*ofctrl.Controller BridgeChainPortMap map[string]map[string]uint32 // map vds to patch port to ofport-num map Config *DpManagerConfig Info *DpManagerInfo Rules map[string]*EveroutePolicyRuleEntry // rules database FlowIDToRules map[uint64]*EveroutePolicyRuleEntry ArpChan chan ArpInfo ArpLimiter *rate.Limiter AgentMetric *metrics.AgentMetric // contains filtered or unexported fields }
func InitCNIDpMgrUT ¶
func NewDatapathManager ¶
func NewDatapathManager(datapathConfig *DpManagerConfig, ofPortIPAddressUpdateChan chan *types.EndpointIP, agentMetric *metrics.AgentMetric) *DpManager
Datapath manager act as openflow controller: 1. event driven local endpoint info crud and related flow update, 2. collect local endpoint ip learned from different ovsbr(1 per vds), and sync it to management plane
func (*DpManager) AddEveroutePolicyRule ¶
func (dp *DpManager) AddEveroutePolicyRule(ctx context.Context, rule *EveroutePolicyRule, ruleBase RuleBaseInfo) error
func (*DpManager) AddIPPoolGW ¶
func (*DpManager) AddIPPoolSubnet ¶
func (*DpManager) AddLocalEndpoint ¶
func (*DpManager) DelIPPoolGW ¶
func (*DpManager) DelIPPoolSubnet ¶
func (*DpManager) GetAllRules ¶
func (*DpManager) GetChainBridge ¶
func (*DpManager) GetNatBridges ¶
func (*DpManager) GetPolicyByFlowID ¶
func (dp *DpManager) GetPolicyByFlowID(flowID ...uint64) []*PolicyInfo
func (*DpManager) GetRulesByFlowIDs ¶
func (*DpManager) GetRulesByRuleIDs ¶
func (*DpManager) GetUplinkBridgeOverlay ¶
func (dp *DpManager) GetUplinkBridgeOverlay() *UplinkBridgeOverlay
func (*DpManager) HandleEndpointIPTimeout ¶
func (*DpManager) InitializeCNI ¶
func (dp *DpManager) InitializeCNI()
func (*DpManager) InitializeDatapath ¶
func (*DpManager) IsBridgesConnected ¶
func (*DpManager) IsEnableCNI ¶
func (*DpManager) IsEnableKubeProxyReplace ¶
func (*DpManager) IsEnableOverlay ¶
func (*DpManager) IsEnableProxy ¶
func (*DpManager) PolicyRuleLimit ¶
func (dm *DpManager) PolicyRuleLimit(_ []string, _, _ []*policycache.PolicyRule) bool
func (dm *DpManager) PolicyRuleLimit(policyIDs []string, addList, deleteList []*policycache.PolicyRule) bool {
func (*DpManager) PolicyRuleMetricsUpdate ¶
func (*DpManager) RemoveEveroutePolicyRule ¶
func (*DpManager) RemoveLocalEndpoint ¶
func (*DpManager) ReplayEverouteIPAMFlow ¶
func (*DpManager) ReplayVDSLocalEndpointFlow ¶
func (*DpManager) ReplayVDSMicroSegmentFlow ¶
func (*DpManager) SetOverlaySyncFunc ¶
func (dp *DpManager) SetOverlaySyncFunc(f func())
func (*DpManager) SetProxySyncFunc ¶
func (dp *DpManager) SetProxySyncFunc(f func())
func (*DpManager) UpdateLocalEndpoint ¶
func (*DpManager) UseEverouteIPAM ¶
func (*DpManager) WaitForBridgeConnected ¶
func (dp *DpManager) WaitForBridgeConnected()
type DpManagerCNIConfig ¶
type DpManagerConfig ¶
type DpManagerInfo ¶
type DpManagerInfo struct { NodeName string PodCIDR []cnitypes.IPNet BridgeName string ClusterCIDR *cnitypes.IPNet ClusterPodCIDR *net.IPNet ClusterPodGw *net.IP LocalGwName string LocalGwIP net.IP LocalGwMac net.HardwareAddr LocalGwOfPort uint32 GatewayName string GatewayIP net.IP GatewayMask net.IPMask GatewayMac net.HardwareAddr GatewayOfPort uint32 TunnelOfPort uint32 Namespace string }
type Endpoint ¶
type Endpoint struct { InterfaceUUID string InterfaceName string // interface name that endpoint attached to IPAddr net.IP IPAddrMutex sync.RWMutex IPAddrLastUpdateTime time.Time PortNo uint32 // endpoint of port MacAddrStr string VlanID uint16 // endpoint vlan id Trunk string // vlan trunk config BridgeName string // bridge name that endpoint attached to }
type EveroutePolicyRule ¶
type EveroutePolicyRule struct { RuleID string // Unique identifier for the rule Priority int // Priority for the rule (1..100. 100 is highest) SrcIPAddr string // source IP addrss and mask DstIPAddr string // Destination IP address and mask IPProtocol uint8 // IP protocol number IPFamily uint8 // IP family SrcPort uint16 // Source port SrcPortMask uint16 DstPort uint16 // destination port DstPortMask uint16 IcmpType uint8 IcmpTypeEnable bool Action string // rule action: 'allow' or 'deny' }
func (*EveroutePolicyRule) DeepCopy ¶
func (r *EveroutePolicyRule) DeepCopy() *EveroutePolicyRule
type EveroutePolicyRuleEntry ¶
type EveroutePolicyRuleEntry struct { EveroutePolicyRule *EveroutePolicyRule Direction uint8 Tier uint8 Mode string RuleFlowMap map[string]*FlowEntry PolicyRuleReference map[PolicyRuleRef]struct{} }
type EveroutePolicyRuleForCT ¶
type EveroutePolicyRuleForCT struct { RuleID string SrcIPNet *net.IPNet SrcIP *net.IP DstIPNet *net.IPNet DstIP *net.IP IPFamily uint8 // IP family IPProtocol uint8 // IP protocol number SrcPort uint16 // Source port SrcPortMask uint16 DstPort uint16 // destination port DstPortMask uint16 IcmpTypeEnable bool IcmpType uint8 }
func (EveroutePolicyRuleForCT) MatchConntrackFlow ¶
func (r EveroutePolicyRuleForCT) MatchConntrackFlow(flow *netlink.ConntrackFlow) bool
type EveroutePolicyRuleList ¶
type EveroutePolicyRuleList []EveroutePolicyRuleForCT
func (EveroutePolicyRuleList) MatchConntrackFlow ¶
func (list EveroutePolicyRuleList) MatchConntrackFlow(flow *netlink.ConntrackFlow) bool
type GroupIDAllocator ¶
type GroupIDAllocator struct {
// contains filtered or unexported fields
}
func NewGroupIDAllocate ¶
func NewGroupIDAllocate(iter uint32) *GroupIDAllocator
func (*GroupIDAllocator) Allocate ¶
func (g *GroupIDAllocator) Allocate() uint32
func (*GroupIDAllocator) GetIter ¶
func (g *GroupIDAllocator) GetIter() uint32
func (*GroupIDAllocator) Max ¶
func (g *GroupIDAllocator) Max() uint32
func (*GroupIDAllocator) Release ¶
func (g *GroupIDAllocator) Release(gID uint32)
type GroupIDInfo ¶
type GroupIDInfo struct { // key is iter, value is the end groupid Exists map[uint32]uint32 `yaml:"exists"` }
func GetGroupIDInfo ¶
func GetGroupIDInfo(brName string) (*GroupIDInfo, error)
func (*GroupIDInfo) Clone ¶
func (e *GroupIDInfo) Clone() *GroupIDInfo
func (*GroupIDInfo) GetNextIter ¶
func (e *GroupIDInfo) GetNextIter() uint32
func (*GroupIDInfo) TooManyGroups ¶
func (e *GroupIDInfo) TooManyGroups() bool
type IPAddressReference ¶
type IPAddressReference struct {
// contains filtered or unexported fields
}
type LocalBridge ¶
type LocalBridge struct { BaseBridge // contains filtered or unexported fields }
func (*LocalBridge) AddLocalEndpoint ¶
func (l *LocalBridge) AddLocalEndpoint(endpoint *Endpoint) error
func (*LocalBridge) AddSFCRule ¶
func (l *LocalBridge) AddSFCRule() error
func (*LocalBridge) AddVNFInstance ¶
func (l *LocalBridge) AddVNFInstance() error
func (*LocalBridge) BridgeInitCNI ¶
func (l *LocalBridge) BridgeInitCNI()
func (*LocalBridge) BridgeReset ¶
func (l *LocalBridge) BridgeReset()
func (*LocalBridge) InitFromLocalLearnAction ¶
func (l *LocalBridge) InitFromLocalLearnAction(fromLocalLearnAction *ofctrl.LearnAction) error
func (*LocalBridge) InitFromLocalTrunkPortLearnAction ¶
func (l *LocalBridge) InitFromLocalTrunkPortLearnAction(fromLocalLearnAction *ofctrl.LearnAction) error
func (*LocalBridge) MultipartReply ¶
func (l *LocalBridge) MultipartReply(*ofctrl.OFSwitch, *openflow13.MultipartReply)
func (*LocalBridge) PacketRcvd ¶
func (l *LocalBridge) PacketRcvd(_ *ofctrl.OFSwitch, pkt *ofctrl.PacketIn)
func (*LocalBridge) RemoveLocalEndpoint ¶
func (l *LocalBridge) RemoveLocalEndpoint(endpoint *Endpoint) error
func (*LocalBridge) RemoveSFCRule ¶
func (l *LocalBridge) RemoveSFCRule() error
func (*LocalBridge) RemoveVNFInstance ¶
func (l *LocalBridge) RemoveVNFInstance() error
type LocalBridgeOverlay ¶
type LocalBridgeOverlay struct { BaseBridge // contains filtered or unexported fields }
func (*LocalBridgeOverlay) AddIPPoolGW ¶
func (l *LocalBridgeOverlay) AddIPPoolGW(gw string) error
func (*LocalBridgeOverlay) AddIPPoolSubnet ¶
func (l *LocalBridgeOverlay) AddIPPoolSubnet(subnetStr string) error
func (*LocalBridgeOverlay) AddLocalEndpoint ¶
func (l *LocalBridgeOverlay) AddLocalEndpoint(endpoint *Endpoint) error
func (*LocalBridgeOverlay) BridgeInitCNI ¶
func (l *LocalBridgeOverlay) BridgeInitCNI()
func (*LocalBridgeOverlay) DelIPPoolGW ¶
func (l *LocalBridgeOverlay) DelIPPoolGW(gw string) error
func (*LocalBridgeOverlay) DelIPPoolSubnet ¶
func (l *LocalBridgeOverlay) DelIPPoolSubnet(subnetStr string) error
func (*LocalBridgeOverlay) RemoveLocalEndpoint ¶
func (l *LocalBridgeOverlay) RemoveLocalEndpoint(endpoint *Endpoint) error
type NatBridge ¶
type NatBridge struct { BaseBridge // contains filtered or unexported fields }
func NewNatBridge ¶
func (*NatBridge) AddDnatFlow ¶
func (*NatBridge) AddLocalEndpoint ¶
func (*NatBridge) AddSessionAffinityFlow ¶
func (n *NatBridge) AddSessionAffinityFlow(svcLB *proxycache.SvcLB) error
func (*NatBridge) BridgeInit ¶
func (n *NatBridge) BridgeInit()
func (*NatBridge) BridgeInitCNI ¶
func (n *NatBridge) BridgeInitCNI()
func (*NatBridge) BridgeReset ¶
func (n *NatBridge) BridgeReset()
func (*NatBridge) DelDnatFlow ¶
func (*NatBridge) DelLBGroup ¶
func (*NatBridge) DelSessionAffinityFlow ¶
func (n *NatBridge) DelSessionAffinityFlow(svcLB *proxycache.SvcLB) error
func (*NatBridge) GetSvcIndexCache ¶
func (*NatBridge) PacketRcvd ¶
func (*NatBridge) RemoveLocalEndpoint ¶
func (*NatBridge) ResetLBGroup ¶
func (*NatBridge) UpdateLBGroup ¶
func (n *NatBridge) UpdateLBGroup(svcID, portName string, backends []everoutesvc.Backend, tp ertype.TrafficPolicyType) error
type PolicyBridge ¶
type PolicyBridge struct { BaseBridge // contains filtered or unexported fields }
func NewPolicyBridge ¶
func NewPolicyBridge(brName string, datapathManager *DpManager) *PolicyBridge
func (*PolicyBridge) AddLocalEndpoint ¶
func (p *PolicyBridge) AddLocalEndpoint(_ *Endpoint) error
func (*PolicyBridge) AddMicroSegmentRule ¶
func (p *PolicyBridge) AddMicroSegmentRule(ctx context.Context, rule *EveroutePolicyRule, direction uint8, tier uint8, mode string) (*FlowEntry, error)
func (*PolicyBridge) AddSFCRule ¶
func (p *PolicyBridge) AddSFCRule() error
func (*PolicyBridge) AddVNFInstance ¶
func (p *PolicyBridge) AddVNFInstance() error
func (*PolicyBridge) BridgeInit ¶
func (p *PolicyBridge) BridgeInit()
func (*PolicyBridge) BridgeInitCNI ¶
func (p *PolicyBridge) BridgeInitCNI()
func (*PolicyBridge) BridgeReset ¶
func (p *PolicyBridge) BridgeReset()
func (*PolicyBridge) GetTierTable ¶
func (*PolicyBridge) MultipartReply ¶
func (p *PolicyBridge) MultipartReply(_ *ofctrl.OFSwitch, _ *openflow13.MultipartReply)
func (*PolicyBridge) PacketRcvd ¶
func (p *PolicyBridge) PacketRcvd(_ *ofctrl.OFSwitch, _ *ofctrl.PacketIn)
func (*PolicyBridge) RemoveLocalEndpoint ¶
func (p *PolicyBridge) RemoveLocalEndpoint(_ *Endpoint) error
func (*PolicyBridge) RemoveSFCRule ¶
func (p *PolicyBridge) RemoveSFCRule() error
func (*PolicyBridge) RemoveVNFInstance ¶
func (p *PolicyBridge) RemoveVNFInstance() error
type PolicyInfo ¶
type PolicyItem ¶
type PolicyItem struct { Name string Namespace string PolicyType policycache.PolicyType }
type PolicyRuleRef ¶
type RuleBaseInfo ¶
type RuleBaseInfo struct { Ref PolicyRuleRef Direction uint8 Tier uint8 Mode string }
type UplinkBridge ¶
type UplinkBridge struct { BaseBridge // contains filtered or unexported fields }
func (*UplinkBridge) AddLocalEndpoint ¶
func (u *UplinkBridge) AddLocalEndpoint(_ *Endpoint) error
func (*UplinkBridge) AddSFCRule ¶
func (u *UplinkBridge) AddSFCRule() error
func (*UplinkBridge) AddVNFInstance ¶
func (u *UplinkBridge) AddVNFInstance() error
func (*UplinkBridge) BridgeInit ¶
func (u *UplinkBridge) BridgeInit()
func (*UplinkBridge) BridgeInitCNI ¶
func (u *UplinkBridge) BridgeInitCNI()
func (*UplinkBridge) BridgeReset ¶
func (u *UplinkBridge) BridgeReset()
func (*UplinkBridge) MultipartReply ¶
func (u *UplinkBridge) MultipartReply(_ *ofctrl.OFSwitch, _ *openflow13.MultipartReply)
func (*UplinkBridge) PacketRcvd ¶
func (u *UplinkBridge) PacketRcvd(_ *ofctrl.OFSwitch, _ *ofctrl.PacketIn)
func (*UplinkBridge) RemoveLocalEndpoint ¶
func (u *UplinkBridge) RemoveLocalEndpoint(_ *Endpoint) error
func (*UplinkBridge) RemoveSFCRule ¶
func (u *UplinkBridge) RemoveSFCRule() error
func (*UplinkBridge) RemoveVNFInstance ¶
func (u *UplinkBridge) RemoveVNFInstance() error
type UplinkBridgeOverlay ¶
type UplinkBridgeOverlay struct { BaseBridge // contains filtered or unexported fields }
func (*UplinkBridgeOverlay) AddIPPoolSubnet ¶
func (u *UplinkBridgeOverlay) AddIPPoolSubnet(subnetStr string) error
func (*UplinkBridgeOverlay) AddLocalEndpoint ¶
func (u *UplinkBridgeOverlay) AddLocalEndpoint(endpoint *Endpoint) error
func (*UplinkBridgeOverlay) AddRemoteEndpoint ¶
func (u *UplinkBridgeOverlay) AddRemoteEndpoint(epIP, remoteNodeIP net.IP) error
func (*UplinkBridgeOverlay) BridgeInitCNI ¶
func (u *UplinkBridgeOverlay) BridgeInitCNI()
func (*UplinkBridgeOverlay) DelIPPoolSubnet ¶
func (u *UplinkBridgeOverlay) DelIPPoolSubnet(subnetStr string) error
func (*UplinkBridgeOverlay) RemoveLocalEndpoint ¶
func (u *UplinkBridgeOverlay) RemoveLocalEndpoint(endpoint *Endpoint) error
func (*UplinkBridgeOverlay) RemoveRemoteEndpoint ¶
func (u *UplinkBridgeOverlay) RemoveRemoteEndpoint(epIPStr string) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.