types

package
v1.17.7 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	VlanStripTypeFilter = "filter"
	VlanStripTypeVlan   = "vlan"
)

how datapath handle vlan

View Source
const (
	BandwidthModeEDT = "edt"
	BandwidthModeTC  = "tc"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CNIConf

type CNIConf struct {
	cniTypes.NetConf

	// HostVethPrefix is the veth for container prefix on host
	HostVethPrefix string `json:"veth_prefix"`

	// eniIPVirtualType is the ipvlan for container
	ENIIPVirtualType string `json:"eniip_virtual_type"`

	// HostStackCIDRs is a list of CIDRs, all traffic targeting these CIDRs will be redirected to host network stack
	HostStackCIDRs []string `json:"host_stack_cidrs"`

	DisableHostPeer bool `yaml:"disable_host_peer" json:"disable_host_peer"` // disable create peer for host and container. This will also disable ability for service

	VlanStripType VlanStripType `yaml:"vlan_strip_type" json:"vlan_strip_type"` // used in multi ip mode, how datapath config vlan

	// MTU is container and ENI network interface MTU
	MTU int `json:"mtu"`

	// RuntimeConfig represents the options to be passed in by the runtime.
	RuntimeConfig cni.RuntimeConfig `json:"runtimeConfig"`

	BandwidthMode string `json:"bandwidth_mode"`

	// EnableNetworkPriority by enable priority control, eni qdisc is replaced with tc_prio
	EnableNetworkPriority bool `json:"enable_network_priority"`

	// Debug
	Debug bool `json:"debug"`

	// SymmetricRoutingConfig contains configuration for symmetric routing
	SymmetricRoutingConfig *SymmetricRoutingConfig `json:"symmetric_routing_config,omitempty"`
}

CNIConf is the cni network config

func (*CNIConf) IPVlan

func (n *CNIConf) IPVlan() bool

type CheckConfig

type CheckConfig struct {
	DP DataPath

	RecordPodEvent

	NetNS ns.NetNS

	HostVETHName    string
	ContainerIfName string

	ContainerIPNet *terwayTypes.IPNetSet
	HostIPSet      *terwayTypes.IPNetSet
	GatewayIP      *terwayTypes.IPSet

	ENIIndex int32 // phy device
	TrunkENI bool
	MTU      int

	DefaultRoute bool
	MultiNetwork bool
}

type DataPath

type DataPath int
const (
	VPCRoute DataPath = iota
	PolicyRoute
	IPVlan
	ExclusiveENI
	Vlan
)

datapath terway supported

type K8SArgs

type K8SArgs struct {
	cniTypes.CommonArgs
	IP                         net.IP
	K8S_POD_NAME               cniTypes.UnmarshallableString // nolint
	K8S_POD_NAMESPACE          cniTypes.UnmarshallableString // nolint
	K8S_POD_INFRA_CONTAINER_ID cniTypes.UnmarshallableString // nolint
}

K8SArgs is cni args of kubernetes

type RecordPodEvent

type RecordPodEvent func(msg string)

type SetupConfig

type SetupConfig struct {
	DP DataPath

	HostVETHName string

	ContainerIfName string
	ContainerIPNet  *terwayTypes.IPNetSet
	GatewayIP       *terwayTypes.IPSet
	MTU             int
	ENIIndex        int
	ERDMA           bool
	ENIGatewayIP    *terwayTypes.IPSet

	// disable create peer for exclusiveENI
	DisableCreatePeer bool

	// StripVlan or use vlan
	StripVlan bool
	Vid       int

	DefaultRoute bool
	MultiNetwork bool

	// add extra route in container
	ExtraRoutes []cniTypes.Route

	ServiceCIDR *terwayTypes.IPNetSet
	HostIPSet   *terwayTypes.IPNetSet
	// ipvlan
	HostStackCIDRs []*net.IPNet

	BandwidthMode string
	Ingress       uint64
	Egress        uint64

	EnableNetworkPriority bool
	NetworkPriority       uint32

	RuntimeConfig cni.RuntimeConfig

	// for windows
	AssistantContainerIPNet *terwayTypes.IPNetSet
	AssistantGatewayIP      *terwayTypes.IPSet
}

type SymmetricRoutingConfig added in v1.15.0

type SymmetricRoutingConfig struct {
	// Interface is the interface name used for symmetric routing
	Interface string `json:"interface,omitempty"`
	// Mark is the fwmark value used for symmetric routing
	Mark int `json:"mark,omitempty"`
	// Mask is the fwmark mask value used for symmetric routing
	Mask int `json:"mask,omitempty"`
	// TableID is the routing table ID used for symmetric routing
	TableID int `json:"table_id,omitempty"`
	// RulePriority is the priority of the ip rule
	RulePriority int `json:"rule_priority,omitempty"`
	// Comment is the comment for iptables rules
	Comment string `json:"comment,omitempty"`
	// Backend specifies the firewall backend to use: "iptables" or "nftables"
	// Default is "iptables"
	Backend string `json:"backend,omitempty"`
}

SymmetricRoutingConfig contains configuration for symmetric routing

type TeardownCfg

type TeardownCfg struct {
	DP DataPath

	HostVETHName string

	ENIIndex int

	ContainerIfName string
	ContainerIPNet  *terwayTypes.IPNetSet

	ServiceCIDR *terwayTypes.IPNetSet

	EnableNetworkPriority bool
}

type VlanStripType

type VlanStripType string

VlanStripType how datapath handle vlan

Jump to

Keyboard shortcuts

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