Ejemplo n.º 1
0
func (mapper *OvsMapper) Enhance(mac string, attrs *flow.Flow_InterfaceAttributes) {
	if mapper.Topology != nil {
		container := mapper.Topology.GetPort(attrs.GetIfName())
		if container != nil {
			attrs.BridgeName = proto.String(container.ID)
			return
		}
	}
	attrs.BridgeName = proto.String("")
}
Ejemplo n.º 2
0
func (mapper *NeutronMapper) Enhance(mac string, attrs *flow.Flow_InterfaceAttributes) {
	a, f := mapper.cache.Get(mac)
	if f {
		ia := a.(Attributes)

		/* update attributes with attributes retrieved from neutron */
		attrs.TenantID = proto.String(ia.TenantID)
		attrs.VNI = proto.Uint64(ia.VNI)

		return
	}

	mapper.cacheUpdaterChan <- mac
}
Ejemplo n.º 3
0
func (mapper *NetLinkMapper) Enhance(mac string, attrs *flow.Flow_InterfaceAttributes) {
	a, f := mapper.cache.Get(strconv.Itoa(int(attrs.GetIfIndex())))
	if f {
		la := a.(*netlink.LinkAttrs)

		attrs.IfName = proto.String(la.Name)
		attrs.MTU = proto.Uint32(uint32(la.MTU))

		return
	}

	mapper.cacheUpdaterChan <- attrs.GetIfIndex()
}
Ejemplo n.º 4
0
func (d *FakeIfNameDriver) Enhance(mac string, attrs *flow.Flow_InterfaceAttributes) {
	attrs.IfName = proto.String(d.FakeIfName)
}
Ejemplo n.º 5
0
func (d *FakeInterfaceDriver) Enhance(mac string, attrs *flow.Flow_InterfaceAttributes) {
	attrs.TenantID = proto.String(d.FakeTenantID)
	attrs.VNI = proto.Uint64(d.FakeVNI)
}