Skip to content
Snippets Groups Projects

Develop

Closed Ghost User requested to merge develop into master
3 files
+ 13
2
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 10
1
@@ -3,9 +3,9 @@ package nucleus
import (
tpb "code.fbi.h-da.de/cocsn/api/go/gosdn/transport"
"github.com/docker/docker/pkg/namesgenerator"
"github.com/golang/protobuf/proto"
"github.com/google/uuid"
"github.com/openconfig/ygot/ygot"
"google.golang.org/protobuf/proto"
)
// Device represents an Orchestrated Network Device (OND) which is managed by
@@ -21,6 +21,7 @@ type Device interface {
isDevice()
}
// CommonDevice represents an OND
type CommonDevice struct {
// UUID represents the Devices UUID
UUID uuid.UUID
@@ -63,34 +64,42 @@ func (d *CommonDevice) ID() uuid.UUID {
return d.UUID
}
// Model returns the ygot representation of the Device
func (d *CommonDevice) Model() ygot.GoStruct {
return d.GoStruct
}
// Transport returns the Transport of the device
func (d *CommonDevice) Transport() Transport {
return d.transport
}
// Name returns the name of the device
func (d *CommonDevice) Name() string {
return d.name
}
// SBI returns the sbi of the Device
func (d *CommonDevice) SBI() SouthboundInterface {
return d.sbi
}
// SetTransport sets the Device's Transport
func (d *CommonDevice) SetTransport(t Transport) {
d.transport = t
}
// SetName sets the Device's name
func (d *CommonDevice) SetName(n string) {
d.name = n
}
// SetSBI sets the Device's SBI
func (d *CommonDevice) SetSBI(sbi SouthboundInterface) {
d.sbi = sbi
}
// ProcessResponse processes a response for the Device
func (d *CommonDevice) ProcessResponse(resp proto.Message) error {
return d.transport.ProcessResponse(resp, d.GoStruct, d.sbi.Schema())
}
Loading