mock_l2

package
v2.4.0-alpha+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2019 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 (
	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 FIBEntry_Action_name = map[int32]string{
	0: "FORWARD",
	1: "DROP",
}
View Source
var FIBEntry_Action_value = map[string]int32{
	"FORWARD": 0,
	"DROP":    1,
}

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"`
	Interfaces           []*BridgeDomain_Interface `protobuf:"bytes,10,rep,name=interfaces,proto3" json:"interfaces,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                  `json:"-"`
	XXX_unrecognized     []byte                    `json:"-"`
	XXX_sizecache        int32                     `json:"-"`
}

func (*BridgeDomain) Descriptor

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

func (*BridgeDomain) GetInterfaces

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

func (*BridgeDomain) GetName

func (m *BridgeDomain) GetName() string

func (*BridgeDomain) ProtoMessage

func (*BridgeDomain) ProtoMessage()

func (*BridgeDomain) Reset

func (m *BridgeDomain) Reset()

func (*BridgeDomain) String

func (m *BridgeDomain) String() string

func (*BridgeDomain) XXX_DiscardUnknown

func (m *BridgeDomain) XXX_DiscardUnknown()

func (*BridgeDomain) XXX_Marshal

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

func (*BridgeDomain) XXX_Merge

func (dst *BridgeDomain) XXX_Merge(src proto.Message)

func (*BridgeDomain) XXX_MessageName

func (*BridgeDomain) XXX_MessageName() string

func (*BridgeDomain) XXX_Size

func (m *BridgeDomain) XXX_Size() int

func (*BridgeDomain) XXX_Unmarshal

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

type BridgeDomain_Interface

type BridgeDomain_Interface struct {
	Name                    string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	BridgedVirtualInterface bool     `` /* 133-byte string literal not displayed */
	XXX_NoUnkeyedLiteral    struct{} `json:"-"`
	XXX_unrecognized        []byte   `json:"-"`
	XXX_sizecache           int32    `json:"-"`
}

func (*BridgeDomain_Interface) Descriptor

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

func (*BridgeDomain_Interface) GetBridgedVirtualInterface

func (m *BridgeDomain_Interface) GetBridgedVirtualInterface() bool

func (*BridgeDomain_Interface) GetName

func (m *BridgeDomain_Interface) GetName() string

func (*BridgeDomain_Interface) ProtoMessage

func (*BridgeDomain_Interface) ProtoMessage()

func (*BridgeDomain_Interface) Reset

func (m *BridgeDomain_Interface) Reset()

func (*BridgeDomain_Interface) String

func (m *BridgeDomain_Interface) String() string

func (*BridgeDomain_Interface) XXX_DiscardUnknown

func (m *BridgeDomain_Interface) XXX_DiscardUnknown()

func (*BridgeDomain_Interface) XXX_Marshal

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

func (*BridgeDomain_Interface) XXX_Merge

func (dst *BridgeDomain_Interface) XXX_Merge(src proto.Message)

func (*BridgeDomain_Interface) XXX_MessageName

func (*BridgeDomain_Interface) XXX_MessageName() string

func (*BridgeDomain_Interface) XXX_Size

func (m *BridgeDomain_Interface) XXX_Size() int

func (*BridgeDomain_Interface) XXX_Unmarshal

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

type FIBEntry

type FIBEntry struct {
	PhysAddress          string          `protobuf:"bytes,1,opt,name=phys_address,json=physAddress,proto3" json:"phys_address,omitempty"`
	BridgeDomain         string          `protobuf:"bytes,2,opt,name=bridge_domain,json=bridgeDomain,proto3" json:"bridge_domain,omitempty"`
	Action               FIBEntry_Action `protobuf:"varint,3,opt,name=action,proto3,enum=mock.l2.FIBEntry_Action" json:"action,omitempty"`
	OutgoingInterface    string          `protobuf:"bytes,4,opt,name=outgoing_interface,json=outgoingInterface,proto3" json:"outgoing_interface,omitempty"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

func (*FIBEntry) Descriptor

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

func (*FIBEntry) GetAction

func (m *FIBEntry) GetAction() FIBEntry_Action

func (*FIBEntry) GetBridgeDomain

func (m *FIBEntry) GetBridgeDomain() string

func (*FIBEntry) GetOutgoingInterface

func (m *FIBEntry) GetOutgoingInterface() string

func (*FIBEntry) GetPhysAddress

func (m *FIBEntry) GetPhysAddress() string

func (*FIBEntry) ProtoMessage

func (*FIBEntry) ProtoMessage()

func (*FIBEntry) Reset

func (m *FIBEntry) Reset()

func (*FIBEntry) String

func (m *FIBEntry) String() string

func (*FIBEntry) XXX_DiscardUnknown

func (m *FIBEntry) XXX_DiscardUnknown()

func (*FIBEntry) XXX_Marshal

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

func (*FIBEntry) XXX_Merge

func (dst *FIBEntry) XXX_Merge(src proto.Message)

func (*FIBEntry) XXX_MessageName

func (*FIBEntry) XXX_MessageName() string

func (*FIBEntry) XXX_Size

func (m *FIBEntry) XXX_Size() int

func (*FIBEntry) XXX_Unmarshal

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

type FIBEntry_Action

type FIBEntry_Action int32
const (
	FIBEntry_FORWARD FIBEntry_Action = 0
	FIBEntry_DROP    FIBEntry_Action = 1
)

func (FIBEntry_Action) EnumDescriptor

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

func (FIBEntry_Action) String

func (x FIBEntry_Action) String() string

Jump to

Keyboard shortcuts

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