mirror of
https://github.com/tim-beatham/smegmesh.git
synced 2024-12-13 18:11:25 +01:00
35 lines
658 B
Go
35 lines
658 B
Go
package ctrlserver
|
|
|
|
import (
|
|
"github.com/tim-beatham/wgmesh/pkg/conn"
|
|
"golang.zx2c4.com/wireguard/wgctrl"
|
|
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
|
|
)
|
|
|
|
/*
|
|
* Represents a WireGuard node
|
|
*/
|
|
type MeshNode struct {
|
|
HostEndpoint string
|
|
WgEndpoint string
|
|
PublicKey string
|
|
WgHost string
|
|
}
|
|
|
|
type Mesh struct {
|
|
SharedKey *wgtypes.Key
|
|
Nodes map[string]MeshNode
|
|
}
|
|
|
|
/*
|
|
* Defines the mesh control server this node
|
|
* is running
|
|
*/
|
|
type MeshCtrlServer struct {
|
|
Client *wgctrl.Client
|
|
Meshes map[string]Mesh
|
|
IfName string
|
|
ConnectionManager *conn.ConnectionManager
|
|
ConnectionServer *conn.ConnectionServer
|
|
}
|