Documentation
¶
Index ¶
- Constants
- 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 GetIPFamily(ip net.IP) int
- 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 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
- type AVFInterface
- type CapoFilterType
- type CnatEndpoint
- type CnatEndpointTuple
- type CnatTranslateEntry
- type IPIPTunnel
- type IPNeighborFlags
- type IPPort
- type IPProto
- type IPsecTunnelProtection
- type IfAddress
- type InterfaceConfig
- type IpsetType
- type Nat44Entry
- type NatFlags
- type Neighbor
- type Policy
- type PortRange
- type Route
- type RoutePath
- type Rule
- type RuleAction
- type RuleFilter
- type RxMode
- type TapFlags
- type TapV2
- type VXLanTunnel
- type VppInterfaceDetails
- type VppXDPInterface
- type WireguardPeer
- type WireguardTunnel
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 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 GetIPFamily ¶
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 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
Types ¶
type AVFInterface ¶
func (*AVFInterface) GetPciId ¶
func (ai *AVFInterface) GetPciId() (id uint32, err error)
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 }
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 (n *CnatTranslateEntry) Equal(o *CnatTranslateEntry) bool
func (*CnatTranslateEntry) String ¶
func (n *CnatTranslateEntry) String() string
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) )
type IPsecTunnelProtection ¶
type InterfaceConfig ¶
type InterfaceConfig struct { IngressPolicyIDs []uint32 EgressPolicyIDs []uint32 ProfileIDs []uint32 }
func NewInterfaceConfig ¶
func NewInterfaceConfig() *InterfaceConfig
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 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 }
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 VXLanTunnel ¶
type VppInterfaceDetails ¶
type VppXDPInterface ¶
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.