33 lines
968 B
PHP
33 lines
968 B
PHP
<?php
|
|
|
|
namespace App\Services\Wireguard;
|
|
|
|
/**
|
|
* The CluPilot VM's WireGuard hub. Onboarding allocates a management IP and
|
|
* registers the new host as a peer so its Proxmox API is reachable over the tunnel.
|
|
*/
|
|
interface WireguardHub
|
|
{
|
|
/** Allocate a free management IP from the hub subnet. */
|
|
public function allocateIp(): string;
|
|
|
|
public function addPeer(string $publicKey, string $ip): void;
|
|
|
|
public function removePeer(string $publicKey): void;
|
|
|
|
/** Public endpoint (host:port) peers dial to reach the hub. */
|
|
public function endpoint(): string;
|
|
|
|
/** The hub's WireGuard public key. */
|
|
public function publicKey(): string;
|
|
|
|
/**
|
|
* What the interface currently reports, keyed by public key. Live state —
|
|
* traffic counters and handshakes only exist here, never in the database
|
|
* until SyncVpnPeers copies them over.
|
|
*
|
|
* @return array<string, PeerSnapshot>
|
|
*/
|
|
public function peers(): array;
|
|
}
|