gbp

package
v0.0.0-...-9da2307 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2016 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Debug *log.Logger
	Info  *log.Logger
	Warn  *log.Logger
	Error *log.Logger
)

Functions

This section is empty.

Types

type Action

type Action struct {
	Name            string       `json:"name"`
	Order           float64      `json:"order"`
	ParameterValues []*Parameter `json:"parameter-value"`
	Id              string       `json:"action-definition-id"`
}

func (*Action) IsAllow

func (x *Action) IsAllow() bool

func (*Action) String

func (x *Action) String() string

type Classifier

type Classifier struct {
	Name            string       `json:"name"`
	ParameterValues []*Parameter `json:"parameter-value"`
	Direction       string       `json:"direction"`
	Id              string       `json:"classifier-definition-id"`
}

func (*Classifier) String

func (x *Classifier) String() string

func (*Classifier) ToMatch

func (x *Classifier) ToMatch() Match

type Dataplane

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

func NewDataplane

func NewDataplane(sqlUrl string) *Dataplane

func (*Dataplane) AddEndpoint

func (d *Dataplane) AddEndpoint(ipStr, tenant, epg string) (err error)

func (*Dataplane) Close

func (d *Dataplane) Close() error

func (*Dataplane) DeleteEndpoint

func (d *Dataplane) DeleteEndpoint(ip string) (err error)

func (*Dataplane) Endpoints

func (d *Dataplane) Endpoints() <-chan *EndpointEntry

func (*Dataplane) Id

func (d *Dataplane) Id() string

func (*Dataplane) Init

func (d *Dataplane) Init(baseUrl string) error

func (*Dataplane) ParsePolicy

func (d *Dataplane) ParsePolicy(policy *Policy) (err error)

type EndpointEntry

type EndpointEntry struct {
	Ip     string `db:"ip" json:"ip"`
	Tenant string `db:"tenant" json:"tenant"`
	Epg    string `db:"epg" json:"epg"`
}

type GbpServer

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

func NewServer

func NewServer(upstreamUri, dataplaneUri string) (*GbpServer, error)

func (*GbpServer) Handler

func (g *GbpServer) Handler() http.Handler

type Match

type Match struct {
	SourcePort uint16
	DestPort   uint16
	Proto      uint8
	Direction  uint8 // 0=any, 1=in, 2=out
}

type Notifier

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

func NewNotifier

func NewNotifier(url, location string) *Notifier

func (*Notifier) NotifyEndpointDown

func (n *Notifier) NotifyEndpointDown()

func (*Notifier) NotifyEndpointUp

func (n *Notifier) NotifyEndpointUp() error

type Parameter

type Parameter struct {
	Name  string  `json:"name"`
	Value float64 `json:"int-value"`
}

func (*Parameter) String

func (x *Parameter) String() string

type Policy

type Policy struct {
	ConsumerTenantId string                        `json:"consumer-tenant-id"`
	ConsumerEpgId    string                        `json:"consumer-epg-id"`
	ProviderTenantId string                        `json:"provider-tenant-id"`
	ProviderEpgId    string                        `json:"provider-epg-id"`
	PolicyRuleGroups []*PolicyRuleGroupConstrained `json:"policy-rule-group-with-endpoint-constraints"`
}

func (*Policy) String

func (x *Policy) String() string

type PolicyRuleGroup

type PolicyRuleGroup struct {
	TenantId      string  `json:"tenant-id"`
	ContractId    string  `json:"contract-id"`
	SubjectName   string  `json:"subject-name"`
	ResolvedRules []*Rule `json:"resolved-rule"`
}

func (*PolicyRuleGroup) String

func (x *PolicyRuleGroup) String() string

type PolicyRuleGroupConstrained

type PolicyRuleGroupConstrained struct {
	PolicyRuleGroups []*PolicyRuleGroup `json:"policy-rule-group"`
}

func (*PolicyRuleGroupConstrained) String

func (x *PolicyRuleGroupConstrained) String() string

type ResolvedPolicy

type ResolvedPolicy struct {
	ResolvedPolicies []*Policy `json:"resolved-policy"`
}

func (*ResolvedPolicy) String

func (x *ResolvedPolicy) String() string

type Rule

type Rule struct {
	Name        string        `json:"name"`
	Classifiers []*Classifier `json:"classifier"`
	Order       float64       `json:"order"`
	Actions     []*Action     `json:"action"`
}

func (*Rule) IsAllow

func (x *Rule) IsAllow() bool

func (*Rule) String

func (x *Rule) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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