Documentation ¶
Index ¶
- Constants
- Variables
- func ARPHRD2IfType(ARPHRD uint16) uint8
- func ArpDump(ptree *netutil.Ptree)
- func ClientUnregister(conn net.Conn)
- func Config(command int, path []string)
- func ConfigJSON(conf *rpc.ConfigReply)
- func ConfigPrefixListJSON(jsonStr string)
- func ConfigPull(path []string)
- func ConfigPush(path []string)
- func DistanceCalc(typ uint8, subType uint8) uint8
- func DistributeListOspf(dlistName string, p *netutil.Prefix, ri *Rib) policy.Action
- func DistributeListOspfApi(Cmd int, Args cmd.Args) int
- func DtlsNexthop(vrfId uint32, nexthop net.IP) bool
- func EncapTypeString(typ int) string
- func EsiIfAddHook(ifp *Interface)
- func EsiIfAddrAddHook(ifp *Interface, ifaddr *netutil.Prefix)
- func EsiIfAddrDeleteHook(ifp *Interface, ifaddr *netutil.Prefix)
- func EsiIfMask(addr net.IP) int
- func EsiNetlinkDoneHook()
- func EsiNewServerHook()
- func EsiNexthopLookup(vrf *Vrf, nexthop net.IP) bool
- func EsiShutdownSkipHook(ifp *Interface) bool
- func EtcdIf(ifName string, ifp *Interface) string
- func EtcdSetIfStatus(ifname string, up bool, running bool)
- func HandleBody(client *Client, h *Header, len int) error
- func HardwareAddrSet(ifp *Interface, hwaddr net.HardwareAddr) error
- func HeaderSize(version uint8) int
- func IPv4RouteApi(Cmd int, Args cmd.Args) int
- func IPv4RouteSeg6SegmentsApi(Cmd int, Args cmd.Args) int
- func IPv4VrfRouteApi(Cmd int, Args cmd.Args) int
- func IPv4VrfRouteApi2(Cmd int, Args cmd.Args) int
- func IPv6RouteApi(Cmd int, Args cmd.Args) int
- func IPv6RouteSeg6SegmentsApi(Cmd int, Args cmd.Args) int
- func IPv6VrfRouteApi(Cmd int, Args cmd.Args) int
- func IfAdd(ifi *IfInfo)
- func IfAddrAdd(ai *IfAddrInfo)
- func IfAddrClean()
- func IfAddrDelete(ai *IfAddrInfo)
- func IfDelete(ifi *IfInfo)
- func IfDownRibRemove(ifp *Interface)
- func IfFlagsString(flags uint32) string
- func IfForceUp(ifName string)
- func IfNameByIndex(index IfIndex) string
- func IfRegister(ifp *Interface)
- func IfStatsScan(version int, buf string, stats *IfStats)
- func IfStatsUpdate()
- func IfStatusNotifyEtcd(ifname string, up bool, running bool)
- func IfSync(ifp *Interface, ifi *IfInfo)
- func IfUnregister(ifp *Interface)
- func IfUpRibAdd(ifp *Interface)
- func IfUpdate(ifi *IfInfo)
- func IfVrfString(vrfId uint32) string
- func InitAPI()
- func InterfaceAddress(Cmd int, Args cmd.Args) int
- func InterfaceConfigPush()
- func InterfaceConfigSync(ifp *Interface, ifc *InterfaceConfig)
- func InterfaceDescription(Cmd int, Args cmd.Args) int
- func InterfaceIterate(f func(*Interface))
- func InterfaceMtu(Cmd int, Args cmd.Args) int
- func InterfaceShow(jsonFlag bool, Args ...string) string
- func InterfaceShowBrief(afi int) (line string)
- func InterfaceShutdown(Cmd int, Args cmd.Args) int
- func InterfaceSyncWithConfig()
- func InterfaceVlanApi(Cmd int, Args cmd.Args) int
- func InterfaceVrfApi(Cmd int, Args cmd.Args) int
- func IsLanInterface(ifName string) bool
- func LanFileMonitor(fileName string)
- func LanInterfaceMonitorStart()
- func LinkSetDown(ifp *Interface) error
- func LinkSetMtu(ifp *Interface, mtu uint32) error
- func LinkSetUp(ifp *Interface) error
- func MessageString(m uint8) string
- func NeighFlagString(flag uint8) string
- func NeighStateString(state uint16) string
- func NetlinkDumpAndSubscribe(inst *Server) error
- func NetlinkIpAddrAdd(ifp *Interface, p *netutil.Prefix)
- func NetlinkIpAddrDelete(ifp *Interface, p *netutil.Prefix)
- func NetlinkRouteAdd(p *netutil.Prefix, rib *Rib, vrfId uint32) error
- func NetlinkRouteDelete(p *netutil.Prefix, rib *Rib, vrfId uint32) error
- func NetlinkVlanAdd(name string, vlanId int, parentIndex int)
- func NetlinkVlanDelete(name string, vlanId int)
- func NetlinkVrfAdd(name string, table uint32)
- func NetlinkVrfBindInterface(ifname string, ifindex IfIndex, master IfIndex) error
- func NetlinkVrfDelete(name string, table uint32)
- func NetlinkVrfUnbindInterface(ifname string, ifindex IfIndex)
- func NewAddress(addr *IfAddr) *pb.Address
- func NewInterfaceAddrUpdate(op pb.Op, ifp *Interface, addr *IfAddr) *pb.InterfaceUpdate
- func NewInterfaceUpdate(op pb.Op, ifp *Interface) *pb.InterfaceUpdate
- func NewInterfaceUpdateFull(op pb.Op, ifp *Interface) *pb.InterfaceUpdate
- func NewPrefixFromPb(p *pb.Prefix) *netutil.Prefix
- func NewRpcPeer(s *Server) *rpcPeer
- func NewRpcServer(s *Server) *rpcServer
- func NexthopEncode(rib *Rib) []*pb.Nexthop
- func NotifyInterfaces(w Watcher, vrf *Vrf)
- func NotifyRouterId(w Watcher, vrf *Vrf)
- func PeerId(vrfId string, nexthop string) string
- func PrefixFilter(p *netutil.Prefix, r *pb.Route) bool
- func ResourceHandler(resource Resource) http.HandlerFunc
- func RibAdd(vrfId uint32, p *netutil.Prefix, ri *Rib)
- func RibClearSrc(src interface{})
- func RibDelete(vrfId uint32, p *netutil.Prefix, ri *Rib)
- func RibShow(vrfName string, t *ShowTask)
- func RibStringType(str string) uint8
- func RibTypeFromRouteType(typ uint8) (uint8, int)
- func RibTypeString(typ uint8) string
- func RibWalker()
- func RouteType2RibType(t RouteType) uint8
- func RouterIdApi(Cmd int, Args cmd.Args) int
- func RpcConfig(conf *rpc.ConfigReply)
- func RpcRegister()
- func RpcServer()
- func Seg6LocalEndApi(Cmd int, Args cmd.Args) int
- func Seg6LocalEndB6Api(Cmd int, Args cmd.Args) int
- func Seg6LocalEndB6EncapsApi(Cmd int, Args cmd.Args) int
- func Seg6LocalEndDT6Api(Cmd int, Args cmd.Args) int
- func Seg6LocalEndDX2Api(Cmd int, Args cmd.Args) int
- func Seg6LocalEndDX4Api(Cmd int, Args cmd.Args) int
- func Seg6LocalEndDX6Api(Cmd int, Args cmd.Args) int
- func Seg6LocalEndTApi(Cmd int, Args cmd.Args) int
- func Seg6LocalEndXApi(Cmd int, Args cmd.Args) int
- func ShowInterface(t *ShowTask, Args []interface{})
- func ShowInterfaceVrf(t *ShowTask, Args []interface{})
- func ShowIpInterfaceBrief(t *ShowTask, Args []interface{})
- func ShowIpRoute(t *ShowTask, Args []interface{})
- func ShowIpRouteDatabase(t *ShowTask, Args []interface{})
- func ShowIpRouteType(t *ShowTask, Args []interface{})
- func ShowIpRouteVrf(t *ShowTask, Args []interface{})
- func ShowIpRouteVrfDatabase(t *ShowTask, Args []interface{})
- func ShowIpRouteVrfType(t *ShowTask, Args []interface{})
- func ShowIpv6InterfaceBrief(t *ShowTask, Args []interface{})
- func ShowIpv6Route(t *ShowTask, Args []interface{})
- func ShowIpv6RouteDatabase(t *ShowTask, Args []interface{})
- func ShowIpv6RouteVrf(t *ShowTask, Args []interface{})
- func ShowIpv6RouteVrfDatabase(t *ShowTask, Args []interface{})
- func ShowRibdNumGoroutine(t *ShowTask, Args []interface{})
- func ShowRouterId(t *ShowTask, Args []interface{})
- func ShowRouterIdVrf(t *ShowTask, Args []interface{})
- func TapAdd(name string) (*os.File, error)
- func TapDelete(name string) error
- func TunnelProbe(vrfId string, peerId string) bool
- func VIFClean()
- func VlanApi(Cmd int, Args cmd.Args) int
- func VrfApi(Cmd int, Args cmd.Args) int
- func VrfAssignIndex() uint32
- func VrfDefaultZservStart()
- func VrfExtractIndex(name string) uint32
- func VrfFilter(c *Client, r *pb.Route) bool
- func VrfHubNodeAdd(vrf string, hubNode string)
- func VrfHubNodeApi(Cmd int, Args cmd.Args) int
- func VrfHubNodeDelete(vrf string, hubNode string)
- func VrfStop()
- func WaitAsync(errCh chan error) error
- func WatcherDone(v *Vrf, w *IfWatcher, err error)
- func WatcherNotifyAddressAdd(ifp *Interface, addr *IfAddr)
- func WatcherNotifyAddressDelete(ifp *Interface, addr *IfAddr)
- func ZServerStop(s *ZServer)
- type Body
- type Client
- func (c *Client) HandleRequest(conn net.Conn, vrfId uint32)
- func (c *Client) InterfaceNotify(mes *pb.InterfaceUpdate)
- func (c *Client) Notify(mes interface{})
- func (c *Client) RouteNotify(r *pb.Route)
- func (c *Client) RouteNotifyGobgp(p *netutil.Prefix, r *pb.Route)
- func (c *Client) RouterIdUpdateNotify(mes *pb.RouterIdUpdate)
- type CommandType
- type EncapSEG6
- type EncapSEG6Local
- type EtcdIfStatus
- type EtcdIfStatusIPv6
- type FLAG
- type Fn
- type GrpcComponent
- type Header
- type HelloBody
- type INTERFACE_STATUS
- type IPv4NexthopLookupBody
- type IPv4NexthopReplyBody
- type IfAddr
- type IfAddrFlag
- type IfAddrInfo
- type IfAddrSlice
- type IfIndex
- type IfInfo
- type IfShow
- type IfStats
- type IfStatsYang
- type IfWatcher
- type IfcFlag
- type Interface
- func (ifp *Interface) IsBroadcast() bool
- func (ifp *Interface) IsLoopback() bool
- func (ifp *Interface) IsRunning() bool
- func (ifp *Interface) IsUp() bool
- func (ifp *Interface) NotifyInterface(op pb.Op)
- func (ifp *Interface) NotifyInterfaceAdd()
- func (ifp *Interface) NotifyInterfaceDelete()
- func (ifp *Interface) NotifyInterfaceDown()
- func (ifp *Interface) NotifyInterfaceFlagChange()
- func (ifp *Interface) NotifyInterfaceMtuChange()
- func (ifp *Interface) NotifyInterfaceNameChange()
- func (ifp *Interface) NotifyInterfaceUp()
- func (ifp *Interface) Show(jsonFlag bool) string
- func (ifp *Interface) ShowStats() string
- func (ifp *Interface) UnregisterVIF(vlanId uint64) *VIF
- func (ifp *Interface) VIFLookup(vlanId uint64) *VIF
- type InterfaceAddressUpdateBody
- type InterfaceConfig
- func (ifc *InterfaceConfig) AddrAdd(ifName string, addr *netutil.Prefix) error
- func (ifc *InterfaceConfig) AddrDelete(ifName string, addr *netutil.Prefix) error
- func (ifc *InterfaceConfig) DescriptionSet(desc string)
- func (ifc *InterfaceConfig) DescriptionUnset()
- func (ifc *InterfaceConfig) MtuSet(mtu uint32)
- func (ifc *InterfaceConfig) MtuSync(ifp *Interface)
- func (ifc *InterfaceConfig) MtuUnset()
- func (ifc *InterfaceConfig) ShutdownSet()
- func (ifc *InterfaceConfig) ShutdownSync(ifp *Interface)
- func (ifc *InterfaceConfig) ShutdownUnset()
- func (ifc *InterfaceConfig) Sync(flags IfcFlag)
- type InterfaceUpdateBody
- type InterfacesStateHandler
- type LanForwardingTable
- type Message
- type NEXTHOP_FLAG
- type Ndmsg
- type Neigh
- type Nexthop
- func (n *Nexthop) AddressString() string
- func (n *Nexthop) Equal(nn *Nexthop) bool
- func (n *Nexthop) InterfaceString() string
- func (n *Nexthop) IsAddrIf() bool
- func (n *Nexthop) IsAddrOnly() bool
- func (n *Nexthop) IsIfOnly() bool
- func (n *Nexthop) MarshalJSON() ([]byte, error)
- func (n Nexthop) String() string
- type NexthopInfo
- type RedistributeBody
- type RedistributeDefaultBody
- type Resource
- type ResourceBase
- func (ResourceBase) Delete(url string, queries url.Values) (Status, interface{})
- func (ResourceBase) Get(url string, queries url.Values) (Status, interface{})
- func (ResourceBase) Post(url string, queries url.Values) (Status, interface{})
- func (ResourceBase) Put(url string, queries url.Values) (Status, interface{})
- type RestComponent
- type Rib
- func (r *Rib) CheckFlag(flag RibFlag) bool
- func (rib *Rib) Equal(ri *Rib) bool
- func (r *Rib) HasDistance() bool
- func (r *Rib) HasMetric() bool
- func (r *Rib) IsDelete() bool
- func (r *Rib) IsFib() bool
- func (r *Rib) IsResolved() bool
- func (r *Rib) IsSelected() bool
- func (r *Rib) IsSelectedFib() bool
- func (r *Rib) IsSystem() bool
- func (r *Rib) MarshalJSON() ([]byte, error)
- func (r *Rib) SetDelete()
- func (r *Rib) SetFib()
- func (r *Rib) SetFlag(flag RibFlag)
- func (r *Rib) SetResolved()
- func (r *Rib) SetSelected()
- func (r *Rib) String() string
- func (r *Rib) UnsetDelete()
- func (r *Rib) UnsetFib()
- func (r *Rib) UnsetFlag(flag RibFlag)
- func (r *Rib) UnsetResolved()
- func (r *Rib) UnsetSelected()
- type RibFlag
- type RibShowParam
- type RibSlice
- type RouteInfo
- type RouteType
- type RouteUpdateBody
- type RouterId
- type RouterIdUpdateBody
- type RpcComponent
- type SAFI
- type Server
- func (s *Server) AddrAdd(ifName string, addr *netutil.Prefix) error
- func (s *Server) AddrDelete(ifName string, addr *netutil.Prefix) error
- func (s *Server) IfVrfBind(ifName string, vrfName string) error
- func (s *Server) IfVrfUnbind(ifName string, vrfName string) error
- func (s *Server) InterfaceSubscribe(w Watcher, vrfId uint32) error
- func (s *Server) InterfaceUnsubscribe(w Watcher, vrfId uint32) error
- func (s *Server) PrefixListLookup(plistName string) *policy.PrefixList
- func (s *Server) PrefixListMasterSet(pm *policy.PrefixListMaster) error
- func (s *Server) PrefixListOut() *policy.PrefixList
- func (s *Server) PrefixListOutAdd(entry *policy.PrefixListEntry)
- func (s *Server) RedistDefaultSubscribe(w Watcher, allVrf bool, vrfId uint32, afi int) error
- func (s *Server) RedistDefaultUnsubscribe(w Watcher, allVrf bool, vrfId uint32, afi int) error
- func (s *Server) RedistSubscribe(w Watcher, allVrf bool, vrfId uint32, afi int, typ uint8) error
- func (s *Server) RedistUnsubscribe(w Watcher, allVrf bool, vrfId uint32, afi int, typ uint8) error
- func (s *Server) RouterIdSubscribe(w Watcher, vrfId uint32) error
- func (s *Server) RouterIdUnsubscribe(w Watcher, vrfId uint32) error
- func (s *Server) Serv()
- func (s *Server) Start() component.Component
- func (s *Server) StaticAdd(prefix *netutil.Prefix, nexthop net.IP) error
- func (s *Server) StaticDelete(prefix *netutil.Prefix, nexthop net.IP) error
- func (s *Server) StaticSeg6LocalAdd(prefix *netutil.Prefix, nexthop net.IP, seg6local EncapSEG6Local) error
- func (s *Server) StaticSeg6LocalDelete(prefix *netutil.Prefix, nexthop net.IP, seg6local EncapSEG6Local) error
- func (s *Server) StaticSeg6SegmentsAdd(prefix *netutil.Prefix, nexthop net.IP, mode string, segs []net.IP) error
- func (s *Server) StaticSeg6SegmentsDelete(prefix *netutil.Prefix, nexthop net.IP, mode string, segs []net.IP) error
- func (s *Server) Stop() component.Component
- func (s *Server) VIFAdd(ifName string, vlanId uint64) error
- func (s *Server) VIFDelete(ifName string, vlanId uint64) error
- func (s *Server) VrfAdd(vrfName string) error
- func (s *Server) VrfDelete(vrfName string) error
- func (s *Server) VrfDistributeListOspfAdd(vrfName string, dlistName string) error
- func (s *Server) VrfDistributeListOspfDelete(vrfName string, dlistName string) error
- func (s *Server) WatcherUnsubscribe(w Watcher) error
- type ShowFunc
- type ShowServer
- type ShowTask
- type Static
- type Status
- type VIF
- type Vlan
- type Vrf
- func (v *Vrf) AfiPtree(p *netutil.Prefix) *netutil.Ptree
- func (v *Vrf) ArpAdd(neigh *Neigh)
- func (v *Vrf) ArpDelete(neigh *Neigh)
- func (v *Vrf) ArpTable(neigh *Neigh) *netutil.Ptree
- func (v *Vrf) FibAdd(p *netutil.Prefix, rib *Rib)
- func (v *Vrf) FibDelete(p *netutil.Prefix, rib *Rib)
- func (v *Vrf) IfLookupByIndex(index IfIndex) *Interface
- func (v *Vrf) IfLookupByName(name string) *Interface
- func (v *Vrf) IfName(index IfIndex) string
- func (v *Vrf) IfRegister(ifp *Interface)
- func (v *Vrf) IfUnregister(ifp *Interface)
- func (v *Vrf) IfWatchAdd(typ int, ifName string, errCh chan error) *IfWatcher
- func (v *Vrf) InterfaceIterate(f func(*Interface))
- func (v *Vrf) InterfaceShow(jsonFlag bool, Args ...string) (line string)
- func (v *Vrf) IsValid(rib *Rib) bool
- func (vrf *Vrf) NotifyRouterId()
- func (v *Vrf) RedistAdd(p *netutil.Prefix, rib *Rib)
- func (vrf *Vrf) RedistDefaultSync(w Watcher, afi int)
- func (v *Vrf) RedistDelete(p *netutil.Prefix, rib *Rib)
- func (vrf *Vrf) RedistSync(w Watcher, afi int, typ uint8)
- func (v *Vrf) Redistribute(op pb.Op, p *netutil.Prefix, rib *Rib)
- func (v *Vrf) Resolve(ri *Rib)
- func (vrf *Vrf) Rib2Route(op pb.Op, p *netutil.Prefix, rib *Rib) *pb.Route
- func (v *Vrf) RibAdd(p *netutil.Prefix, ri *Rib)
- func (v *Vrf) RibClean(src interface{})
- func (v *Vrf) RibDelete(p *netutil.Prefix, ri *Rib)
- func (v *Vrf) RibProcess(p *netutil.Prefix, ribs RibSlice, dels []*Rib, resolve bool)
- func (v *Vrf) RibShow(t *ShowTask)
- func (v *Vrf) RibShowEntryJson(t *ShowTask, p *RibShowParam, rib *Rib)
- func (v *Vrf) RibShowIPv4Entry(t *ShowTask, rib *Rib, database bool)
- func (v *Vrf) RibShowIPv4Nexthop(rib *Rib, n *Nexthop, offset int, out io.Writer)
- func (v *Vrf) RibShowIPv6Entry(t *ShowTask, rib *Rib, database bool)
- func (v *Vrf) RibSync(afi int)
- func (v *Vrf) RibWalker(af int)
- func (v *Vrf) RouterId() net.IP
- func (v *Vrf) RouterIdAdd(ifp *Interface, addr *IfAddr)
- func (v *Vrf) RouterIdDelete(ifp *Interface, addr *IfAddr)
- func (v *Vrf) RouterIdSet(id net.IP)
- func (v *Vrf) RouterIdShow() string
- func (v *Vrf) RouterIdUnset()
- func (v *Vrf) RouterIdUpdate()
- func (v *Vrf) StaticAdd(p *netutil.Prefix, naddr net.IP) error
- func (v *Vrf) StaticDelete(p *netutil.Prefix, naddr net.IP) error
- func (v *Vrf) StaticSeg6LocalAdd(p *netutil.Prefix, naddr net.IP, seg6local EncapSEG6Local) error
- func (v *Vrf) StaticSeg6LocalDelete(p *netutil.Prefix, naddr net.IP, seg6local EncapSEG6Local) error
- func (v *Vrf) StaticSeg6SegmentsAdd(p *netutil.Prefix, naddr net.IP, mode string, segs []net.IP) error
- func (v *Vrf) StaticSeg6SegmentsDelete(p *netutil.Prefix, naddr net.IP, mode string, segs []net.IP) error
- type Watcher
- type WatcherRedist
- type Watchers
- type ZServer
Constants ¶
View Source
const ( CliSuccess = iota CliSuccessExec CliSuccessShow )
View Source
const ( IF_TYPE_UNKNOWN uint8 = iota IF_TYPE_ETHERNET IF_TYPE_LOOPBACK IF_TYPE_HDLC IF_TYPE_PPP IF_TYPE_ATM IF_TYPE_FRELAY IF_TYPE_VLAN IF_TYPE_IPIP IF_TYPE_IPGRE IF_TYPE_IP6GRE IF_TYPE_IP6IP )
View Source
const ( IF_WATCH_REGISTER = iota IF_WATCH_UNREGISTER )
View Source
const ( IFC_FLAG_SHUTDOWN = 1 << iota IFC_FLAG_MTU IFC_FLAG_DESCRIPTION )
View Source
const ( NDA_UNSPEC = iota NDA_DST NDA_LLADDR NDA_CACHEINFO NDA_PROBES NDA_VLAN NDA_PORT NDA_VNI NDA_IFINDEX NDA_MAX = NDA_IFINDEX )
View Source
const ( NUD_NONE = 0x00 NUD_INCOMPLETE = 0x01 NUD_REACHABLE = 0x02 NUD_STALE = 0x04 NUD_DELAY = 0x08 NUD_PROBE = 0x10 NUD_FAILED = 0x20 NUD_NOARP = 0x40 NUD_PERMANENT = 0x80 )
Neighbor Cache Entry States.
View Source
const ( NTF_USE = 0x01 NTF_SELF = 0x02 NTF_MASTER = 0x04 NTF_PROXY = 0x08 NTF_ROUTER = 0x80 )
Neighbor Flags
View Source
const ( SizeOfIfReq = 40 IFNAMSIZ = 16 TUN_DEV = "/dev/net/tun" )
View Source
const ( RULE_SELECTOR_IIF = iota RULE_SELECTOR_OIF )
Netlink VRF
View Source
const ( AFI_IP = iota AFI_IP6 AFI_MAX )
View Source
const ( RIB_UNKNOWN uint8 = iota RIB_KERNEL RIB_CONNECTED RIB_STATIC RIB_RIP RIB_OSPF RIB_ISIS RIB_BGP RIB_MAX )
View Source
const ( RIB_SUB_OSPF_IA uint8 = iota RIB_SUB_OSPF_NSSA_1 RIB_SUB_OSPF_NSSA_2 RIB_SUB_OSPF_EXTERNAL_1 RIB_SUB_OSPF_EXTERNAL_2 RIB_SUB_BGP_IBGP RIB_SUB_BGP_EBGP RIB_SUB_BGP_CONFED RIB_SUB_ISIS_L1 RIB_SUB_ISIS_L2 RIB_SUB_ISIS_IA )
View Source
const ( DISTANCE_KERNEL = 0 DISTANCE_CONNECTED = 0 DISTANCE_STATIC = 1 DISTANCE_RIP = 120 DISTANCE_OSPF = 110 DISTANCE_ISIS = 115 DISTANCE_EBGP = 20 DISTANCE_IBGP = 200 DISTNACE_INFINITY = 255 )
View Source
const ( RouterIdTypeUnset = iota RouterIdTypeConfig RouterIdTypeLoopback RouterIdTypeAutomatic )
View Source
const ( VRF_ID_MIN = 1 VRF_ID_MAX = 253 VRF_TABLE_SIZE = 254 )
View Source
const ( WATCH_TYPE_INTERFACE = 0 WATCH_TYPE_ROUTER_ID = 1 WATCH_TYPE_REDIST = 2 WATCH_TYPE_REDIST_DEFAULT = 3 WATCH_TYPE_MAX = 4 )
View Source
const ( HEADER_V2_LEN = 6 HEADER_V3_V4_LEN = 8 )
View Source
const ( INTERFACE_ACTIVE = 0x01 INTERFACE_SUB = 0x02 INTERFACE_LINKDETECTION = 0x04 )
View Source
const ( ZEBRA_LLT_UNKNOWN = iota ZEBRA_LLT_ETHER ZEBRA_LLT_EETHER ZEBRA_LLT_AX25 ZEBRA_LLT_PRONET ZEBRA_LLT_IEEE802 ZEBRA_LLT_ARCNET ZEBRA_LLT_APPLETLK ZEBRA_LLT_DLCI ZEBRA_LLT_ATM ZEBRA_LLT_METRICOM ZEBRA_LLT_IEEE1394 ZEBRA_LLT_EUI64 ZEBRA_LLT_INFINIBAND ZEBRA_LLT_SLIP ZEBRA_LLT_CSLIP ZEBRA_LLT_SLIP6 ZEBRA_LLT_CSLIP6 ZEBRA_LLT_RSRVD ZEBRA_LLT_ADAPT ZEBRA_LLT_ROSE ZEBRA_LLT_X25 ZEBRA_LLT_PPP ZEBRA_LLT_CHDLC ZEBRA_LLT_LAPB ZEBRA_LLT_RAWHDLC ZEBRA_LLT_IPIP ZEBRA_LLT_IPIP6 ZEBRA_LLT_FRAD ZEBRA_LLT_SKIP ZEBRA_LLT_LOOPBACK ZEBRA_LLT_LOCALTLK ZEBRA_LLT_FDDI ZEBRA_LLT_SIT ZEBRA_LLT_IPDDP ZEBRA_LLT_IPGRE ZEBRA_LLT_IP6GRE ZEBRA_LLT_PIMREG ZEBRA_LLT_HIPPI ZEBRA_LLT_ECONET ZEBRA_LLT_IRDA ZEBRA_LLT_FCPP ZEBRA_LLT_FCAL ZEBRA_LLT_FCPL ZEBRA_LLT_FCFABRIC ZEBRA_LLT_IEEE802_TR ZEBRA_LLT_IEEE80211 ZEBRA_LLT_IEEE80211_RADIOTAP ZEBRA_LLT_IEEE802154 ZEBRA_LLT_IEEE802154_PHY )
View Source
const ( HEADER_MARKER = 255 INTERFACE_NAMSIZ = 20 )
View Source
const ( MESSAGE_NEXTHOP = 0x01 MESSAGE_IFINDEX = 0x02 MESSAGE_DISTANCE = 0x04 MESSAGE_METRIC = 0x08 MESSAGE_MTU = 0x10 MESSAGE_TAG = 0x20 MESSAGE_PATH_ID = 0x40 MESSAGE_ASPATH = 0x80 )
View Source
const (
GrpcConnRetryInterval = 5
)
View Source
const IFC_FLAG_MAX = 32
View Source
const IfShowTemplate = `` /* 409-byte string literal not displayed */
Variables ¶
View Source
var ( ArpAddHook func(int, net.IP, net.HardwareAddr) ArpDeleteHook func(int, net.IP, net.HardwareAddr) )
View Source
var ( LanInterfaceTable LanForwardingTable LanInterfaceFound bool LanInterfaceMutex sync.RWMutex )
View Source
var ( GrpcConn *grpc.ClientConn GrpcCommitCount int )
View Source
var ( IfTable = netutil.NewPtree(32) IfMap = map[string]*Interface{} IfMutex sync.Mutex )
View Source
var ( VlanAddHook func(uint16, *InterfaceConfig) int VlanDeleteHook func(uint16, *InterfaceConfig) int VlanTapHook func(uint16, []byte, int) )
View Source
var ( VrfTable = [VRF_TABLE_SIZE]*Vrf{} VrfMap = map[string]*Vrf{} VrfMutex sync.RWMutex )
View Source
var AddPathDefault bool
View Source
var CommandTypeMap = map[CommandType]string{ INTERFACE_ADD: "INTERFACE_ADD", INTERFACE_DELETE: "INTERFACE_DELETE", INTERFACE_ADDRESS_ADD: "INTERFACE_ADDRESS_ADD", INTERFACE_ADDRESS_DELETE: "INTERFACE_ADDRESS_DELETE", INTERFACE_UP: "INTERFACE_UP", INTERFACE_DOWN: "INTERFACE_DOWN", IPV4_ROUTE_ADD: "IPV4_ROUTE_ADD", IPV4_ROUTE_DELETE: "IPV4_ROUTE_DELETE", IPV6_ROUTE_ADD: "IPV6_ROUTE_ADD", IPV6_ROUTE_DELETE: "IPV6_ROUTE_DELETE", REDISTRIBUTE_ADD: "REDISTRIBUTE_ADD", REDISTRIBUTE_DELETE: "REDISTRIBUTE_DELETE", REDISTRIBUTE_DEFAULT_ADD: "REDISTRIBUTE_DEFAULT_ADD", REDISTRIBUTE_DEFAULT_DELETE: "REDISTRIBUTE_DEFAULT_DELETE", IPV4_NEXTHOP_LOOKUP: "IPV4_NEXTHOP_LOOKUP", IPV6_NEXTHOP_LOOKUP: "IPV6_NEXTHOP_LOOKUP", IPV4_IMPORT_LOOKUP: "IPV4_IMPORT_LOOKUP", IPV6_IMPORT_LOOKUP: "IPV6_IMPORT_LOOKUP", INTERFACE_RENAME: "INTERFACE_RENAME", ROUTER_ID_ADD: "ROUTER_ID_ADD", ROUTER_ID_DELETE: "ROUTER_ID_DELETE", ROUTER_ID_UPDATE: "ROUTER_ID_UPDATE", HELLO: "HELLO", INTERFACE_LINK_PARAMS: "INTERFACE_LINK_PARAMS", NEXTHOP_REGISTER: "NEXTHOP_REGISTER", NEXTHOP_UNREGISTER: "NEXTHOP_UNREGISTER", NEXTHOP_UPDATE: "NEXTHOP_UPDATE", }
View Source
var (
DefaultVrfProtect = false
)
View Source
var (
HardwareAddrSetHook func(int, []byte)
)
View Source
var HubNodeMap = map[uint32]string{}
View Source
var IfAddHook func(ifp *Interface)
View Source
var IfAddrAddHook func(ifp *Interface, ifaddr *netutil.Prefix)
View Source
var IfAddrDeleteHook func(ifp *Interface, ifaddr *netutil.Prefix)
View Source
var IfForceUpFlag bool
View Source
var IfStatusChangeHook func(string, bool, bool)
View Source
var IfTypeStringMap = map[uint8]string{ IF_TYPE_UNKNOWN: "Unknown", IF_TYPE_ETHERNET: "Ethernet", IF_TYPE_LOOPBACK: "Loopback", IF_TYPE_HDLC: "HDLC", IF_TYPE_PPP: "PPP", IF_TYPE_ATM: "ATM", IF_TYPE_FRELAY: "Frame Relay", IF_TYPE_VLAN: "VLAN", IF_TYPE_IPIP: "IP over IP Tunnel", IF_TYPE_IPGRE: "IP over GRE Tunnel", IF_TYPE_IP6GRE: "IPv6 over GRE Tunnel", IF_TYPE_IP6IP: "IPv6 over IP Tunnel", }
View Source
var InterfaceConfigMap = map[string]*InterfaceConfig{}
View Source
var InterfaceVlanBindHook func(int, int)
View Source
var InterfaceVlanFea bool
View Source
var LocalPolicy = false
View Source
var NetlinkDoneHook func()
View Source
var NetlinkIPv4AddressEnsure = false
View Source
var (
NewServerHook func()
)
View Source
var NexthopFlagMap = map[NEXTHOP_FLAG]string{ NEXTHOP_IFINDEX: "NEXTHOP_IFINDEX", NEXTHOP_IFNAME: "NEXTHOP_IFNAME", NEXTHOP_IPV4: "NEXTHOP_IPV4", NEXTHOP_IPV4_IFINDEX: "NEXTHOP_IPV4_IFINDEX", NEXTHOP_IPV4_IFNAME: "NEXTHOP_IPV4_IFNAME", NEXTHOP_IPV6: "NEXTHOP_IPV6", NEXTHOP_IPV6_IFINDEX: "NEXTHOP_IPV6_IFINDEX", NEXTHOP_IPV6_IFNAME: "NEXTHOP_IPV6_IFNAME", NEXTHOP_BLACKHOLE: "NEXTHOP_BLACKHOLE", }
View Source
var NexthopLookupHook func(vrf *Vrf, nexthop net.IP) bool
View Source
var NoVRFDelete bool
View Source
var Parser *cmd.Node
View Source
var Redist [AFI_MAX]WatcherRedist
For all VRF redistribute.
View Source
var RibShowHeader = `` /* 311-byte string literal not displayed */
View Source
var RibShowHeaderDB = ` > - selected route, * - FIB route
`
View Source
var RouteTypeStringMap = map[RouteType]string{ ROUTE_SYSTEM: "system", ROUTE_KERNEL: "kernel", ROUTE_CONNECT: "connect", ROUTE_STATIC: "static", ROUTE_RIP: "rip", ROUTE_RIPNG: "ripng", ROUTE_OSPF: "ospf", ROUTE_OSPF6: "ospf3", ROUTE_ISIS: "isis", ROUTE_BGP: "bgp", ROUTE_HSLS: "hsls", ROUTE_OLSR: "olsr", ROUTE_BABEL: "babel", }
View Source
var RouterIdTypeMap = map[int]string{ RouterIdTypeUnset: "router id not set", RouterIdTypeConfig: "configured", RouterIdTypeLoopback: "automatic from looback", RouterIdTypeAutomatic: "automatic", }
View Source
var ShowParser *cmd.Node
View Source
var ShutdownSkipHook func(ifp *Interface) bool
View Source
var Stream struct { // contains filtered or unexported fields }
View Source
var VlanDB = &vlanDB{}
Functions ¶
func ARPHRD2IfType ¶
func ClientUnregister ¶
func ConfigJSON ¶ added in v1.8.1
func ConfigJSON(conf *rpc.ConfigReply)
func ConfigPrefixListJSON ¶ added in v1.8.1
func ConfigPrefixListJSON(jsonStr string)
func ConfigPull ¶
func ConfigPull(path []string)
func ConfigPush ¶
func ConfigPush(path []string)
func DistanceCalc ¶ added in v1.8.1
func DistributeListOspf ¶ added in v1.8.1
func EncapTypeString ¶ added in v1.8.1
Encap Helper functions for LWT (light weight tunnel)
func EsiIfAddHook ¶
func EsiIfAddHook(ifp *Interface)
func EsiIfAddrAddHook ¶
func EsiIfAddrDeleteHook ¶
func EsiNetlinkDoneHook ¶
func EsiNetlinkDoneHook()
func EsiNewServerHook ¶ added in v1.8.1
func EsiNewServerHook()
func EsiShutdownSkipHook ¶
func EtcdSetIfStatus ¶
func HardwareAddrSet ¶
func HardwareAddrSet(ifp *Interface, hwaddr net.HardwareAddr) error
func HeaderSize ¶
func IPv4RouteSeg6SegmentsApi ¶ added in v1.8.1
func IPv6RouteSeg6SegmentsApi ¶ added in v1.8.1
func IfAddrAdd ¶
func IfAddrAdd(ai *IfAddrInfo)
func IfAddrClean ¶
func IfAddrClean()
func IfAddrDelete ¶
func IfAddrDelete(ai *IfAddrInfo)
func IfDownRibRemove ¶
func IfDownRibRemove(ifp *Interface)
func IfFlagsString ¶
func IfNameByIndex ¶
func IfRegister ¶
func IfRegister(ifp *Interface)
func IfStatsScan ¶
func IfStatsUpdate ¶
func IfStatsUpdate()
func IfStatusNotifyEtcd ¶
func IfUnregister ¶
func IfUnregister(ifp *Interface)
func IfUpRibAdd ¶
func IfUpRibAdd(ifp *Interface)
func IfVrfString ¶
func InterfaceConfigPush ¶
func InterfaceConfigPush()
func InterfaceConfigSync ¶
func InterfaceConfigSync(ifp *Interface, ifc *InterfaceConfig)
func InterfaceIterate ¶
func InterfaceIterate(f func(*Interface))
func InterfaceShow ¶
func InterfaceShowBrief ¶
func InterfaceSyncWithConfig ¶
func InterfaceSyncWithConfig()
func IsLanInterface ¶ added in v1.8.1
func LanFileMonitor ¶ added in v1.8.1
func LanFileMonitor(fileName string)
func LanInterfaceMonitorStart ¶ added in v1.8.1
func LanInterfaceMonitorStart()
func LinkSetDown ¶
func LinkSetMtu ¶
func MessageString ¶
func NeighFlagString ¶
func NeighStateString ¶
func NetlinkDumpAndSubscribe ¶
func NetlinkIpAddrAdd ¶
func NetlinkIpAddrDelete ¶
func NetlinkVlanAdd ¶
func NetlinkVlanDelete ¶
func NetlinkVrfAdd ¶
func NetlinkVrfBindInterface ¶
func NetlinkVrfDelete ¶
func NewAddress ¶ added in v1.8.1
func NewInterfaceAddrUpdate ¶ added in v1.8.1
func NewInterfaceUpdate ¶ added in v1.8.1
func NewInterfaceUpdate(op pb.Op, ifp *Interface) *pb.InterfaceUpdate
func NewInterfaceUpdateFull ¶ added in v1.8.1
func NewInterfaceUpdateFull(op pb.Op, ifp *Interface) *pb.InterfaceUpdate
func NewRpcPeer ¶ added in v1.8.1
func NewRpcPeer(s *Server) *rpcPeer
func NewRpcServer ¶ added in v1.8.1
func NewRpcServer(s *Server) *rpcServer
func NexthopEncode ¶ added in v1.8.1
func NotifyInterfaces ¶ added in v1.8.1
func NotifyRouterId ¶ added in v1.8.1
func ResourceHandler ¶
func ResourceHandler(resource Resource) http.HandlerFunc
func RibClearSrc ¶
func RibClearSrc(src interface{})
func RibStringType ¶
func RibTypeFromRouteType ¶ added in v1.8.1
func RibTypeString ¶
func RouteType2RibType ¶
func RpcConfig ¶
func RpcConfig(conf *rpc.ConfigReply)
func RpcRegister ¶
func RpcRegister()
func Seg6LocalEndB6EncapsApi ¶ added in v1.8.1
func ShowInterface ¶
func ShowInterface(t *ShowTask, Args []interface{})
func ShowInterfaceVrf ¶
func ShowInterfaceVrf(t *ShowTask, Args []interface{})
func ShowIpInterfaceBrief ¶
func ShowIpInterfaceBrief(t *ShowTask, Args []interface{})
func ShowIpRoute ¶
func ShowIpRoute(t *ShowTask, Args []interface{})
func ShowIpRouteDatabase ¶
func ShowIpRouteDatabase(t *ShowTask, Args []interface{})
func ShowIpRouteType ¶
func ShowIpRouteType(t *ShowTask, Args []interface{})
func ShowIpRouteVrf ¶
func ShowIpRouteVrf(t *ShowTask, Args []interface{})
func ShowIpRouteVrfDatabase ¶
func ShowIpRouteVrfDatabase(t *ShowTask, Args []interface{})
func ShowIpRouteVrfType ¶
func ShowIpRouteVrfType(t *ShowTask, Args []interface{})
func ShowIpv6InterfaceBrief ¶
func ShowIpv6InterfaceBrief(t *ShowTask, Args []interface{})
func ShowIpv6Route ¶
func ShowIpv6Route(t *ShowTask, Args []interface{})
func ShowIpv6RouteDatabase ¶
func ShowIpv6RouteDatabase(t *ShowTask, Args []interface{})
func ShowIpv6RouteVrf ¶
func ShowIpv6RouteVrf(t *ShowTask, Args []interface{})
func ShowIpv6RouteVrfDatabase ¶
func ShowIpv6RouteVrfDatabase(t *ShowTask, Args []interface{})
func ShowRibdNumGoroutine ¶ added in v1.8.1
func ShowRibdNumGoroutine(t *ShowTask, Args []interface{})
func ShowRouterId ¶
func ShowRouterId(t *ShowTask, Args []interface{})
func ShowRouterIdVrf ¶ added in v1.8.1
func ShowRouterIdVrf(t *ShowTask, Args []interface{})
func TunnelProbe ¶
func VrfAssignIndex ¶
func VrfAssignIndex() uint32
func VrfDefaultZservStart ¶
func VrfDefaultZservStart()
func VrfExtractIndex ¶
func VrfHubNodeAdd ¶
func VrfHubNodeDelete ¶
func WatcherDone ¶
func WatcherNotifyAddressAdd ¶ added in v1.8.1
func WatcherNotifyAddressDelete ¶ added in v1.8.1
func ZServerStop ¶
func ZServerStop(s *ZServer)
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func ClientRegister ¶
func (*Client) HandleRequest ¶ added in v1.8.1
func (*Client) InterfaceNotify ¶ added in v1.8.1
func (c *Client) InterfaceNotify(mes *pb.InterfaceUpdate)
func (*Client) RouteNotify ¶ added in v1.8.1
func (*Client) RouteNotifyGobgp ¶ added in v1.8.1
func (*Client) RouterIdUpdateNotify ¶ added in v1.8.1
func (c *Client) RouterIdUpdateNotify(mes *pb.RouterIdUpdate)
type CommandType ¶ added in v1.8.1
type CommandType uint16
const ( INTERFACE_ADD CommandType INTERFACE_DELETE INTERFACE_ADDRESS_ADD INTERFACE_ADDRESS_DELETE INTERFACE_UP INTERFACE_DOWN IPV4_ROUTE_ADD IPV4_ROUTE_DELETE IPV6_ROUTE_ADD IPV6_ROUTE_DELETE REDISTRIBUTE_ADD REDISTRIBUTE_DELETE REDISTRIBUTE_DEFAULT_ADD REDISTRIBUTE_DEFAULT_DELETE IPV4_NEXTHOP_LOOKUP IPV6_NEXTHOP_LOOKUP IPV4_IMPORT_LOOKUP IPV6_IMPORT_LOOKUP INTERFACE_RENAME ROUTER_ID_ADD ROUTER_ID_DELETE ROUTER_ID_UPDATE HELLO IPV4_NEXTHOP_LOOKUP_MRIB VRF_UNREGISTER INTERFACE_LINK_PARAMS NEXTHOP_REGISTER NEXTHOP_UNREGISTER NEXTHOP_UPDATE MESSAGE_MAX )
func (CommandType) String ¶ added in v1.8.1
func (c CommandType) String() string
type EncapSEG6Local ¶ added in v1.8.1
type EncapSEG6Local netlink.SEG6LocalEncap
func (EncapSEG6Local) Equal ¶ added in v1.8.1
func (e EncapSEG6Local) Equal(o EncapSEG6Local) bool
func (EncapSEG6Local) String ¶ added in v1.8.1
func (e EncapSEG6Local) String() string
type EtcdIfStatus ¶
type EtcdIfStatus struct { Status string `json:"status"` ProtocolStatus string `json:"protocol_status"` Address string `json:"address,omitempty"` Prefix string `json:"prefix,omitempty"` IPv6 []EtcdIfStatusIPv6 `json:"ipv6,omitempty"` }
type EtcdIfStatusIPv6 ¶ added in v1.8.1
type GrpcComponent ¶
type GrpcComponent struct { }
func NewGrpcComponent ¶
func NewGrpcComponent() *GrpcComponent
func (*GrpcComponent) Start ¶
func (g *GrpcComponent) Start() component.Component
func (*GrpcComponent) Stop ¶
func (g *GrpcComponent) Stop() component.Component
type Header ¶
type Header struct { Length uint16 Marker uint8 Version uint8 VrfId uint16 Command CommandType }
func (*Header) DecodeFromBytes ¶
type HelloBody ¶ added in v1.8.1
type HelloBody struct {
RouteType RouteType `json:"route-type"`
}
func (*HelloBody) DecodeFromBytes ¶ added in v1.8.1
func (b *HelloBody) DecodeFromBytes(command CommandType, data []byte) error
func (*HelloBody) MarshalJSON ¶ added in v1.8.1
type INTERFACE_STATUS ¶
type INTERFACE_STATUS uint8
func (INTERFACE_STATUS) String ¶
func (t INTERFACE_STATUS) String() string
type IPv4NexthopLookupBody ¶
Nexthop lookup for IPv4 routes.
func (*IPv4NexthopLookupBody) DecodeFromBytes ¶
func (b *IPv4NexthopLookupBody) DecodeFromBytes(command CommandType, data []byte) error
func (*IPv4NexthopLookupBody) Process ¶ added in v1.8.1
func (b *IPv4NexthopLookupBody) Process(client *Client, h *Header) error
func (*IPv4NexthopLookupBody) Serialize ¶
func (b *IPv4NexthopLookupBody) Serialize() ([]byte, error)
type IPv4NexthopReplyBody ¶
func (*IPv4NexthopReplyBody) DecodeFromBytes ¶
func (b *IPv4NexthopReplyBody) DecodeFromBytes(CommandType, []byte) error
func (*IPv4NexthopReplyBody) Process ¶ added in v1.8.1
func (b *IPv4NexthopReplyBody) Process(*Client, *Header) error
func (*IPv4NexthopReplyBody) Serialize ¶
func (b *IPv4NexthopReplyBody) Serialize() ([]byte, error)
type IfAddr ¶
type IfAddr struct { Flags IfAddrFlag `json:"-"` Prefix *netutil.Prefix `json:"address"` Label string `json:"-"` }
type IfAddrFlag ¶
type IfAddrFlag uint32
const ( IFADDR_SOURCE_SYSTEM IfAddrFlag = 1 << iota IFADDR_SOURCE_CONFIG )
func (IfAddrFlag) CheckFlag ¶
func (f IfAddrFlag) CheckFlag(flag IfAddrFlag) bool
func (IfAddrFlag) SetFlag ¶
func (f IfAddrFlag) SetFlag(flag IfAddrFlag) IfAddrFlag
func (IfAddrFlag) SourceConfig ¶
func (f IfAddrFlag) SourceConfig() bool
func (IfAddrFlag) SourceSystem ¶
func (f IfAddrFlag) SourceSystem() bool
type IfAddrInfo ¶
type IfAddrInfo struct { Flags IfAddrFlag MsgType uint16 Prefix *netutil.Prefix Family int Index IfIndex Label string Scope int }
func (*IfAddrInfo) String ¶
func (ifaddr *IfAddrInfo) String() string
type IfAddrSlice ¶
type IfAddrSlice []*IfAddr
func (IfAddrSlice) Delete ¶
func (addrs IfAddrSlice) Delete(prefix *netutil.Prefix) (IfAddrSlice, *IfAddr)
type IfInfo ¶
type IfShow ¶
type IfShow struct { Name string `json:"name,omitempty"` Type string `json:"type,omitempty"` HwAddr string `json:"hardware-adddress,omitempty"` Desc string `json:"description,omitempty"` Index IfIndex `json:"index,omitempty"` Metric uint32 `json:"metric,omitempty"` Mtu uint32 `json:"mtu,omitempty"` Flags string `json:"flags,omitempty"` Vrf string `json:"vrf,omitempty"` AddressIPv4 IfAddrSlice `json:"ipv4-address,omitempty"` AddressIPv6 IfAddrSlice `json:"ipv6-address,omitempty"` }
type IfStats ¶
type IfStats struct { Rx_packets uint32 Rx_bytes uint64 Rx_errors uint32 Rx_dropped uint32 Rx_multicast uint32 Rx_compressed uint32 Rx_length_errors uint32 Rx_over_errors uint32 Rx_crc_errors uint32 Rx_frame_errors uint32 Rx_fifo_errors uint32 Rx_missed_errors uint32 Tx_packets uint32 Tx_bytes uint64 Tx_errors uint32 Tx_dropped uint32 Tx_compressed uint32 Tx_aborted_errors uint32 Tx_carrier_errors uint32 Tx_fifo_errors uint32 Tx_heartbeat_errors uint32 Tx_window_errors uint32 Collisions uint32 }
type IfStatsYang ¶
type IfStatsYang struct {
// contains filtered or unexported fields
}
type Interface ¶
type Interface struct { Name string Index IfIndex VrfIndex uint32 Vrf *Vrf IfType uint8 Mtu uint32 DefaultMtu uint32 Metric uint32 Flags uint32 Stats IfStats Addrs [AFI_MAX]IfAddrSlice //HwAddr net.HardwareAddr HwAddr []byte Description string Master int VIFs []*VIF }
func IfLookupByIndex ¶
func IfLookupByName ¶
func (*Interface) IsBroadcast ¶
func (*Interface) IsLoopback ¶
func (*Interface) NotifyInterface ¶ added in v1.8.1
func (*Interface) NotifyInterfaceAdd ¶ added in v1.8.1
func (ifp *Interface) NotifyInterfaceAdd()
func (*Interface) NotifyInterfaceDelete ¶ added in v1.8.1
func (ifp *Interface) NotifyInterfaceDelete()
func (*Interface) NotifyInterfaceDown ¶ added in v1.8.1
func (ifp *Interface) NotifyInterfaceDown()
func (*Interface) NotifyInterfaceFlagChange ¶ added in v1.8.1
func (ifp *Interface) NotifyInterfaceFlagChange()
func (*Interface) NotifyInterfaceMtuChange ¶ added in v1.8.1
func (ifp *Interface) NotifyInterfaceMtuChange()
func (*Interface) NotifyInterfaceNameChange ¶ added in v1.8.1
func (ifp *Interface) NotifyInterfaceNameChange()
func (*Interface) NotifyInterfaceUp ¶ added in v1.8.1
func (ifp *Interface) NotifyInterfaceUp()
func (*Interface) UnregisterVIF ¶
type InterfaceAddressUpdateBody ¶
func NewInterfaceAddrUpdateBody ¶
func NewInterfaceAddrUpdateBody(addr *IfAddr) *InterfaceAddressUpdateBody
func NewInterfaceAddrUpdateBodyPb ¶ added in v1.8.1
func NewInterfaceAddrUpdateBodyPb(ifIndex uint32, addr *pb.Address) *InterfaceAddressUpdateBody
func (*InterfaceAddressUpdateBody) DecodeFromBytes ¶
func (b *InterfaceAddressUpdateBody) DecodeFromBytes(command CommandType, data []byte) error
func (*InterfaceAddressUpdateBody) Process ¶ added in v1.8.1
func (b *InterfaceAddressUpdateBody) Process(client *Client, h *Header) error
func (*InterfaceAddressUpdateBody) Serialize ¶
func (b *InterfaceAddressUpdateBody) Serialize() ([]byte, error)
type InterfaceConfig ¶
type InterfaceConfig struct { Flags IfcFlag Name string Description string Shutdown bool HwAddr []byte Index int L3Index int VlanId int Addrs [AFI_MAX]IfAddrSlice Interface *Interface Mtu uint32 }
func InterfaceConfigGet ¶
func InterfaceConfigGet(ifname string) *InterfaceConfig
func InterfaceConfigLookup ¶
func InterfaceConfigLookup(ifname string) *InterfaceConfig
func NewInterfaceConfig ¶
func NewInterfaceConfig(ifname string) *InterfaceConfig
func (*InterfaceConfig) AddrAdd ¶
func (ifc *InterfaceConfig) AddrAdd(ifName string, addr *netutil.Prefix) error
func (*InterfaceConfig) AddrDelete ¶
func (ifc *InterfaceConfig) AddrDelete(ifName string, addr *netutil.Prefix) error
func (*InterfaceConfig) DescriptionSet ¶
func (ifc *InterfaceConfig) DescriptionSet(desc string)
func (*InterfaceConfig) DescriptionUnset ¶
func (ifc *InterfaceConfig) DescriptionUnset()
func (*InterfaceConfig) MtuSet ¶
func (ifc *InterfaceConfig) MtuSet(mtu uint32)
func (*InterfaceConfig) MtuSync ¶
func (ifc *InterfaceConfig) MtuSync(ifp *Interface)
func (*InterfaceConfig) MtuUnset ¶
func (ifc *InterfaceConfig) MtuUnset()
func (*InterfaceConfig) ShutdownSet ¶
func (ifc *InterfaceConfig) ShutdownSet()
func (*InterfaceConfig) ShutdownSync ¶
func (ifc *InterfaceConfig) ShutdownSync(ifp *Interface)
func (*InterfaceConfig) ShutdownUnset ¶
func (ifc *InterfaceConfig) ShutdownUnset()
func (*InterfaceConfig) Sync ¶
func (ifc *InterfaceConfig) Sync(flags IfcFlag)
type InterfaceUpdateBody ¶
type InterfaceUpdateBody struct { Name string Index uint32 Status INTERFACE_STATUS Flags uint64 Metric uint32 Mtu uint32 Mtu6 uint32 Bandwidth uint32 HwAddr []byte }
func NewInterfaceUpdateBodyPb ¶ added in v1.8.1
func NewInterfaceUpdateBodyPb(mes *pb.InterfaceUpdate) *InterfaceUpdateBody
func (*InterfaceUpdateBody) DecodeFromBytes ¶
func (b *InterfaceUpdateBody) DecodeFromBytes(CommandType, []byte) error
func (*InterfaceUpdateBody) Process ¶ added in v1.8.1
func (b *InterfaceUpdateBody) Process(client *Client, h *Header) error
func (*InterfaceUpdateBody) Serialize ¶
func (b *InterfaceUpdateBody) Serialize() ([]byte, error)
type InterfacesStateHandler ¶
type InterfacesStateHandler struct {
ResourceBase
}
type LanForwardingTable ¶ added in v1.8.1
type LanForwardingTable struct { InterfaceTable struct { Tenant struct { Interfaces []string `mapstructure:"local-interface"` } `mapstructure:"tenant"` } `mapstructure:"interface-table"` }
type Message ¶
func NewMessage ¶ added in v1.8.1
func NewMessage(version uint8, command CommandType, body Body) *Message
type NEXTHOP_FLAG ¶
type NEXTHOP_FLAG uint8
const ( NEXTHOP_IFINDEX NEXTHOP_FLAG NEXTHOP_IFNAME NEXTHOP_IPV4 NEXTHOP_IPV4_IFINDEX NEXTHOP_IPV4_IFNAME NEXTHOP_IPV6 NEXTHOP_IPV6_IFINDEX NEXTHOP_IPV6_IFNAME NEXTHOP_BLACKHOLE )
func (NEXTHOP_FLAG) String ¶
func (n NEXTHOP_FLAG) String() string
type Neigh ¶
type Neigh struct { LinkIndex int Family int State uint16 Type int Flags uint8 IP net.IP HardwareAddr net.HardwareAddr }
Neigh represents a link layer neighbor from netlink.
func (*Neigh) IsReachable ¶
type Nexthop ¶
type Nexthop struct { net.IP Index IfIndex EncapType int EncapSeg6 EncapSEG6 EncapSeg6Local EncapSEG6Local }
func NewNexthop ¶ added in v1.8.1
func NewNexthopAddr ¶
func NewNexthopFromPb ¶ added in v1.8.1
func NewNexthopIf ¶
func (*Nexthop) AddressString ¶
func (*Nexthop) InterfaceString ¶
func (*Nexthop) IsAddrOnly ¶
func (*Nexthop) MarshalJSON ¶
type NexthopInfo ¶
type RedistributeBody ¶ added in v1.8.1
type RedistributeBody struct {
Type uint8
}
Redistribute routes.
func (*RedistributeBody) DecodeFromBytes ¶ added in v1.8.1
func (b *RedistributeBody) DecodeFromBytes(command CommandType, data []byte) error
func (*RedistributeBody) Process ¶ added in v1.8.1
func (b *RedistributeBody) Process(client *Client, h *Header) error
func (*RedistributeBody) Serialize ¶ added in v1.8.1
func (b *RedistributeBody) Serialize() ([]byte, error)
type RedistributeDefaultBody ¶ added in v1.8.1
type RedistributeDefaultBody struct { }
Redistribute default message. Message body is empty. When redistribute default is on, it effective to both IPv4 and IPv6.
func (*RedistributeDefaultBody) DecodeFromBytes ¶ added in v1.8.1
func (b *RedistributeDefaultBody) DecodeFromBytes(command CommandType, data []byte) error
func (*RedistributeDefaultBody) Process ¶ added in v1.8.1
func (b *RedistributeDefaultBody) Process(client *Client, h *Header) error
func (*RedistributeDefaultBody) Serialize ¶ added in v1.8.1
func (b *RedistributeDefaultBody) Serialize() ([]byte, error)
type ResourceBase ¶
type ResourceBase struct{}
func (ResourceBase) Delete ¶
func (ResourceBase) Delete(url string, queries url.Values) (Status, interface{})
func (ResourceBase) Get ¶
func (ResourceBase) Get(url string, queries url.Values) (Status, interface{})
type RestComponent ¶
type RestComponent struct { }
func NewRestComponent ¶
func NewRestComponent() *RestComponent
func (*RestComponent) Start ¶
func (r *RestComponent) Start() component.Component
func (*RestComponent) Stop ¶
func (r *RestComponent) Stop() component.Component
type Rib ¶
type Rib struct { pb.Rib Flags RibFlag Prefix *netutil.Prefix Type uint8 SubType uint8 Distance uint8 Metric uint32 PathId uint32 Nexthops []*Nexthop Color []string Aux []byte Src interface{} }
func (*Rib) HasDistance ¶
func (*Rib) IsResolved ¶
func (*Rib) IsSelected ¶
func (*Rib) IsSelectedFib ¶
func (*Rib) MarshalJSON ¶
func (*Rib) SetResolved ¶
func (r *Rib) SetResolved()
func (*Rib) SetSelected ¶
func (r *Rib) SetSelected()
func (*Rib) UnsetDelete ¶ added in v1.8.1
func (r *Rib) UnsetDelete()
func (*Rib) UnsetResolved ¶
func (r *Rib) UnsetResolved()
func (*Rib) UnsetSelected ¶
func (r *Rib) UnsetSelected()
type RibShowParam ¶
type RibShowParam struct {
// contains filtered or unexported fields
}
type RouteInfo ¶
type RouteInfo struct { MsgType uint16 Rib Table int MultiPath []*NexthopInfo }
Route represents a netlink route.
type RouteUpdateBody ¶ added in v1.8.1
type RouteUpdateBody struct { Message uint8 Type RouteType Flags FLAG Prefix *netutil.Prefix Nexthops []*Nexthop Distance uint8 Metric uint32 PathId uint32 Aux []byte }
func (*RouteUpdateBody) DecodeFromBytes ¶ added in v1.8.1
func (b *RouteUpdateBody) DecodeFromBytes(command CommandType, data []byte) error
func (*RouteUpdateBody) Process ¶ added in v1.8.1
func (b *RouteUpdateBody) Process(client *Client, h *Header) error
func (*RouteUpdateBody) Serialize ¶ added in v1.8.1
func (b *RouteUpdateBody) Serialize() ([]byte, error)
type RouterId ¶
type RouterIdUpdateBody ¶ added in v1.8.1
Router ID update.
func (*RouterIdUpdateBody) DecodeFromBytes ¶ added in v1.8.1
func (b *RouterIdUpdateBody) DecodeFromBytes(command CommandType, data []byte) error
func (*RouterIdUpdateBody) Process ¶ added in v1.8.1
func (b *RouterIdUpdateBody) Process(client *Client, h *Header) error
func (*RouterIdUpdateBody) Serialize ¶ added in v1.8.1
func (b *RouterIdUpdateBody) Serialize() ([]byte, error)
type RpcComponent ¶ added in v1.8.1
type RpcComponent struct {
// contains filtered or unexported fields
}
func NewRpcComponent ¶ added in v1.8.1
func NewRpcComponent(server *Server, port int) *RpcComponent
func (*RpcComponent) Start ¶ added in v1.8.1
func (r *RpcComponent) Start() component.Component
func (*RpcComponent) Stop ¶ added in v1.8.1
func (r *RpcComponent) Stop() component.Component
type SAFI ¶
type SAFI uint8
Subsequent Address Family Identifier.
const ( SAFI_UNICAST SAFI SAFI_MULTICAST SAFI_RESERVED_3 SAFI_MPLS_VPN SAFI_MAX )
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) InterfaceSubscribe ¶ added in v1.8.1
func (*Server) InterfaceUnsubscribe ¶ added in v1.8.1
func (*Server) PrefixListLookup ¶ added in v1.8.1
func (s *Server) PrefixListLookup(plistName string) *policy.PrefixList
func (*Server) PrefixListMasterSet ¶ added in v1.8.1
func (s *Server) PrefixListMasterSet(pm *policy.PrefixListMaster) error
func (*Server) PrefixListOut ¶ added in v1.8.1
func (s *Server) PrefixListOut() *policy.PrefixList
func (*Server) PrefixListOutAdd ¶ added in v1.8.1
func (s *Server) PrefixListOutAdd(entry *policy.PrefixListEntry)
func (*Server) RedistDefaultSubscribe ¶ added in v1.8.1
func (*Server) RedistDefaultUnsubscribe ¶ added in v1.8.1
func (*Server) RedistSubscribe ¶ added in v1.8.1
func (*Server) RedistUnsubscribe ¶ added in v1.8.1
func (*Server) RouterIdSubscribe ¶ added in v1.8.1
func (*Server) RouterIdUnsubscribe ¶ added in v1.8.1
func (*Server) StaticDelete ¶
func (*Server) StaticSeg6LocalAdd ¶ added in v1.8.1
func (*Server) StaticSeg6LocalDelete ¶ added in v1.8.1
func (*Server) StaticSeg6SegmentsAdd ¶ added in v1.8.1
func (*Server) StaticSeg6SegmentsDelete ¶ added in v1.8.1
func (*Server) VrfDistributeListOspfAdd ¶ added in v1.8.1
func (*Server) VrfDistributeListOspfDelete ¶ added in v1.8.1
func (*Server) WatcherUnsubscribe ¶ added in v1.8.1
type ShowServer ¶
type ShowServer struct { }
func NewShowServer ¶
func NewShowServer() *ShowServer
func (*ShowServer) Show ¶
func (s *ShowServer) Show(req *rpc.ShowRequest, stream rpc.Show_ShowServer) error
type Vlan ¶
type Vlan struct { VlanId uint16 IfName string IfConfig *InterfaceConfig File *os.File Ports []*InterfaceConfig }
type Vrf ¶
type Vrf struct { Name string Id uint32 IfTable *netutil.Ptree IfMap map[string]*Interface ZServer *ZServer Mutex sync.RWMutex IfMutex sync.Mutex Watcher map[*IfWatcher]bool // Will be merged to Watchers WMutex sync.Mutex Watchers []Watchers DListOspf string // contains filtered or unexported fields }
func VrfDefault ¶
func VrfDefault() *Vrf
func VrfLookupByIndex ¶
func VrfLookupByName ¶
func (*Vrf) IfLookupByIndex ¶
func (*Vrf) IfLookupByName ¶
func (*Vrf) IfRegister ¶
func (*Vrf) IfUnregister ¶
func (*Vrf) IfWatchAdd ¶
func (*Vrf) InterfaceIterate ¶
func (*Vrf) InterfaceShow ¶
func (*Vrf) NotifyRouterId ¶ added in v1.8.1
func (vrf *Vrf) NotifyRouterId()
func (*Vrf) RedistDefaultSync ¶ added in v1.8.1
func (*Vrf) Redistribute ¶ added in v1.8.1
func (*Vrf) RibProcess ¶
func (*Vrf) RibShowEntryJson ¶
func (v *Vrf) RibShowEntryJson(t *ShowTask, p *RibShowParam, rib *Rib)
func (*Vrf) RibShowIPv4Nexthop ¶
func (*Vrf) RouterIdAdd ¶
func (*Vrf) RouterIdDelete ¶
func (*Vrf) RouterIdSet ¶
func (*Vrf) RouterIdShow ¶
func (*Vrf) RouterIdUnset ¶
func (v *Vrf) RouterIdUnset()
func (*Vrf) RouterIdUpdate ¶
func (v *Vrf) RouterIdUpdate()
func (*Vrf) StaticSeg6LocalAdd ¶ added in v1.8.1
func (*Vrf) StaticSeg6LocalDelete ¶ added in v1.8.1
func (*Vrf) StaticSeg6SegmentsAdd ¶ added in v1.8.1
type WatcherRedist ¶ added in v1.8.1
type WatcherRedist struct {
// contains filtered or unexported fields
}
type Watchers ¶ added in v1.8.1
type Watchers []Watcher
func RedistWatcherAdd ¶ added in v1.8.1
func RedistWatcherRemove ¶ added in v1.8.1
Source Files ¶
- api.go
- arp.go
- dtls.go
- dynamic.go
- esi_lan.go
- etcd.go
- grpc.go
- if_flags.go
- if_show.go
- if_stats.go
- if_type.go
- ifaddr.go
- interface.go
- interface_config.go
- netlink.go
- nexthop.go
- rest.go
- rib.go
- rib_show.go
- router_id.go
- rpc.go
- server.go
- static.go
- vif.go
- vlan.go
- vrf.go
- watcher.go
- zapi.go
- zapi_iftype.go
- zapi_type.go
Click to show internal directories.
Click to hide internal directories.