vpp_punt

package
v3.4.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: Apache-2.0 Imports: 6 Imported by: 6

Documentation

Index

Constants

View Source
const ModuleName = "vpp"

ModuleName is the module name used for models.

Variables

View Source
var (
	ModelIPRedirect = models.Register(&IPRedirect{}, models.Spec{
		Module:  ModuleName,
		Type:    "ipredirect",
		Version: "v2",
	}, models.WithNameTemplate(
		"l3/{{.L3Protocol}}/tx/{{.TxInterface}}",
	))
	ModelToHost = models.Register(&ToHost{}, models.Spec{
		Module:  ModuleName,
		Type:    "tohost",
		Version: "v2",
	}, models.WithNameTemplate(
		"l3/{{.L3Protocol}}/l4/{{.L4Protocol}}/port/{{.Port}}",
	))
	ModelException = models.Register(&Exception{}, models.Spec{
		Module:  ModuleName,
		Type:    "exception",
		Version: "v2",
	}, models.WithNameTemplate(
		"reason/{{.Reason}}",
	))
)
View Source
var (
	L3Protocol_name = map[int32]string{
		0:  "UNDEFINED_L3",
		4:  "IPV4",
		6:  "IPV6",
		10: "ALL",
	}
	L3Protocol_value = map[string]int32{
		"UNDEFINED_L3": 0,
		"IPV4":         4,
		"IPV6":         6,
		"ALL":          10,
	}
)

Enum value maps for L3Protocol.

View Source
var (
	L4Protocol_name = map[int32]string{
		0:  "UNDEFINED_L4",
		6:  "TCP",
		17: "UDP",
	}
	L4Protocol_value = map[string]int32{
		"UNDEFINED_L4": 0,
		"TCP":          6,
		"UDP":          17,
	}
)

Enum value maps for L4Protocol.

View Source
var File_ligato_vpp_punt_punt_proto protoreflect.FileDescriptor

Functions

func ExceptionKey

func ExceptionKey(reason string) string

func IPRedirectKey

func IPRedirectKey(l3Proto L3Protocol, txIf string) string

IPRedirectKey returns key representing IP punt redirect configuration.

func ToHostKey

func ToHostKey(l3Proto L3Protocol, l4Proto L4Protocol, port uint32) string

ToHostKey returns key representing punt to host/socket configuration.

Types

type Exception

type Exception struct {

	// Name should contain reason name, e.g. `ipsec4-spi-0`.
	Reason string `protobuf:"bytes,1,opt,name=reason,proto3" json:"reason,omitempty"`
	// SocketPath defines path to unix domain socket
	// used for punt packets to the host.
	// In dumps, it will actually contain the socket
	// defined in VPP config under punt section.
	SocketPath string `protobuf:"bytes,2,opt,name=socket_path,json=socketPath,proto3" json:"socket_path,omitempty"`
	// contains filtered or unexported fields
}

Exception allows specifying punt exceptions used for punting packets. The type of exception is defined by reason name.

func (*Exception) Descriptor deprecated

func (*Exception) Descriptor() ([]byte, []int)

Deprecated: Use Exception.ProtoReflect.Descriptor instead.

func (*Exception) GetReason

func (x *Exception) GetReason() string

func (*Exception) GetSocketPath

func (x *Exception) GetSocketPath() string

func (*Exception) ProtoMessage

func (*Exception) ProtoMessage()

func (*Exception) ProtoReflect added in v3.2.0

func (x *Exception) ProtoReflect() protoreflect.Message

func (*Exception) Reset

func (x *Exception) Reset()

func (*Exception) String

func (x *Exception) String() string

type IPRedirect

type IPRedirect struct {

	// L3 protocol to be redirected
	L3Protocol L3Protocol `protobuf:"varint,1,opt,name=l3_protocol,json=l3Protocol,proto3,enum=ligato.vpp.punt.L3Protocol" json:"l3_protocol,omitempty"`
	// Receive interface name. Optional, only redirect traffic incoming from this interface
	RxInterface string `protobuf:"bytes,2,opt,name=rx_interface,json=rxInterface,proto3" json:"rx_interface,omitempty"`
	// Transmit interface name
	TxInterface string `protobuf:"bytes,3,opt,name=tx_interface,json=txInterface,proto3" json:"tx_interface,omitempty"`
	// Next hop IP where the traffic is redirected
	NextHop string `protobuf:"bytes,4,opt,name=next_hop,json=nextHop,proto3" json:"next_hop,omitempty"`
	// contains filtered or unexported fields
}

IPRedirect allows otherwise dropped packet which destination IP address matching some of the VPP addresses to redirect to the defined next hop address via the TX interface.

func (*IPRedirect) Descriptor deprecated

func (*IPRedirect) Descriptor() ([]byte, []int)

Deprecated: Use IPRedirect.ProtoReflect.Descriptor instead.

func (*IPRedirect) GetL3Protocol

func (x *IPRedirect) GetL3Protocol() L3Protocol

func (*IPRedirect) GetNextHop

func (x *IPRedirect) GetNextHop() string

func (*IPRedirect) GetRxInterface

func (x *IPRedirect) GetRxInterface() string

func (*IPRedirect) GetTxInterface

func (x *IPRedirect) GetTxInterface() string

func (*IPRedirect) ProtoMessage

func (*IPRedirect) ProtoMessage()

func (*IPRedirect) ProtoReflect added in v3.2.0

func (x *IPRedirect) ProtoReflect() protoreflect.Message

func (*IPRedirect) Reset

func (x *IPRedirect) Reset()

func (*IPRedirect) String

func (x *IPRedirect) String() string

type L3Protocol

type L3Protocol int32

L3Protocol defines Layer 3 protocols.

const (
	L3Protocol_UNDEFINED_L3 L3Protocol = 0
	L3Protocol_IPV4         L3Protocol = 4
	L3Protocol_IPV6         L3Protocol = 6
	L3Protocol_ALL          L3Protocol = 10
)

func (L3Protocol) Descriptor added in v3.2.0

func (L3Protocol) Descriptor() protoreflect.EnumDescriptor

func (L3Protocol) Enum added in v3.2.0

func (x L3Protocol) Enum() *L3Protocol

func (L3Protocol) EnumDescriptor deprecated

func (L3Protocol) EnumDescriptor() ([]byte, []int)

Deprecated: Use L3Protocol.Descriptor instead.

func (L3Protocol) Number added in v3.2.0

func (x L3Protocol) Number() protoreflect.EnumNumber

func (L3Protocol) String

func (x L3Protocol) String() string

func (L3Protocol) Type added in v3.2.0

type L4Protocol

type L4Protocol int32

L4Protocol defines Layer 4 protocols.

const (
	L4Protocol_UNDEFINED_L4 L4Protocol = 0
	L4Protocol_TCP          L4Protocol = 6
	L4Protocol_UDP          L4Protocol = 17
)

func (L4Protocol) Descriptor added in v3.2.0

func (L4Protocol) Descriptor() protoreflect.EnumDescriptor

func (L4Protocol) Enum added in v3.2.0

func (x L4Protocol) Enum() *L4Protocol

func (L4Protocol) EnumDescriptor deprecated

func (L4Protocol) EnumDescriptor() ([]byte, []int)

Deprecated: Use L4Protocol.Descriptor instead.

func (L4Protocol) Number added in v3.2.0

func (x L4Protocol) Number() protoreflect.EnumNumber

func (L4Protocol) String

func (x L4Protocol) String() string

func (L4Protocol) Type added in v3.2.0

type Reason

type Reason struct {

	// Name contains reason name.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

Reason represents punt reason used in exceptions. List of known exceptions can be retrieved in VPP CLI with following command:

vpp# show punt reasons

[0] ipsec4-spi-0 from:[ipsec ]
[1] ipsec6-spi-0 from:[ipsec ]
[2] ipsec4-spi-o-udp-0 from:[ipsec ]
[3] ipsec4-no-such-tunnel from:[ipsec ]
[4] ipsec6-no-such-tunnel from:[ipsec ]
[5] VXLAN-GBP-no-such-v4-tunnel from:[vxlan-gbp ]
[6] VXLAN-GBP-no-such-v6-tunnel from:[vxlan-gbp ]

func (*Reason) Descriptor deprecated

func (*Reason) Descriptor() ([]byte, []int)

Deprecated: Use Reason.ProtoReflect.Descriptor instead.

func (*Reason) GetName

func (x *Reason) GetName() string

func (*Reason) ProtoMessage

func (*Reason) ProtoMessage()

func (*Reason) ProtoReflect added in v3.2.0

func (x *Reason) ProtoReflect() protoreflect.Message

func (*Reason) Reset

func (x *Reason) Reset()

func (*Reason) String

func (x *Reason) String() string

type ToHost

type ToHost struct {

	// L3 destination protocol a packet has to match in order to be punted.
	L3Protocol L3Protocol `protobuf:"varint,2,opt,name=l3_protocol,json=l3Protocol,proto3,enum=ligato.vpp.punt.L3Protocol" json:"l3_protocol,omitempty"`
	// L4 destination protocol a packet has to match.
	// Currently VPP only supports UDP.
	L4Protocol L4Protocol `protobuf:"varint,3,opt,name=l4_protocol,json=l4Protocol,proto3,enum=ligato.vpp.punt.L4Protocol" json:"l4_protocol,omitempty"`
	// Destination port
	Port uint32 `protobuf:"varint,4,opt,name=port,proto3" json:"port,omitempty"`
	// SocketPath defines path to unix domain socket
	// used for punt packets to the host.
	// In dumps, it will actually contain the socket
	// defined in VPP config under punt section.
	SocketPath string `protobuf:"bytes,5,opt,name=socket_path,json=socketPath,proto3" json:"socket_path,omitempty"`
	// contains filtered or unexported fields
}

ToHost allows otherwise dropped packet which destination IP address matching some of the VPP interface IP addresses to be punted to the host. L3 and L4 protocols can be used for filtering */

func (*ToHost) Descriptor deprecated

func (*ToHost) Descriptor() ([]byte, []int)

Deprecated: Use ToHost.ProtoReflect.Descriptor instead.

func (*ToHost) GetL3Protocol

func (x *ToHost) GetL3Protocol() L3Protocol

func (*ToHost) GetL4Protocol

func (x *ToHost) GetL4Protocol() L4Protocol

func (*ToHost) GetPort

func (x *ToHost) GetPort() uint32

func (*ToHost) GetSocketPath

func (x *ToHost) GetSocketPath() string

func (*ToHost) ProtoMessage

func (*ToHost) ProtoMessage()

func (*ToHost) ProtoReflect added in v3.2.0

func (x *ToHost) ProtoReflect() protoreflect.Message

func (*ToHost) Reset

func (x *ToHost) Reset()

func (*ToHost) String

func (x *ToHost) String() string

Jump to

Keyboard shortcuts

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