Пример #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("")
}
Пример #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
}
Пример #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()
}
Пример #4
0
func (d *FakeIfNameDriver) Enhance(mac string, attrs *flow.Flow_InterfaceAttributes) {
	attrs.IfName = proto.String(d.FakeIfName)
}
Пример #5
0
func (d *FakeInterfaceDriver) Enhance(mac string, attrs *flow.Flow_InterfaceAttributes) {
	attrs.TenantID = proto.String(d.FakeTenantID)
	attrs.VNI = proto.Uint64(d.FakeVNI)
}