@@ -30,6 +30,7 @@ import (
30
30
l3vppcalls "go.ligato.io/vpp-agent/v3/plugins/vpp/l3plugin/vppcalls"
31
31
natvppcalls "go.ligato.io/vpp-agent/v3/plugins/vpp/natplugin/vppcalls"
32
32
"go.ligato.io/vpp-agent/v3/plugins/vpp/puntplugin/vppcalls"
33
+ wireguardvppcalls "go.ligato.io/vpp-agent/v3/plugins/vpp/wireguardplugin/vppcalls"
33
34
rpc "go.ligato.io/vpp-agent/v3/proto/ligato/configurator"
34
35
linux_interfaces "go.ligato.io/vpp-agent/v3/proto/ligato/linux/interfaces"
35
36
linux_l3 "go.ligato.io/vpp-agent/v3/proto/ligato/linux/l3"
@@ -41,6 +42,7 @@ import (
41
42
vpp_l3 "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/l3"
42
43
vpp_nat "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/nat"
43
44
vpp_punt "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/punt"
45
+ vpp_wg "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/wireguard"
44
46
)
45
47
46
48
type dumpService struct {
@@ -56,6 +58,7 @@ type dumpService struct {
56
58
abfHandler abfvppcalls.ABFVppRead
57
59
natHandler natvppcalls.NatVppRead
58
60
puntHandler vppcalls.PuntVPPRead
61
+ wireguardHandler wireguardvppcalls.WgVppRead
59
62
60
63
// Linux handlers
61
64
linuxIfHandler iflinuxcalls.NetlinkAPIRead
@@ -160,6 +163,11 @@ func (svc *dumpService) Dump(ctx context.Context, req *rpc.DumpRequest) (*rpc.Du
160
163
svc .log .Errorf ("DumpPuntExceptions failed: %v" , err )
161
164
return nil , err
162
165
}
166
+ dump .VppConfig .WgPeers , err = svc .DumpWgPeers ()
167
+ if err != nil {
168
+ svc .log .Errorf ("DumpWgPeers failed: %v" , err )
169
+ return nil , err
170
+ }
163
171
164
172
// -----
165
173
// Linux
@@ -464,6 +472,22 @@ func (svc *dumpService) DumpPuntExceptions() (punts []*vpp_punt.Exception, err e
464
472
return punts , nil
465
473
}
466
474
475
+ func (svc * dumpService ) DumpWgPeers () (peers []* vpp_wg.Peer , err error ) {
476
+ if svc .wireguardHandler == nil {
477
+ // handler is not available
478
+ return nil , nil
479
+ }
480
+
481
+ _peers , err := svc .wireguardHandler .DumpWgPeers ()
482
+ if err != nil {
483
+ return nil , err
484
+ }
485
+ for _ , peer := range _peers {
486
+ peers = append (peers , peer )
487
+ }
488
+ return
489
+ }
490
+
467
491
// DumpLinuxInterfaces reads linux interfaces and returns them as an *LinuxInterfaceResponse. If reading ends up with error,
468
492
// only error is send back in response
469
493
func (svc * dumpService ) DumpLinuxInterfaces () (linuxIfs []* linux_interfaces.Interface , err error ) {
0 commit comments