Documentation ¶
Index ¶
- Constants
- Variables
- func InitSnmpConfig() error
- type Attributes
- type DockerProbe
- type FabricProbe
- type NetLinkProbe
- type NetNSProbe
- type NetNs
- type NetNsNetLinkProbe
- type NeutronPortNotFound
- type NeutronProbe
- type OpenContrailMdata
- type OpenContrailProbe
- type OvsdbProbe
- func (o *OvsdbProbe) OnOvsBridgeAdd(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)
- func (o *OvsdbProbe) OnOvsBridgeDel(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)
- func (o *OvsdbProbe) OnOvsBridgeUpdate(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)
- func (o *OvsdbProbe) OnOvsInterfaceAdd(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)
- func (o *OvsdbProbe) OnOvsInterfaceDel(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)
- func (o *OvsdbProbe) OnOvsInterfaceUpdate(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)
- func (o *OvsdbProbe) OnOvsPortAdd(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)
- func (o *OvsdbProbe) OnOvsPortDel(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)
- func (o *OvsdbProbe) OnOvsPortUpdate(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)
- func (o *OvsdbProbe) Start()
- func (o *OvsdbProbe) Stop()
- type PeeringProbe
- type PortMetadata
- type SnmpLink
- type SnmpProbe
- type TopologyDetect
- type TopologyDetectClient
- type TopologyDetectReply
- type TopologyDetectServer
Constants ¶
const ( OidSysDesc = ".1.3.6.1.2.1.1.1.0" OidSysObjectId = ".1.3.6.1.2.1.1.2.0" OidSysUptime = ".1.3.6.1.2.1.1.3.0" OidSysContact = ".1.3.6.1.2.1.1.4.0" OidSysName = ".1.3.6.1.2.1.1.5.0" OidSysLocation = ".1.3.6.1.2.1.1.6.0" OidSysServices = ".1.3.6.1.2.1.1.7.0" OidBoardSn = "1.3.6.1.2.1.47.1.1.1.1.11.256" // interfaces OidIfPhyAddr = ".1.3.6.1.2.1.2.2.1.6" OidIfOperStatus = ".1.3.6.1.2.1.2.2.1.8" OidIfDescr = ".1.3.6.1.2.1.2.2.1.2" OidIfMTU = ".1.3.6.1.2.1.2.2.1.4" OidIfSpeed = ".1.3.6.1.2.1.2.2.1.5" OidIfAlias = ".1.3.6.1.2.1.31.1.1.1.18" OidIpForwarding = ".1.3.6.1.2.1.4.1.0" OidIpAddr = ".1.3.6.1.2.1.4.20.1.1" OidIpIfindex = ".1.3.6.1.2.1.4.20.1.2" OidIpMask = ".1.3.6.1.2.1.4.20.1.3" OidRouteDest = ".1.3.6.1.2.1.4.21.1.1" OidRouteIfindex = ".1.3.6.1.2.1.4.21.1.2" OidRouteNexthop = ".1.3.6.1.2.1.4.21.1.7" OidRouteType = ".1.3.6.1.2.1.4.21.1.8" OidRouteMask = ".1.3.6.1.2.1.4.21.1.11" OidEnterprises = ".1.3.6.1.4.1" OidBaseNumPorts = ".1.3.6.1.2.1.17.1.2.0" OidStpRootCost = ".1.3.6.1.2.1.17.2.6.0" OidStpRootPort = ".1.3.6.1.2.1.17.2.7.0" OidFdbAddress = ".1.3.6.1.2.1.17.4.3.1.1" // dot1dBase OidTpFdbPort = ".1.3.6.1.2.1.17.4.3.1.2" OidPhysAddress = ".1.3.6.1.2.1.3.1.1.2" OidBasePort = ".1.3.6.1.2.1.17.1.4.1.1" OidBasePortIfindex = ".1.3.6.1.2.1.17.1.4.1.2" OidTpFdb2Port = ".1.3.6.1.2.1.17.7.1.2.2.1.2" OidDot1dBaseBridgeAddress = ".1.3.6.1.2.1.17.1.1.0" // qBridgeMIB OidDot1qPvid = ".1.3.6.1.2.1.17.7.1.4.5.1.1" OidDot1qVlanFdbId = ".1.3.6.1.2.1.17.7.1.4.2.1.3" OidDot1qVlanCurrentEgressPorts = ".1.3.6.1.2.1.17.7.1.4.2.1.4" OidDot1qVlanCurrentUntaggedPorts = ".1.3.6.1.2.1.17.7.1.4.2.1.5" OidIpNetToMediaPhysAddress = ".1.3.6.1.2.1.4.22.1.2" // LLDP OidLldpRemChassisIdSubType = ".1.0.8802.1.1.2.1.4.1.1.4" OidLldpRemChassisId = ".1.0.8802.1.1.2.1.4.1.1.5" OidLldpRemPortIdSubType = ".1.0.8802.1.1.2.1.4.1.1.6" OidLldpRemPortId = ".1.0.8802.1.1.2.1.4.1.1.7" OidLldpRemManAddrIfId = ".1.0.8802.1.1.2.1.4.2.1.4" OidLldpLocalManAddrIfId = ".1.0.8802.1.1.2.1.3.8.1.5" OidLldpLocalPortId = ".1.0.8802.1.1.2.1.3.7.1.3" OidLldpLocalPortDesc = ".1.0.8802.1.1.2.1.3.7.1.4" )
const ( UnknownType = iota ServersType SwitchL2SnmpType PrinterType SwitchL3Type RouteType DeviceType GateDeviceType HostType SwitchL2Type WirelessRouteType Subnetype )
const ( DirectRouteType = 3 InDirectRouteType = 4 )
const ( TypePortUp = 1 + iota TypePortDown TypePortLeaf )
const (
DetectConfigFile = "etc/topology_detect.json"
)
const DockerClientAPIVersion = "1.18"
DockerClientAPIVersion Client API version used
const (
Namespace = "Topology_Detect"
)
Variables ¶
var TopoRelationMap map[string]*topoRelation
var TopologyDetectChan chan *TopologyDetect
Functions ¶
func InitSnmpConfig ¶
func InitSnmpConfig() error
Types ¶
type Attributes ¶
type Attributes struct { PortID string NetworkID string NetworkName string TenantID string IPs string VNI string }
Attributes neutron attributes
type DockerProbe ¶
type DockerProbe struct { sync.RWMutex *NetNSProbe // contains filtered or unexported fields }
DockerProbe describes a Docker topology graph that enhance the graph
func NewDockerProbe ¶
func NewDockerProbe(nsProbe *NetNSProbe, dockerURL string) (probe *DockerProbe, _ error)
NewDockerProbe creates a new topology Docker probe
func NewDockerProbeFromConfig ¶
func NewDockerProbeFromConfig(nsProbe *NetNSProbe) (*DockerProbe, error)
NewDockerProbeFromConfig creates a new topology Docker probe based on configuration
type FabricProbe ¶
type FabricProbe struct { graph.DefaultGraphListener Graph *graph.Graph // contains filtered or unexported fields }
FabricProbe describes a topology probe
func NewFabricProbe ¶
func NewFabricProbe(g *graph.Graph) *FabricProbe
NewFabricProbe creates a new probe to enhance the graph
func (*FabricProbe) LinkNodes ¶
func (fb *FabricProbe) LinkNodes(parent *graph.Node, child *graph.Node, linkMetadata *graph.Metadata)
LinkNodes link the parent and child (layer 2) if there not linked already
func (*FabricProbe) OnEdgeAdded ¶
func (fb *FabricProbe) OnEdgeAdded(e *graph.Edge)
OnEdgeAdded event
func (*FabricProbe) OnNodeDeleted ¶
func (fb *FabricProbe) OnNodeDeleted(n *graph.Node)
OnNodeDeleted event
type NetLinkProbe ¶
type NetLinkProbe struct { sync.RWMutex Graph *graph.Graph // contains filtered or unexported fields }
NetLinkProbe describes a list NetLink NameSpace probe to enhance the graph
func NewNetLinkProbe ¶
func NewNetLinkProbe(g *graph.Graph) (*NetLinkProbe, error)
NewNetLinkProbe creates a new netlink probe
func (*NetLinkProbe) Register ¶
func (u *NetLinkProbe) Register(nsPath string, root *graph.Node) (*NetNsNetLinkProbe, error)
Register a new network netlink/namespace probe in the graph
func (*NetLinkProbe) Unregister ¶
func (u *NetLinkProbe) Unregister(nsPath string) error
Unregister a probe from a network namespace
type NetNSProbe ¶
type NetNSProbe struct { sync.RWMutex Graph *graph.Graph Root *graph.Node NetLinkProbe *NetLinkProbe // contains filtered or unexported fields }
NetNSProbe describes a netlink probe in a network namespace
func NewNetNSProbe ¶
func NewNetNSProbe(g *graph.Graph, n *graph.Node, nlProbe *NetLinkProbe, runPath ...string) (*NetNSProbe, error)
NewNetNSProbe creates a new network namespace probe
func NewNetNSProbeFromConfig ¶
func NewNetNSProbeFromConfig(g *graph.Graph, n *graph.Node, nlProbe *NetLinkProbe) (*NetNSProbe, error)
NewNetNSProbeFromConfig creates a new network namespace probe based on configuration
func (*NetNSProbe) Unregister ¶
func (u *NetNSProbe) Unregister(path string)
Unregister a network namespace path
type NetNs ¶
type NetNs struct {
// contains filtered or unexported fields
}
NetNs describes a network namespace path associated with a device / inode
type NetNsNetLinkProbe ¶
type NetNsNetLinkProbe struct { sync.RWMutex Graph *graph.Graph Root *graph.Node NsPath string // contains filtered or unexported fields }
NetNsNetLinkProbe describes a topology probe based on netlink in a network namespace
type NeutronPortNotFound ¶
type NeutronPortNotFound struct {
MAC string
}
NeutronPortNotFound error
func (NeutronPortNotFound) Error ¶
func (e NeutronPortNotFound) Error() string
type NeutronProbe ¶
type NeutronProbe struct { graph.DefaultGraphListener // contains filtered or unexported fields }
NeutronProbe describes a topology porbe that map neutron attribues in the graph
func NewNeutronProbe ¶
func NewNeutronProbe(g *graph.Graph, wspool *shttp.WSAsyncClientPool, authURL, username, password, tenantName, regionName, domainName string, availability gophercloud.Availability) (*NeutronProbe, error)
NewNeutronProbe creates a neutron probe that will enhance the graph
func NewNeutronProbeFromConfig ¶
func NewNeutronProbeFromConfig(g *graph.Graph, wspool *shttp.WSAsyncClientPool) (*NeutronProbe, error)
NewNeutronProbeFromConfig creates a new neutron probe based on configuration
func (*NeutronProbe) EnhanceNode ¶
func (mapper *NeutronProbe) EnhanceNode(node *graph.Node)
EnhanceNode enhance the graph node with neutron metadata (Name, MAC, Manager ...)
func (*NeutronProbe) OnNodeAdded ¶
func (mapper *NeutronProbe) OnNodeAdded(n *graph.Node)
OnNodeAdded event
func (*NeutronProbe) OnNodeUpdated ¶
func (mapper *NeutronProbe) OnNodeUpdated(n *graph.Node)
OnNodeUpdated event
type OpenContrailMdata ¶
OpenContrailMdata metadata
type OpenContrailProbe ¶
type OpenContrailProbe struct { graph.DefaultGraphListener // contains filtered or unexported fields }
OpenContrailProbe describes a probe that reads OpenContrail database and updates the graph
func NewOpenContrailProbeFromConfig ¶
func NewOpenContrailProbeFromConfig(g *graph.Graph, r *graph.Node) *OpenContrailProbe
NewOpenContrailProbeFromConfig creates a new OpenContrail probe based on configuration
func (*OpenContrailProbe) OnNodeAdded ¶
func (mapper *OpenContrailProbe) OnNodeAdded(n *graph.Node)
OnNodeAdded event
func (*OpenContrailProbe) OnNodeDeleted ¶
func (mapper *OpenContrailProbe) OnNodeDeleted(n *graph.Node)
OnNodeDeleted event
func (*OpenContrailProbe) OnNodeUpdated ¶
func (mapper *OpenContrailProbe) OnNodeUpdated(n *graph.Node)
OnNodeUpdated event
type OvsdbProbe ¶
type OvsdbProbe struct { sync.Mutex Graph *graph.Graph Root *graph.Node OvsMon *ovsdb.OvsMonitor // contains filtered or unexported fields }
OvsdbProbe describes a probe that reads OVS database and updates the graph
func NewOvsdbProbe ¶
NewOvsdbProbe creates a new graph OVS database probe
func NewOvsdbProbeFromConfig ¶
func NewOvsdbProbeFromConfig(g *graph.Graph, n *graph.Node) *OvsdbProbe
NewOvsdbProbeFromConfig creates a new probe based on configuration
func (*OvsdbProbe) OnOvsBridgeAdd ¶
func (o *OvsdbProbe) OnOvsBridgeAdd(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)
OnOvsBridgeAdd event
func (*OvsdbProbe) OnOvsBridgeDel ¶
func (o *OvsdbProbe) OnOvsBridgeDel(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)
OnOvsBridgeDel event
func (*OvsdbProbe) OnOvsBridgeUpdate ¶
func (o *OvsdbProbe) OnOvsBridgeUpdate(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)
OnOvsBridgeUpdate event
func (*OvsdbProbe) OnOvsInterfaceAdd ¶
func (o *OvsdbProbe) OnOvsInterfaceAdd(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)
OnOvsInterfaceAdd event
func (*OvsdbProbe) OnOvsInterfaceDel ¶
func (o *OvsdbProbe) OnOvsInterfaceDel(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)
OnOvsInterfaceDel event
func (*OvsdbProbe) OnOvsInterfaceUpdate ¶
func (o *OvsdbProbe) OnOvsInterfaceUpdate(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)
OnOvsInterfaceUpdate event
func (*OvsdbProbe) OnOvsPortAdd ¶
func (o *OvsdbProbe) OnOvsPortAdd(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)
OnOvsPortAdd event
func (*OvsdbProbe) OnOvsPortDel ¶
func (o *OvsdbProbe) OnOvsPortDel(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)
OnOvsPortDel event
func (*OvsdbProbe) OnOvsPortUpdate ¶
func (o *OvsdbProbe) OnOvsPortUpdate(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)
OnOvsPortUpdate event
type PeeringProbe ¶
type PeeringProbe struct { graph.DefaultGraphListener // contains filtered or unexported fields }
PeeringProbe describes graph peering based on MAC address and graph events
func NewPeeringProbe ¶
func NewPeeringProbe(g *graph.Graph) *PeeringProbe
NewPeeringProbe creates a new graph node peering probe
func (*PeeringProbe) OnNodeAdded ¶
func (p *PeeringProbe) OnNodeAdded(n *graph.Node)
OnNodeAdded event
func (*PeeringProbe) OnNodeDeleted ¶
func (p *PeeringProbe) OnNodeDeleted(n *graph.Node)
OnNodeDeleted event
func (*PeeringProbe) OnNodeUpdated ¶
func (p *PeeringProbe) OnNodeUpdated(n *graph.Node)
OnNodeUpdated event
type PortMetadata ¶
type PortMetadata struct {
// contains filtered or unexported fields
}
PortMetadata neutron metadata
type SnmpProbe ¶
type SnmpProbe struct { Graph *graph.Graph SnmpRoot *graph.Node Root *graph.Node TopologyDetectChan chan *TopologyDetect // contains filtered or unexported fields }
func NewSnmpProbeFromConfig ¶
type TopologyDetect ¶
type TopologyDetectClient ¶
type TopologyDetectClient struct { shttp.DefaultWSServerEventHandler WSServer *shttp.WSServer // contains filtered or unexported fields }
func NewTopologyDetectClient ¶
func NewTopologyDetectClient(w *shttp.WSServer) *TopologyDetectClient
func (*TopologyDetectClient) DetectTopology ¶
func (td *TopologyDetectClient) DetectTopology(dp *TopologyDetect) (string, error)
func (*TopologyDetectClient) DetectTopologyDelete ¶
func (td *TopologyDetectClient) DetectTopologyDelete(dp *TopologyDetect) (string, error)
type TopologyDetectReply ¶
type TopologyDetectReply struct { TrackingID string // contains filtered or unexported fields }
type TopologyDetectServer ¶
type TopologyDetectServer struct { shttp.DefaultWSClientEventHandler WSAsyncClientPool *shttp.WSAsyncClientPool Graph *graph.Graph }
func NewServer ¶
func NewServer(wspool *shttp.WSAsyncClientPool, graph *graph.Graph) *TopologyDetectServer
func (*TopologyDetectServer) OnMessage ¶
func (td *TopologyDetectServer) OnMessage(c *shttp.WSAsyncClient, msg shttp.WSMessage)