summaryrefslogtreecommitdiff
path: root/accel-pppd/ctrl/pptp/pptp.h
diff options
context:
space:
mode:
authorDenys Fedoryshchenko <denys.f@collabora.com>2026-04-29 14:08:37 +0300
committerDenys Fedoryshchenko <denys.f@collabora.com>2026-05-04 03:09:49 +0300
commitd3d5aec5551d7d451fa4dae3df118a6ebd4cc2b7 (patch)
tree9ca57f75dac5ab8bce45c9e8be52372f05c55093 /accel-pppd/ctrl/pptp/pptp.h
parent55157b5411e374e651c7db78967d2908db9b30e8 (diff)
downloadaccel-ppp-d3d5aec5551d7d451fa4dae3df118a6ebd4cc2b7.tar.gz
accel-ppp-d3d5aec5551d7d451fa4dae3df118a6ebd4cc2b7.zip
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 <denys.f@collabora.com>
Diffstat (limited to 'accel-pppd/ctrl/pptp/pptp.h')
-rw-r--r--accel-pppd/ctrl/pptp/pptp.h7
1 files changed, 7 insertions, 0 deletions
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