diff --git a/Dockerfile b/Dockerfile index 13ae8fb29028bed5abfe18d86f9e8e1c0d5e75e2..5a081c9c5551139f47cc673e06d5152940f7e479 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ ARG GOLANG_VERSION=1.18 FROM golang:$GOLANG_VERSION-buster AS installer - WORKDIR /gnmi-target/ COPY go.* ./ RUN go mod download diff --git a/Makefile b/Makefile index ba6548f7eb99c0edc7288595289cb0c685f4de64..f818a9d06f4d992680a900e8fb9b247f1f9333a2 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,9 @@ generate-yang-models: install-tools container: build docker build -t gnmi-target -f ./Dockerfile . +container-debug: + docker build -t gnmi-target-debug -f ./Dockerfile.debug . + # other targets cross: go build -o ${OUTPUT} diff --git a/os_clients/freebsd/freebsd.go b/os_clients/freebsd/freebsd.go index 0a92a5a8fcda03ccf7a9751b7562265de0553752..b66c5a9461c3765039b91e938df3c09c08aa2f1a 100644 --- a/os_clients/freebsd/freebsd.go +++ b/os_clients/freebsd/freebsd.go @@ -43,6 +43,15 @@ func (of *OsclientFreebsd) GetConfig() *gnmitargetygot.Gnmitarget { return of.gt } +func (ou *OsclientFreebsd) GetCallbackFunc() func(ygot.ValidatedGoStruct) error { + return callbackFunc +} + +func callbackFunc(config ygot.ValidatedGoStruct) error { + + return nil +} + // ExampleAnnotation is used to demonstrate the ygot.Annotation interface, // and the ability for ygot to add annotations to generated structs. type ExampleAnnotation struct { diff --git a/os_clients/os_clients.go b/os_clients/os_clients.go index 66da6efe7b54bc37d4e91f68f56e1991962d9147..675bf89df7b9a913ed8b2014524664ed9835e8c5 100644 --- a/os_clients/os_clients.go +++ b/os_clients/os_clients.go @@ -1,11 +1,12 @@ package os_clients import ( - "github.com/openconfig/ygot/ygot" "code.fbi.h-da.de/danet/gnmi-target/modeldata/gnmitargetygot" + "github.com/openconfig/ygot/ygot" ) type Osclient interface { UpdateConfig(config *ygot.ValidatedGoStruct) error GetConfig() *gnmitargetygot.Gnmitarget + GetCallbackFunc() func(ygot.ValidatedGoStruct) error } diff --git a/os_clients/ubuntu/ubuntu.go b/os_clients/ubuntu/ubuntu.go index aeb51a97830539a0c74f1c2b1e821605809df37b..1227139cd421bea9d6995da0f3486a70919ef163 100644 --- a/os_clients/ubuntu/ubuntu.go +++ b/os_clients/ubuntu/ubuntu.go @@ -1,6 +1,7 @@ package ubuntu import ( + "fmt" "net" "os" "os/exec" @@ -50,6 +51,15 @@ func (ou *OsclientUbuntu) GetConfig() *gnmitargetygot.Gnmitarget { return ou.gt } +func (ou *OsclientUbuntu) GetCallbackFunc() func(ygot.ValidatedGoStruct) error { + return callbackFunc +} + +func callbackFunc(config ygot.ValidatedGoStruct) error { + fmt.Printf("config: %v\n", config) + return nil +} + func (ou OsclientUbuntu) createInterfaces(localIface netlink.Link, gt *gnmitargetygot.Gnmitarget) { //experiment with the ygot struct //populate with data HERE