mock_l2

package
v3.4.0-beta Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// InvalidKeyPart is used in key for parts which are invalid
	InvalidKeyPart = "<invalid>"
)
View Source
const ModuleName = "mock"

ModuleName is the module name used for models of the mock l2plugin.

Variables

View Source
var (
	FIBEntry_Action_name = map[int32]string{
		0: "FORWARD",
		1: "DROP",
	}
	FIBEntry_Action_value = map[string]int32{
		"FORWARD": 0,
		"DROP":    1,
	}
)

Enum value maps for FIBEntry_Action.

View Source
var (
	ModelBridgeDomain = models.Register(&BridgeDomain{}, models.Spec{
		Module:  ModuleName,
		Type:    "bridge-domain",
		Version: "v1",
	})

	ModelFIBEntry = models.Register(&FIBEntry{}, models.Spec{
		Module:  ModuleName,
		Type:    "fib",
		Version: "v1",
	}, models.WithNameTemplate("{{.BridgeDomain}}/mac/{{.PhysAddress}}"))
)
View Source
var File_model_bridge_domain_proto protoreflect.FileDescriptor
View Source
var File_model_fib_proto protoreflect.FileDescriptor

Functions

func BDInterfaceKey

func BDInterfaceKey(bdName string, iface string) string

BDInterfaceKey returns the key used to represent binding between the given interface and the bridge domain.

func BridgeDomainKey

func BridgeDomainKey(bdName string) string

BridgeDomainKey returns the key used in NB DB to store the configuration of the given mock bridge domain.

func FIBKey

func FIBKey(bdName string, fibMac string) string

FIBKey returns the key used in NB DB to store the configuration of the given mock L2 FIB entry.

func ParseBDInterfaceKey

func ParseBDInterfaceKey(key string) (bdName string, iface string, isBDIfaceKey bool)

ParseBDInterfaceKey parses key representing binding between interface and a bridge domain.

Types

type BridgeDomain

type BridgeDomain struct {
	Name       string                    `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`              // bridge domain name
	Interfaces []*BridgeDomain_Interface `protobuf:"bytes,10,rep,name=interfaces,proto3" json:"interfaces,omitempty"` // list of interfaces
	// contains filtered or unexported fields
}

func (*BridgeDomain) Descriptor deprecated

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

Deprecated: Use BridgeDomain.ProtoReflect.Descriptor instead.

func (*BridgeDomain) GetInterfaces

func (x *BridgeDomain) GetInterfaces() []*BridgeDomain_Interface

func (*BridgeDomain) GetName

func (x *BridgeDomain) GetName() string

func (*BridgeDomain) ProtoMessage

func (*BridgeDomain) ProtoMessage()

func (*BridgeDomain) ProtoReflect added in v3.3.0

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

func (*BridgeDomain) Reset

func (x *BridgeDomain) Reset()

func (*BridgeDomain) String

func (x *BridgeDomain) String() string

type BridgeDomain_Interface

type BridgeDomain_Interface struct {
	Name                    string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // interface name belonging to this bridge domain
	BridgedVirtualInterface bool   ``                                                              // true if this is a BVI interface
	/* 133-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*BridgeDomain_Interface) Descriptor deprecated

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

Deprecated: Use BridgeDomain_Interface.ProtoReflect.Descriptor instead.

func (*BridgeDomain_Interface) GetBridgedVirtualInterface

func (x *BridgeDomain_Interface) GetBridgedVirtualInterface() bool

func (*BridgeDomain_Interface) GetName

func (x *BridgeDomain_Interface) GetName() string

func (*BridgeDomain_Interface) ProtoMessage

func (*BridgeDomain_Interface) ProtoMessage()

func (*BridgeDomain_Interface) ProtoReflect added in v3.3.0

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

func (*BridgeDomain_Interface) Reset

func (x *BridgeDomain_Interface) Reset()

func (*BridgeDomain_Interface) String

func (x *BridgeDomain_Interface) String() string

type FIBEntry

type FIBEntry struct {
	PhysAddress       string          `protobuf:"bytes,1,opt,name=phys_address,json=physAddress,proto3" json:"phys_address,omitempty"`                   // unique destination MAC address
	BridgeDomain      string          `protobuf:"bytes,2,opt,name=bridge_domain,json=bridgeDomain,proto3" json:"bridge_domain,omitempty"`                // name of bridge domain this FIB table entry belongs to
	Action            FIBEntry_Action `protobuf:"varint,3,opt,name=action,proto3,enum=mock.l2.FIBEntry_Action" json:"action,omitempty"`                  // action to tke on matching frames
	OutgoingInterface string          `protobuf:"bytes,4,opt,name=outgoing_interface,json=outgoingInterface,proto3" json:"outgoing_interface,omitempty"` // outgoing interface for matching frames
	// contains filtered or unexported fields
}

func (*FIBEntry) Descriptor deprecated

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

Deprecated: Use FIBEntry.ProtoReflect.Descriptor instead.

func (*FIBEntry) GetAction

func (x *FIBEntry) GetAction() FIBEntry_Action

func (*FIBEntry) GetBridgeDomain

func (x *FIBEntry) GetBridgeDomain() string

func (*FIBEntry) GetOutgoingInterface

func (x *FIBEntry) GetOutgoingInterface() string

func (*FIBEntry) GetPhysAddress

func (x *FIBEntry) GetPhysAddress() string

func (*FIBEntry) ProtoMessage

func (*FIBEntry) ProtoMessage()

func (*FIBEntry) ProtoReflect added in v3.3.0

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

func (*FIBEntry) Reset

func (x *FIBEntry) Reset()

func (*FIBEntry) String

func (x *FIBEntry) String() string

type FIBEntry_Action

type FIBEntry_Action int32
const (
	FIBEntry_FORWARD FIBEntry_Action = 0 // forward the matching frame
	FIBEntry_DROP    FIBEntry_Action = 1 // drop the matching frame
)

func (FIBEntry_Action) Descriptor added in v3.3.0

func (FIBEntry_Action) Enum added in v3.3.0

func (x FIBEntry_Action) Enum() *FIBEntry_Action

func (FIBEntry_Action) EnumDescriptor deprecated

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

Deprecated: Use FIBEntry_Action.Descriptor instead.

func (FIBEntry_Action) Number added in v3.3.0

func (FIBEntry_Action) String

func (x FIBEntry_Action) String() string

func (FIBEntry_Action) Type added in v3.3.0

Jump to

Keyboard shortcuts

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