Exemple #1
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()
}