package vpn // OverallVPNStatus provides quick telemetry for the sidebar badges type OverallVPNStatus struct { TotalPPPoE int `json:"total_pppoe"` ActivePPPoE int `json:"active_pppoe"` TotalWireGuard int `json:"total_wireguard"` ActiveWireGuard int `json:"active_wireguard"` TotalWireGuardPeers int `json:"total_wg_peers"` TotalPPTP int `json:"total_pptp"` ActivePPTP int `json:"active_pptp"` TotalL2TP int `json:"total_l2tp"` ActiveL2TP int `json:"active_l2tp"` TotalIPSec int `json:"total_ipsec"` ActiveIPSec int `json:"active_ipsec"` TotalEoIP int `json:"total_eoip"` ActiveEoIP int `json:"active_eoip"` TotalPPPSessions int `json:"total_ppp_sessions"` PPPoEServerRunning bool `json:"pppoe_server_running"` PPTPServerRunning bool `json:"pptp_server_running"` L2TPServerRunning bool `json:"l2tp_server_running"` IPSecServerRunning bool `json:"ipsec_server_running"` TotalActiveTunnels int `json:"total_active_tunnels"` } // ======================== PPPoE Client (MikroTik style) ======================== type PPPoEInstance struct { Name string `json:"name"` // e.g. "pppoe-out1", "pppoe-wan2" Interface string `json:"interface"` // Physical or VLAN interface, e.g. "eth0", "eth0.100" Username string `json:"username"` Password string `json:"password"` ServiceName string `json:"service_name,omitempty"` MTU int `json:"mtu"` // default 1492 DefaultRoute bool `json:"default_route"` AutoReconnect bool `json:"auto_reconnect"` Disabled bool `json:"disabled"` Running bool `json:"running"` // MikroTik 'R' flag AssignedIP string `json:"assigned_ip,omitempty"` PPPDevice string `json:"ppp_device,omitempty"` // e.g. "ppp0" Uptime string `json:"uptime,omitempty"` LastError string `json:"last_error,omitempty"` } // ======================== WireGuard (MikroTik style) ======================== type WireGuardPeer struct { Interface string `json:"interface"` // Name of parent WG interface (e.g. "wg0") Name string `json:"name"` // Friendly label (e.g. "Peer-Office", "Laptop") Comment string `json:"comment,omitempty"` PublicKey string `json:"public_key"` AllowedIPs []string `json:"allowed_ips"` EndpointAddress string `json:"endpoint_address,omitempty"` EndpointPort int `json:"endpoint_port,omitempty"` PersistentKeepalive int `json:"persistent_keepalive,omitempty"` PresharedKey string `json:"preshared_key,omitempty"` Disabled bool `json:"disabled"` LatestHandshake string `json:"latest_handshake,omitempty"` TransferRxBytes uint64 `json:"transfer_rx_bytes,omitempty"` TransferTxBytes uint64 `json:"transfer_tx_bytes,omitempty"` TransferRxHuman string `json:"transfer_rx_human,omitempty"` TransferTxHuman string `json:"transfer_tx_human,omitempty"` } type WireGuardInterface struct { Name string `json:"name"` // e.g. "wg0", "wg-office", "wg-site2site" ListenPort int `json:"listen_port"` // UDP port e.g. 51820 PrivateKey string `json:"private_key"` PublicKey string `json:"public_key"` Address string `json:"address"` // e.g. "10.10.0.1/24" MTU int `json:"mtu"` // default 1420 Comment string `json:"comment,omitempty"` Disabled bool `json:"disabled"` Running bool `json:"running"` // MikroTik 'R' flag PeersCount int `json:"peers_count"` Peers []WireGuardPeer `json:"peers"` LastError string `json:"last_error,omitempty"` } type SaveWireGuardInterfaceRequest struct { WireGuardInterface OrigName string `json:"orig_name,omitempty"` } type SaveWireGuardPeerRequest struct { WireGuardPeer OrigInterface string `json:"orig_interface,omitempty"` OrigPublicKey string `json:"orig_public_key,omitempty"` } // ======================== PPTP Client (MikroTik style) ======================== type PPTPInstance struct { Name string `json:"name"` // e.g. "pptp-out1" ConnectTo string `json:"connect_to"` // Server IP / hostname Username string `json:"username"` Password string `json:"password"` RequireMPPE bool `json:"require_mppe"` DefaultRoute bool `json:"default_route"` AutoReconnect bool `json:"auto_reconnect"` Disabled bool `json:"disabled"` Running bool `json:"running"` AssignedIP string `json:"assigned_ip,omitempty"` PPPDevice string `json:"ppp_device,omitempty"` LastError string `json:"last_error,omitempty"` } // ======================== L2TP Client (MikroTik style) ======================== type L2TPInstance struct { Name string `json:"name"` // e.g. "l2tp-out1" ConnectTo string `json:"connect_to"` // Server IP / hostname Username string `json:"username"` Password string `json:"password"` IPsecSecret string `json:"ipsec_secret,omitempty"` // For L2TP/IPsec DefaultRoute bool `json:"default_route"` Disabled bool `json:"disabled"` Running bool `json:"running"` AssignedIP string `json:"assigned_ip,omitempty"` PPPDevice string `json:"ppp_device,omitempty"` LastError string `json:"last_error,omitempty"` } // ======================== IPSec Connection / Policy (MikroTik style) ======================== type IPSecConfig struct { Connections []IPSecConnection `json:"connections"` } type IPSecStatus struct { Running bool `json:"running"` ActiveSAs int `json:"active_sas"` Connections []IPSecConnection `json:"connections"` RawStatus string `json:"raw_status"` } type IPSecConnection struct { Name string `json:"name"` // e.g. "ipsec-peer1", "site-to-site" LocalAddrs string `json:"local_addrs"` // "%any" or local IP RemoteAddrs string `json:"remote_addrs"` // Remote Gateway IP or FQDN LocalSubnet string `json:"local_subnet"` // e.g. "192.168.10.0/24" RemoteSubnet string `json:"remote_subnet"` // e.g. "192.168.20.0/24" PresharedKey string `json:"preshared_key"` IKEProposals string `json:"ike_proposals"` // default: aes256-sha256-modp2048 ESPProposals string `json:"esp_proposals"` // default: aes256-sha256-modp2048 AutoStart bool `json:"auto_start"` Disabled bool `json:"disabled"` Running bool `json:"running"` // Active SA installed Status string `json:"status"` // "ESTABLISHED", "INSTALLED", "DISCONNECTED" }