github.com/cilium/cilium@v1.16.2/pkg/datapath/ipcache/cell.go (about) 1 // SPDX-License-Identifier: Apache-2.0 2 // Copyright Authors of Cilium 3 4 package ipcache 5 6 import ( 7 "github.com/cilium/hive/cell" 8 9 "github.com/cilium/cilium/pkg/ipcache" 10 ipcacheMap "github.com/cilium/cilium/pkg/maps/ipcache" 11 monitorAgent "github.com/cilium/cilium/pkg/monitor/agent" 12 ) 13 14 // Cell is a cell that provides and registers the listener which synchronizes 15 // the userspace ipcache with the corresponding BPF map. 16 var Cell = cell.Module( 17 "ipcache-bpf-listener", 18 "IPCache BPF Listener", 19 20 cell.Provide(NewListener), 21 cell.ProvidePrivate( 22 func() Map { return ipcacheMap.IPCacheMap() }, 23 func(agent monitorAgent.Agent) monitorNotify { return agent }, 24 ), 25 26 cell.Invoke(func(listener *BPFListener, ipc *ipcache.IPCache) { ipc.AddListener(listener) }), 27 )