policy

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: May 17, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AS_SET             = 1
	AS_SEQUENCE        = 2
	AS_CONFED_SEQUENCE = 3
	AS_CONFED_SET      = 4
)
View Source
const (
	Permit = true
	Deny   = false
)

Variables

This section is empty.

Functions

func AsPathTokenGet added in v1.8.1

func AsPathTokenGet(str string) (string, int, uint32)

func AsSegmentDelimiter added in v1.8.1

func AsSegmentDelimiter(typ uint8) (string, string)

func MatchVersion added in v1.8.1

func MatchVersion(rule interface{}, val interface{}) bool

func MatchVersionCompile added in v1.8.1

func MatchVersionCompile(args []string) interface{}

Types

type ASPath added in v1.8.1

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

////////////////////////////

func NewASPath added in v1.8.1

func NewASPath() *ASPath

func (*ASPath) Append added in v1.8.1

func (aspath *ASPath) Append(asnum uint32) *ASPath

func (*ASPath) DecodeFromBytes added in v1.8.1

func (aspath *ASPath) DecodeFromBytes(data []byte, opts ...DecodeOption) error

func (*ASPath) Replace added in v1.8.1

func (aspath *ASPath) Replace(from, to uint32) *ASPath

func (*ASPath) Serialize added in v1.8.1

func (aspath *ASPath) Serialize() ([]byte, error)

func (*ASPath) String added in v1.8.1

func (aspath *ASPath) String() string

type Action added in v1.8.1

type Action bool

func String2Action added in v1.8.1

func String2Action(str string) Action

func (Action) MarshalJSON added in v1.8.1

func (t Action) MarshalJSON() ([]byte, error)

func (Action) String added in v1.8.1

func (t Action) String() string

type As2Segment added in v1.8.1

type As2Segment struct {
	Type   uint8
	Length uint8
	As     []uint16
}

func (*As2Segment) DecodeFromBytes added in v1.8.1

func (seg *As2Segment) DecodeFromBytes(data []byte) error

func (*As2Segment) EncodeLength added in v1.8.1

func (seg *As2Segment) EncodeLength() int

func (*As2Segment) PathLength added in v1.8.1

func (seg *As2Segment) PathLength() int

func (*As2Segment) Serialize added in v1.8.1

func (seg *As2Segment) Serialize() ([]byte, error)

func (*As2Segment) String added in v1.8.1

func (seg *As2Segment) String() string

type As4Segment added in v1.8.1

type As4Segment struct {
	Type   uint8
	Length uint8
	As     []uint32
}

func NewAs4Segment added in v1.8.1

func NewAs4Segment(typ uint8) *As4Segment

func (*As4Segment) Append added in v1.8.1

func (seg *As4Segment) Append(asnum uint32)

func (*As4Segment) DecodeFromBytes added in v1.8.1

func (seg *As4Segment) DecodeFromBytes(data []byte) error

func (*As4Segment) EncodeLength added in v1.8.1

func (seg *As4Segment) EncodeLength() int

func (*As4Segment) GetLength added in v1.8.1

func (seg *As4Segment) GetLength() int

func (*As4Segment) GetType added in v1.8.1

func (seg *As4Segment) GetType() uint8

func (*As4Segment) PathLength added in v1.8.1

func (seg *As4Segment) PathLength() int

func (*As4Segment) Replace added in v1.8.1

func (seg *As4Segment) Replace(from, to uint32)

func (*As4Segment) Serialize added in v1.8.1

func (seg *As4Segment) Serialize() ([]byte, error)

func (*As4Segment) String added in v1.8.1

func (seg *As4Segment) String() string

type AsPath added in v1.8.1

type AsPath []AsSegmentInterface

func AsPathParse added in v1.8.1

func AsPathParse(str string) (AsPath, error)

func (AsPath) Append added in v1.8.1

func (aspath AsPath) Append(asnum uint32) AsPath

func (AsPath) PathLength added in v1.8.1

func (aspath AsPath) PathLength() int

func (AsPath) Prepend added in v1.8.1

func (aspath AsPath) Prepend(path AsPath) AsPath

AsPath Prepend.

func (AsPath) String added in v1.8.1

func (aspath AsPath) String() string

type AsSegmentInterface added in v1.8.1

type AsSegmentInterface interface {
	String() string
	Serialize() ([]byte, error)
	DecodeFromBytes([]byte) error
	EncodeLength() int
	PathLength() int
	Append(uint32)
	GetLength() int
	GetType() uint8
}

type DecodeOption added in v1.8.1

type DecodeOption func() int

func With2Octet added in v1.8.1

func With2Octet() DecodeOption

type MatchTag added in v1.8.1

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

MatchTag for route-map match statement such as "match tag 100".

func (*MatchTag) Match added in v1.8.1

func (match *MatchTag) Match(p, r interface{}) bool

func (*MatchTag) MatchAdd added in v1.8.1

func (match *MatchTag) MatchAdd(args ...string)

type PrefixList added in v1.8.1

type PrefixList struct {
	Name        string               `json:"name"`
	Description string               `json:"description,omitempty"`
	Entries     PrefixListEntrySlice `json:"seq"`
}

func NewPrefixList added in v1.8.1

func NewPrefixList(name string) *PrefixList

func (*PrefixList) AddWithClosure added in v1.8.1

func (plist *PrefixList) AddWithClosure(entry *PrefixListEntry)

func (*PrefixList) EntryAdd added in v1.8.1

func (plist *PrefixList) EntryAdd(entry *PrefixListEntry)

func (*PrefixList) EntryDelete added in v1.8.1

func (plist *PrefixList) EntryDelete(entry *PrefixListEntry)

func (*PrefixList) Match added in v1.8.1

func (plist *PrefixList) Match(p *netutil.Prefix) Action

type PrefixListEntry added in v1.8.1

type PrefixListEntry struct {
	Seq    int             `json:"number"`
	Action Action          `json:"action"`
	Prefix *netutil.Prefix `json:"prefix"`
	Le     *int            `json:"le,omitempty"`
	Ge     *int            `json:"ge,omitempty"`
	Eq     *int            `json:"eq,omitempty"`
}

func NewPrefixListEntry added in v1.8.1

func NewPrefixListEntry(seq int, action Action, p *netutil.Prefix, opts ...PrefixListOption) *PrefixListEntry

func (*PrefixListEntry) Match added in v1.8.1

func (entry *PrefixListEntry) Match(p *netutil.Prefix) bool

func (*PrefixListEntry) Validate added in v1.8.1

func (entry *PrefixListEntry) Validate() error

type PrefixListEntrySlice added in v1.8.1

type PrefixListEntrySlice []*PrefixListEntry

func (PrefixListEntrySlice) Add added in v1.8.1

type PrefixListMaster added in v1.8.1

type PrefixListMaster struct {
	PrefixLists map[string]*PrefixList `json:"prefix-lists"`
}

func NewPrefixListMaster added in v1.8.1

func NewPrefixListMaster() *PrefixListMaster

func PrefixListMasterFromJSON added in v1.8.1

func PrefixListMasterFromJSON(cfg *config.PrefixLists) *PrefixListMaster

func (*PrefixListMaster) Delete added in v1.8.1

func (m *PrefixListMaster) Delete(name string)

func (*PrefixListMaster) DescriptionSet added in v1.8.1

func (m *PrefixListMaster) DescriptionSet(name string, desc string)

func (*PrefixListMaster) DescriptionUnset added in v1.8.1

func (m *PrefixListMaster) DescriptionUnset(name string, desc string)

func (*PrefixListMaster) EntryAdd added in v1.8.1

func (m *PrefixListMaster) EntryAdd(name string, entry *PrefixListEntry) error

func (*PrefixListMaster) EntryDelete added in v1.8.1

func (m *PrefixListMaster) EntryDelete(name string, entry *PrefixListEntry)

func (*PrefixListMaster) Get added in v1.8.1

func (m *PrefixListMaster) Get(name string) *PrefixList

func (*PrefixListMaster) Lookup added in v1.8.1

func (m *PrefixListMaster) Lookup(name string) *PrefixList

type PrefixListOption added in v1.8.1

type PrefixListOption func(*PrefixListEntry)

func WithEq added in v1.8.1

func WithEq(val int) PrefixListOption

func WithGe added in v1.8.1

func WithGe(val int) PrefixListOption

func WithLe added in v1.8.1

func WithLe(val int) PrefixListOption

type RouteMap added in v1.8.1

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

func (*RouteMap) Match added in v1.8.1

func (rmap *RouteMap) Match(p, r interface{}) bool

func (*RouteMap) RouteMapEntryAdd added in v1.8.1

func (rmap *RouteMap) RouteMapEntryAdd(ent *RouteMapEntry)

type RouteMapAction added in v1.8.1

type RouteMapAction interface {
	Action(interface{}, interface{})
}

type RouteMapEntry added in v1.8.1

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

func NewRouteMapEntry added in v1.8.1

func NewRouteMapEntry(typ Action, seq uint32) *RouteMapEntry

func (*RouteMapEntry) Action added in v1.8.1

func (ent *RouteMapEntry) Action(p, r interface{})

func (*RouteMapEntry) Match added in v1.8.1

func (ent *RouteMapEntry) Match(p, r interface{}) bool

func (*RouteMapEntry) MatchAdd added in v1.8.1

func (rmap *RouteMapEntry) MatchAdd(name string, args ...string)

type RouteMapMaster added in v1.8.1

type RouteMapMaster struct {
	Map map[string]*RouteMap
}

func NewRouteMapMaster added in v1.8.1

func NewRouteMapMaster() *RouteMapMaster

func (*RouteMapMaster) RouteMapEntryGet added in v1.8.1

func (m *RouteMapMaster) RouteMapEntryGet(name string, typ Action, seq uint32) *RouteMapEntry

func (*RouteMapMaster) RouteMapLookup added in v1.8.1

func (m *RouteMapMaster) RouteMapLookup(name string) *RouteMap

type RouteMapMatch added in v1.8.1

type RouteMapMatch interface {
	Match(interface{}, interface{}) bool
	MatchAdd(args ...string)
}

Jump to

Keyboard shortcuts

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