vpp_punt

package
Version: v2.5.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2019 License: Apache-2.0 Imports: 5 Imported by: 113

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",
}
View Source
var L3Protocol_value = map[string]int32{
	"UNDEFINED_L3": 0,
	"IPv4":         4,
	"IPv6":         6,
	"ALL":          10,
}
View Source
var L4Protocol_name = map[int32]string{
	0:  "UNDEFINED_L4",
	6:  "TCP",
	17: "UDP",
}
View Source
var L4Protocol_value = map[string]int32{
	"UNDEFINED_L4": 0,
	"TCP":          6,
	"UDP":          17,
}

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

func (*Exception) Descriptor

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

func (*Exception) GetReason

func (m *Exception) GetReason() string

func (*Exception) GetSocketPath

func (m *Exception) GetSocketPath() string

func (*Exception) ProtoMessage

func (*Exception) ProtoMessage()

func (*Exception) Reset

func (m *Exception) Reset()

func (*Exception) String

func (m *Exception) String() string

func (*Exception) XXX_DiscardUnknown

func (m *Exception) XXX_DiscardUnknown()

func (*Exception) XXX_Marshal

func (m *Exception) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Exception) XXX_Merge

func (m *Exception) XXX_Merge(src proto.Message)

func (*Exception) XXX_MessageName

func (*Exception) XXX_MessageName() string

func (*Exception) XXX_Size

func (m *Exception) XXX_Size() int

func (*Exception) XXX_Unmarshal

func (m *Exception) XXX_Unmarshal(b []byte) error

type IPRedirect

type IPRedirect struct {
	// L3 protocol to be redirected
	L3Protocol L3Protocol `protobuf:"varint,1,opt,name=l3_protocol,json=l3Protocol,proto3,enum=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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

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

func (*IPRedirect) GetL3Protocol

func (m *IPRedirect) GetL3Protocol() L3Protocol

func (*IPRedirect) GetNextHop

func (m *IPRedirect) GetNextHop() string

func (*IPRedirect) GetRxInterface

func (m *IPRedirect) GetRxInterface() string

func (*IPRedirect) GetTxInterface

func (m *IPRedirect) GetTxInterface() string

func (*IPRedirect) ProtoMessage

func (*IPRedirect) ProtoMessage()

func (*IPRedirect) Reset

func (m *IPRedirect) Reset()

func (*IPRedirect) String

func (m *IPRedirect) String() string

func (*IPRedirect) XXX_DiscardUnknown

func (m *IPRedirect) XXX_DiscardUnknown()

func (*IPRedirect) XXX_Marshal

func (m *IPRedirect) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*IPRedirect) XXX_Merge

func (m *IPRedirect) XXX_Merge(src proto.Message)

func (*IPRedirect) XXX_MessageName

func (*IPRedirect) XXX_MessageName() string

func (*IPRedirect) XXX_Size

func (m *IPRedirect) XXX_Size() int

func (*IPRedirect) XXX_Unmarshal

func (m *IPRedirect) XXX_Unmarshal(b []byte) error

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

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

func (L3Protocol) String

func (x L3Protocol) String() string

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

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

func (L4Protocol) String

func (x L4Protocol) String() string

type Reason

type Reason struct {
	// Name contains reason name.
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

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

func (*Reason) GetName

func (m *Reason) GetName() string

func (*Reason) ProtoMessage

func (*Reason) ProtoMessage()

func (*Reason) Reset

func (m *Reason) Reset()

func (*Reason) String

func (m *Reason) String() string

func (*Reason) XXX_DiscardUnknown

func (m *Reason) XXX_DiscardUnknown()

func (*Reason) XXX_Marshal

func (m *Reason) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Reason) XXX_Merge

func (m *Reason) XXX_Merge(src proto.Message)

func (*Reason) XXX_MessageName

func (*Reason) XXX_MessageName() string

func (*Reason) XXX_Size

func (m *Reason) XXX_Size() int

func (*Reason) XXX_Unmarshal

func (m *Reason) XXX_Unmarshal(b []byte) error

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=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=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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

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

func (*ToHost) GetL3Protocol

func (m *ToHost) GetL3Protocol() L3Protocol

func (*ToHost) GetL4Protocol

func (m *ToHost) GetL4Protocol() L4Protocol

func (*ToHost) GetPort

func (m *ToHost) GetPort() uint32

func (*ToHost) GetSocketPath

func (m *ToHost) GetSocketPath() string

func (*ToHost) ProtoMessage

func (*ToHost) ProtoMessage()

func (*ToHost) Reset

func (m *ToHost) Reset()

func (*ToHost) String

func (m *ToHost) String() string

func (*ToHost) XXX_DiscardUnknown

func (m *ToHost) XXX_DiscardUnknown()

func (*ToHost) XXX_Marshal

func (m *ToHost) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ToHost) XXX_Merge

func (m *ToHost) XXX_Merge(src proto.Message)

func (*ToHost) XXX_MessageName

func (*ToHost) XXX_MessageName() string

func (*ToHost) XXX_Size

func (m *ToHost) XXX_Size() int

func (*ToHost) XXX_Unmarshal

func (m *ToHost) XXX_Unmarshal(b []byte) error

Source Files

Jump to

Keyboard shortcuts

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