package vpn type Manager struct { PPPoE *PPPoEManager WireGuard *WireGuardManager PPTP *PPTPManager L2TP *L2TPManager IPSec *IPSecManager } func NewManager() *Manager { return &Manager{ PPPoE: NewPPPoEManager(), WireGuard: NewWireGuardManager(), PPTP: NewPPTPManager(), L2TP: NewL2TPManager(), IPSec: NewIPSecManager(), } } // GetOverallStatus returns a summary of all active instances across all protocols. func (m *Manager) GetOverallStatus() OverallVPNStatus { pppoeList := m.PPPoE.List() wgIfaces := m.WireGuard.ListInterfaces() wgPeers := m.WireGuard.ListPeers("") pptpList := m.PPTP.List() l2tpList := m.L2TP.List() ipsecList := m.IPSec.List() activePPPoE := 0 for _, p := range pppoeList { if p.Running { activePPPoE++ } } activeWG := 0 for _, w := range wgIfaces { if w.Running { activeWG++ } } activePPTP := 0 for _, p := range pptpList { if p.Running { activePPTP++ } } activeL2TP := 0 for _, l := range l2tpList { if l.Running { activeL2TP++ } } activeIPSec := 0 for _, i := range ipsecList { if i.Running { activeIPSec++ } } totalActive := activePPPoE + activeWG + activePPTP + activeL2TP + activeIPSec return OverallVPNStatus{ TotalPPPoE: len(pppoeList), ActivePPPoE: activePPPoE, TotalWireGuard: len(wgIfaces), ActiveWireGuard: activeWG, TotalWireGuardPeers: len(wgPeers), TotalPPTP: len(pptpList), ActivePPTP: activePPTP, TotalL2TP: len(l2tpList), ActiveL2TP: activeL2TP, TotalIPSec: len(ipsecList), ActiveIPSec: activeIPSec, TotalActiveTunnels: totalActive, } }