github.com/cilium/cilium@v1.16.2/pkg/proxy/endpoint/endpoint.go (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  // Copyright Authors of Cilium
     3  
     4  package endpoint
     5  
     6  import (
     7  	"github.com/cilium/cilium/pkg/fqdn/restore"
     8  	"github.com/cilium/cilium/pkg/proxy/accesslog"
     9  )
    10  
    11  // EndpointInfoSource returns information about an endpoint being proxied.
    12  // The read lock must be held when calling any method.
    13  type EndpointInfoSource interface {
    14  	GetID() uint64
    15  	GetIPv4Address() string
    16  	GetIPv6Address() string
    17  	ConntrackNameLocked() string
    18  	GetNamedPort(ingress bool, name string, proto uint8) uint16
    19  }
    20  
    21  // EndpointUpdater returns information about an endpoint being proxied and
    22  // is called back to update the endpoint when proxy events occur.
    23  // This is a subset of `Endpoint`.
    24  type EndpointUpdater interface {
    25  	EndpointInfoSource
    26  
    27  	// OnProxyPolicyUpdate is called when the proxy acknowledges that it
    28  	// has applied a policy.
    29  	OnProxyPolicyUpdate(policyRevision uint64)
    30  
    31  	// UpdateProxyStatistics updates the Endpoint's proxy statistics to account
    32  	// for a new observed flow with the given characteristics.
    33  	UpdateProxyStatistics(proxyType, l4Protocol string, port, proxyPort uint16, ingress, request bool, verdict accesslog.FlowVerdict)
    34  
    35  	// OnDNSPolicyUpdateLocked is called when the Endpoint's DNS policy has been updated.
    36  	// 'rules' is a fresh copy of the DNS rules passed to the callee.
    37  	OnDNSPolicyUpdateLocked(rules restore.DNSRules)
    38  }