Documentation
¶
Index ¶
- Constants
- func RegisterMetrics()
- func StringToXDPAttachMode(Mode string) link.XDPAttachFlags
- type SettingsReconciler
- type SettingsStore
- type UPF
- func (u *UPF) Close(ctx context.Context)
- func (u *UPF) Engine() *engine.SessionEngine
- func (u *UPF) FlushUsage(ctx context.Context, seid uint64)
- func (u *UPF) ReloadFlowAccounting(flowact bool) error
- func (u *UPF) ReloadNAT(masquerade bool) error
- func (u *UPF) UpdateAdvertisedN3Address(newN3Addr netip.Addr)
- func (u *UPF) UpdateFilters(ctx context.Context, policyID string, direction models.Direction, ...) error
- type Updater
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func RegisterMetrics ¶ added in v1.2.0
func RegisterMetrics()
func StringToXDPAttachMode ¶
func StringToXDPAttachMode(Mode string) link.XDPAttachFlags
Types ¶
type SettingsReconciler ¶ added in v1.10.0
type SettingsReconciler struct {
// contains filtered or unexported fields
}
SettingsReconciler drives this node's UPF runtime from replicated DB settings: NAT toggle, flow accounting toggle, advertised N3 address, and per-policy SDF filters. Each tick reads the desired state from the DB and applies it to the local UPF only when it differs from the last-applied snapshot — the underlying Reload* and UpdateFilters calls re-attach XDP / re-write eBPF maps, so calling them unconditionally on every tick would disrupt the data plane.
func NewSettingsReconciler ¶ added in v1.10.0
func NewSettingsReconciler(updater Updater, store SettingsStore, changefeed *db.Changefeed, fallbackN3IP netip.Addr) *SettingsReconciler
NewSettingsReconciler wires a reconciler. fallbackN3IP is the local node's configured N3 address used when n3_settings.external_address is empty. changefeed may be nil in tests that drive Reconcile() directly; production callers always pass a non-nil broker.
func (*SettingsReconciler) Reconcile ¶ added in v1.10.0
func (r *SettingsReconciler) Reconcile(ctx context.Context) error
Reconcile performs one reconcile pass. Exposed for tests and for callers that want to force convergence after a known change.
func (*SettingsReconciler) Start ¶ added in v1.10.0
func (r *SettingsReconciler) Start()
Start launches the reconciler goroutine. Subsequent calls without a paired Stop are no-ops.
func (*SettingsReconciler) Stop ¶ added in v1.10.0
func (r *SettingsReconciler) Stop()
Stop signals the reconciler to exit and blocks until the goroutine has drained.
type SettingsStore ¶ added in v1.10.0
type SettingsStore interface {
IsNATEnabled(ctx context.Context) (bool, error)
IsFlowAccountingEnabled(ctx context.Context) (bool, error)
GetN3Settings(ctx context.Context) (*db.N3Settings, error)
ListPoliciesPage(ctx context.Context, page int, perPage int) ([]db.Policy, int, error)
ListRulesForPolicy(ctx context.Context, policyID string) ([]*db.NetworkRule, error)
}
SettingsStore is the narrow view the reconciler needs over the DB. *db.Database satisfies it; a fake satisfies it in tests.
type UPF ¶ added in v0.1.0
type UPF struct {
// contains filtered or unexported fields
}
func (*UPF) Engine ¶ added in v1.9.0
func (u *UPF) Engine() *engine.SessionEngine
func (*UPF) FlushUsage ¶ added in v1.10.0
FlushUsage drains and reports any pending URR counters for the given SEID. Called by the SMF immediately before session deletion so that traffic accounted since the last periodic poll is reported to the subscriber-usage store and not dropped when the session is removed from the engine (3GPP TS 29.244 §5.2.2.4 termination reporting trigger).
func (*UPF) ReloadFlowAccounting ¶ added in v1.4.0
func (*UPF) UpdateAdvertisedN3Address ¶ added in v0.5.0
type Updater ¶ added in v1.10.0
type Updater interface {
ReloadNAT(enabled bool) error
ReloadFlowAccounting(enabled bool) error
UpdateAdvertisedN3Address(addr netip.Addr)
UpdateFilters(ctx context.Context, policyID string, direction models.Direction, rules []models.FilterRule) error
}
Updater is the narrow view the reconciler needs over the UPF runtime. *UPF satisfies it.