types

package
v3.26.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: Apache-2.0 Imports: 27 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 (
	CnatNoNat = uint8(cnat.CNAT_EPT_NO_NAT)
)
View Source
const InvalidID uint32 = ^uint32(0)
View Source
const (
	InvalidInterface = interface_types.InterfaceIndex(^uint32(0))
)

Variables

View Source
var (
	VppErrorUnimplemented = api.UNIMPLEMENTED
)

Functions

func AddrIsZeros

func AddrIsZeros(p net.IP) bool

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 FromVppPrefix

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

func GetBoolIPFamily

func GetBoolIPFamily(isIP6 bool) ip_types.AddressFamily

func GetIPFamily

func GetIPFamily(ip net.IP) int

func GetPciIdInt

func GetPciIdInt(PciIdStr string) (id uint32, err error)

func IntListToString

func IntListToString(prefix string, lst []uint32) string

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 MacAddress added in v3.26.0

func MacAddress(hwAddr net.HardwareAddr) ethernet_types.MacAddress

func StrListToString

func StrListToString(prefix string, lst []string) string

func StrableListToString

func StrableListToString(prefix string, arg interface{}) string

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 ToFibPathList

func ToFibPathList(routePaths []RoutePath, isIP6 bool) (apiPathList []fib_types.FibPath)

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

func ToVppSrBehavior

func ToVppSrBehavior(behavior SrBehavior) sr_types.SrBehavior

func ToVppSrSteerTrafficType

func ToVppSrSteerTrafficType(trafficType SrSteerTrafficType) sr_types.SrSteer

Types

type ACL

type ACL struct {
	ACLIndex uint32
	Tag      string
	Rules    []ACLRule
}

type ACLRule

type ACLRule struct {
	Src     net.IPNet
	Dst     net.IPNet
	SrcPort uint16
	DstPort uint16
	Proto   IPProto
}

func (*ACLRule) ToVppACLRule

func (r *ACLRule) ToVppACLRule() acl_types.ACLRule

type AVFInterface

type AVFInterface struct {
	GenericVppInterface
	PciId string
}

type AbfPolicy

type AbfPolicy struct {
	Paths    []RoutePath
	PolicyID uint32
	AclIndex uint32
}

type AfPacketInterface

type AfPacketInterface struct {
	GenericVppInterface
	Flags af_packet.AfPacketFlags
}

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
	Flags       uint8
}

func (*CnatEndpointTuple) String

func (t *CnatEndpointTuple) String() string

type CnatLbType

type CnatLbType uint8

type CnatTranslateEntry

type CnatTranslateEntry struct {
	Endpoint CnatEndpoint
	Backends []CnatEndpointTuple
	Proto    IPProto
	IsRealIP bool
	LbType   CnatLbType
}

func (*CnatTranslateEntry) Equal

func (*CnatTranslateEntry) Key

func (e *CnatTranslateEntry) Key() string

func (*CnatTranslateEntry) String

func (n *CnatTranslateEntry) String() string

type GenericVppInterface

type GenericVppInterface struct {
	Name              string /* Desired name in VPP */
	HostInterfaceName string /* Name of the host interface */
	HardwareAddr      net.HardwareAddr
	NumRxQueues       int
	NumTxQueues       int
	TxQueueSize       int
	RxQueueSize       int
	/* return value on create */
	SwIfIndex uint32
}

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 InterfaceEvent added in v3.25.1

type InterfaceEvent struct {
	SwIfIndex uint32
	Type      InterfaceEventType
}

func ToInterfaceEvent added in v3.25.1

func ToInterfaceEvent(e *interfaces.SwInterfaceEvent) InterfaceEvent

type InterfaceEventType added in v3.25.1

type InterfaceEventType int
const (
	InterfaceEventUnknown InterfaceEventType = iota
	InterfaceEventAdminUp
	InterfaceEventLinkUp
	InterfaceEventDeleted
)

type IpPuntRedirect

type IpPuntRedirect struct {
	RxSwIfIndex uint32
	IsIP6       bool
	Paths       []RoutePath
}

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

func (IpsetType) String

func (i IpsetType) String() string

type Memif

type Memif struct {
	Role        MemifRole
	Mode        MemifMode
	NumRxQueues int
	NumTxQueues int
	QueueSize   int
	MacAddress  net.HardwareAddr
	SocketId    uint32
	SwIfIndex   uint32
	Flags       MemifFlag
}

type MemifFlag

type MemifFlag uint32

type MemifMode

type MemifMode uint32

type MemifRole

type MemifRole uint32

type MemifSocket

type MemifSocket struct {
	SocketID       uint32
	SocketFilename string
}

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 ObjEqualityState

type ObjEqualityState int
const (
	AreEqualObj       ObjEqualityState = iota /* objects are equal */
	CanUpdateObj                              /* objects differ, but you can call update */
	ShouldRecreateObj                         /* object differ, you need to delete the old & add back the new */
)

type PblClient

type PblClient struct {
	ID         uint32
	TableId    uint32
	Addr       net.IP
	Path       RoutePath
	PortRanges []PblPortRange
}

type PblPortRange

type PblPortRange struct {
	Start uint16
	End   uint16
	Proto IPProto
}

type Policy

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

func (*Policy) DeepCopy

func (p *Policy) DeepCopy() *Policy

func (*Policy) String

func (p *Policy) String() string

type PortRange

type PortRange struct {
	First uint16
	Last  uint16
}

func (PortRange) String

func (pr PortRange) String() string

type RDMAInterface

type RDMAInterface struct {
	GenericVppInterface
}

type Route

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

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      uint32
	IsAttached bool
	Preference uint8
	RpfID      uint32
}

func FromFibPath

func FromFibPath(vppPath fib_types.FibPath) RoutePath

func FromFibPathList

func FromFibPathList(apiPathList []fib_types.FibPath) (routePaths []RoutePath)

func (*RoutePath) String

func (p *RoutePath) String() string

func (*RoutePath) ToFibPath

func (p *RoutePath) ToFibPath(isIP6 bool) fib_types.FibPath

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

	DstIPPortSet []uint32
}

func (*Rule) DeepCopy

func (r *Rule) DeepCopy() *Rule

func (*Rule) String

func (r *Rule) String() string

type RuleAction

type RuleAction uint8

func (RuleAction) String

func (r RuleAction) String() string

type RuleFilter

type RuleFilter struct {
	ShouldMatch bool
	Type        CapoFilterType
	Value       int
}

func (RuleFilter) String

func (f RuleFilter) String() string

type RxMode

type RxMode uint32
const (
	UnknownRxMode    RxMode = 0
	PollingRxMode    RxMode = 1
	InterruptRxMode  RxMode = 2
	AdaptativeRxMode RxMode = 3
	DefaultRxMode    RxMode = 4

	AllQueues = ^uint32(0)
)

func (*RxMode) UnmarshalText added in v3.25.1

func (mode *RxMode) UnmarshalText(text []byte) error

type SessionAppNamespace

type SessionAppNamespace struct {
	NamespaceId string
	Netns       string
	SwIfIndex   uint32
	SocketName  string
	Secret      uint64
}

type SrLocalsid

type SrLocalsid struct {
	Localsid  ip_types.IP6Address
	EndPsp    bool
	Behavior  SrBehavior
	SwIfIndex interface_types.InterfaceIndex
	VlanIndex uint32
	FibTable  uint32
	NhAddr    ip_types.Address
}

SrLocalsid definition

func (*SrLocalsid) CompareBehaviorTo

func (l *SrLocalsid) CompareBehaviorTo(behavior uint8) bool

func (*SrLocalsid) SetBehavior

func (l *SrLocalsid) SetBehavior(code uint8)

func (*SrLocalsid) String

func (l *SrLocalsid) String() (policy string)

type SrPolicy

type SrPolicy struct {
	Bsid     ip_types.IP6Address
	IsSpray  bool
	IsEncap  bool
	FibTable uint32
	SidLists []Srv6SidList
}

SrPolicy definition

func (*SrPolicy) FromVPP

func (p *SrPolicy) FromVPP(response *sr.SrPoliciesDetails)

func (*SrPolicy) String

func (p *SrPolicy) String() (policy string)

type SrSteer

type SrSteer struct {
	TrafficType SrSteerTrafficType
	FibTable    uint32
	Prefix      ip_types.Prefix
	SwIfIndex   uint32
	Bsid        ip_types.IP6Address
}

func (*SrSteer) String

func (s *SrSteer) String() string

type Srv6SidList

type Srv6SidList struct {
	NumSids uint8
	Weight  uint32
	Sids    [16]ip_types.IP6Address
}

Srv6SidList definition

func (*Srv6SidList) String

func (s *Srv6SidList) String() string

type TapFlags

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

type TapV2

type TapV2 struct {
	GenericVppInterface
	HostNamespace  string
	Tag            string
	HostMacAddress net.HardwareAddr
	Flags          TapFlags
	HostMtu        int
}

type VRF

type VRF struct {
	Name  string
	VrfID uint32
	IsIP6 bool
}

type VXLanTunnel

type VXLanTunnel struct {
	SrcAddress     net.IP
	DstAddress     net.IP
	SrcPort        uint16
	DstPort        uint16
	Vni            uint32
	DecapNextIndex uint32
	SwIfIndex      uint32
}

func (*VXLanTunnel) String

func (t *VXLanTunnel) String() string

type VirtioInterface

type VirtioInterface struct {
	GenericVppInterface
	PciId string
}

type Vmxnet3Interface

type Vmxnet3Interface struct {
	GenericVppInterface
	PciId     string
	EnableGso bool
}

type VppInterfaceDetails

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

type VppXDPInterface

type VppXDPInterface struct {
	GenericVppInterface
}

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