cmd

package
v0.0.0-...-65c99c8 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2016 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CMD_GLOBAL         = "global"
	CMD_NEIGHBOR       = "neighbor"
	CMD_POLICY         = "policy"
	CMD_RIB            = "rib"
	CMD_ADD            = "add"
	CMD_DEL            = "del"
	CMD_ALL            = "all"
	CMD_SET            = "set"
	CMD_LOCAL          = "local"
	CMD_ADJ_IN         = "adj-in"
	CMD_ADJ_OUT        = "adj-out"
	CMD_RESET          = "reset"
	CMD_SOFT_RESET     = "softreset"
	CMD_SOFT_RESET_IN  = "softresetin"
	CMD_SOFT_RESET_OUT = "softresetout"
	CMD_SHUTDOWN       = "shutdown"
	CMD_ENABLE         = "enable"
	CMD_DISABLE        = "disable"
	CMD_PREFIX         = "prefix"
	CMD_ASPATH         = "as-path"
	CMD_COMMUNITY      = "community"
	CMD_EXTCOMMUNITY   = "ext-community"
	CMD_IMPORT         = "import"
	CMD_EXPORT         = "export"
	CMD_IN             = "in"
	CMD_MONITOR        = "monitor"
	CMD_MRT            = "mrt"
	CMD_DUMP           = "dump"
	CMD_INJECT         = "inject"
	CMD_RPKI           = "rpki"
	CMD_RPKI_TABLE     = "table"
	CMD_RPKI_SERVER    = "server"
	CMD_VRF            = "vrf"
	CMD_ACCEPTED       = "accepted"
	CMD_REJECTED       = "rejected"
	CMD_STATEMENT      = "statement"
	CMD_CONDITION      = "condition"
	CMD_ACTION         = "action"
	CMD_UPDATE         = "update"
	CMD_ROTATE         = "rotate"
	CMD_BMP            = "bmp"
)

Variables

View Source
var ExtCommNameMap = map[ExtCommType]string{
	ACCEPT:    "accept",
	DISCARD:   "discard",
	RATE:      "rate-limit",
	REDIRECT:  "redirect",
	MARK:      "mark",
	ACTION:    "action",
	RT:        "rt",
	ENCAP:     "encap",
	VALID:     "valid",
	NOT_FOUND: "not-found",
	INVALID:   "invalid",
}
View Source
var ExtCommParserMap = map[ExtCommType]func([]string) ([]bgp.ExtendedCommunityInterface, error){
	ACCEPT:    nil,
	DISCARD:   rateLimitParser,
	RATE:      rateLimitParser,
	REDIRECT:  redirectParser,
	MARK:      markParser,
	ACTION:    actionParser,
	RT:        rtParser,
	ENCAP:     encapParser,
	VALID:     validationParser,
	NOT_FOUND: validationParser,
	INVALID:   validationParser,
}

Functions

func NewBmpCmd

func NewBmpCmd() *cobra.Command

func NewGlobalCmd

func NewGlobalCmd() *cobra.Command

func NewMonitorCmd

func NewMonitorCmd() *cobra.Command

func NewMrtCmd

func NewMrtCmd() *cobra.Command

func NewNeighborCmd

func NewNeighborCmd() *cobra.Command

func NewPolicyCmd

func NewPolicyCmd() *cobra.Command

func NewRPKICmd

func NewRPKICmd() *cobra.Command

func NewRootCmd

func NewRootCmd() *cobra.Command

func NewVrfCmd

func NewVrfCmd() *cobra.Command

func ParseEvpnArgs

func ParseEvpnArgs(args []string) (bgp.AddrPrefixInterface, []string, error)

func ParseEvpnMacAdvArgs

func ParseEvpnMacAdvArgs(args []string) (bgp.AddrPrefixInterface, []string, error)

func ParseEvpnMulticastArgs

func ParseEvpnMulticastArgs(args []string) (bgp.AddrPrefixInterface, []string, error)

func ParseExtendedCommunities

func ParseExtendedCommunities(input string) ([]bgp.ExtendedCommunityInterface, error)

func ParseFlowSpecArgs

func ParseFlowSpecArgs(rf bgp.RouteFamily, args []string) (bgp.AddrPrefixInterface, []string, error)

func ParsePath

func ParsePath(rf bgp.RouteFamily, args []string) (*api.Path, error)

func ShowRoute

func ShowRoute(pathList []*Path, showAge, showBest, showLabel, isMonitor, printHeader bool)

Types

type AsPathFormat

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

type Destination

type Destination struct {
	Prefix string  `json:"prefix"`
	Paths  []*Path `json:"paths"`
}

func ApiStruct2Destination

func ApiStruct2Destination(dst *gobgpapi.Destination) (*Destination, error)

type ExtCommType

type ExtCommType int
const (
	ACCEPT ExtCommType = iota
	DISCARD
	RATE
	REDIRECT
	MARK
	ACTION
	RT
	ENCAP
	VALID
	NOT_FOUND
	INVALID
)

type Path

type Path struct {
	Nlri       bgp.AddrPrefixInterface      `json:"nlri"`
	PathAttrs  []bgp.PathAttributeInterface `json:"attrs"`
	Age        int64                        `json:"age"`
	Best       bool                         `json:"best"`
	IsWithdraw bool                         `json:"isWithdraw"`
	Validation int32                        `json:"validation"`
	Filtered   bool                         `json:"filtered"`
	SourceId   string                       `json:"source-id"`
	NeighborIp string                       `json:"neighbor-ip"`
	Stale      bool                         `json:"stale"`
}

func ApiStruct2Path

func ApiStruct2Path(p *gobgpapi.Path) ([]*Path, error)

type Peer

type Peer struct {
	Conf           PeerConf                 `json:"conf,omitempty"`
	Info           *gobgpapi.PeerState      `json:"info,omitempty"`
	Timers         *gobgpapi.Timers         `json:"timers,omitempty"`
	RouteReflector *gobgpapi.RouteReflector `json:"route_reflector,omitempty"`
	RouteServer    *gobgpapi.RouteServer    `json:"route_server,omitempty"`
}

func ApiStruct2Peer

func ApiStruct2Peer(p *gobgpapi.Peer) *Peer

type PeerConf

type PeerConf struct {
	RemoteIp          net.IP                             `json:"remote_ip,omitempty"`
	Id                net.IP                             `json:"id,omitempty"`
	RemoteAs          uint32                             `json:"remote_as,omitempty"`
	LocalAs           uint32                             `json:"local-as,omitempty"`
	RemoteCap         []bgp.ParameterCapabilityInterface `json:"remote_cap,omitempty"`
	LocalCap          []bgp.ParameterCapabilityInterface `json:"local_cap,omitempty"`
	Holdtime          uint32                             `json:"holdtime,omitempty"`
	KeepaliveInterval uint32                             `json:"keepalive_interval,omitempty"`
	PrefixLimits      []*gobgpapi.PrefixLimit
}

Jump to

Keyboard shortcuts

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