gbpserver

package
v0.0.0-...-9647dda Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RdClassID = 31999
	RdEncapID = 7699999
)
View Source
const (
	GBP_ListObjects_FullMethodName = "/gbpserver.GBP/ListObjects"
	GBP_ListVTEPs_FullMethodName   = "/gbpserver.GBP/ListVTEPs"
	GBP_GetSnapShot_FullMethodName = "/gbpserver.GBP/GetSnapShot"
)
View Source
const (
	NoContainer = "NC"

	OpaddEPG
	OpdelEPG
	OpaddContract
	OpdelContract
	OpaddEP
	OpdelEP
	OpaddNetPol
	OpdelNetPol
	OpUpdTunnels
	OpaddGBPCustomMo
	OpdelGBPCustomMo
)

Variables

View Source
var (
	GBPOperation_OpCode_name = map[int32]string{
		0: "ADD",
		1: "REPLACE",
		2: "DELETE",
		3: "DELETE_RECURSIVE",
	}
	GBPOperation_OpCode_value = map[string]int32{
		"ADD":              0,
		"REPLACE":          1,
		"DELETE":           2,
		"DELETE_RECURSIVE": 3,
	}
)

Enum value maps for GBPOperation_OpCode.

View Source
var GBP_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "gbpserver.GBP",
	HandlerType: (*GBPServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ListVTEPs",
			Handler:    _GBP_ListVTEPs_Handler,
		},
		{
			MethodName: "GetSnapShot",
			Handler:    _GBP_GetSnapShot_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ListObjects",
			Handler:       _GBP_ListObjects_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "gbp.proto",
}

GBP_ServiceDesc is the grpc.ServiceDesc for GBP service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var LocalhostCert = []byte(`-----BEGIN CERTIFICATE-----
MIICEzCCAXygAwIBAgIQMIMChMLGrR+QvmQvpwAU6zANBgkqhkiG9w0BAQsFADAS
MRAwDgYDVQQKEwdBY21lIENvMCAXDTcwMDEwMTAwMDAwMFoYDzIwODQwMTI5MTYw
MDAwWjASMRAwDgYDVQQKEwdBY21lIENvMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB
iQKBgQDuLnQAI3mDgey3VBzWnB2L39JUU4txjeVE6myuDqkM/uGlfjb9SjY1bIw4
iA5sBBZzHi3z0h1YV8QPuxEbi4nW91IJm2gsvvZhIrCHS3l6afab4pZBl2+XsDul
rKBxKKtD1rGxlG4LjncdabFn9gvLZad2bSysqz/qTAUStTvqJQIDAQABo2gwZjAO
BgNVHQ8BAf8EBAMCAqQwEwYDVR0lBAwwCgYIKwYBBQUHAwEwDwYDVR0TAQH/BAUw
AwEB/zAuBgNVHREEJzAlggtleGFtcGxlLmNvbYcEfwAAAYcQAAAAAAAAAAAAAAAA
AAAAATANBgkqhkiG9w0BAQsFAAOBgQCEcetwO59EWk7WiJsG4x8SY+UIAA+flUI9
tyC4lNhbcF2Idq9greZwbYCqTTTr2XiRNSMLCOjKyI7ukPoPjo16ocHj+P3vZGfs
h1fIw3cSS2OolhloGw/XM6RWPWtPAlGykKLciQrBru5NAPvCMsb/I1DAceTiotQM
fblo6RBxUQ==
-----END CERTIFICATE-----`)
View Source
var LocalhostKey = []byte(`-----BEGIN RSA PRIVATE KEY-----
MIICXgIBAAKBgQDuLnQAI3mDgey3VBzWnB2L39JUU4txjeVE6myuDqkM/uGlfjb9
SjY1bIw4iA5sBBZzHi3z0h1YV8QPuxEbi4nW91IJm2gsvvZhIrCHS3l6afab4pZB
l2+XsDulrKBxKKtD1rGxlG4LjncdabFn9gvLZad2bSysqz/qTAUStTvqJQIDAQAB
AoGAGRzwwir7XvBOAy5tM/uV6e+Zf6anZzus1s1Y1ClbjbE6HXbnWWF/wbZGOpet
3Zm4vD6MXc7jpTLryzTQIvVdfQbRc6+MUVeLKwZatTXtdZrhu+Jk7hx0nTPy8Jcb
uJqFk541aEw+mMogY/xEcfbWd6IOkp+4xqjlFLBEDytgbIECQQDvH/E6nk+hgN4H
qzzVtxxr397vWrjrIgPbJpQvBsafG7b0dA4AFjwVbFLmQcj2PprIMmPcQrooz8vp
jy4SHEg1AkEA/v13/5M47K9vCxmb8QeD/asydfsgS5TeuNi8DoUBEmiSJwma7FXY
fFUtxuvL7XvjwjN5B30pNEbc6Iuyt7y4MQJBAIt21su4b3sjXNueLKH85Q+phy2U
fQtuUE9txblTu14q3N7gHRZB4ZMhFYyDy8CKrN2cPg/Fvyt0Xlp/DoCzjA0CQQDU
y2ptGsuSmgUtWj3NM9xuwYPm+Z/F84K6+ARYiZ6PYj013sovGKUFfYAqVXVlxtIX
qyUBnu3X9ps8ZfjLZO7BAkEAlT4R5Yl6cGhaJQYZHOde3JEMhNRcVFMO8dJDaFeo
f9Oeos0UUothgiDktdQHxdNEwLjQf7lJJBzV+5OtwswCWA==
-----END RSA PRIVATE KEY-----`)

Functions

func CreateDefVrf

func CreateDefVrf()

func CreateRoot

func CreateRoot(config *GBPServerConfig)

func GetInvMoMap

func GetInvMoMap(vtep string) map[string]*gbpCommonMo

func InitConfig

func InitConfig(config *GBPServerConfig)

func MakeHTTPHandler

func MakeHTTPHandler(handlerFunc httpAPIFunc) http.HandlerFunc

MakeHTTPHandler is a simple Wrapper for http handlers

func RegisterGBPServer

func RegisterGBPServer(s grpc.ServiceRegistrar, srv GBPServer)

func SendDefaultsToAPIC

func SendDefaultsToAPIC()

func StartGRPC

func StartGRPC(port string, gs *Server) (*gbpWatch, error)

func StringFromInfo

func StringFromInfo(ver *VersionInfo) string

StringFromInfo prints the versioning details

func UuidToCid

func UuidToCid(uuid string) string

func VersionString

func VersionString() string

String returns printable version string

Types

type ApicInfo

type ApicInfo struct {
	// The hostnames or IPs for connecting to apic
	Hosts []string `json:"apic-hosts,omitempty"`

	// The username for connecting to APIC
	Username string `json:"apic-username,omitempty"`

	// The password for connecting to APIC
	Password string `json:"apic-password,omitempty"`

	RefreshTimer string `json:"apic-refreshtime,omitempty"`

	// How early (seconds) the subscriptions to be refreshed than
	// actual subscription refresh-timeout. Will be defaulted to 5Seconds.
	RefreshTickerAdjust string `json:"apic-refreshticker-adjust,omitempty"`
	// A path for a PEM-encoded private key for client certificate
	// authentication for APIC API
	PrivateKeyPath string `json:"apic-private-key-path,omitempty"`

	// A path for a PEM-encoded public certificate for APIC server to
	// enable secure TLS server verifification
	CertPath string `json:"apic-cert-path,omitempty"`

	// Cloud Info
	Cloud *kafkac.CloudInfo `json:"cloud-info,omitempty"`

	// kafka config
	Kafka *kafkac.KafkaCfg `json:"kafka,omitempty"`
}

type BDSubnet

type BDSubnet struct {
	// contains filtered or unexported fields
}

func (*BDSubnet) BDUri

func (bds *BDSubnet) BDUri() string

func (*BDSubnet) CreateBD

func (bds *BDSubnet) CreateBD()

func (*BDSubnet) CreateEPG

func (bds *BDSubnet) CreateEPG(name, uri string) *gbpBaseMo

func (*BDSubnet) CreateFD

func (bds *BDSubnet) CreateFD()

func (*BDSubnet) CreateSubnet

func (bds *BDSubnet) CreateSubnet()

func (*BDSubnet) FDMcastUri

func (bds *BDSubnet) FDMcastUri() string

func (*BDSubnet) FDToBDUri

func (bds *BDSubnet) FDToBDUri() string

func (*BDSubnet) FDUri

func (bds *BDSubnet) FDUri() string

func (*BDSubnet) Setup

func (bds *BDSubnet) Setup()

func (*BDSubnet) SnUri

func (bds *BDSubnet) SnUri() string

func (*BDSubnet) SubnetsUri

func (bds *BDSubnet) SubnetsUri() string

type Contract

type Contract struct {
	Name      string      `json:"name,omitempty"`
	Tenant    string      `json:"tenant,omitempty"`
	AllowList []v1.WLRule `json:"allow-list,omitempty"`
	// contains filtered or unexported fields
}

func (*Contract) Delete

func (c *Contract) Delete() error

func (*Contract) FromMo

func (c *Contract) FromMo(mo *gbpBaseMo) error

func (*Contract) Make

func (c *Contract) Make() error

type EPG

type EPG struct {
	Tenant        string   `json:"tenant,omitempty"`
	Name          string   `json:"name,omitempty"`
	ConsContracts []string `json:"consumed-contracts,omitempty"`
	ProvContracts []string `json:"provided-contracts,omitempty"`
	ApicDN        string
	// contains filtered or unexported fields
}

func (*EPG) Delete

func (e *EPG) Delete()

func (*EPG) FromMo

func (e *EPG) FromMo(mo *gbpBaseMo) error

func (*EPG) Make

func (e *EPG) Make() error

type EmptyMsg

type EmptyMsg struct {
	// contains filtered or unexported fields
}

func (*EmptyMsg) Descriptor deprecated

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

Deprecated: Use EmptyMsg.ProtoReflect.Descriptor instead.

func (*EmptyMsg) ProtoMessage

func (*EmptyMsg) ProtoMessage()

func (*EmptyMsg) ProtoReflect

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

func (*EmptyMsg) Reset

func (x *EmptyMsg) Reset()

func (*EmptyMsg) String

func (x *EmptyMsg) String() string

type Endpoint

type Endpoint struct {
	Uuid      string   `json:"uuid,omitempty"`
	MacAddr   string   `json:"macaddr,omitempty"`
	IPAddr    []string `json:"ipaddr,omitempty"`
	EPG       string   `json:"epg,omitempty"`
	VTEP      string   `json:"vtep,omitempty"`
	IFName    string   `json:"ifname,omitempty"`
	Namespace string   `json:"namespace,omitempty"`
	PodName   string   `json:"podname,omitempty"`
}

func (*Endpoint) Add

func (ep *Endpoint) Add() (string, error)

func (*Endpoint) Delete

func (ep *Endpoint) Delete() error

func (*Endpoint) FromMo

func (ep *Endpoint) FromMo(mo *gbpInvMo) error

type GBPAction

type GBPAction struct {
	// contains filtered or unexported fields
}

func (*GBPAction) AddRef

func (g *GBPAction) AddRef(refSubj, targetURI string) error

func (*GBPAction) GetRefURIs

func (g *GBPAction) GetRefURIs(subject string) (map[string]string, error)

returns refMo URI, indexed by the actual target uri

func (*GBPAction) Make

func (a *GBPAction) Make(name, uri string) error

func (*GBPAction) Validate

func (a *GBPAction) Validate() error

type GBPBDToSubnets

type GBPBDToSubnets struct {
	// contains filtered or unexported fields
}

func (*GBPBDToSubnets) Make

func (to *GBPBDToSubnets) Make(name, uri string) error

func (*GBPBDToSubnets) Validate

func (to *GBPBDToSubnets) Validate() error

type GBPBDToVrf

type GBPBDToVrf struct {
	// contains filtered or unexported fields
}

func (*GBPBDToVrf) Make

func (to *GBPBDToVrf) Make(name, uri string) error

func (*GBPBDToVrf) Validate

func (to *GBPBDToVrf) Validate() error

type GBPBridgeDomain

type GBPBridgeDomain struct {
	// contains filtered or unexported fields
}

func (*GBPBridgeDomain) AddRef

func (g *GBPBridgeDomain) AddRef(refSubj, targetURI string) error

func (*GBPBridgeDomain) AddSubnet

func (bd *GBPBridgeDomain) AddSubnet() error

func (*GBPBridgeDomain) GetRefURIs

func (g *GBPBridgeDomain) GetRefURIs(subject string) (map[string]string, error)

returns refMo URI, indexed by the actual target uri

func (*GBPBridgeDomain) Make

func (bd *GBPBridgeDomain) Make(name, uri, subnetsUri string) error

func (*GBPBridgeDomain) Validate

func (bd *GBPBridgeDomain) Validate() error

type GBPClassifierRsrc

type GBPClassifierRsrc struct {
	// contains filtered or unexported fields
}

func (*GBPClassifierRsrc) AddRef

func (g *GBPClassifierRsrc) AddRef(refSubj, targetURI string) error

func (*GBPClassifierRsrc) GetRefURIs

func (g *GBPClassifierRsrc) GetRefURIs(subject string) (map[string]string, error)

returns refMo URI, indexed by the actual target uri

func (*GBPClassifierRsrc) Make

func (cr *GBPClassifierRsrc) Make(name, uri string) error

func (*GBPClassifierRsrc) Validate

func (cr *GBPClassifierRsrc) Validate() error

type GBPClient

type GBPClient interface {
	// Obtains the objects currently in the policy database as a stream
	ListObjects(ctx context.Context, in *Version, opts ...grpc.CallOption) (GBP_ListObjectsClient, error)
	ListVTEPs(ctx context.Context, in *EmptyMsg, opts ...grpc.CallOption) (*VTEPList, error)
	GetSnapShot(ctx context.Context, in *VTEP, opts ...grpc.CallOption) (*ObjectList, error)
}

GBPClient is the client API for GBP service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewGBPClient

func NewGBPClient(cc grpc.ClientConnInterface) GBPClient

type GBPContract

type GBPContract struct {
	// contains filtered or unexported fields
}

func (*GBPContract) AddRef

func (g *GBPContract) AddRef(refSubj, targetURI string) error

func (*GBPContract) GetRefURIs

func (g *GBPContract) GetRefURIs(subject string) (map[string]string, error)

returns refMo URI, indexed by the actual target uri

func (*GBPContract) Make

func (c *GBPContract) Make(name, uri string) error

func (*GBPContract) Validate

func (c *GBPContract) Validate() error

type GBPCustomMo

type GBPCustomMo interface {
	Subject() string
	URI(s *Server) string
	Properties() map[string]interface{}
	ParentSub() string
	ParentURI(s *Server) string
	Children() []string
}

GBPCustomMo acts as the interface between a CRD and the corresponding MO. Implement this interface in the CRD watcher

type GBPEPGToFD

type GBPEPGToFD struct {
	// contains filtered or unexported fields
}

func (*GBPEPGToFD) Make

func (to *GBPEPGToFD) Make(name, uri string) error

func (*GBPEPGToFD) Validate

func (to *GBPEPGToFD) Validate() error

type GBPEPGToSnet

type GBPEPGToSnet struct {
	// contains filtered or unexported fields
}

func (*GBPEPGToSnet) Make

func (to *GBPEPGToSnet) Make(name, uri string) error

func (*GBPEPGToSnet) Validate

func (to *GBPEPGToSnet) Validate() error

type GBPEpGroup

type GBPEpGroup struct {
	// contains filtered or unexported fields
}

func (*GBPEpGroup) AddRef

func (g *GBPEpGroup) AddRef(refSubj, targetURI string) error

func (*GBPEpGroup) GetRefURIs

func (g *GBPEpGroup) GetRefURIs(subject string) (map[string]string, error)

returns refMo URI, indexed by the actual target uri

func (*GBPEpGroup) Make

func (epg *GBPEpGroup) Make(name, uri string) error

func (*GBPEpGroup) Validate

func (epg *GBPEpGroup) Validate() error

type GBPFDToBD

type GBPFDToBD struct {
	// contains filtered or unexported fields
}

func (*GBPFDToBD) Make

func (to *GBPFDToBD) Make(name, uri string) error

func (*GBPFDToBD) Validate

func (to *GBPFDToBD) Validate() error

type GBPFloodDomain

type GBPFloodDomain struct {
	// contains filtered or unexported fields
}

func (*GBPFloodDomain) AddRef

func (g *GBPFloodDomain) AddRef(refSubj, targetURI string) error

func (*GBPFloodDomain) GetRefURIs

func (g *GBPFloodDomain) GetRefURIs(subject string) (map[string]string, error)

returns refMo URI, indexed by the actual target uri

func (*GBPFloodDomain) Make

func (fd *GBPFloodDomain) Make(name, uri string) error

func (*GBPFloodDomain) Validate

func (ss *GBPFloodDomain) Validate() error

type GBPFloodMcast

type GBPFloodMcast struct {
	// contains filtered or unexported fields
}

func (*GBPFloodMcast) AddRef

func (g *GBPFloodMcast) AddRef(refSubj, targetURI string) error

func (*GBPFloodMcast) GetRefURIs

func (g *GBPFloodMcast) GetRefURIs(subject string) (map[string]string, error)

returns refMo URI, indexed by the actual target uri

func (*GBPFloodMcast) Make

func (fm *GBPFloodMcast) Make(name, uri string) error

func (*GBPFloodMcast) Validate

func (ss *GBPFloodMcast) Validate() error

type GBPL24Classifier

type GBPL24Classifier struct {
	// contains filtered or unexported fields
}

func (*GBPL24Classifier) AddRef

func (g *GBPL24Classifier) AddRef(refSubj, targetURI string) error

func (*GBPL24Classifier) GetRefURIs

func (g *GBPL24Classifier) GetRefURIs(subject string) (map[string]string, error)

returns refMo URI, indexed by the actual target uri

func (*GBPL24Classifier) Make

func (c *GBPL24Classifier) Make(name, uri string) error

func (*GBPL24Classifier) Validate

func (c *GBPL24Classifier) Validate() error

type GBPMo

type GBPMo interface {
	Make(name, uri string) error
	FromJSON(j []byte) error
	SetParent(subj, rel, uri string)
	AddChild(uri string)
	DelChild(uri string)
	AddProperty(name string, data interface{})
	WriteJSON() []byte
	Validate() error
	GetStringProperty(name string) string
	GetIntProperty(name string) int
	GetRefURIs(subject string) (map[string]string, error)
}

type GBPObject

type GBPObject struct {
	Subject        string      `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"`
	Uri            string      `protobuf:"bytes,2,opt,name=uri,proto3" json:"uri,omitempty"`
	Properties     []*Property `protobuf:"bytes,3,rep,name=properties,proto3" json:"properties,omitempty"`
	Children       []string    `protobuf:"bytes,4,rep,name=children,proto3" json:"children,omitempty"`
	ParentSubject  string      `protobuf:"bytes,5,opt,name=parent_subject,json=parentSubject,proto3" json:"parent_subject,omitempty"`
	ParentUri      string      `protobuf:"bytes,6,opt,name=parent_uri,json=parentUri,proto3" json:"parent_uri,omitempty"`
	ParentRelation string      `protobuf:"bytes,7,opt,name=parent_relation,json=parentRelation,proto3" json:"parent_relation,omitempty"`
	// contains filtered or unexported fields
}

GBPObject is a generic definition representing an object

func (*GBPObject) Descriptor deprecated

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

Deprecated: Use GBPObject.ProtoReflect.Descriptor instead.

func (*GBPObject) GetChildren

func (x *GBPObject) GetChildren() []string

func (*GBPObject) GetParentRelation

func (x *GBPObject) GetParentRelation() string

func (*GBPObject) GetParentSubject

func (x *GBPObject) GetParentSubject() string

func (*GBPObject) GetParentUri

func (x *GBPObject) GetParentUri() string

func (*GBPObject) GetProperties

func (x *GBPObject) GetProperties() []*Property

func (*GBPObject) GetSubject

func (x *GBPObject) GetSubject() string

func (*GBPObject) GetUri

func (x *GBPObject) GetUri() string

func (*GBPObject) ProtoMessage

func (*GBPObject) ProtoMessage()

func (*GBPObject) ProtoReflect

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

func (*GBPObject) Reset

func (x *GBPObject) Reset()

func (*GBPObject) String

func (x *GBPObject) String() string

type GBPOperation

type GBPOperation struct {
	Opcode     GBPOperation_OpCode `protobuf:"varint,1,opt,name=opcode,proto3,enum=gbpserver.GBPOperation_OpCode" json:"opcode,omitempty"`
	ObjectList []*GBPObject        `protobuf:"bytes,2,rep,name=object_list,json=objectList,proto3" json:"object_list,omitempty"`
	// contains filtered or unexported fields
}

A GBPOperation adds, replaces or deletes a subtree

func (*GBPOperation) Descriptor deprecated

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

Deprecated: Use GBPOperation.ProtoReflect.Descriptor instead.

func (*GBPOperation) GetObjectList

func (x *GBPOperation) GetObjectList() []*GBPObject

func (*GBPOperation) GetOpcode

func (x *GBPOperation) GetOpcode() GBPOperation_OpCode

func (*GBPOperation) ProtoMessage

func (*GBPOperation) ProtoMessage()

func (*GBPOperation) ProtoReflect

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

func (*GBPOperation) Reset

func (x *GBPOperation) Reset()

func (*GBPOperation) String

func (x *GBPOperation) String() string

type GBPOperation_OpCode

type GBPOperation_OpCode int32
const (
	GBPOperation_ADD              GBPOperation_OpCode = 0
	GBPOperation_REPLACE          GBPOperation_OpCode = 1
	GBPOperation_DELETE           GBPOperation_OpCode = 2
	GBPOperation_DELETE_RECURSIVE GBPOperation_OpCode = 3
)

func (GBPOperation_OpCode) Descriptor

func (GBPOperation_OpCode) Enum

func (GBPOperation_OpCode) EnumDescriptor deprecated

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

Deprecated: Use GBPOperation_OpCode.Descriptor instead.

func (GBPOperation_OpCode) Number

func (GBPOperation_OpCode) String

func (x GBPOperation_OpCode) String() string

func (GBPOperation_OpCode) Type

type GBPRoutingDomain

type GBPRoutingDomain struct {
	// contains filtered or unexported fields
}

func (*GBPRoutingDomain) AddRef

func (g *GBPRoutingDomain) AddRef(refSubj, targetURI string) error

func (*GBPRoutingDomain) GetRefURIs

func (g *GBPRoutingDomain) GetRefURIs(subject string) (map[string]string, error)

returns refMo URI, indexed by the actual target uri

func (*GBPRoutingDomain) Make

func (rd *GBPRoutingDomain) Make(name, uri string) error

func (*GBPRoutingDomain) Validate

func (a *GBPRoutingDomain) Validate() error

type GBPRule

type GBPRule struct {
	// contains filtered or unexported fields
}

func (*GBPRule) AddRef

func (g *GBPRule) AddRef(refSubj, targetURI string) error

func (*GBPRule) GetRefURIs

func (g *GBPRule) GetRefURIs(subject string) (map[string]string, error)

returns refMo URI, indexed by the actual target uri

func (*GBPRule) Make

func (r *GBPRule) Make(name, uri string) error

func (*GBPRule) Validate

func (r *GBPRule) Validate() error

type GBPRuleToAct

type GBPRuleToAct struct {
	// contains filtered or unexported fields
}

func (*GBPRuleToAct) Make

func (to *GBPRuleToAct) Make(name, uri string) error

func (*GBPRuleToAct) Validate

func (to *GBPRuleToAct) Validate() error

type GBPRuleToClass

type GBPRuleToClass struct {
	// contains filtered or unexported fields
}

func (*GBPRuleToClass) Make

func (to *GBPRuleToClass) Make(name, uri string) error

func (*GBPRuleToClass) Validate

func (to *GBPRuleToClass) Validate() error

type GBPServer

type GBPServer interface {
	// Obtains the objects currently in the policy database as a stream
	ListObjects(*Version, GBP_ListObjectsServer) error
	ListVTEPs(context.Context, *EmptyMsg) (*VTEPList, error)
	GetSnapShot(context.Context, *VTEP) (*ObjectList, error)
	// contains filtered or unexported methods
}

GBPServer is the server API for GBP service. All implementations must embed UnimplementedGBPServer for forward compatibility

type GBPServerConfig

type GBPServerConfig struct {
	// General log level
	LogLevel string `json:"log-level,omitempty"`

	// GRPC log level
	GRPCLogLevel string `json:"grpc-log-level,omitempty"`

	// Watch log level
	WatchLogLevel string `json:"watch-log-level,omitempty"`

	// Absolute path to a kubeconfig file
	KubeConfig string `json:"kubeconfig,omitempty"`

	// TCP port to run status server on (or 0 to disable)
	StatusPort int `json:"status-port,omitempty"`

	// TCP port to run grpc server on
	GRPCPort int `json:"grpc-port,omitempty"`

	// TCP port to run apic proxy server on (or 0 to disable)
	ProxyListenPort int `json:"proxy-listen-port,omitempty"`

	// Pod subnet CIDR in the form <gateway-address>/<prefix-length> that
	// cover all pod-ip-pools
	PodSubnet  string `json:"pod-subnet,omitempty"`
	NodeSubnet string `json:"node-subnet,omitempty"`

	// Used by internal kv store
	EtcdDir  string `json:"etcd-dir,omitempty"`
	EtcdPort int    `json:"etcd-port,omitempty"`

	// Tenant to use when creating policy objects in APIC
	AciPolicyTenant string `json:"aci-policy-tenant,omitempty"`

	// The name of the ACI VMM domain
	AciVmmDomain string `json:"aci-vmm-domain,omitempty"`

	AciVrfTenant string `json:"aci-vrf-tenant,omitempty"`

	// ACI VRF for this kubernetes instance
	AciVrf     string `json:"aci-vrf,omitempty"`
	VrfEncapID int    `json:"vrf-encap-id,omitempty"`

	// APIC info
	Apic       *ApicInfo `json:"apic,omitempty"`
	SyncRemEps bool      `json:"sync-rem-eps,omitempty"`
	CSRList    string    `json:"csr-list,omitempty"`

	// Metrics
	EnableMetrics bool `json:"enable-metrics,omitempty"`
	MetricsPort   int  `json:"metrics-port,omitempty"`
}

Configuration for the gbpserver

type GBPSubject

type GBPSubject struct {
	// contains filtered or unexported fields
}

func (*GBPSubject) AddRef

func (g *GBPSubject) AddRef(refSubj, targetURI string) error

func (*GBPSubject) GetRefURIs

func (g *GBPSubject) GetRefURIs(subject string) (map[string]string, error)

returns refMo URI, indexed by the actual target uri

func (*GBPSubject) Make

func (s *GBPSubject) Make(name, uri string) error

func (*GBPSubject) Validate

func (s *GBPSubject) Validate() error

type GBPSubnet

type GBPSubnet struct {
	// contains filtered or unexported fields
}

func (*GBPSubnet) AddRef

func (g *GBPSubnet) AddRef(refSubj, targetURI string) error

func (*GBPSubnet) GetRefURIs

func (g *GBPSubnet) GetRefURIs(subject string) (map[string]string, error)

returns refMo URI, indexed by the actual target uri

func (*GBPSubnet) Make

func (s *GBPSubnet) Make(name, uri string) error

func (*GBPSubnet) Validate

func (s *GBPSubnet) Validate() error

type GBPSubnetSet

type GBPSubnetSet struct {
	// contains filtered or unexported fields
}

func (*GBPSubnetSet) AddRef

func (g *GBPSubnetSet) AddRef(refSubj, targetURI string) error

func (*GBPSubnetSet) GetRefURIs

func (g *GBPSubnetSet) GetRefURIs(subject string) (map[string]string, error)

returns refMo URI, indexed by the actual target uri

func (*GBPSubnetSet) Make

func (ss *GBPSubnetSet) Make(name, uri string) error

func (*GBPSubnetSet) Validate

func (ss *GBPSubnetSet) Validate() error

type GBPVrfIntSubnet

type GBPVrfIntSubnet struct {
	// contains filtered or unexported fields
}

func (*GBPVrfIntSubnet) AddRef

func (g *GBPVrfIntSubnet) AddRef(refSubj, targetURI string) error

func (*GBPVrfIntSubnet) GetRefURIs

func (g *GBPVrfIntSubnet) GetRefURIs(subject string) (map[string]string, error)

returns refMo URI, indexed by the actual target uri

func (*GBPVrfIntSubnet) Make

func (vi *GBPVrfIntSubnet) Make(name, uri string) error

func (*GBPVrfIntSubnet) Validate

func (vi *GBPVrfIntSubnet) Validate() error

type GBP_ListObjectsClient

type GBP_ListObjectsClient interface {
	Recv() (*GBPOperation, error)
	grpc.ClientStream
}

type GBP_ListObjectsServer

type GBP_ListObjectsServer interface {
	Send(*GBPOperation) error
	grpc.ServerStream
}

type GBPeInstContext

type GBPeInstContext struct {
	// contains filtered or unexported fields
}

func (*GBPeInstContext) AddRef

func (g *GBPeInstContext) AddRef(refSubj, targetURI string) error

func (*GBPeInstContext) GetRefURIs

func (g *GBPeInstContext) GetRefURIs(subject string) (map[string]string, error)

returns refMo URI, indexed by the actual target uri

func (*GBPeInstContext) Make

func (eic *GBPeInstContext) Make(name, uri string) error

func (*GBPeInstContext) Validate

func (eic *GBPeInstContext) Validate() error

type HpSubj

type HpSubj struct {
	Attributes map[string]string        `json:"attributes,omitempty"`
	Children   []map[string]HpSubjChild `json:"children,omitempty"`
	// contains filtered or unexported fields
}

func (*HpSubj) Make

func (hs *HpSubj) Make(hsMo *gbpCommonMo, npName string) error

type HpSubjChild

type HpSubjChild struct {
	Attributes map[string]string             `json:"attributes,omitempty"`
	Children   []map[string]HpSubjGrandchild `json:"children,omitempty"`
	// contains filtered or unexported fields
}

func (*HpSubjChild) Make

func (hsc *HpSubjChild) Make(ruleMo *gbpCommonMo, subjName, npName string) error

type HpSubjGrandchild

type HpSubjGrandchild struct {
	Attributes map[string]string        `json:"attributes,omitempty"`
	Children   []map[string]interface{} `json:"children,omitempty"`
}

type Hpp

type Hpp struct {
	Attributes map[string]string    `json:"attributes,omitempty"`
	Children   []map[string]*HpSubj `json:"children,omitempty"`
}

type IntRange

type IntRange struct {
	Start int `json:"start,omitempty"`
	End   int `json:"end,omitempty"`
}

type ListResp

type ListResp struct {
	URIs []string
}

type NetworkPolicy

type NetworkPolicy struct {
	HostprotPol Hpp `json:"hostprotPol,omitempty"`
}

func (*NetworkPolicy) Make

func (np *NetworkPolicy) Make() error

type ObjectList

type ObjectList struct {
	MoList []*GBPObject `protobuf:"bytes,1,rep,name=mo_list,json=moList,proto3" json:"mo_list,omitempty"`
	// contains filtered or unexported fields
}

ObjectList is a list of GBP objects

func (*ObjectList) Descriptor deprecated

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

Deprecated: Use ObjectList.ProtoReflect.Descriptor instead.

func (*ObjectList) GetMoList

func (x *ObjectList) GetMoList() []*GBPObject

func (*ObjectList) ProtoMessage

func (*ObjectList) ProtoMessage()

func (*ObjectList) ProtoReflect

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

func (*ObjectList) Reset

func (x *ObjectList) Reset()

func (*ObjectList) String

func (x *ObjectList) String() string

type PostResp

type PostResp struct {
	URI string
}

type Property

type Property struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Types that are assignable to Value:
	//
	//	*Property_StrVal
	//	*Property_IntVal
	//	*Property_RefVal
	Value isProperty_Value `protobuf_oneof:"value"`
	// contains filtered or unexported fields
}

Property is a name value pair, where the value could be one of [string, int, Reference]

func (*Property) Descriptor deprecated

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

Deprecated: Use Property.ProtoReflect.Descriptor instead.

func (*Property) GetIntVal

func (x *Property) GetIntVal() int32

func (*Property) GetName

func (x *Property) GetName() string

func (*Property) GetRefVal

func (x *Property) GetRefVal() *Reference

func (*Property) GetStrVal

func (x *Property) GetStrVal() string

func (*Property) GetValue

func (m *Property) GetValue() isProperty_Value

func (*Property) MarshalJSON

func (p *Property) MarshalJSON() ([]byte, error)

func (*Property) ProtoMessage

func (*Property) ProtoMessage()

func (*Property) ProtoReflect

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

func (*Property) Reset

func (x *Property) Reset()

func (*Property) String

func (x *Property) String() string

func (*Property) UnmarshalJSON

func (p *Property) UnmarshalJSON(data []byte) error

type Property_IntVal

type Property_IntVal struct {
	IntVal int32 `protobuf:"varint,3,opt,name=intVal,proto3,oneof"`
}

type Property_RefVal

type Property_RefVal struct {
	RefVal *Reference `protobuf:"bytes,4,opt,name=refVal,proto3,oneof"`
}

type Property_StrVal

type Property_StrVal struct {
	StrVal string `protobuf:"bytes,2,opt,name=strVal,proto3,oneof"`
}

type Reference

type Reference struct {
	Subject      string `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"`
	ReferenceUri string `protobuf:"bytes,2,opt,name=reference_uri,json=referenceUri,proto3" json:"reference_uri,omitempty"`
	// contains filtered or unexported fields
}

Reference refers to another GBP object

func (*Reference) Descriptor deprecated

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

Deprecated: Use Reference.ProtoReflect.Descriptor instead.

func (*Reference) GetReferenceUri

func (x *Reference) GetReferenceUri() string

func (*Reference) GetSubject

func (x *Reference) GetSubject() string

func (*Reference) ProtoMessage

func (*Reference) ProtoMessage()

func (*Reference) ProtoReflect

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

func (*Reference) Reset

func (x *Reference) Reset()

func (*Reference) String

func (x *Reference) String() string

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(config *GBPServerConfig) *Server

func StartNewServer

func StartNewServer(config *GBPServerConfig, sd StateDriver, etcdURLs []string) (*Server, error)

func (*Server) AddContract

func (s *Server) AddContract(c Contract)

func (*Server) AddEP

func (s *Server) AddEP(ep Endpoint)

func (*Server) AddEPG

func (s *Server) AddEPG(e EPG)

func (*Server) AddGBPCustomMo

func (s *Server) AddGBPCustomMo(crd GBPCustomMo)

AddGBPCustomMo access utility for crd watcher to add an MO

func (*Server) AddNetPol

func (s *Server) AddNetPol(np NetworkPolicy)

func (*Server) Config

func (s *Server) Config() *GBPServerConfig

func (*Server) DelContract

func (s *Server) DelContract(c Contract)

func (*Server) DelEP

func (s *Server) DelEP(ep Endpoint)

func (*Server) DelEPG

func (s *Server) DelEPG(e EPG)

func (*Server) DelGBPCustomMo

func (s *Server) DelGBPCustomMo(crd GBPCustomMo)

DelGBPCustomMo access utility for crd watcher to delete an MO

func (*Server) DelNetPol

func (s *Server) DelNetPol(dn string)

func (*Server) GetPlatformURI

func (s *Server) GetPlatformURI() string

GetPlatformURI helper for watchers to get the platform uri

func (*Server) GetTenantURI

func (s *Server) GetTenantURI() string

GetTenantURI helper for watchers to get the tenant uri

func (*Server) GetURIBySubject

func (s *Server) GetURIBySubject(sub string) string

GetURIBySubject helper for watchers to get a parent URI

func (*Server) InitDB

func (s *Server) InitDB()

Initializes the Mo DB

func (*Server) InitState

func (s *Server) InitState(sd StateDriver) error

func (*Server) RegisterCallBack

func (s *Server) RegisterCallBack(id string, fn func(op GBPOperation_OpCode, urls []string))

func (*Server) RemoveCallBack

func (s *Server) RemoveCallBack(id string)

func (*Server) Stop

func (s *Server) Stop()

func (*Server) UTReadMsg

func (s *Server) UTReadMsg(to time.Duration) (int, interface{}, error)

func (*Server) UpdateTunnels

func (s *Server) UpdateTunnels(tunnels map[string]int64)

type StateDriver

type StateDriver interface {
	Init(int) error
	Get() (*crdv1.GBPSState, error)
	Update(*crdv1.GBPSState) error
}

type UnimplementedGBPServer

type UnimplementedGBPServer struct {
}

UnimplementedGBPServer must be embedded to have forward compatible implementations.

func (UnimplementedGBPServer) GetSnapShot

func (UnimplementedGBPServer) ListObjects

func (UnimplementedGBPServer) ListVTEPs

type UnsafeGBPServer

type UnsafeGBPServer interface {
	// contains filtered or unexported methods
}

UnsafeGBPServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GBPServer will result in compilation errors.

type VTEP

type VTEP struct {
	Vtep string `protobuf:"bytes,1,opt,name=vtep,proto3" json:"vtep,omitempty"`
	// contains filtered or unexported fields
}

VTEP is the ip address of the vtep matching a node.

func (*VTEP) Descriptor deprecated

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

Deprecated: Use VTEP.ProtoReflect.Descriptor instead.

func (*VTEP) GetVtep

func (x *VTEP) GetVtep() string

func (*VTEP) ProtoMessage

func (*VTEP) ProtoMessage()

func (*VTEP) ProtoReflect

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

func (*VTEP) Reset

func (x *VTEP) Reset()

func (*VTEP) String

func (x *VTEP) String() string

type VTEPList

type VTEPList struct {
	Vteps []string `protobuf:"bytes,1,rep,name=vteps,proto3" json:"vteps,omitempty"`
	// contains filtered or unexported fields
}

VTEPList is the list of vteps, corresponding to the connected grpc clients

func (*VTEPList) Descriptor deprecated

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

Deprecated: Use VTEPList.ProtoReflect.Descriptor instead.

func (*VTEPList) GetVteps

func (x *VTEPList) GetVteps() []string

func (*VTEPList) ProtoMessage

func (*VTEPList) ProtoMessage()

func (*VTEPList) ProtoReflect

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

func (*VTEPList) Reset

func (x *VTEPList) Reset()

func (*VTEPList) String

func (x *VTEPList) String() string

type Version

type Version struct {
	Number int32 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"`
	// contains filtered or unexported fields
}

Version is used for syncing between client and server

func (*Version) Descriptor deprecated

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

Deprecated: Use Version.ProtoReflect.Descriptor instead.

func (*Version) GetNumber

func (x *Version) GetNumber() int32

func (*Version) ProtoMessage

func (*Version) ProtoMessage()

func (*Version) ProtoReflect

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

func (*Version) Reset

func (x *Version) Reset()

func (*Version) String

func (x *Version) String() string

type VersionInfo

type VersionInfo struct {
	GitCommit string
	BuildTime string
}

Info enlists version and build information

func GetVersion

func GetVersion() *VersionInfo

Get gets the version information

type WLRule

type WLRule struct {
	Protocol string   `json:"protocol,omitempty"`
	Ports    IntRange `json:"ports,omitempty"`
}

WLRules are implicit allow

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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