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

WIP

parent 4287ce15
Branches
Tags
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
......@@ -630,4 +630,4 @@ func (s *Server) InternalUpdate(fp func(config *ygot.ValidatedGoStruct) error) e
s.mu.Lock()
defer s.mu.Unlock()
return fp(&s.config)
}
\ No newline at end of file
}
......@@ -44,10 +44,15 @@ func StartGNMITarget(bindAddress string, configFile string, osclient string) err
GnmiTargetYgot = currentosclient.GetConfig()
schema, err := gnmitargetygot.Schema()
if err != nil {
log.Fatal("Schema not accessible.")
}
// TODO Document what is going on here :O
model := gnmiserver.NewModel(modeldata.ModelData,
reflect.TypeOf((*gnmitargetygot.Gnmitarget)(nil)),
gnmitargetygot.SchemaTree["Gnmitarget"],
schema.RootSchema(),
gnmitargetygot.Unmarshal,
gnmitargetygot.ΛEnum)
......
......@@ -5,7 +5,8 @@ go 1.17
replace code.fbi.h-da.de/danet/gnmi-target/ => ./
require (
github.com/mlsgit/gnxi v0.0.0-20201217100933-1b3166d5674f
github.com/golang/glog v1.0.0
github.com/golang/protobuf v1.5.2
github.com/openconfig/gnmi v0.0.0-20210914185457-51254b657b7d
github.com/openconfig/goyang v0.3.1
github.com/openconfig/ygot v0.12.5
......@@ -18,16 +19,17 @@ require (
require (
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/golang/glog v1.0.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnxi v0.0.0-20211020090301-00d2fef64b28 // indirect
github.com/google/go-cmp v0.5.5 // indirect
github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/pelletier/go-toml v1.9.3 // indirect
github.com/smartystreets/assertions v1.2.0 // indirect
github.com/spf13/afero v1.6.0 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
......@@ -37,6 +39,7 @@ require (
golang.org/x/text v0.3.6 // indirect
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect
google.golang.org/protobuf v1.26.0 // indirect
gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b // indirect
gopkg.in/ini.v1 v1.62.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
This diff is collapsed.
package gnmitargetygot
// This file is a placeholder in order to ensure that Go does not
// find this directory to contain an empty package.
//go:generate go run $GOPATH/pkg/mod/github.com/openconfig/ygot@v0.16.3/generator/generator.go -path=../../yang-modules -output_file=./gnmitargetygot.go -package_name=gnmitargetygot -generate_fakeroot -fakeroot_name=device ../../yang-modules/openconfig-if-ip.yang ../../yang-modules/openconfig-if-ethernet.yang ../../yang-modules/openconfig-interfaces.yang ../../yang-modules/openconfig-if-tunnel.yang ../../yang-modules/openconfig-if-8021x.yang ../../yang-modules/openconfig-acl.yang ../../yang-modules/openconfig-lldp.yang ../../yang-modules/openconfig-platform.yang ../../yang-modules/openconfig-platform-cpu.yang ../../yang-modules/openconfig-platform-fan.yang ../../yang-modules/openconfig-platform-psu.yang ../../yang-modules/openconfig-platform-software.yang ../../yang-modules/openconfig-probes.yang ../../yang-modules/openconfig-relay-agent.yang ../../yang-modules/openconfig-system.yang ../../yang-modules/openconfig-vlan.yang ../../yang-modules/openconfig-network-instance.yang
......@@ -48,11 +48,7 @@ func (ou *OsclientUbuntu) GetConfig() *gnmitargetygot.Gnmitarget {
func (ou OsclientUbuntu) createInterfaces(localIface *net.Interface, gt *gnmitargetygot.Gnmitarget) {
//experiment with the ygot struct
//populate with data HERE
iface, err := gt.NewInterface(localIface.Name)
if err != nil {
log.Error("failed to create interface on gnmitarget")
log.WithFields(log.Fields{}).Error(err)
}
iface := gt.GetOrCreateInterface(localIface.Name)
iface.Ifindex = ygot.Uint32(uint32(localIface.Index))
iface.Name = ygot.String(localIface.Name)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment