コード例 #1
0
ファイル: netlink.go プロジェクト: razorinc/skydive
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()
}
コード例 #2
0
ファイル: mapper_test.go プロジェクト: razorinc/skydive
func (d *FakeIfNameDriver) Enhance(mac string, attrs *flow.Flow_InterfaceAttributes) {
	attrs.IfName = proto.String(d.FakeIfName)
}