From 2fc385155e114a18989ad1b8a60a5f3886ad147b Mon Sep 17 00:00:00 2001 From: Owen Date: Mon, 17 Nov 2025 18:14:17 -0500 Subject: [PATCH] Formatting Former-commit-id: c3c0a7b7651ec95bfd3998f27af056d2e82af46d --- olm/olm.go | 4 ++++ olm/types.go | 20 -------------------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/olm/olm.go b/olm/olm.go index d3583db..0dc19f8 100644 --- a/olm/olm.go +++ b/olm/olm.go @@ -74,6 +74,9 @@ var ( tunnelRunning bool sharedBind *bind.SharedBind holePunchManager *holepunch.Manager + peerMonitor *peermonitor.PeerMonitor + stopRegister func() + stopPing chan struct{} ) 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 { logger.Error("Failed to bring up WireGuard device: %v", err) } + if err = ConfigureInterface(interfaceName, wgData); err != nil { logger.Error("Failed to configure interface: %v", err) } diff --git a/olm/types.go b/olm/types.go index 192f7fe..4ccdb8d 100644 --- a/olm/types.go +++ b/olm/types.go @@ -1,7 +1,5 @@ package olm -import "github.com/fosrl/olm/peermonitor" - type WgData struct { Sites []SiteConfig `json:"sites"` 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 } -type TargetsByType struct { - UDP []string `json:"udp"` - TCP []string `json:"tcp"` -} - -type TargetData struct { - Targets []string `json:"targets"` -} - type HolePunchMessage struct { NewtID string `json:"newtId"` } @@ -44,15 +33,6 @@ type EncryptedHolePunchMessage struct { 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 type PeerAction struct { Action string `json:"action"` // "add", "update", or "remove"