Skip to content
Snippets Groups Projects
Commit e1b84b3b authored by Malte Bauch's avatar Malte Bauch
Browse files

WIP

parent 7e109f0f
No related branches found
No related tags found
4 merge requests!17Build basic ci,!10Add simple modem support on linux through modemmanager,!8General refactoring,!5Draft: Add basic set support for ip/routing via gnmi
ARG GOLANG_VERSION=1.18
FROM golang:$GOLANG_VERSION-buster AS installer
WORKDIR /gnmi-target/
COPY go.* ./
RUN go mod download
......
......@@ -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}
......
......@@ -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 {
......
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
}
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment