From d3d5aec5551d7d451fa4dae3df118a6ebd4cc2b7 Mon Sep 17 00:00:00 2001 From: Denys Fedoryshchenko Date: Wed, 29 Apr 2026 14:08:37 +0300 Subject: pptp: encapsulate statistics counters Group the PPTP starting and active statistics in struct pptp_stat_t and keep the storage under the PPTP server object instead of exposing writable stat_* globals. This keeps ownership inside the PPTP control code while preserving the existing CLI and ACCEL-PPP-MIB counter semantics. Route counter updates through pptp_stat_*() helpers. Connection setup, transition to PPP, and teardown paths no longer open-code individual counter increments/decrements; the update policy now lives beside the PPTP-owned storage and uses relaxed atomic operations for the simple state counters. Make the CLI show-stat path render from a local snapshot and convert the PPTP SNMP starting/active scalars from watched raw pointers to scalar handlers. SNMP now reads through pptp_stat_starting() and pptp_stat_active(), removing the old pptp_get_stat() pointer escape hatch. Signed-off-by: Denys Fedoryshchenko --- accel-pppd/ctrl/pptp/pptp.h | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 accel-pppd/ctrl/pptp/pptp.h (limited to 'accel-pppd/ctrl/pptp/pptp.h') diff --git a/accel-pppd/ctrl/pptp/pptp.h b/accel-pppd/ctrl/pptp/pptp.h new file mode 100644 index 00000000..29f24ca2 --- /dev/null +++ b/accel-pppd/ctrl/pptp/pptp.h @@ -0,0 +1,7 @@ +#ifndef __PPTP_H +#define __PPTP_H + +unsigned int pptp_stat_starting(void); +unsigned int pptp_stat_active(void); + +#endif -- cgit v1.2.3