Formatting

Former-commit-id: c3c0a7b765
This commit is contained in:
Owen
2025-11-17 18:14:17 -05:00
parent b7271b77b6
commit 2fc385155e
2 changed files with 4 additions and 20 deletions

View File

@@ -74,6 +74,9 @@ var (
tunnelRunning bool tunnelRunning bool
sharedBind *bind.SharedBind sharedBind *bind.SharedBind
holePunchManager *holepunch.Manager holePunchManager *holepunch.Manager
peerMonitor *peermonitor.PeerMonitor
stopRegister func()
stopPing chan struct{}
) )
func Run(ctx context.Context, config Config) { func Run(ctx context.Context, config Config) {
@@ -432,6 +435,7 @@ func TunnelProcess(ctx context.Context, config Config, id string, secret string,
if err = dev.Up(); err != nil { if err = dev.Up(); err != nil {
logger.Error("Failed to bring up WireGuard device: %v", err) logger.Error("Failed to bring up WireGuard device: %v", err)
} }
if err = ConfigureInterface(interfaceName, wgData); err != nil { if err = ConfigureInterface(interfaceName, wgData); err != nil {
logger.Error("Failed to configure interface: %v", err) logger.Error("Failed to configure interface: %v", err)
} }

View File

@@ -1,7 +1,5 @@
package olm package olm
import "github.com/fosrl/olm/peermonitor"
type WgData struct { type WgData struct {
Sites []SiteConfig `json:"sites"` Sites []SiteConfig `json:"sites"`
TunnelIP string `json:"tunnelIP"` TunnelIP string `json:"tunnelIP"`
@@ -16,15 +14,6 @@ type SiteConfig struct {
RemoteSubnets string `json:"remoteSubnets,omitempty"` // optional, comma-separated list of subnets that this site can access RemoteSubnets string `json:"remoteSubnets,omitempty"` // optional, comma-separated list of subnets that this site can access
} }
type TargetsByType struct {
UDP []string `json:"udp"`
TCP []string `json:"tcp"`
}
type TargetData struct {
Targets []string `json:"targets"`
}
type HolePunchMessage struct { type HolePunchMessage struct {
NewtID string `json:"newtId"` NewtID string `json:"newtId"`
} }
@@ -44,15 +33,6 @@ type EncryptedHolePunchMessage struct {
Ciphertext []byte `json:"ciphertext"` Ciphertext []byte `json:"ciphertext"`
} }
var (
peerMonitor *peermonitor.PeerMonitor
stopHolepunch chan struct{}
stopRegister func()
stopPing chan struct{}
olmToken string
holePunchRunning bool
)
// PeerAction represents a request to add, update, or remove a peer // PeerAction represents a request to add, update, or remove a peer
type PeerAction struct { type PeerAction struct {
Action string `json:"action"` // "add", "update", or "remove" Action string `json:"action"` // "add", "update", or "remove"