epInfoCache describes the set of lxcmap entries necessary to describe an Endpoint in the BPF maps. It is generated while holding the Endpoint lock, then used after releasing that lock to push the entries into the datapath. Functions below implement the EndpointFrontend interface with this cached inf
| 19 | // after releasing that lock to push the entries into the datapath. |
| 20 | // Functions below implement the EndpointFrontend interface with this cached information. |
| 21 | type epInfoCache struct { |
| 22 | // revision is used by the endpoint regeneration code to determine |
| 23 | // whether this cache is out-of-date wrt the underlying endpoint. |
| 24 | revision uint64 |
| 25 | |
| 26 | // For datapath.loader.endpoint |
| 27 | epdir string |
| 28 | id uint64 |
| 29 | ifName string |
| 30 | |
| 31 | // For datapath.EndpointConfiguration |
| 32 | identity identity.NumericIdentity |
| 33 | mac mac.MAC |
| 34 | ipv4 netip.Addr |
| 35 | ipv6 netip.Addr |
| 36 | requireARPPassthrough bool |
| 37 | requireEgressProg bool |
| 38 | requireRouting bool |
| 39 | requireEndpointRoute bool |
| 40 | atHostNS bool |
| 41 | policyVerdictLogFilter uint32 |
| 42 | options *option.IntOptions |
| 43 | lxcMAC mac.MAC |
| 44 | ifIndex int |
| 45 | parentIfIndex int |
| 46 | netNsCookie uint64 |
| 47 | properties map[string]any |
| 48 | |
| 49 | // endpoint is used to get the endpoint's logger. |
| 50 | // |
| 51 | // Do NOT use this for fetching endpoint data directly; this structure |
| 52 | // is intended as a safe cache of endpoint data that is assembled while |
| 53 | // holding the endpoint lock, for use beyond the holding of that lock. |
| 54 | // Dereferencing fields in this endpoint is not guaranteed to be safe. |
| 55 | endpoint *Endpoint |
| 56 | } |
| 57 | |
| 58 | // Must be called when endpoint is still locked. |
| 59 | func (e *Endpoint) createEpInfoCache(epdir string) *epInfoCache { |
nothing calls this directly
no outgoing calls
no test coverage detected