Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3858f7f23a | |||
| 9f0aba0f32 | |||
| 5e64dfc4eb | |||
| 20f51ee286 | |||
| f7c63678d1 | |||
| c9bfcf2ebe | |||
| b0de9be277 | |||
| 88f8e88805 | |||
| d2fa2a2202 | |||
| 74a6b09b97 | |||
| 7a4fc3491a | |||
| 56c843cfc1 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,5 +3,6 @@ CHANGELOG.md
|
||||
.cache
|
||||
virtual-vxlan.exe
|
||||
virtual-vxlan
|
||||
virtual-vxlan.log
|
||||
dist
|
||||
sysroot/linux*
|
||||
|
||||
2
Makefile
2
Makefile
@ -2,7 +2,7 @@ VERSION ?= $(shell git describe --tags `git rev-list --tags --max-count=1`)
|
||||
GITREV = $(shell git rev-parse --short HEAD)
|
||||
BUILDTIME = $(shell date +'%FT%TZ%z')
|
||||
PACKAGE_NAME := github.com/grmrgecko/virtual-vxlan
|
||||
GO_BUILDER_VERSION ?= 1.23
|
||||
GO_BUILDER_VERSION ?= 1.25
|
||||
|
||||
.PHONY: default
|
||||
default: build ;
|
||||
|
||||
@ -20,11 +20,20 @@ func (s *GRPCServer) SaveConfig(ctx context.Context, in *pb.Empty) (*pb.Empty, e
|
||||
// Reload the configuration from the yaml file.
|
||||
func (s *GRPCServer) ReloadConfig(ctx context.Context, in *pb.Empty) (*pb.Empty, error) {
|
||||
log.Println("Reloading configurations.")
|
||||
app.ApplyingConfig = true
|
||||
config := ReadConfig()
|
||||
err := ApplyConfig(config)
|
||||
app.ApplyingConfig = false
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
return nil, err
|
||||
}
|
||||
return new(pb.Empty), nil
|
||||
}
|
||||
|
||||
// Check if the config is being applied.
|
||||
func (s *GRPCServer) IsApplyingConfig(ctx context.Context, in *pb.Empty) (*pb.IsApplyingConfigReply, error) {
|
||||
reply := new(pb.IsApplyingConfigReply)
|
||||
reply.IsApplying = app.ApplyingConfig
|
||||
return reply, nil
|
||||
}
|
||||
|
||||
@ -18,8 +18,9 @@ const _deviceState_name = "DownUpClosed"
|
||||
var _deviceState_index = [...]uint8{0, 4, 6, 12}
|
||||
|
||||
func (i deviceState) String() string {
|
||||
if i >= deviceState(len(_deviceState_index)-1) {
|
||||
idx := int(i) - 0
|
||||
if i < 0 || idx >= len(_deviceState_index)-1 {
|
||||
return "deviceState(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||
}
|
||||
return _deviceState_name[_deviceState_index[i]:_deviceState_index[i+1]]
|
||||
return _deviceState_name[_deviceState_index[idx]:_deviceState_index[idx+1]]
|
||||
}
|
||||
|
||||
62
go.mod
62
go.mod
@ -1,31 +1,35 @@
|
||||
module github.com/grmrgecko/virtual-vxlan
|
||||
|
||||
go 1.23.4
|
||||
go 1.24.6
|
||||
|
||||
require (
|
||||
github.com/alecthomas/kong v1.6.0
|
||||
github.com/Microsoft/go-winio v0.6.2
|
||||
github.com/alecthomas/kong v1.12.1
|
||||
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf
|
||||
github.com/creativeprojects/go-selfupdate v1.4.0
|
||||
github.com/creativeprojects/go-selfupdate v1.5.1
|
||||
github.com/google/gopacket v1.1.19
|
||||
github.com/hashicorp/go-version v1.7.0
|
||||
github.com/jedib0t/go-pretty/v6 v6.6.5
|
||||
github.com/kardianos/service v1.2.2
|
||||
github.com/kkyr/fig v0.4.0
|
||||
github.com/jedib0t/go-pretty/v6 v6.6.8
|
||||
github.com/kardianos/service v1.2.4
|
||||
github.com/kkyr/fig v0.5.0
|
||||
github.com/shibukawa/configdir v0.0.0-20170330084843-e180dbdc8da0
|
||||
github.com/sirupsen/logrus v1.9.3
|
||||
github.com/vishvananda/netlink v1.3.0
|
||||
golang.org/x/sys v0.29.0
|
||||
github.com/vishvananda/netlink v1.3.1
|
||||
golang.org/x/sys v0.37.0
|
||||
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2
|
||||
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173
|
||||
golang.zx2c4.com/wireguard v0.0.0-20250521234502-f333402bd9cb
|
||||
golang.zx2c4.com/wireguard/windows v0.5.3
|
||||
google.golang.org/grpc v1.69.2
|
||||
google.golang.org/protobuf v1.36.1
|
||||
google.golang.org/grpc v1.76.0
|
||||
google.golang.org/protobuf v1.36.10
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.2.1
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
)
|
||||
|
||||
require (
|
||||
code.gitea.io/sdk/gitea v0.19.0 // indirect
|
||||
github.com/Masterminds/semver/v3 v3.3.1 // indirect
|
||||
code.gitea.io/sdk/gitea v0.22.0 // indirect
|
||||
github.com/42wim/httpsig v1.2.3 // indirect
|
||||
github.com/Masterminds/semver/v3 v3.4.0 // indirect
|
||||
github.com/clipperhouse/uax29/v2 v2.2.0 // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/davidmz/go-pageant v1.0.2 // indirect
|
||||
github.com/fatih/color v1.18.0 // indirect
|
||||
@ -33,26 +37,24 @@ require (
|
||||
github.com/google/go-github/v30 v30.1.0 // indirect
|
||||
github.com/google/go-querystring v1.1.0 // indirect
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
|
||||
github.com/hashicorp/go-retryablehttp v0.7.8 // indirect
|
||||
github.com/kr/pretty v0.3.1 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.16 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.19 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||
github.com/rivo/uniseg v0.4.7 // indirect
|
||||
github.com/rogpeppe/go-internal v1.13.2-0.20241226121412-a5dc8ff20d0a // indirect
|
||||
github.com/stretchr/testify v1.10.0 // indirect
|
||||
github.com/ulikunitz/xz v0.5.12 // indirect
|
||||
github.com/vishvananda/netns v0.0.4 // indirect
|
||||
github.com/xanzy/go-gitlab v0.112.0 // indirect
|
||||
golang.org/x/crypto v0.32.0 // indirect
|
||||
golang.org/x/mod v0.22.0 // indirect
|
||||
golang.org/x/net v0.34.0 // indirect
|
||||
golang.org/x/oauth2 v0.24.0 // indirect
|
||||
golang.org/x/sync v0.10.0 // indirect
|
||||
golang.org/x/text v0.21.0 // indirect
|
||||
golang.org/x/time v0.7.0 // indirect
|
||||
golang.org/x/tools v0.29.0 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect
|
||||
github.com/ulikunitz/xz v0.5.15 // indirect
|
||||
github.com/vishvananda/netns v0.0.5 // indirect
|
||||
github.com/xanzy/go-gitlab v0.115.0 // indirect
|
||||
golang.org/x/crypto v0.43.0 // indirect
|
||||
golang.org/x/mod v0.29.0 // indirect
|
||||
golang.org/x/net v0.46.0 // indirect
|
||||
golang.org/x/oauth2 v0.32.0 // indirect
|
||||
golang.org/x/sync v0.17.0 // indirect
|
||||
golang.org/x/text v0.30.0 // indirect
|
||||
golang.org/x/time v0.14.0 // indirect
|
||||
golang.org/x/tools v0.38.0 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20251022142026-3a174f9686a8 // indirect
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
|
||||
)
|
||||
|
||||
160
go.sum
160
go.sum
@ -1,18 +1,24 @@
|
||||
code.gitea.io/sdk/gitea v0.19.0 h1:8I6s1s4RHgzxiPHhOQdgim1RWIRcr0LVMbHBjBFXq4Y=
|
||||
code.gitea.io/sdk/gitea v0.19.0/go.mod h1:IG9xZJoltDNeDSW0qiF2Vqx5orMWa7OhVWrjvrd5NpI=
|
||||
github.com/Masterminds/semver/v3 v3.3.1 h1:QtNSWtVZ3nBfk8mAOu/B6v7FMJ+NHTIgUPi7rj+4nv4=
|
||||
github.com/Masterminds/semver/v3 v3.3.1/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
|
||||
code.gitea.io/sdk/gitea v0.22.0 h1:HCKq7bX/HQ85Nw7c/HAhWgRye+vBp5nQOE8Md1+9Ef0=
|
||||
code.gitea.io/sdk/gitea v0.22.0/go.mod h1:yyF5+GhljqvA30sRDreoyHILruNiy4ASufugzYg0VHM=
|
||||
github.com/42wim/httpsig v1.2.3 h1:xb0YyWhkYj57SPtfSttIobJUPJZB9as1nsfo7KWVcEs=
|
||||
github.com/42wim/httpsig v1.2.3/go.mod h1:nZq9OlYKDrUBhptd77IHx4/sZZD+IxTBADvAPI9G/EM=
|
||||
github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0=
|
||||
github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
|
||||
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
|
||||
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
|
||||
github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0=
|
||||
github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k=
|
||||
github.com/alecthomas/kong v1.6.0 h1:mwOzbdMR7uv2vul9J0FU3GYxE7ls/iX1ieMg5WIM6gE=
|
||||
github.com/alecthomas/kong v1.6.0/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU=
|
||||
github.com/alecthomas/kong v1.12.1 h1:iq6aMJDcFYP9uFrLdsiZQ2ZMmcshduyGv4Pek0MQPW0=
|
||||
github.com/alecthomas/kong v1.12.1/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU=
|
||||
github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc=
|
||||
github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
|
||||
github.com/clipperhouse/uax29/v2 v2.2.0 h1:ChwIKnQN3kcZteTXMgb1wztSgaU+ZemkgWdohwgs8tY=
|
||||
github.com/clipperhouse/uax29/v2 v2.2.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM=
|
||||
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf h1:iW4rZ826su+pqaw19uhpSCzhj44qo35pNgKFGqzDKkU=
|
||||
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/creativeprojects/go-selfupdate v1.4.0 h1:4ePPd2CPCNl/YoPXeVxpuBLDUZh8rMEKP5ac+1Y/r5c=
|
||||
github.com/creativeprojects/go-selfupdate v1.4.0/go.mod h1:oPG7LmzEmS6OxfqEm620k5VKxP45xFZNKMkp4V5qqUY=
|
||||
github.com/creativeprojects/go-selfupdate v1.5.1 h1:fuyEGFFfqcC8SxDGolcEPYPLXGQ9Mcrc5uRyRG2Mqnk=
|
||||
github.com/creativeprojects/go-selfupdate v1.5.1/go.mod h1:2uY75rP8z/D/PBuDn6mlBnzu+ysEmwOJfcgF8np0JIM=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||
@ -23,16 +29,16 @@ github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
|
||||
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
|
||||
github.com/go-fed/httpsig v1.1.0 h1:9M+hb0jkEICD8/cAiNqEB66R87tTINszBRTjwjQzWcI=
|
||||
github.com/go-fed/httpsig v1.1.0/go.mod h1:RCMrTZvN1bJYtofsG4rd5NaO5obxQ5xBkdiS7xsT7bM=
|
||||
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
|
||||
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
|
||||
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
||||
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
|
||||
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
|
||||
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/google/go-github/v30 v30.1.0 h1:VLDx+UolQICEOKu2m4uAoMti1SxuEBAl7RSEG16L+Oo=
|
||||
github.com/google/go-github/v30 v30.1.0/go.mod h1:n8jBpHl45a/rlBUtRJMOG4GhNADUQFEufcolZ95JfU8=
|
||||
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
|
||||
@ -46,18 +52,18 @@ github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9n
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
|
||||
github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k=
|
||||
github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU=
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk=
|
||||
github.com/hashicorp/go-retryablehttp v0.7.8 h1:ylXZWnqa7Lhqpk0L1P1LzDtGcCR0rPVUrx/c8Unxc48=
|
||||
github.com/hashicorp/go-retryablehttp v0.7.8/go.mod h1:rjiScheydd+CxvumBsIrFKlx3iS0jrZ7LvzFGFmuKbw=
|
||||
github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY=
|
||||
github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
|
||||
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
|
||||
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
|
||||
github.com/jedib0t/go-pretty/v6 v6.6.5 h1:9PgMJOVBedpgYLI56jQRJYqngxYAAzfEUua+3NgSqAo=
|
||||
github.com/jedib0t/go-pretty/v6 v6.6.5/go.mod h1:Uq/HrbhuFty5WSVNfjpQQe47x16RwVGXIveNGEyGtHs=
|
||||
github.com/kardianos/service v1.2.2 h1:ZvePhAHfvo0A7Mftk/tEzqEZ7Q4lgnR8sGz4xu1YX60=
|
||||
github.com/kardianos/service v1.2.2/go.mod h1:CIMRFEJVL+0DS1a3Nx06NaMn4Dz63Ng6O7dl0qH0zVM=
|
||||
github.com/kkyr/fig v0.4.0 h1:4D/g72a8ij1fgRypuIbEoqIT7ukf2URVBtE777/gkbc=
|
||||
github.com/kkyr/fig v0.4.0/go.mod h1:U4Rq/5eUNJ8o5UvOEc9DiXtNf41srOLn2r/BfCyuc58=
|
||||
github.com/jedib0t/go-pretty/v6 v6.6.8 h1:JnnzQeRz2bACBobIaa/r+nqjvws4yEhcmaZ4n1QzsEc=
|
||||
github.com/jedib0t/go-pretty/v6 v6.6.8/go.mod h1:YwC5CE4fJ1HFUDeivSV1r//AmANFHyqczZk+U6BDALU=
|
||||
github.com/kardianos/service v1.2.4 h1:XNlGtZOYNx2u91urOdg/Kfmc+gfmuIo1Dd3rEi2OgBk=
|
||||
github.com/kardianos/service v1.2.4/go.mod h1:E4V9ufUuY82F7Ztlu1eN9VXWIQxg8NoLQlmFe0MtrXc=
|
||||
github.com/kkyr/fig v0.5.0 h1:D4ym5MYYScOSgqyx1HYQaqFn9dXKzIuSz8N6SZ4rzqM=
|
||||
github.com/kkyr/fig v0.5.0/go.mod h1:U4Rq/5eUNJ8o5UvOEc9DiXtNf41srOLn2r/BfCyuc58=
|
||||
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
@ -69,19 +75,16 @@ github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxec
|
||||
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
|
||||
github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
||||
github.com/mattn/go-runewidth v0.0.19 h1:v++JhqYnZuu5jSKrk9RbgF5v4CGUjqRfBm05byFGLdw=
|
||||
github.com/mattn/go-runewidth v0.0.19/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs=
|
||||
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
|
||||
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||
github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M=
|
||||
github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc=
|
||||
github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=
|
||||
github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
|
||||
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
|
||||
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
|
||||
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
||||
github.com/rogpeppe/go-internal v1.13.2-0.20241226121412-a5dc8ff20d0a h1:w3tdWGKbLGBPtR/8/oO74W6hmz0qE5q0z9aqSAewaaM=
|
||||
github.com/rogpeppe/go-internal v1.13.2-0.20241226121412-a5dc8ff20d0a/go.mod h1:S8kfXMp+yh77OxPD4fdM6YUknrZpQxLhvxzS4gDHENY=
|
||||
@ -91,88 +94,93 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ
|
||||
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc=
|
||||
github.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
|
||||
github.com/vishvananda/netlink v1.3.0 h1:X7l42GfcV4S6E4vHTsw48qbrV+9PVojNfIhZcwQdrZk=
|
||||
github.com/vishvananda/netlink v1.3.0/go.mod h1:i6NetklAujEcC6fK0JPjT8qSwWyO0HLn4UKG+hGqeJs=
|
||||
github.com/vishvananda/netns v0.0.4 h1:Oeaw1EM2JMxD51g9uhtC0D7erkIjgmj8+JZc26m1YX8=
|
||||
github.com/vishvananda/netns v0.0.4/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM=
|
||||
github.com/xanzy/go-gitlab v0.112.0 h1:6Z0cqEooCvBMfBIHw+CgO4AKGRV8na/9781xOb0+DKw=
|
||||
github.com/xanzy/go-gitlab v0.112.0/go.mod h1:wKNKh3GkYDMOsGmnfuX+ITCmDuSDWFO0G+C4AygL9RY=
|
||||
go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY=
|
||||
go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE=
|
||||
go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE=
|
||||
go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY=
|
||||
go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk=
|
||||
go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8=
|
||||
go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys=
|
||||
go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A=
|
||||
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
||||
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
|
||||
github.com/ulikunitz/xz v0.5.15 h1:9DNdB5s+SgV3bQ2ApL10xRc35ck0DuIX/isZvIk+ubY=
|
||||
github.com/ulikunitz/xz v0.5.15/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
|
||||
github.com/vishvananda/netlink v1.3.1 h1:3AEMt62VKqz90r0tmNhog0r/PpWKmrEShJU0wJW6bV0=
|
||||
github.com/vishvananda/netlink v1.3.1/go.mod h1:ARtKouGSTGchR8aMwmkzC0qiNPrrWO5JS/XMVl45+b4=
|
||||
github.com/vishvananda/netns v0.0.5 h1:DfiHV+j8bA32MFM7bfEunvT8IAqQ/NzSJHtcmW5zdEY=
|
||||
github.com/vishvananda/netns v0.0.5/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM=
|
||||
github.com/xanzy/go-gitlab v0.115.0 h1:6DmtItNcVe+At/liXSgfE/DZNZrGfalQmBRmOcJjOn8=
|
||||
github.com/xanzy/go-gitlab v0.115.0/go.mod h1:5XCDtM7AM6WMKmfDdOiEpyRWUqui2iS9ILfvCZ2gJ5M=
|
||||
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
|
||||
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
|
||||
go.opentelemetry.io/otel v1.37.0 h1:9zhNfelUvx0KBfu/gb+ZgeAfAgtWrfHJZcAqFC228wQ=
|
||||
go.opentelemetry.io/otel v1.37.0/go.mod h1:ehE/umFRLnuLa/vSccNq9oS1ErUlkkK71gMcN34UG8I=
|
||||
go.opentelemetry.io/otel/metric v1.37.0 h1:mvwbQS5m0tbmqML4NqK+e3aDiO02vsf/WgbsdpcPoZE=
|
||||
go.opentelemetry.io/otel/metric v1.37.0/go.mod h1:04wGrZurHYKOc+RKeye86GwKiTb9FKm1WHtO+4EVr2E=
|
||||
go.opentelemetry.io/otel/sdk v1.37.0 h1:ItB0QUqnjesGRvNcmAcU0LyvkVyGJ2xftD29bWdDvKI=
|
||||
go.opentelemetry.io/otel/sdk v1.37.0/go.mod h1:VredYzxUvuo2q3WRcDnKDjbdvmO0sCzOvVAiY+yUkAg=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.37.0 h1:90lI228XrB9jCMuSdA0673aubgRobVZFhbjxHHspCPc=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.37.0/go.mod h1:cNen4ZWfiD37l5NhS+Keb5RXVWZWpRE+9WyVCpbo5ps=
|
||||
go.opentelemetry.io/otel/trace v1.37.0 h1:HLdcFNbRQBE2imdSEgm/kwqmQj1Or1l/7bW6mxVK7z4=
|
||||
go.opentelemetry.io/otel/trace v1.37.0/go.mod h1:TlgrlQ+PtQO5XFerSPUYG0JSgGyryXewPGyayAWSBS0=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
|
||||
golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc=
|
||||
golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc=
|
||||
golang.org/x/crypto v0.43.0 h1:dduJYIi3A3KOfdGOHX8AVZ/jGiyPa3IbBozJ5kNuE04=
|
||||
golang.org/x/crypto v0.43.0/go.mod h1:BFbav4mRNlXJL4wNeejLpWxB7wMbc79PdRGhWKncxR0=
|
||||
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||
golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=
|
||||
golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
|
||||
golang.org/x/mod v0.29.0 h1:HV8lRxZC4l2cr3Zq1LvtOsi/ThTgWnUk/y64QSs8GwA=
|
||||
golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
|
||||
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
|
||||
golang.org/x/net v0.46.0 h1:giFlY12I07fugqwPuWJi68oOnpfqFnJIJzaIIm2JVV4=
|
||||
golang.org/x/net v0.46.0/go.mod h1:Q9BGdFy1y4nkUwiLvT5qtyhAnEHgnQ/zd8PfU6nc210=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE=
|
||||
golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
|
||||
golang.org/x/oauth2 v0.32.0 h1:jsCblLleRMDrxMN29H3z/k1KliIvpLgCkE6R8FXXNgY=
|
||||
golang.org/x/oauth2 v0.32.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
|
||||
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug=
|
||||
golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
|
||||
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ=
|
||||
golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg=
|
||||
golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek=
|
||||
golang.org/x/term v0.36.0 h1:zMPR+aF8gfksFprF/Nc/rd1wRS1EI6nDBGyWAvDzx2Q=
|
||||
golang.org/x/term v0.36.0/go.mod h1:Qu394IJq6V6dCBRgwqshf3mPF85AqzYEzofzRdZkWss=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
|
||||
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
|
||||
golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ=
|
||||
golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
|
||||
golang.org/x/text v0.30.0 h1:yznKA/E9zq54KzlzBEAWn1NXSQ8DIp/NYMy88xJjl4k=
|
||||
golang.org/x/text v0.30.0/go.mod h1:yDdHFIX9t+tORqspjENWgzaCVXgk0yYnYuSZ8UzzBVM=
|
||||
golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=
|
||||
golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE=
|
||||
golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588=
|
||||
golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ=
|
||||
golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 h1:B82qJJgjvYKsXS9jeunTOisW56dUokqW/FOteYJJ/yg=
|
||||
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2/go.mod h1:deeaetjYA+DHMHg+sMSMI58GrEteJUUzzw7en6TJQcI=
|
||||
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173 h1:/jFs0duh4rdb8uIfPMv78iAJGcPKDeqAFnaLBropIC4=
|
||||
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173/go.mod h1:tkCQ4FQXmpAgYVh++1cq16/dH4QJtmvpRv19DWGAHSA=
|
||||
golang.zx2c4.com/wireguard v0.0.0-20250521234502-f333402bd9cb h1:whnFRlWMcXI9d+ZbWg+4sHnLp52d5yiIPUxMBSt4X9A=
|
||||
golang.zx2c4.com/wireguard v0.0.0-20250521234502-f333402bd9cb/go.mod h1:rpwXGsirqLqN2L0JDJQlwOboGHmptD5ZD6T2VmcqhTw=
|
||||
golang.zx2c4.com/wireguard/windows v0.5.3 h1:On6j2Rpn3OEMXqBq00QEDC7bWSZrPIHKIus8eIuExIE=
|
||||
golang.zx2c4.com/wireguard/windows v0.5.3/go.mod h1:9TEe8TJmtwyQebdFwAkEWOPr3prrtqm+REGFifP60hI=
|
||||
gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=
|
||||
gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 h1:X58yt85/IXCx0Y3ZwN6sEIKZzQtDEYaBWrDvErdXrRE=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI=
|
||||
google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU=
|
||||
google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4=
|
||||
google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk=
|
||||
google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20251022142026-3a174f9686a8 h1:M1rk8KBnUsBDg1oPGHNCxG4vc1f49epmTO7xscSajMk=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20251022142026-3a174f9686a8/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk=
|
||||
google.golang.org/grpc v1.76.0 h1:UnVkv1+uMLYXoIz6o7chp59WfQUYA2ex/BXQ9rHZu7A=
|
||||
google.golang.org/grpc v1.76.0/go.mod h1:Ju12QI8M6iQJtbcsV+awF5a4hfJMLi4X0JLo94ULZ6c=
|
||||
google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=
|
||||
google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc=
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
|
||||
@ -1,77 +1,97 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
|
||||
pb "github.com/grmrgecko/virtual-vxlan/vxlan"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
)
|
||||
|
||||
// Allows go generate to compile the protobuf to golang.
|
||||
//go:generate protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative ./vxlan/vxlan.proto
|
||||
|
||||
// GRPC server structure.
|
||||
type GRPCServer struct {
|
||||
pb.UnimplementedVxlanServer
|
||||
RPCPath string
|
||||
server *grpc.Server
|
||||
}
|
||||
|
||||
// Start serving GRPC requests.
|
||||
func (s *GRPCServer) Serve(li net.Listener) {
|
||||
err := s.server.Serve(li)
|
||||
if err != nil {
|
||||
log.Errorf("Error serving grpc: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
// Stop GRPC server.
|
||||
func (s *GRPCServer) Close() {
|
||||
s.server.Stop()
|
||||
}
|
||||
|
||||
// Start GRPC server.
|
||||
func NewGRPCServer(rpcPath string) (s *GRPCServer, err error) {
|
||||
// Verify another server doesn't exist.
|
||||
if app.grpcServer != nil {
|
||||
return nil, fmt.Errorf("grpc server is already running")
|
||||
}
|
||||
|
||||
// Connect to RPC path.
|
||||
li, err := net.Listen("unix", rpcPath)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to listen on socket: %v", err)
|
||||
}
|
||||
|
||||
// Setup server.
|
||||
s = new(GRPCServer)
|
||||
s.server = grpc.NewServer()
|
||||
|
||||
// Register the vxlan service to this server.
|
||||
pb.RegisterVxlanServer(s.server, s)
|
||||
|
||||
// Update the global app gRPC server.
|
||||
app.grpcServer = s
|
||||
|
||||
// Start serving requests.
|
||||
go s.Serve(li)
|
||||
return s, nil
|
||||
}
|
||||
|
||||
// Start a connection to the gRPC Server.
|
||||
func NewGRPCClient() (c pb.VxlanClient, conn *grpc.ClientConn, err error) {
|
||||
// Read the minimal config.
|
||||
config := ReadMinimalConfig()
|
||||
|
||||
// Start an gRPC client connection to the unix socket.
|
||||
conn, err = grpc.NewClient(fmt.Sprintf("unix:%s", config.RPCPath), grpc.WithTransportCredentials(insecure.NewCredentials()))
|
||||
|
||||
// If connection is successful, provide client to the vxlan service.
|
||||
if err == nil {
|
||||
c = pb.NewVxlanClient(conn)
|
||||
}
|
||||
return
|
||||
}
|
||||
//go:build !windows
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"os"
|
||||
|
||||
pb "github.com/grmrgecko/virtual-vxlan/vxlan"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
)
|
||||
|
||||
// Allows go generate to compile the protobuf to golang.
|
||||
//go:generate protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative ./vxlan/vxlan.proto
|
||||
|
||||
// GRPC server structure.
|
||||
type GRPCServer struct {
|
||||
pb.UnimplementedVxlanServer
|
||||
RPCPath string
|
||||
server *grpc.Server
|
||||
}
|
||||
|
||||
// Start serving GRPC requests.
|
||||
func (s *GRPCServer) Serve(li net.Listener) {
|
||||
err := s.server.Serve(li)
|
||||
if err != nil {
|
||||
log.Errorf("Error serving grpc: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
// Stop GRPC server.
|
||||
func (s *GRPCServer) Close() {
|
||||
s.server.Stop()
|
||||
}
|
||||
|
||||
// Verifies the RPC UNIX path is still listening if it exists.
|
||||
func RPCCleanPath(rpcPath string) {
|
||||
// Check if the RPC socket already exists.
|
||||
_, err := os.Stat(rpcPath)
|
||||
if err == nil {
|
||||
// If the socket exists, see if its listening.
|
||||
l, err := net.Dial("unix", rpcPath)
|
||||
|
||||
// If its not listening, remove it to allow us to start.
|
||||
if err != nil {
|
||||
os.Remove(rpcPath)
|
||||
} else {
|
||||
l.Close()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Start GRPC server.
|
||||
func NewGRPCServer(rpcPath string) (s *GRPCServer, err error) {
|
||||
// Verify another server doesn't exist.
|
||||
if app.grpcServer != nil {
|
||||
return nil, fmt.Errorf("grpc server is already running")
|
||||
}
|
||||
|
||||
// Connect to RPC path.
|
||||
li, err := net.Listen("unix", rpcPath)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to listen on socket: %v", err)
|
||||
}
|
||||
|
||||
// Setup server.
|
||||
s = new(GRPCServer)
|
||||
s.server = grpc.NewServer()
|
||||
|
||||
// Register the vxlan service to this server.
|
||||
pb.RegisterVxlanServer(s.server, s)
|
||||
|
||||
// Update the global app gRPC server.
|
||||
app.grpcServer = s
|
||||
|
||||
// Start serving requests.
|
||||
go s.Serve(li)
|
||||
return s, nil
|
||||
}
|
||||
|
||||
// Start a connection to the gRPC Server.
|
||||
func NewGRPCClient() (c pb.VxlanClient, conn *grpc.ClientConn, err error) {
|
||||
// Read the minimal config.
|
||||
config := ReadMinimalConfig()
|
||||
|
||||
// Start an gRPC client connection to the unix socket.
|
||||
conn, err = grpc.NewClient(fmt.Sprintf("unix:%s", config.RPCPath), grpc.WithTransportCredentials(insecure.NewCredentials()))
|
||||
|
||||
// If connection is successful, provide client to the vxlan service.
|
||||
if err == nil {
|
||||
c = pb.NewVxlanClient(conn)
|
||||
}
|
||||
return
|
||||
}
|
||||
126
grpc_windows.go
Normal file
126
grpc_windows.go
Normal file
@ -0,0 +1,126 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Microsoft/go-winio"
|
||||
pb "github.com/grmrgecko/virtual-vxlan/vxlan"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
)
|
||||
|
||||
// Allows go generate to compile the protobuf to golang.
|
||||
//go:generate protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative ./vxlan/vxlan.proto
|
||||
|
||||
// GRPC server structure.
|
||||
type GRPCServer struct {
|
||||
pb.UnimplementedVxlanServer
|
||||
RPCPath string
|
||||
server *grpc.Server
|
||||
}
|
||||
|
||||
// Start serving GRPC requests.
|
||||
func (s *GRPCServer) Serve(li net.Listener) {
|
||||
err := s.server.Serve(li)
|
||||
if err != nil {
|
||||
log.Errorf("Error serving grpc: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
// Stop GRPC server.
|
||||
func (s *GRPCServer) Close() {
|
||||
s.server.Stop()
|
||||
}
|
||||
|
||||
// Dialer for named pipes to allow connecting GRPC via named pipes.
|
||||
func pipeDialer(ctx context.Context, addr string) (net.Conn, error) {
|
||||
return winio.DialPipe(addr, nil)
|
||||
}
|
||||
|
||||
// Verifies the RPC UNIX path is still listening if it exists.
|
||||
func RPCCleanPath(rpcPath string) {
|
||||
if !strings.HasPrefix(rpcPath, `\\.\`) {
|
||||
// Check if the RPC socket already exists.
|
||||
_, err := os.Stat(rpcPath)
|
||||
if err == nil {
|
||||
// If the socket exists, see if its listening.
|
||||
l, err := net.Dial("unix", rpcPath)
|
||||
|
||||
// If its not listening, remove it to allow us to start.
|
||||
if err != nil {
|
||||
os.Remove(rpcPath)
|
||||
} else {
|
||||
l.Close()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Start GRPC server.
|
||||
func NewGRPCServer(rpcPath string) (s *GRPCServer, err error) {
|
||||
// Verify another server doesn't exist.
|
||||
if app.grpcServer != nil {
|
||||
return nil, fmt.Errorf("grpc server is already running")
|
||||
}
|
||||
|
||||
// Connect to RPC path.
|
||||
var li net.Listener
|
||||
if strings.HasPrefix(rpcPath, `\\.\`) {
|
||||
li, err = winio.ListenPipe(rpcPath, nil)
|
||||
} else {
|
||||
li, err = net.Listen("unix", rpcPath)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to listen on socket: %v", err)
|
||||
}
|
||||
|
||||
// Setup server.
|
||||
s = new(GRPCServer)
|
||||
s.server = grpc.NewServer()
|
||||
|
||||
// Register the vxlan service to this server.
|
||||
pb.RegisterVxlanServer(s.server, s)
|
||||
|
||||
// Update the global app gRPC server.
|
||||
app.grpcServer = s
|
||||
|
||||
// Start serving requests.
|
||||
go s.Serve(li)
|
||||
return s, nil
|
||||
}
|
||||
|
||||
// Start a connection to the gRPC Server.
|
||||
func NewGRPCClient() (c pb.VxlanClient, conn *grpc.ClientConn, err error) {
|
||||
// Read the minimal config.
|
||||
config := ReadMinimalConfig()
|
||||
|
||||
// Start an gRPC client connection to the unix socket.
|
||||
if strings.HasPrefix(config.RPCPath, `\\.\`) {
|
||||
// Attempt to connect using named pipes.
|
||||
dialOption := grpc.WithContextDialer(pipeDialer)
|
||||
|
||||
conn, err = grpc.DialContext(
|
||||
context.Background(),
|
||||
config.RPCPath,
|
||||
dialOption,
|
||||
grpc.WithTransportCredentials(insecure.NewCredentials()),
|
||||
// Add a timeout for the initial connection
|
||||
grpc.WithBlock(),
|
||||
grpc.WithTimeout(5*time.Second),
|
||||
)
|
||||
} else {
|
||||
conn, err = grpc.NewClient(fmt.Sprintf("unix:%s", config.RPCPath), grpc.WithTransportCredentials(insecure.NewCredentials()))
|
||||
}
|
||||
|
||||
// If connection is successful, provide client to the vxlan service.
|
||||
if err == nil {
|
||||
c = pb.NewVxlanClient(conn)
|
||||
}
|
||||
return
|
||||
}
|
||||
94
interface.go
94
interface.go
@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math"
|
||||
"math/rand"
|
||||
"net"
|
||||
"net/netip"
|
||||
@ -27,6 +28,14 @@ type ArpEntry struct {
|
||||
Updating bool
|
||||
}
|
||||
|
||||
// Static Route.
|
||||
type StaticRoute struct {
|
||||
Destination netip.Prefix
|
||||
Gateway netip.Addr
|
||||
Metric int
|
||||
Permanent bool
|
||||
}
|
||||
|
||||
// MAC Table Entry.
|
||||
type MacEntry struct {
|
||||
MAC net.HardwareAddr
|
||||
@ -57,6 +66,7 @@ type Interface struct {
|
||||
tables struct {
|
||||
arp []ArpEntry
|
||||
arpEvent map[netip.Addr][]chan net.HardwareAddr
|
||||
route []StaticRoute
|
||||
mac []MacEntry
|
||||
sync.RWMutex
|
||||
}
|
||||
@ -392,6 +402,83 @@ func (i *Interface) GetDestinationFor(mac net.HardwareAddr) *net.UDPAddr {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Add static route to interface.
|
||||
func (i *Interface) AddStaticRoute(destination netip.Prefix, gateway netip.Addr, metric int, perm bool) error {
|
||||
// Prevent concurrent table modifications.
|
||||
i.tables.Lock()
|
||||
defer i.tables.Unlock()
|
||||
i.tun.Lock()
|
||||
defer i.tun.Unlock()
|
||||
|
||||
// Default to 256 metric.
|
||||
if metric == 0 {
|
||||
metric = 256
|
||||
}
|
||||
|
||||
// Try adding via tunnel device.
|
||||
err := i.tun.device.AddRoute(destination, gateway, metric)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// If route successfully added, add to route table.
|
||||
route := StaticRoute{
|
||||
Destination: destination,
|
||||
Gateway: gateway,
|
||||
Metric: metric,
|
||||
Permanent: perm,
|
||||
}
|
||||
i.tables.route = append(i.tables.route, route)
|
||||
return nil
|
||||
}
|
||||
|
||||
// Remove static route from interface.
|
||||
func (i *Interface) RemoveStaticRoute(destination netip.Prefix, gateway netip.Addr) error {
|
||||
// Prevent concurrent table modifications.
|
||||
i.tables.Lock()
|
||||
defer i.tables.Unlock()
|
||||
i.tun.Lock()
|
||||
defer i.tun.Unlock()
|
||||
|
||||
// Remove from device first.
|
||||
err := i.tun.device.RemoveRoute(destination, gateway)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Remove from table.
|
||||
for r, route := range i.tables.route {
|
||||
// If route matches, remove it.
|
||||
if route.Destination == destination && route.Gateway == gateway {
|
||||
i.tables.route = append(i.tables.route[:r], i.tables.route[r+1:]...)
|
||||
break
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Returns the static route table.
|
||||
func (i *Interface) GetStaticRoutes() []StaticRoute {
|
||||
i.tables.RLock()
|
||||
defer i.tables.RUnlock()
|
||||
return i.tables.route
|
||||
}
|
||||
|
||||
// Find gateway for IP.
|
||||
func (i *Interface) GetGateway(destination netip.Addr) (gateway netip.Addr) {
|
||||
// Get read lock on table.
|
||||
i.tables.RLock()
|
||||
defer i.tables.RUnlock()
|
||||
metric := math.MaxInt
|
||||
for _, route := range i.tables.route {
|
||||
if route.Destination.Contains(destination) && route.Metric < metric {
|
||||
gateway = route.Gateway
|
||||
metric = route.Metric
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Add an ARP entry that is static.
|
||||
func (i *Interface) AddStaticARPEntry(addr netip.Addr, mac net.HardwareAddr, perm bool) {
|
||||
// Prevent concurrent table modifications.
|
||||
@ -598,6 +685,13 @@ func (i *Interface) updateARPFor(addr netip.Addr, brdMac net.HardwareAddr, ifceA
|
||||
// Find the MAC address for an IP address from the ARP table.
|
||||
// If an entry doesn't exist, we will attempt to request it.
|
||||
func (i *Interface) GetMacFor(addr netip.Addr) (net.HardwareAddr, error) {
|
||||
// First, check if a static route defines a replacement address.
|
||||
gateway := i.GetGateway(addr)
|
||||
// If an gateway is defined, replace the requested address with the gateway.
|
||||
if gateway.IsValid() {
|
||||
addr = gateway
|
||||
}
|
||||
|
||||
// Lots of math depending on is4.
|
||||
is4 := addr.Is4()
|
||||
|
||||
|
||||
123
interface_cmd.go
123
interface_cmd.go
@ -429,7 +429,119 @@ func (a *InterfaceFlushMACTableCmd) Run(l *ListenerCmd, i *InterfaceCmd) (err er
|
||||
return
|
||||
}
|
||||
|
||||
// Command to add an MAC entry to an interface.
|
||||
// Command to add a static route to an interface.
|
||||
type InterfaceAddStaticRouteCmd struct {
|
||||
Destination string `help:"The CIDR of the destination network" required:""`
|
||||
Gateway string `help:"The IP address to route traffic via." required:""`
|
||||
Metric int `help:"Metric value to set route priority." required:""`
|
||||
Permanent bool `help:"Should the static route be saved to disk?"`
|
||||
}
|
||||
|
||||
func (a *InterfaceAddStaticRouteCmd) Run(l *ListenerCmd, i *InterfaceCmd) (err error) {
|
||||
// Connect to GRPC.
|
||||
c, conn, err := NewGRPCClient()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
defer conn.Close()
|
||||
|
||||
// Setup call timeout of 10 seconds.
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
|
||||
// Attempt to add static route to an interface.
|
||||
ifce := &pb.InterfaceAddStaticRouteRequest{
|
||||
ListenerName: l.name(),
|
||||
Name: i.name(),
|
||||
Destination: a.Destination,
|
||||
Gateway: a.Gateway,
|
||||
Metric: int32(a.Metric),
|
||||
Permanent: a.Permanent,
|
||||
}
|
||||
_, err = c.InterfaceAddStaticRoute(ctx, ifce)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println("Added static route.")
|
||||
return
|
||||
}
|
||||
|
||||
// Command to remove a static route from an interface.
|
||||
type InterfaceRemoveStaticRouteCmd struct {
|
||||
Destination string `help:"The CIDR of the destination network" required:""`
|
||||
Gateway string `help:"The IP address to route traffic via." required:""`
|
||||
}
|
||||
|
||||
func (a *InterfaceRemoveStaticRouteCmd) Run(l *ListenerCmd, i *InterfaceCmd) (err error) {
|
||||
// Connect to GRPC.
|
||||
c, conn, err := NewGRPCClient()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
defer conn.Close()
|
||||
|
||||
// Setup call timeout of 10 seconds.
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
|
||||
// Attempt to remove a static route from an interface.
|
||||
ifce := &pb.InterfaceRemoveStaticRouteRequest{
|
||||
ListenerName: l.name(),
|
||||
Name: i.name(),
|
||||
Destination: a.Destination,
|
||||
Gateway: a.Gateway,
|
||||
}
|
||||
_, err = c.InterfaceRemoveStaticRoute(ctx, ifce)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println("Removed static route.")
|
||||
return
|
||||
}
|
||||
|
||||
// Command to get static routes on an interface.
|
||||
type InterfaceGetStaticRoutesCmd struct{}
|
||||
|
||||
func (a *InterfaceGetStaticRoutesCmd) Run(l *ListenerCmd, i *InterfaceCmd) (err error) {
|
||||
// Connect to GRPC.
|
||||
c, conn, err := NewGRPCClient()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
defer conn.Close()
|
||||
|
||||
// Setup call timeout of 10 seconds.
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
|
||||
// Attempt to get static routes on an interface.
|
||||
ifce := &pb.InterfaceRequestWithName{
|
||||
ListenerName: l.name(),
|
||||
Name: i.name(),
|
||||
}
|
||||
r, err := c.InterfaceGetStaticRoutes(ctx, ifce)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
// Setup table for static routes.
|
||||
t := table.NewWriter()
|
||||
t.SetOutputMirror(os.Stdout)
|
||||
t.AppendHeader(table.Row{"Destination", "Gateway", "Metric", "Permanent"})
|
||||
|
||||
// Add rows for entries.
|
||||
for _, ent := range r.Routes {
|
||||
t.AppendRow([]interface{}{ent.Destination, ent.Gateway, ent.Metric, ent.Permanent})
|
||||
}
|
||||
|
||||
// Render the table.
|
||||
t.Render()
|
||||
return
|
||||
}
|
||||
|
||||
// Command to add an ARP entry to an interface.
|
||||
type InterfaceAddStaticARPEntryCmd struct {
|
||||
Address string `help:"IP address" required:""`
|
||||
MAC string `help:"MAC address" required:""`
|
||||
@ -465,7 +577,7 @@ func (a *InterfaceAddStaticARPEntryCmd) Run(l *ListenerCmd, i *InterfaceCmd) (er
|
||||
return
|
||||
}
|
||||
|
||||
// Command to remove an MAC entry from an interface.
|
||||
// Command to remove an ARP entry from an interface.
|
||||
type InterfaceRemoveARPEntryCmd struct {
|
||||
Address string `help:"IP address" required:""`
|
||||
}
|
||||
@ -497,7 +609,7 @@ func (a *InterfaceRemoveARPEntryCmd) Run(l *ListenerCmd, i *InterfaceCmd) (err e
|
||||
return
|
||||
}
|
||||
|
||||
// Command to get MAC entries on an interface.
|
||||
// Command to get ARP entries on an interface.
|
||||
type InterfaceGetARPEntriesCmd struct{}
|
||||
|
||||
func (a *InterfaceGetARPEntriesCmd) Run(l *ListenerCmd, i *InterfaceCmd) (err error) {
|
||||
@ -537,7 +649,7 @@ func (a *InterfaceGetARPEntriesCmd) Run(l *ListenerCmd, i *InterfaceCmd) (err er
|
||||
return
|
||||
}
|
||||
|
||||
// Command to remove all mac entries from an interface.
|
||||
// Command to remove all ARP entries from an interface.
|
||||
type InterfaceFlushARPTableCmd struct{}
|
||||
|
||||
func (a *InterfaceFlushARPTableCmd) Run(l *ListenerCmd, i *InterfaceCmd) (err error) {
|
||||
@ -582,6 +694,9 @@ type InterfaceCmd struct {
|
||||
RemoveMACEntry InterfaceRemoveMACEntryCmd `cmd:""`
|
||||
GetMACEntries InterfaceGetMACEntriesCmd `cmd:""`
|
||||
FlushMACTable InterfaceFlushMACTableCmd `cmd:""`
|
||||
AddStaticRoute InterfaceAddStaticRouteCmd `cmd:""`
|
||||
RemoveStaticRoute InterfaceRemoveStaticRouteCmd `cmd:""`
|
||||
GetStaticRoutes InterfaceGetStaticRoutesCmd `cmd:""`
|
||||
AddStaticARPEntry InterfaceAddStaticARPEntryCmd `cmd:""`
|
||||
RemoveARPEntry InterfaceRemoveARPEntryCmd `cmd:""`
|
||||
GetARPEntries InterfaceGetARPEntriesCmd `cmd:""`
|
||||
|
||||
@ -310,6 +310,88 @@ func (s *GRPCServer) InterfaceFlushMACTable(ctx context.Context, in *pb.Interfac
|
||||
return new(pb.Empty), nil
|
||||
}
|
||||
|
||||
// Add static route to an interface.
|
||||
func (s *GRPCServer) InterfaceAddStaticRoute(ctx context.Context, in *pb.InterfaceAddStaticRouteRequest) (*pb.Empty, error) {
|
||||
// Parse destination prefix.
|
||||
dst, err := netip.ParsePrefix(in.Destination)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to parse destination prefix %s: %v", in.Destination, err)
|
||||
}
|
||||
|
||||
// Parse gateway.
|
||||
gateway, err := netip.ParseAddr(in.Gateway)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to parse gateway %s: %v", in.Gateway, err)
|
||||
}
|
||||
|
||||
// Find interface.
|
||||
_, ifce, err := s.FindInterface(in.ListenerName, in.Name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Add the static route.
|
||||
err = ifce.AddStaticRoute(dst, gateway, int(in.Metric), in.Permanent)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return new(pb.Empty), nil
|
||||
}
|
||||
|
||||
// Remove static route from an interface.
|
||||
func (s *GRPCServer) InterfaceRemoveStaticRoute(ctx context.Context, in *pb.InterfaceRemoveStaticRouteRequest) (*pb.Empty, error) {
|
||||
// Parse destination prefix.
|
||||
dst, err := netip.ParsePrefix(in.Destination)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to parse destination prefix %s: %v", in.Destination, err)
|
||||
}
|
||||
|
||||
// Parse gateway.
|
||||
gateway, err := netip.ParseAddr(in.Gateway)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to parse gateway %s: %v", in.Gateway, err)
|
||||
}
|
||||
|
||||
// Find interface.
|
||||
_, ifce, err := s.FindInterface(in.ListenerName, in.Name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Remove the static route.
|
||||
err = ifce.RemoveStaticRoute(dst, gateway)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return new(pb.Empty), nil
|
||||
}
|
||||
|
||||
// Get static routes on interface.
|
||||
func (s *GRPCServer) InterfaceGetStaticRoutes(ctx context.Context, in *pb.InterfaceRequestWithName) (*pb.InterfaceStaticRouteReply, error) {
|
||||
// Find interface.
|
||||
_, ifce, err := s.FindInterface(in.ListenerName, in.Name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Get static routes and make reply.
|
||||
routes := ifce.GetStaticRoutes()
|
||||
reply := new(pb.InterfaceStaticRouteReply)
|
||||
for _, route := range routes {
|
||||
ent := &pb.StaticRoute{
|
||||
Destination: route.Destination.String(),
|
||||
Gateway: route.Gateway.String(),
|
||||
Metric: int32(route.Metric),
|
||||
Permanent: route.Permanent,
|
||||
}
|
||||
reply.Routes = append(reply.Routes, ent)
|
||||
}
|
||||
|
||||
return reply, nil
|
||||
}
|
||||
|
||||
// Add static ARP entry to an interface.
|
||||
func (s *GRPCServer) InterfaceAddStaticARPEntry(ctx context.Context, in *pb.InterfaceARPEntryRequest) (*pb.Empty, error) {
|
||||
// Parse IP address
|
||||
|
||||
10
listener.go
10
listener.go
@ -36,16 +36,6 @@ type Listener struct {
|
||||
log *log.Entry
|
||||
}
|
||||
|
||||
// Check if IP address is all zero.
|
||||
func isZeroAddr(ip net.IP) bool {
|
||||
for _, b := range ip {
|
||||
if b != 0x0 {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Make a new listener on the specified address. This
|
||||
// listener is added to the app listener list, and errors
|
||||
// on existing listeners for the specified address.
|
||||
|
||||
2
main.go
2
main.go
@ -6,7 +6,7 @@ const (
|
||||
serviceDisplayName = "Virtual VXLAN"
|
||||
serviceVendor = "com.mrgeckosmedia"
|
||||
serviceDescription = "Virtual VXLAN using TUN interfaces"
|
||||
serviceVersion = "0.1.4"
|
||||
serviceVersion = "0.2.5"
|
||||
defaultConfigFile = "config.yaml"
|
||||
)
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ import (
|
||||
"net"
|
||||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"github.com/google/gopacket/pcap"
|
||||
@ -121,7 +122,25 @@ func (p *Promiscuous) tryICMPListen(ifaceIP net.IP) (err error) {
|
||||
}
|
||||
|
||||
// Use listen packet to start a connection.
|
||||
p.conn, err = cfg.ListenPacket(context.Background(), network, ifaceIP.String())
|
||||
tries := 0
|
||||
for {
|
||||
p.conn, err = cfg.ListenPacket(context.Background(), network, ifaceIP.String())
|
||||
if err == nil {
|
||||
break
|
||||
}
|
||||
|
||||
// If the bind address wasn't found on an interface, try again for 5 minutes.
|
||||
tries++
|
||||
if tries < 5 {
|
||||
log.Printf("Error putting interface in promiscuous mode, trying again: %v", err)
|
||||
time.Sleep(time.Minute)
|
||||
} else {
|
||||
// If we passed 5 minutes, we should stop...
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
// If we failed too many times, stop.
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
@ -24,6 +24,7 @@ type App struct {
|
||||
}
|
||||
ControllerMac net.HardwareAddr
|
||||
grpcServer *GRPCServer
|
||||
ApplyingConfig bool
|
||||
Stop chan struct{}
|
||||
UpdateConfig *UpdateConfig
|
||||
}
|
||||
@ -41,18 +42,27 @@ func (a *ServerCmd) Run() error {
|
||||
config := ReadConfig()
|
||||
app.UpdateConfig = config.Update
|
||||
|
||||
// So that other services interacting can confirm the config is applied prior to working.
|
||||
app.ApplyingConfig = true
|
||||
|
||||
// Start the GRPC server for cli communication.
|
||||
_, err := NewGRPCServer(config.RPCPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Apply the configuration read.
|
||||
err = ApplyConfig(config)
|
||||
// If error applying the config, we should fail.
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Apply the configuration in the background, to allow service start to notify
|
||||
// the service managers fast.
|
||||
go func() {
|
||||
err = ApplyConfig(config)
|
||||
// If error applying the config, log.
|
||||
if err != nil {
|
||||
log.Println("An error occurred applying configuration:", err)
|
||||
}
|
||||
|
||||
// Other services may now work.
|
||||
app.ApplyingConfig = false
|
||||
}()
|
||||
}
|
||||
|
||||
// Send notification that the service is ready.
|
||||
|
||||
@ -45,6 +45,12 @@ type Device interface {
|
||||
// Get IP Addresses for the device.
|
||||
GetIPAddresses() ([]netip.Prefix, error)
|
||||
|
||||
// Add static route.
|
||||
AddRoute(destination netip.Prefix, gateway netip.Addr, metric int) error
|
||||
|
||||
// Remove static route.
|
||||
RemoveRoute(destination netip.Prefix, gateway netip.Addr) error
|
||||
|
||||
// Events returns a channel of type Event, which is fed Device events.
|
||||
Events() <-chan Event
|
||||
|
||||
|
||||
@ -11,6 +11,7 @@ package tun
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/netip"
|
||||
"os"
|
||||
"sync"
|
||||
@ -314,6 +315,41 @@ func (tun *NativeTun) GetIPAddresses() ([]netip.Prefix, error) {
|
||||
return prefixes, nil
|
||||
}
|
||||
|
||||
func (tun *NativeTun) AddRoute(destination netip.Prefix, gateway netip.Addr, metric int) error {
|
||||
family := netlink.FAMILY_V4
|
||||
if gateway.Is6() {
|
||||
family = netlink.FAMILY_V6
|
||||
}
|
||||
staticRoute := &netlink.Route{
|
||||
Family: family,
|
||||
LinkIndex: int(tun.index),
|
||||
Dst: &net.IPNet{
|
||||
IP: destination.Addr().AsSlice(),
|
||||
Mask: net.CIDRMask(destination.Bits(), destination.Addr().BitLen()),
|
||||
},
|
||||
Gw: gateway.AsSlice(),
|
||||
Priority: metric,
|
||||
}
|
||||
return netlink.RouteAdd(staticRoute)
|
||||
}
|
||||
|
||||
func (tun *NativeTun) RemoveRoute(destination netip.Prefix, gateway netip.Addr) error {
|
||||
family := netlink.FAMILY_V4
|
||||
if gateway.Is6() {
|
||||
family = netlink.FAMILY_V6
|
||||
}
|
||||
staticRoute := &netlink.Route{
|
||||
Family: family,
|
||||
LinkIndex: int(tun.index),
|
||||
Dst: &net.IPNet{
|
||||
IP: destination.Addr().AsSlice(),
|
||||
Mask: net.CIDRMask(destination.Bits(), destination.Addr().BitLen()),
|
||||
},
|
||||
Gw: gateway.AsSlice(),
|
||||
}
|
||||
return netlink.RouteDel(staticRoute)
|
||||
}
|
||||
|
||||
func (tun *NativeTun) MTU() (int, error) {
|
||||
name, err := tun.Name()
|
||||
if err != nil {
|
||||
|
||||
@ -315,6 +315,16 @@ func (tun *NativeTun) GetIPAddresses() ([]netip.Prefix, error) {
|
||||
return prefixes, nil
|
||||
}
|
||||
|
||||
func (tun *NativeTun) AddRoute(destination netip.Prefix, gateway netip.Addr, metric int) error {
|
||||
luid := winipcfg.LUID(tun.LUID())
|
||||
return luid.AddRoute(destination, gateway, uint32(metric))
|
||||
}
|
||||
|
||||
func (tun *NativeTun) RemoveRoute(destination netip.Prefix, gateway netip.Addr) error {
|
||||
luid := winipcfg.LUID(tun.LUID())
|
||||
return luid.DeleteRoute(destination, gateway)
|
||||
}
|
||||
|
||||
// RunningVersion returns the running version of the Wintun driver.
|
||||
func (tun *NativeTun) RunningVersion() (version uint32, err error) {
|
||||
return wintun.RunningVersion()
|
||||
|
||||
10
utils.go
10
utils.go
@ -18,3 +18,13 @@ func generateRandomMAC() net.HardwareAddr {
|
||||
|
||||
return mac
|
||||
}
|
||||
|
||||
// Check if IP address is all zero.
|
||||
func isZeroAddr(ip net.IP) bool {
|
||||
for _, b := range ip {
|
||||
if b != 0x0 {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
1034
vxlan/vxlan.pb.go
1034
vxlan/vxlan.pb.go
File diff suppressed because it is too large
Load Diff
@ -7,6 +7,7 @@ service vxlan {
|
||||
// Config commands.
|
||||
rpc SaveConfig (Empty) returns (Empty) {}
|
||||
rpc ReloadConfig (Empty) returns (Empty) {}
|
||||
rpc IsApplyingConfig (Empty) returns (IsApplyingConfigReply) {}
|
||||
|
||||
// Listener commands.
|
||||
rpc ListListeners (Empty) returns (ListListenersReply) {}
|
||||
@ -29,6 +30,9 @@ service vxlan {
|
||||
rpc InterfaceRemoveMACEntry (InterfaceRemoveMacEntryRequest) returns (Empty) {}
|
||||
rpc InterfaceGetMACEntries (InterfaceRequestWithName) returns (InterfaceMacEntryReply) {}
|
||||
rpc InterfaceFlushMACTable (InterfaceRequestWithName) returns (Empty) {}
|
||||
rpc InterfaceAddStaticRoute (InterfaceAddStaticRouteRequest) returns (Empty) {}
|
||||
rpc InterfaceRemoveStaticRoute (InterfaceRemoveStaticRouteRequest) returns (Empty) {}
|
||||
rpc InterfaceGetStaticRoutes (InterfaceRequestWithName) returns (InterfaceStaticRouteReply) {}
|
||||
rpc InterfaceAddStaticARPEntry (InterfaceARPEntryRequest) returns (Empty) {}
|
||||
rpc InterfaceRemoveARPEntry (InterfaceRemoveARPEntryRequest) returns (Empty) {}
|
||||
rpc InterfaceGetARPEntries (InterfaceRequestWithName) returns (InterfaceArpEntryReply) {}
|
||||
@ -39,6 +43,11 @@ service vxlan {
|
||||
message Empty {
|
||||
}
|
||||
|
||||
// Response to is applying config.
|
||||
message IsApplyingConfigReply {
|
||||
bool isApplying = 1;
|
||||
}
|
||||
|
||||
// Listener messages.
|
||||
message ListenerRequestWithName {
|
||||
string name = 1;
|
||||
@ -144,6 +153,33 @@ message InterfaceMacEntryReply {
|
||||
repeated MacEntry entries = 1;
|
||||
}
|
||||
|
||||
message InterfaceAddStaticRouteRequest {
|
||||
string listenerName = 1;
|
||||
string name = 2;
|
||||
string destination = 3;
|
||||
string gateway = 4;
|
||||
int32 metric = 5;
|
||||
bool permanent = 6;
|
||||
}
|
||||
|
||||
message InterfaceRemoveStaticRouteRequest {
|
||||
string listenerName = 1;
|
||||
string name = 2;
|
||||
string destination = 3;
|
||||
string gateway = 4;
|
||||
}
|
||||
|
||||
message StaticRoute {
|
||||
string destination = 1;
|
||||
string gateway = 2;
|
||||
int32 metric = 3;
|
||||
bool permanent = 4;
|
||||
}
|
||||
|
||||
message InterfaceStaticRouteReply {
|
||||
repeated StaticRoute routes = 1;
|
||||
}
|
||||
|
||||
message InterfaceARPEntryRequest {
|
||||
string listenerName = 1;
|
||||
string name = 2;
|
||||
|
||||
@ -21,6 +21,7 @@ const _ = grpc.SupportPackageIsVersion9
|
||||
const (
|
||||
Vxlan_SaveConfig_FullMethodName = "/vxlan.vxlan/SaveConfig"
|
||||
Vxlan_ReloadConfig_FullMethodName = "/vxlan.vxlan/ReloadConfig"
|
||||
Vxlan_IsApplyingConfig_FullMethodName = "/vxlan.vxlan/IsApplyingConfig"
|
||||
Vxlan_ListListeners_FullMethodName = "/vxlan.vxlan/ListListeners"
|
||||
Vxlan_AddListener_FullMethodName = "/vxlan.vxlan/AddListener"
|
||||
Vxlan_RemoveListener_FullMethodName = "/vxlan.vxlan/RemoveListener"
|
||||
@ -39,6 +40,9 @@ const (
|
||||
Vxlan_InterfaceRemoveMACEntry_FullMethodName = "/vxlan.vxlan/InterfaceRemoveMACEntry"
|
||||
Vxlan_InterfaceGetMACEntries_FullMethodName = "/vxlan.vxlan/InterfaceGetMACEntries"
|
||||
Vxlan_InterfaceFlushMACTable_FullMethodName = "/vxlan.vxlan/InterfaceFlushMACTable"
|
||||
Vxlan_InterfaceAddStaticRoute_FullMethodName = "/vxlan.vxlan/InterfaceAddStaticRoute"
|
||||
Vxlan_InterfaceRemoveStaticRoute_FullMethodName = "/vxlan.vxlan/InterfaceRemoveStaticRoute"
|
||||
Vxlan_InterfaceGetStaticRoutes_FullMethodName = "/vxlan.vxlan/InterfaceGetStaticRoutes"
|
||||
Vxlan_InterfaceAddStaticARPEntry_FullMethodName = "/vxlan.vxlan/InterfaceAddStaticARPEntry"
|
||||
Vxlan_InterfaceRemoveARPEntry_FullMethodName = "/vxlan.vxlan/InterfaceRemoveARPEntry"
|
||||
Vxlan_InterfaceGetARPEntries_FullMethodName = "/vxlan.vxlan/InterfaceGetARPEntries"
|
||||
@ -52,6 +56,7 @@ type VxlanClient interface {
|
||||
// Config commands.
|
||||
SaveConfig(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
|
||||
ReloadConfig(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
|
||||
IsApplyingConfig(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*IsApplyingConfigReply, error)
|
||||
// Listener commands.
|
||||
ListListeners(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ListListenersReply, error)
|
||||
AddListener(ctx context.Context, in *Listener, opts ...grpc.CallOption) (*Empty, error)
|
||||
@ -72,6 +77,9 @@ type VxlanClient interface {
|
||||
InterfaceRemoveMACEntry(ctx context.Context, in *InterfaceRemoveMacEntryRequest, opts ...grpc.CallOption) (*Empty, error)
|
||||
InterfaceGetMACEntries(ctx context.Context, in *InterfaceRequestWithName, opts ...grpc.CallOption) (*InterfaceMacEntryReply, error)
|
||||
InterfaceFlushMACTable(ctx context.Context, in *InterfaceRequestWithName, opts ...grpc.CallOption) (*Empty, error)
|
||||
InterfaceAddStaticRoute(ctx context.Context, in *InterfaceAddStaticRouteRequest, opts ...grpc.CallOption) (*Empty, error)
|
||||
InterfaceRemoveStaticRoute(ctx context.Context, in *InterfaceRemoveStaticRouteRequest, opts ...grpc.CallOption) (*Empty, error)
|
||||
InterfaceGetStaticRoutes(ctx context.Context, in *InterfaceRequestWithName, opts ...grpc.CallOption) (*InterfaceStaticRouteReply, error)
|
||||
InterfaceAddStaticARPEntry(ctx context.Context, in *InterfaceARPEntryRequest, opts ...grpc.CallOption) (*Empty, error)
|
||||
InterfaceRemoveARPEntry(ctx context.Context, in *InterfaceRemoveARPEntryRequest, opts ...grpc.CallOption) (*Empty, error)
|
||||
InterfaceGetARPEntries(ctx context.Context, in *InterfaceRequestWithName, opts ...grpc.CallOption) (*InterfaceArpEntryReply, error)
|
||||
@ -106,6 +114,16 @@ func (c *vxlanClient) ReloadConfig(ctx context.Context, in *Empty, opts ...grpc.
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *vxlanClient) IsApplyingConfig(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*IsApplyingConfigReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(IsApplyingConfigReply)
|
||||
err := c.cc.Invoke(ctx, Vxlan_IsApplyingConfig_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *vxlanClient) ListListeners(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ListListenersReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListListenersReply)
|
||||
@ -286,6 +304,36 @@ func (c *vxlanClient) InterfaceFlushMACTable(ctx context.Context, in *InterfaceR
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *vxlanClient) InterfaceAddStaticRoute(ctx context.Context, in *InterfaceAddStaticRouteRequest, opts ...grpc.CallOption) (*Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Empty)
|
||||
err := c.cc.Invoke(ctx, Vxlan_InterfaceAddStaticRoute_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *vxlanClient) InterfaceRemoveStaticRoute(ctx context.Context, in *InterfaceRemoveStaticRouteRequest, opts ...grpc.CallOption) (*Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Empty)
|
||||
err := c.cc.Invoke(ctx, Vxlan_InterfaceRemoveStaticRoute_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *vxlanClient) InterfaceGetStaticRoutes(ctx context.Context, in *InterfaceRequestWithName, opts ...grpc.CallOption) (*InterfaceStaticRouteReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(InterfaceStaticRouteReply)
|
||||
err := c.cc.Invoke(ctx, Vxlan_InterfaceGetStaticRoutes_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *vxlanClient) InterfaceAddStaticARPEntry(ctx context.Context, in *InterfaceARPEntryRequest, opts ...grpc.CallOption) (*Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Empty)
|
||||
@ -333,6 +381,7 @@ type VxlanServer interface {
|
||||
// Config commands.
|
||||
SaveConfig(context.Context, *Empty) (*Empty, error)
|
||||
ReloadConfig(context.Context, *Empty) (*Empty, error)
|
||||
IsApplyingConfig(context.Context, *Empty) (*IsApplyingConfigReply, error)
|
||||
// Listener commands.
|
||||
ListListeners(context.Context, *Empty) (*ListListenersReply, error)
|
||||
AddListener(context.Context, *Listener) (*Empty, error)
|
||||
@ -353,6 +402,9 @@ type VxlanServer interface {
|
||||
InterfaceRemoveMACEntry(context.Context, *InterfaceRemoveMacEntryRequest) (*Empty, error)
|
||||
InterfaceGetMACEntries(context.Context, *InterfaceRequestWithName) (*InterfaceMacEntryReply, error)
|
||||
InterfaceFlushMACTable(context.Context, *InterfaceRequestWithName) (*Empty, error)
|
||||
InterfaceAddStaticRoute(context.Context, *InterfaceAddStaticRouteRequest) (*Empty, error)
|
||||
InterfaceRemoveStaticRoute(context.Context, *InterfaceRemoveStaticRouteRequest) (*Empty, error)
|
||||
InterfaceGetStaticRoutes(context.Context, *InterfaceRequestWithName) (*InterfaceStaticRouteReply, error)
|
||||
InterfaceAddStaticARPEntry(context.Context, *InterfaceARPEntryRequest) (*Empty, error)
|
||||
InterfaceRemoveARPEntry(context.Context, *InterfaceRemoveARPEntryRequest) (*Empty, error)
|
||||
InterfaceGetARPEntries(context.Context, *InterfaceRequestWithName) (*InterfaceArpEntryReply, error)
|
||||
@ -373,6 +425,9 @@ func (UnimplementedVxlanServer) SaveConfig(context.Context, *Empty) (*Empty, err
|
||||
func (UnimplementedVxlanServer) ReloadConfig(context.Context, *Empty) (*Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ReloadConfig not implemented")
|
||||
}
|
||||
func (UnimplementedVxlanServer) IsApplyingConfig(context.Context, *Empty) (*IsApplyingConfigReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method IsApplyingConfig not implemented")
|
||||
}
|
||||
func (UnimplementedVxlanServer) ListListeners(context.Context, *Empty) (*ListListenersReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListListeners not implemented")
|
||||
}
|
||||
@ -427,6 +482,15 @@ func (UnimplementedVxlanServer) InterfaceGetMACEntries(context.Context, *Interfa
|
||||
func (UnimplementedVxlanServer) InterfaceFlushMACTable(context.Context, *InterfaceRequestWithName) (*Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method InterfaceFlushMACTable not implemented")
|
||||
}
|
||||
func (UnimplementedVxlanServer) InterfaceAddStaticRoute(context.Context, *InterfaceAddStaticRouteRequest) (*Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method InterfaceAddStaticRoute not implemented")
|
||||
}
|
||||
func (UnimplementedVxlanServer) InterfaceRemoveStaticRoute(context.Context, *InterfaceRemoveStaticRouteRequest) (*Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method InterfaceRemoveStaticRoute not implemented")
|
||||
}
|
||||
func (UnimplementedVxlanServer) InterfaceGetStaticRoutes(context.Context, *InterfaceRequestWithName) (*InterfaceStaticRouteReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method InterfaceGetStaticRoutes not implemented")
|
||||
}
|
||||
func (UnimplementedVxlanServer) InterfaceAddStaticARPEntry(context.Context, *InterfaceARPEntryRequest) (*Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method InterfaceAddStaticARPEntry not implemented")
|
||||
}
|
||||
@ -496,6 +560,24 @@ func _Vxlan_ReloadConfig_Handler(srv interface{}, ctx context.Context, dec func(
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Vxlan_IsApplyingConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Empty)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(VxlanServer).IsApplyingConfig(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Vxlan_IsApplyingConfig_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(VxlanServer).IsApplyingConfig(ctx, req.(*Empty))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Vxlan_ListListeners_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Empty)
|
||||
if err := dec(in); err != nil {
|
||||
@ -820,6 +902,60 @@ func _Vxlan_InterfaceFlushMACTable_Handler(srv interface{}, ctx context.Context,
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Vxlan_InterfaceAddStaticRoute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(InterfaceAddStaticRouteRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(VxlanServer).InterfaceAddStaticRoute(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Vxlan_InterfaceAddStaticRoute_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(VxlanServer).InterfaceAddStaticRoute(ctx, req.(*InterfaceAddStaticRouteRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Vxlan_InterfaceRemoveStaticRoute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(InterfaceRemoveStaticRouteRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(VxlanServer).InterfaceRemoveStaticRoute(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Vxlan_InterfaceRemoveStaticRoute_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(VxlanServer).InterfaceRemoveStaticRoute(ctx, req.(*InterfaceRemoveStaticRouteRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Vxlan_InterfaceGetStaticRoutes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(InterfaceRequestWithName)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(VxlanServer).InterfaceGetStaticRoutes(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Vxlan_InterfaceGetStaticRoutes_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(VxlanServer).InterfaceGetStaticRoutes(ctx, req.(*InterfaceRequestWithName))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Vxlan_InterfaceAddStaticARPEntry_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(InterfaceARPEntryRequest)
|
||||
if err := dec(in); err != nil {
|
||||
@ -907,6 +1043,10 @@ var Vxlan_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "ReloadConfig",
|
||||
Handler: _Vxlan_ReloadConfig_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "IsApplyingConfig",
|
||||
Handler: _Vxlan_IsApplyingConfig_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListListeners",
|
||||
Handler: _Vxlan_ListListeners_Handler,
|
||||
@ -979,6 +1119,18 @@ var Vxlan_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "InterfaceFlushMACTable",
|
||||
Handler: _Vxlan_InterfaceFlushMACTable_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "InterfaceAddStaticRoute",
|
||||
Handler: _Vxlan_InterfaceAddStaticRoute_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "InterfaceRemoveStaticRoute",
|
||||
Handler: _Vxlan_InterfaceRemoveStaticRoute_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "InterfaceGetStaticRoutes",
|
||||
Handler: _Vxlan_InterfaceGetStaticRoutes_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "InterfaceAddStaticARPEntry",
|
||||
Handler: _Vxlan_InterfaceAddStaticARPEntry_Handler,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user