Documentation ¶
Index ¶
- Constants
- Variables
- func AddrIsZeros(p net.IP) bool
- func FormatRxMode(rxMode RxMode) string
- func FromVppAddress(addr ip_types.Address) net.IP
- func FromVppAddressWithPrefix(prefix ip_types.AddressWithPrefix) *net.IPNet
- func FromVppIpAddressUnion(Un ip_types.AddressUnion, isv6 bool) net.IP
- func FromVppMacAddress(vppHwAddr ethernet_types.MacAddress) net.HardwareAddr
- func FromVppPrefix(prefix ip_types.Prefix) *net.IPNet
- func GetBoolIPFamily(isIP6 bool) ip_types.AddressFamily
- func GetIPFamily(ip net.IP) int
- func GetPciIdInt(PciIdStr string) (id uint32, err error)
- func IsIP4(ip net.IP) bool
- func IsIP6(ip net.IP) bool
- func IsV6toFibProto(isv6 bool) fib_types.FibPathNhProto
- func ToCapoPolicy(p *Policy) (items []capo.CapoPolicyItem)
- func ToCapoRule(r *Rule) (cr capo.CapoRule)
- func ToCnatEndpoint(ep CnatEndpoint) cnat.CnatEndpoint
- func ToFibPathList(routePaths []RoutePath, isIP6 bool) (apiPathList []fib_types.FibPath)
- func ToVppAddress(addr net.IP) ip_types.Address
- func ToVppAddressFamily(isv6 bool) ip_types.AddressFamily
- func ToVppAddressWithPrefix(prefix *net.IPNet) ip_types.AddressWithPrefix
- func ToVppIP4Address(addr net.IP) ip_types.IP4Address
- func ToVppIP6Address(addr net.IP) ip_types.IP6Address
- func ToVppIPProto(proto IPProto) ip_types.IPProto
- func ToVppMacAddress(hardwareAddr *net.HardwareAddr) ethernet_types.MacAddress
- func ToVppNatConfigFlags(flags NatFlags) nat_types.NatConfigFlags
- func ToVppNeighborFlags(flags IPNeighborFlags) ip_neighbor.IPNeighborFlags
- func ToVppPrefix(prefix *net.IPNet) ip_types.Prefix
- func ToVppSrBehavior(behavior SrBehavior) sr_types.SrBehavior
- func ToVppSrSteerTrafficType(trafficType SrSteerTrafficType) sr_types.SrSteer
- type ACL
- type ACLRule
- type AVFInterface
- type AbfPolicy
- type AfPacketInterface
- type CapoFilterType
- type CnatEndpoint
- type CnatEndpointTuple
- type CnatLbType
- type CnatTranslateEntry
- type GenericVppInterface
- type IPFlowHash
- type IPIPTunnel
- type IPNeighborFlags
- type IPPort
- type IPProto
- type IPsecTunnelProtection
- type IfAddress
- type InterfaceConfig
- type IpPuntRedirect
- type IpsetType
- type Memif
- type MemifFlag
- type MemifMode
- type MemifRole
- type Nat44Entry
- type NatFlags
- type Neighbor
- type PblClient
- type PblPortRange
- type Policy
- type PortRange
- type RDMAInterface
- type Route
- type RoutePath
- type Rule
- type RuleAction
- type RuleFilter
- type RxMode
- type SessionAppNamespace
- type SrBehavior
- type SrLocalsid
- type SrPolicy
- type SrSteer
- type SrSteerTrafficType
- type Srv6SidList
- type TapFlags
- type TapV2
- type VXLanTunnel
- type VirtioInterface
- type Vmxnet3Interface
- type VppInterfaceDetails
- type VppXDPInterface
- type WireguardPeer
- type WireguardTunnel
Constants ¶
View Source
const ( DefaultLB = CnatLbType(cnat.CNAT_LB_TYPE_DEFAULT) MaglevLB = CnatLbType(cnat.CNAT_LB_TYPE_MAGLEV) )
View Source
const ( // Family type definitions FAMILY_ALL = unix.AF_UNSPEC FAMILY_V4 = unix.AF_INET FAMILY_V6 = unix.AF_INET6 )
View Source
const ( MemifMaster MemifRole = MemifRole(memif.MEMIF_ROLE_API_MASTER) MemifSlave MemifRole = MemifRole(memif.MEMIF_ROLE_API_SLAVE) MemifModeEthernet MemifMode = MemifMode(memif.MEMIF_MODE_API_ETHERNET) MemifModeIP MemifMode = MemifMode(memif.MEMIF_MODE_API_IP) MemifModePuntInject MemifMode = MemifMode(memif.MEMIF_MODE_API_PUNT_INJECT) MemifAdminUp MemifFlag = MemifFlag(interface_types.IF_STATUS_API_FLAG_ADMIN_UP) MemifLinkUp MemifFlag = MemifFlag(interface_types.IF_STATUS_API_FLAG_LINK_UP) )
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 ( SrBehaviorVPP_GoBGP = map[uint8]bgpapi.SRv6Behavior{ 1: bgpapi.SRv6Behavior_END, 2: bgpapi.SRv6Behavior_ENDX, 3: bgpapi.SRv6Behavior_ENDT, 5: bgpapi.SRv6Behavior_END_DX2, 6: bgpapi.SRv6Behavior_END_DX6, 7: bgpapi.SRv6Behavior_END_DX4, 8: bgpapi.SRv6Behavior_END_DT6, 9: bgpapi.SRv6Behavior_END_DT4, } SrBehaviorGoBGP_VPP = map[bgpapi.SRv6Behavior]uint8{ bgpapi.SRv6Behavior_END: 1, bgpapi.SRv6Behavior_ENDX: 2, bgpapi.SRv6Behavior_ENDT: 3, bgpapi.SRv6Behavior_END_DX2: 5, bgpapi.SRv6Behavior_END_DX6: 6, bgpapi.SRv6Behavior_END_DX4: 7, bgpapi.SRv6Behavior_END_DT6: 8, bgpapi.SRv6Behavior_END_DT4: 9, } )
Functions ¶
func AddrIsZeros ¶
func FormatRxMode ¶
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 GetBoolIPFamily ¶
func GetBoolIPFamily(isIP6 bool) ip_types.AddressFamily
func GetIPFamily ¶
func GetPciIdInt ¶
func IsV6toFibProto ¶
func IsV6toFibProto(isv6 bool) fib_types.FibPathNhProto
func ToCapoPolicy ¶
func ToCapoPolicy(p *Policy) (items []capo.CapoPolicyItem)
func ToCapoRule ¶
func ToCnatEndpoint ¶
func ToCnatEndpoint(ep CnatEndpoint) cnat.CnatEndpoint
func ToFibPathList ¶
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 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 ToVppSrBehavior ¶
func ToVppSrBehavior(behavior SrBehavior) sr_types.SrBehavior
func ToVppSrSteerTrafficType ¶
func ToVppSrSteerTrafficType(trafficType SrSteerTrafficType) sr_types.SrSteer
Types ¶
type ACLRule ¶
func (*ACLRule) ToVppACLRule ¶
type AVFInterface ¶
type AVFInterface struct { GenericVppInterface PciId string }
type AfPacketInterface ¶
type AfPacketInterface struct {
GenericVppInterface
}
type CapoFilterType ¶
type CapoFilterType uint8
const ( CapoFilterTypeNone CapoFilterType = CapoFilterType(capo.CAPO_RULE_FILTER_NONE_TYPE) CapoFilterICMPType CapoFilterType = CapoFilterType(capo.CAPO_RULE_FILTER_ICMP_TYPE) CapoFilterICMPCode CapoFilterType = CapoFilterType(capo.CAPO_RULE_FILTER_ICMP_CODE) CapoFilterProto CapoFilterType = CapoFilterType(capo.CAPO_RULE_FILTER_L4_PROTO) )
type CnatEndpoint ¶
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 ID uint32 LbType CnatLbType }
func (*CnatTranslateEntry) Equal ¶
func (n *CnatTranslateEntry) Equal(o *CnatTranslateEntry) bool
func (*CnatTranslateEntry) String ¶
func (n *CnatTranslateEntry) String() string
type GenericVppInterface ¶
type IPFlowHash ¶
type IPIPTunnel ¶
func (*IPIPTunnel) String ¶
func (t *IPIPTunnel) String() string
type IPNeighborFlags ¶
type IPNeighborFlags uint32
const ( IPNeighborNone IPNeighborFlags = IPNeighborFlags(ip_neighbor.IP_API_NEIGHBOR_FLAG_NONE) IPNeighborStatic IPNeighborFlags = IPNeighborFlags(ip_neighbor.IP_API_NEIGHBOR_FLAG_STATIC) IPNeighborNoFibEntry IPNeighborFlags = IPNeighborFlags(ip_neighbor.IP_API_NEIGHBOR_FLAG_NO_FIB_ENTRY) )
func FromVppNeighborFlags ¶
func FromVppNeighborFlags(flags ip_neighbor.IPNeighborFlags) IPNeighborFlags
type IPProto ¶
type IPProto uint8
const ( TCP IPProto = IPProto(ip_types.IP_API_PROTO_TCP) UDP IPProto = IPProto(ip_types.IP_API_PROTO_UDP) SCTP IPProto = IPProto(ip_types.IP_API_PROTO_SCTP) ICMP IPProto = IPProto(ip_types.IP_API_PROTO_ICMP) ICMP6 IPProto = IPProto(ip_types.IP_API_PROTO_ICMP6) INVALID IPProto = IPProto(ip_types.IP_API_PROTO_RESERVED) )
func UnformatProto ¶
type IPsecTunnelProtection ¶
type InterfaceConfig ¶
type InterfaceConfig struct { IngressPolicyIDs []uint32 EgressPolicyIDs []uint32 ProfileIDs []uint32 }
func NewInterfaceConfig ¶
func NewInterfaceConfig() *InterfaceConfig
type IpPuntRedirect ¶
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 NatFlags ¶
type NatFlags uint8
const ( NatNone NatFlags = NatFlags(nat_types.NAT_IS_NONE) NatTwice NatFlags = NatFlags(nat_types.NAT_IS_TWICE_NAT) NatSelfTwice NatFlags = NatFlags(nat_types.NAT_IS_SELF_TWICE_NAT) NatOut2In NatFlags = NatFlags(nat_types.NAT_IS_OUT2IN_ONLY) NatAddrOnly NatFlags = NatFlags(nat_types.NAT_IS_ADDR_ONLY) NatOutside NatFlags = NatFlags(nat_types.NAT_IS_OUTSIDE) NatInside NatFlags = NatFlags(nat_types.NAT_IS_INSIDE) NatStatic NatFlags = NatFlags(nat_types.NAT_IS_STATIC) NatExtHostValid NatFlags = NatFlags(nat_types.NAT_IS_EXT_HOST_VALID) )
type Neighbor ¶
type Neighbor struct { SwIfIndex uint32 IP net.IP HardwareAddr net.HardwareAddr Flags IPNeighborFlags }
type PblPortRange ¶
type RDMAInterface ¶
type RDMAInterface struct {
GenericVppInterface
}
type Route ¶
func (*Route) IsLinkLocal ¶
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 }
type RuleAction ¶
type RuleAction uint8
const ( ActionAllow RuleAction = RuleAction(capo.CAPO_ALLOW) ActionDeny RuleAction = RuleAction(capo.CAPO_DENY) ActionLog RuleAction = RuleAction(capo.CAPO_LOG) ActionPass RuleAction = RuleAction(capo.CAPO_PASS) )
type RuleFilter ¶
type RuleFilter struct { ShouldMatch bool Type CapoFilterType Value int }
type SessionAppNamespace ¶
type SrBehavior ¶
type SrBehavior uint8
const ( SrBehaviorEND SrBehavior = SrBehavior(sr_types.SR_BEHAVIOR_API_END) SrBehaviorX SrBehavior = SrBehavior(sr_types.SR_BEHAVIOR_API_X) SrBehaviorT SrBehavior = SrBehavior(sr_types.SR_BEHAVIOR_API_T) SrBehaviorDFIRST SrBehavior = SrBehavior(sr_types.SR_BEHAVIOR_API_D_FIRST) SrBehaviorDX2 SrBehavior = SrBehavior(sr_types.SR_BEHAVIOR_API_DX2) SrBehaviorDX6 SrBehavior = SrBehavior(sr_types.SR_BEHAVIOR_API_DX6) SrBehaviorDX4 SrBehavior = SrBehavior(sr_types.SR_BEHAVIOR_API_DX4) SrBehaviorDT6 SrBehavior = SrBehavior(sr_types.SR_BEHAVIOR_API_DT6) SrBehaviorDT4 SrBehavior = SrBehavior(sr_types.SR_BEHAVIOR_API_DT4) SrBehaviorLAST SrBehavior = SrBehavior(sr_types.SR_BEHAVIOR_API_LAST) )
func FromGoBGPSrBehavior ¶
func FromGoBGPSrBehavior(behavior uint8) SrBehavior
func FromVppSrBehavior ¶
func FromVppSrBehavior(behavior sr_types.SrBehavior) SrBehavior
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)
type SrSteer ¶
type SrSteer struct { TrafficType SrSteerTrafficType FibTable uint32 Prefix ip_types.Prefix SwIfIndex uint32 Bsid ip_types.IP6Address }
type SrSteerTrafficType ¶
type SrSteerTrafficType uint8
const ( SR_STEER_L2 SrSteerTrafficType = SrSteerTrafficType(sr_types.SR_STEER_API_L2) SR_STEER_IPV4 SrSteerTrafficType = SrSteerTrafficType(sr_types.SR_STEER_API_IPV4) SR_STEER_IPV6 SrSteerTrafficType = SrSteerTrafficType(sr_types.SR_STEER_API_IPV6) )
func FromVppSrSteerTrafficType ¶
func FromVppSrSteerTrafficType(trafficType sr_types.SrSteer) SrSteerTrafficType
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 TapV2 ¶
type TapV2 struct { GenericVppInterface HostNamespace string Tag string HostMacAddress net.HardwareAddr Flags TapFlags HostMtu int }
type VXLanTunnel ¶
type VXLanTunnel struct { SrcAddress net.IP DstAddress net.IP SrcPort uint16 DstPort uint16 Vni uint32 DecapNextIndex uint32 SwIfIndex interface_types.InterfaceIndex }
type VirtioInterface ¶
type VirtioInterface struct { GenericVppInterface PciId string }
type Vmxnet3Interface ¶
type Vmxnet3Interface struct { GenericVppInterface PciId string EnableGso bool }
type VppInterfaceDetails ¶
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
Click to show internal directories.
Click to hide internal directories.