types

package
v0.11.0-calicov3.15.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Family type definitions
	FAMILY_ALL = unix.AF_UNSPEC
	FAMILY_V4  = unix.AF_INET
	FAMILY_V6  = unix.AF_INET6
)
View Source
const InvalidID uint32 = ^uint32(0)
View Source
const (
	InvalidInterface = interface_types.InterfaceIndex(^uint32(0))
)

Variables

This section is empty.

Functions

func FormatRxMode

func FormatRxMode(rxMode RxMode) string

func FromVppAddress

func FromVppAddress(addr ip_types.Address) net.IP

func FromVppAddressWithPrefix

func FromVppAddressWithPrefix(prefix ip_types.AddressWithPrefix) *net.IPNet

func FromVppIpAddressUnion

func FromVppIpAddressUnion(Un ip_types.AddressUnion, isv6 bool) net.IP

func FromVppMacAddress

func FromVppMacAddress(vppHwAddr ethernet_types.MacAddress) net.HardwareAddr

func FromVppPrefix

func FromVppPrefix(prefix ip_types.Prefix) *net.IPNet

func GetIPFamily

func GetIPFamily(ip net.IP) int

func IsIP4

func IsIP4(ip net.IP) bool

func IsIP6

func IsIP6(ip net.IP) bool

func IsV6toFibProto

func IsV6toFibProto(isv6 bool) fib_types.FibPathNhProto

func ToCapoPolicy

func ToCapoPolicy(p *Policy) (items []capo.CapoPolicyItem)

func ToCapoRule

func ToCapoRule(r *Rule) (cr capo.CapoRule)

func ToCnatEndpoint

func ToCnatEndpoint(ep CnatEndpoint) cnat.CnatEndpoint

func ToVppAddress

func ToVppAddress(addr net.IP) ip_types.Address

func ToVppAddressFamily

func ToVppAddressFamily(isv6 bool) ip_types.AddressFamily

func ToVppAddressWithPrefix

func ToVppAddressWithPrefix(prefix *net.IPNet) ip_types.AddressWithPrefix

func ToVppIP4Address

func ToVppIP4Address(addr net.IP) ip_types.IP4Address

Make sure you really call this with an IPv4 address...

func ToVppIP6Address

func ToVppIP6Address(addr net.IP) ip_types.IP6Address

func ToVppIPProto

func ToVppIPProto(proto IPProto) ip_types.IPProto

func ToVppMacAddress

func ToVppMacAddress(hardwareAddr *net.HardwareAddr) ethernet_types.MacAddress

func ToVppNatConfigFlags

func ToVppNatConfigFlags(flags NatFlags) nat_types.NatConfigFlags

func ToVppNeighborFlags

func ToVppNeighborFlags(flags IPNeighborFlags) ip_neighbor.IPNeighborFlags

func ToVppPrefix

func ToVppPrefix(prefix *net.IPNet) ip_types.Prefix

Types

type AVFInterface

type AVFInterface struct {
	NumRxQueues int
	TxQueueSize int
	RxQueueSize int
	PciId       string
}

func (*AVFInterface) GetPciId

func (ai *AVFInterface) GetPciId() (id uint32, err error)

type CnatEndpoint

type CnatEndpoint struct {
	IP   net.IP
	Port uint16
}

func (*CnatEndpoint) String

func (e *CnatEndpoint) String() string

type CnatEndpointTuple

type CnatEndpointTuple struct {
	SrcEndpoint CnatEndpoint
	DstEndpoint CnatEndpoint
}

func (*CnatEndpointTuple) String

func (t *CnatEndpointTuple) String() string

type CnatTranslateEntry

type CnatTranslateEntry struct {
	Endpoint CnatEndpoint
	Backends []CnatEndpointTuple
	Proto    IPProto
	IsRealIP bool
	ID       uint32
}

func (*CnatTranslateEntry) Equal

func (*CnatTranslateEntry) String

func (n *CnatTranslateEntry) String() string

type IPIPTunnel

type IPIPTunnel struct {
	Src       net.IP
	Dst       net.IP
	TableID   uint32
	SwIfIndex uint32
}

func (*IPIPTunnel) String

func (t *IPIPTunnel) String() string

type IPPort

type IPPort struct {
	Addr    net.IP
	L4Proto uint8
	Port    uint16
}

func (*IPPort) Equal

func (i *IPPort) Equal(j *IPPort) bool

type IPsecTunnelProtection

type IPsecTunnelProtection struct {
	SwIfIndex   uint32
	NextHop     net.IP
	OutSAIndex  uint32
	InSAIndices []uint32
}

type IfAddress

type IfAddress struct {
	IPNet     net.IPNet
	SwIfIndex uint32
}

type InterfaceConfig

type InterfaceConfig struct {
	IngressPolicyIDs []uint32
	EgressPolicyIDs  []uint32
	ProfileIDs       []uint32
}

func NewInterfaceConfig

func NewInterfaceConfig() *InterfaceConfig

type IpsetType

type IpsetType uint8
const (
	IpsetTypeIP     IpsetType = IpsetType(capo.CAPO_IP)
	IpsetTypeIPPort IpsetType = IpsetType(capo.CAPO_IP_AND_PORT)
	IpsetTypeNet    IpsetType = IpsetType(capo.CAPO_NET)
)

type Nat44Entry

type Nat44Entry struct {
	ServiceIP   net.IP
	ServicePort int32
	Protocol    IPProto
	BackendIPs  []net.IP
	BackendPort int32
}

func (*Nat44Entry) String

func (n *Nat44Entry) String() string

type Neighbor

type Neighbor struct {
	SwIfIndex    uint32
	IP           net.IP
	HardwareAddr net.HardwareAddr
	Flags        IPNeighborFlags
}

type Policy

type Policy struct {
	InboundRuleIDs  []uint32
	OutboundRuleIDs []uint32
}

type PortRange

type PortRange struct {
	First uint16
	Last  uint16
}

type Route

type Route struct {
	Dst   *net.IPNet
	Paths []RoutePath
	Table int
}

func (*Route) IsIP6

func (r *Route) IsIP6() bool

func (*Route) IsLinkLocal

func (r *Route) IsLinkLocal() bool

func (*Route) String

func (r *Route) String() string

type RoutePath

type RoutePath struct {
	Gw        net.IP
	SwIfIndex uint32
	Table     int
}

func (*RoutePath) String

func (p *RoutePath) String() string

type Rule

type Rule struct {
	Action        RuleAction
	AddressFamily int
	Filters       []RuleFilter

	DstNet    []net.IPNet
	DstNotNet []net.IPNet
	SrcNet    []net.IPNet
	SrcNotNet []net.IPNet

	DstPortRange    []PortRange
	DstNotPortRange []PortRange
	SrcPortRange    []PortRange
	SrcNotPortRange []PortRange

	DstIPPortIPSet    []uint32
	DstNotIPPortIPSet []uint32
	SrcIPPortIPSet    []uint32
	SrcNotIPPortIPSet []uint32

	DstIPSet    []uint32
	DstNotIPSet []uint32
	SrcIPSet    []uint32
	SrcNotIPSet []uint32
}

type RuleAction

type RuleAction uint8

type RuleFilter

type RuleFilter struct {
	ShouldMatch bool
	Type        CapoFilterType
	Value       int
}

type RxMode

type RxMode uint32
const (
	UnknownRxMode RxMode = 0
	Polling       RxMode = 1
	Interrupt     RxMode = 2
	Adaptative    RxMode = 3
	DefaultRxMode RxMode = 4

	AllQueues = ^uint32(0)
)

func UnformatRxMode

func UnformatRxMode(str string) RxMode

type TapFlags

type TapFlags uint32
const (
	TapFlagGSO         TapFlags = 1
	TapFlagCsumOffload TapFlags = 2
	TapFlagPersist     TapFlags = 4
	TapFlagAttach      TapFlags = 8
	TapFlagTun         TapFlags = 16
	TapGROCoalesce     TapFlags = 32
)

type TapV2

type TapV2 struct {
	HostNamespace  string
	HostIfName     string
	Tag            string
	MacAddress     net.HardwareAddr
	HostMacAddress net.HardwareAddr
	NumRxQueues    int
	NumTxQueues    int
	Flags          TapFlags
	TxQueueSize    int
	RxQueueSize    int
	Mtu            int
}

type VXLanTunnel

type VXLanTunnel struct {
	SrcAddress     net.IP
	DstAddress     net.IP
	Vni            uint32
	DecapNextIndex uint32
}

type VppInterfaceDetails

type VppInterfaceDetails struct {
	SwIfIndex uint32
	IsUp      bool
	Name      string
	Tag       string
	Type      string
}

type VppXDPInterface

type VppXDPInterface struct {
	SwIfIndex         uint32
	Name              string
	HostInterfaceName string
	RxQueueSize       int
	TxQueueSize       int
	NumRxQueues       int
}

type WireguardPeer

type WireguardPeer struct {
	PublicKey           []byte
	Port                uint16
	PersistentKeepalive int
	TableID             uint32
	Addr                net.IP
	SwIfIndex           uint32
	Index               uint32
	AllowedIps          []net.IPNet
}

func (*WireguardPeer) AddAllowedIp

func (t *WireguardPeer) AddAllowedIp(addr net.IPNet)

func (*WireguardPeer) DelAllowedIp

func (t *WireguardPeer) DelAllowedIp(addr net.IPNet)

func (*WireguardPeer) Equal

func (t *WireguardPeer) Equal(o *WireguardPeer) bool

func (*WireguardPeer) String

func (t *WireguardPeer) String() string

type WireguardTunnel

type WireguardTunnel struct {
	Addr       net.IP
	Port       uint16
	SwIfIndex  uint32
	PublicKey  []byte
	PrivateKey []byte
}

func (*WireguardTunnel) String

func (t *WireguardTunnel) String() string

Jump to

Keyboard shortcuts

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