Skip to content
Snippets Groups Projects
Commit 90e8b93d authored by Manuel Kieweg's avatar Manuel Kieweg
Browse files

Refactoring in progress

parent 9a365ba1
No related branches found
No related tags found
4 merge requests!90Develop,!88Use SPF Viper for configuration,!85Draft: Resolve "Overhaul Architecture",!53V.0.1.0 Codename Threadbare
Showing
with 3401 additions and 92 deletions
// openconfig.enums is generated by proto_generator as a protobuf
// representation of a YANG schema.
//
// Input schema modules:
// - ../yang-models/models/openconfig/release/models/interfaces/openconfig-interfaces.yang
// Include paths:
// - ../yang-models/models/...
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0-devel
// protoc v3.13.0
// source: openconfig/enums/enums.proto
package openconfig_enums
import (
proto "github.com/golang/protobuf/proto"
_ "github.com/openconfig/ygot/proto/yext"
_ "github.com/openconfig/ygot/proto/ywrapper"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
// IETFInterfacesInterfaceType represents an enumerated type generated for the YANG identity interface-type.
type IETFInterfacesInterfaceType int32
const (
IETFInterfacesInterfaceType_IETFINTERFACESINTERFACETYPE_UNSET IETFInterfacesInterfaceType = 0
)
// Enum value maps for IETFInterfacesInterfaceType.
var (
IETFInterfacesInterfaceType_name = map[int32]string{
0: "IETFINTERFACESINTERFACETYPE_UNSET",
}
IETFInterfacesInterfaceType_value = map[string]int32{
"IETFINTERFACESINTERFACETYPE_UNSET": 0,
}
)
func (x IETFInterfacesInterfaceType) Enum() *IETFInterfacesInterfaceType {
p := new(IETFInterfacesInterfaceType)
*p = x
return p
}
func (x IETFInterfacesInterfaceType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (IETFInterfacesInterfaceType) Descriptor() protoreflect.EnumDescriptor {
return file_openconfig_enums_enums_proto_enumTypes[0].Descriptor()
}
func (IETFInterfacesInterfaceType) Type() protoreflect.EnumType {
return &file_openconfig_enums_enums_proto_enumTypes[0]
}
func (x IETFInterfacesInterfaceType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use IETFInterfacesInterfaceType.Descriptor instead.
func (IETFInterfacesInterfaceType) EnumDescriptor() ([]byte, []int) {
return file_openconfig_enums_enums_proto_rawDescGZIP(), []int{0}
}
var File_openconfig_enums_enums_proto protoreflect.FileDescriptor
var file_openconfig_enums_enums_proto_rawDesc = []byte{
0x0a, 0x1c, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x65, 0x6e, 0x75,
0x6d, 0x73, 0x2f, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10,
0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x65, 0x6e, 0x75, 0x6d, 0x73,
0x1a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65,
0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x79, 0x67, 0x6f, 0x74, 0x2f, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x2f, 0x79, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x2f, 0x79, 0x77, 0x72, 0x61,
0x70, 0x70, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x30, 0x67, 0x69, 0x74, 0x68,
0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69,
0x67, 0x2f, 0x79, 0x67, 0x6f, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x79, 0x65, 0x78,
0x74, 0x2f, 0x79, 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2a, 0x44, 0x0a, 0x1b,
0x49, 0x45, 0x54, 0x46, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x49, 0x6e,
0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x25, 0x0a, 0x21, 0x49,
0x45, 0x54, 0x46, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x46, 0x41, 0x43, 0x45, 0x53, 0x49, 0x4e, 0x54,
0x45, 0x52, 0x46, 0x41, 0x43, 0x45, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x45, 0x54,
0x10, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_openconfig_enums_enums_proto_rawDescOnce sync.Once
file_openconfig_enums_enums_proto_rawDescData = file_openconfig_enums_enums_proto_rawDesc
)
func file_openconfig_enums_enums_proto_rawDescGZIP() []byte {
file_openconfig_enums_enums_proto_rawDescOnce.Do(func() {
file_openconfig_enums_enums_proto_rawDescData = protoimpl.X.CompressGZIP(file_openconfig_enums_enums_proto_rawDescData)
})
return file_openconfig_enums_enums_proto_rawDescData
}
var file_openconfig_enums_enums_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_openconfig_enums_enums_proto_goTypes = []interface{}{
(IETFInterfacesInterfaceType)(0), // 0: openconfig.enums.IETFInterfacesInterfaceType
}
var file_openconfig_enums_enums_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_openconfig_enums_enums_proto_init() }
func file_openconfig_enums_enums_proto_init() {
if File_openconfig_enums_enums_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_openconfig_enums_enums_proto_rawDesc,
NumEnums: 1,
NumMessages: 0,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_openconfig_enums_enums_proto_goTypes,
DependencyIndexes: file_openconfig_enums_enums_proto_depIdxs,
EnumInfos: file_openconfig_enums_enums_proto_enumTypes,
}.Build()
File_openconfig_enums_enums_proto = out.File
file_openconfig_enums_enums_proto_rawDesc = nil
file_openconfig_enums_enums_proto_goTypes = nil
file_openconfig_enums_enums_proto_depIdxs = nil
}
// openconfig.enums is generated by proto_generator as a protobuf
// representation of a YANG schema.
//
// Input schema modules:
// - ../yang-models/models/openconfig/release/models/interfaces/openconfig-interfaces.yang
// Include paths:
// - ../yang-models/models/...
syntax = "proto3";
package openconfig.enums;
import "github.com/openconfig/ygot/proto/ywrapper/ywrapper.proto";
import "github.com/openconfig/ygot/proto/yext/yext.proto";
// IETFInterfacesInterfaceType represents an enumerated type generated for the YANG identity interface-type.
enum IETFInterfacesInterfaceType {
IETFINTERFACESINTERFACETYPE_UNSET = 0;
}
// openconfig is generated by proto_generator as a protobuf
// representation of a YANG schema.
//
// Input schema modules:
// - ../yang-models/models/openconfig/release/models/interfaces/openconfig-interfaces.yang
// Include paths:
// - ../yang-models/models/...
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0-devel
// protoc v3.13.0
// source: openconfig/openconfig.proto
package openconfig
import (
proto "github.com/golang/protobuf/proto"
_ "github.com/openconfig/ygot/proto/yext"
_ "github.com/openconfig/ygot/proto/ywrapper"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
openconfig_interfaces "openconfig/openconfig_interfaces"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
type Device struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Interfaces *openconfig_interfaces.Interfaces `protobuf:"bytes,85031486,opt,name=interfaces,proto3" json:"interfaces,omitempty"`
}
func (x *Device) Reset() {
*x = Device{}
if protoimpl.UnsafeEnabled {
mi := &file_openconfig_openconfig_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Device) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Device) ProtoMessage() {}
func (x *Device) ProtoReflect() protoreflect.Message {
mi := &file_openconfig_openconfig_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Device.ProtoReflect.Descriptor instead.
func (*Device) Descriptor() ([]byte, []int) {
return file_openconfig_openconfig_proto_rawDescGZIP(), []int{0}
}
func (x *Device) GetInterfaces() *openconfig_interfaces.Interfaces {
if x != nil {
return x.Interfaces
}
return nil
}
var File_openconfig_openconfig_proto protoreflect.FileDescriptor
var file_openconfig_openconfig_proto_rawDesc = []byte{
0x0a, 0x1b, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x6f, 0x70, 0x65,
0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x6f,
0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75,
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
0x2f, 0x79, 0x67, 0x6f, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x79, 0x77, 0x72, 0x61,
0x70, 0x70, 0x65, 0x72, 0x2f, 0x79, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x1a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x79, 0x67, 0x6f, 0x74, 0x2f,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x79, 0x65, 0x78, 0x74, 0x2f, 0x79, 0x65, 0x78, 0x74, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x3c, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69,
0x67, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x6e, 0x74,
0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66,
0x69, 0x67, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x22, 0x69, 0x0a, 0x06, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5f, 0x0a,
0x0a, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x18, 0xbe, 0xf4, 0xc5, 0x28,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69,
0x67, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x6e, 0x74,
0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63,
0x65, 0x73, 0x42, 0x0e, 0x82, 0x41, 0x0b, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63,
0x65, 0x73, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_openconfig_openconfig_proto_rawDescOnce sync.Once
file_openconfig_openconfig_proto_rawDescData = file_openconfig_openconfig_proto_rawDesc
)
func file_openconfig_openconfig_proto_rawDescGZIP() []byte {
file_openconfig_openconfig_proto_rawDescOnce.Do(func() {
file_openconfig_openconfig_proto_rawDescData = protoimpl.X.CompressGZIP(file_openconfig_openconfig_proto_rawDescData)
})
return file_openconfig_openconfig_proto_rawDescData
}
var file_openconfig_openconfig_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_openconfig_openconfig_proto_goTypes = []interface{}{
(*Device)(nil), // 0: openconfig.Device
(*openconfig_interfaces.Interfaces)(nil), // 1: openconfig.openconfig_interfaces.Interfaces
}
var file_openconfig_openconfig_proto_depIdxs = []int32{
1, // 0: openconfig.Device.interfaces:type_name -> openconfig.openconfig_interfaces.Interfaces
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_openconfig_openconfig_proto_init() }
func file_openconfig_openconfig_proto_init() {
if File_openconfig_openconfig_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_openconfig_openconfig_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Device); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_openconfig_openconfig_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_openconfig_openconfig_proto_goTypes,
DependencyIndexes: file_openconfig_openconfig_proto_depIdxs,
MessageInfos: file_openconfig_openconfig_proto_msgTypes,
}.Build()
File_openconfig_openconfig_proto = out.File
file_openconfig_openconfig_proto_rawDesc = nil
file_openconfig_openconfig_proto_goTypes = nil
file_openconfig_openconfig_proto_depIdxs = nil
}
// openconfig is generated by proto_generator as a protobuf
// representation of a YANG schema.
//
// Input schema modules:
// - ../yang-models/models/openconfig/release/models/interfaces/openconfig-interfaces.yang
// Include paths:
// - ../yang-models/models/...
syntax = "proto3";
package openconfig;
import "github.com/openconfig/ygot/proto/ywrapper/ywrapper.proto";
import "github.com/openconfig/ygot/proto/yext/yext.proto";
import "openconfig/openconfig_interfaces/openconfig_interfaces.proto";
message Device {
openconfig_interfaces.Interfaces interfaces = 85031486 [(yext.schemapath) = "/interfaces"];
}
This diff is collapsed.
// openconfig.openconfig_interfaces is generated by proto_generator as a protobuf
// representation of a YANG schema.
//
// Input schema modules:
// - ../yang-models/models/openconfig/release/models/interfaces/openconfig-interfaces.yang
// Include paths:
// - ../yang-models/models/...
syntax = "proto3";
package openconfig.openconfig_interfaces;
import "github.com/openconfig/ygot/proto/ywrapper/ywrapper.proto";
import "github.com/openconfig/ygot/proto/yext/yext.proto";
import "openconfig/enums/enums.proto";
message Interfaces {
message Interface {
message Config {
ywrapper.StringValue description = 418535860 [(yext.schemapath) = "/interfaces/interface/config/description"];
ywrapper.BoolValue enabled = 37224301 [(yext.schemapath) = "/interfaces/interface/config/enabled"];
ywrapper.BoolValue loopback_mode = 253516347 [(yext.schemapath) = "/interfaces/interface/config/loopback-mode"];
ywrapper.UintValue mtu = 376210342 [(yext.schemapath) = "/interfaces/interface/config/mtu"];
ywrapper.StringValue name = 51804187 [(yext.schemapath) = "/interfaces/interface/config/name"];
openconfig.enums.IETFInterfacesInterfaceType type = 144596894 [(yext.schemapath) = "/interfaces/interface/config/type"];
}
message HoldTime {
message Config {
ywrapper.UintValue down = 171181656 [(yext.schemapath) = "/interfaces/interface/hold-time/config/down"];
ywrapper.UintValue up = 62026235 [(yext.schemapath) = "/interfaces/interface/hold-time/config/up"];
}
message State {
ywrapper.UintValue down = 167887721 [(yext.schemapath) = "/interfaces/interface/hold-time/state/down"];
ywrapper.UintValue up = 223847598 [(yext.schemapath) = "/interfaces/interface/hold-time/state/up"];
}
Config config = 316512729 [(yext.schemapath) = "/interfaces/interface/hold-time/config"];
State state = 483010990 [(yext.schemapath) = "/interfaces/interface/hold-time/state"];
}
message State {
message Counters {
ywrapper.UintValue carrier_transitions = 270803130 [(yext.schemapath) = "/interfaces/interface/state/counters/carrier-transitions"];
ywrapper.UintValue in_broadcast_pkts = 280201989 [(yext.schemapath) = "/interfaces/interface/state/counters/in-broadcast-pkts"];
ywrapper.UintValue in_discards = 11979514 [(yext.schemapath) = "/interfaces/interface/state/counters/in-discards"];
ywrapper.UintValue in_errors = 456697578 [(yext.schemapath) = "/interfaces/interface/state/counters/in-errors"];
ywrapper.UintValue in_fcs_errors = 501559027 [(yext.schemapath) = "/interfaces/interface/state/counters/in-fcs-errors"];
ywrapper.UintValue in_multicast_pkts = 113269128 [(yext.schemapath) = "/interfaces/interface/state/counters/in-multicast-pkts"];
ywrapper.UintValue in_octets = 333138891 [(yext.schemapath) = "/interfaces/interface/state/counters/in-octets"];
ywrapper.UintValue in_pkts = 412843491 [(yext.schemapath) = "/interfaces/interface/state/counters/in-pkts"];
ywrapper.UintValue in_unicast_pkts = 272792307 [(yext.schemapath) = "/interfaces/interface/state/counters/in-unicast-pkts"];
ywrapper.UintValue in_unknown_protos = 241475497 [(yext.schemapath) = "/interfaces/interface/state/counters/in-unknown-protos"];
ywrapper.UintValue last_clear = 186014919 [(yext.schemapath) = "/interfaces/interface/state/counters/last-clear"];
ywrapper.UintValue out_broadcast_pkts = 338589668 [(yext.schemapath) = "/interfaces/interface/state/counters/out-broadcast-pkts"];
ywrapper.UintValue out_discards = 254055111 [(yext.schemapath) = "/interfaces/interface/state/counters/out-discards"];
ywrapper.UintValue out_errors = 471103047 [(yext.schemapath) = "/interfaces/interface/state/counters/out-errors"];
ywrapper.UintValue out_multicast_pkts = 457840757 [(yext.schemapath) = "/interfaces/interface/state/counters/out-multicast-pkts"];
ywrapper.UintValue out_octets = 201005514 [(yext.schemapath) = "/interfaces/interface/state/counters/out-octets"];
ywrapper.UintValue out_pkts = 437582090 [(yext.schemapath) = "/interfaces/interface/state/counters/out-pkts"];
ywrapper.UintValue out_unicast_pkts = 36542246 [(yext.schemapath) = "/interfaces/interface/state/counters/out-unicast-pkts"];
}
enum AdminStatus {
ADMINSTATUS_UNSET = 0;
ADMINSTATUS_UP = 1 [(yext.yang_name) = "UP"];
ADMINSTATUS_DOWN = 2 [(yext.yang_name) = "DOWN"];
ADMINSTATUS_TESTING = 3 [(yext.yang_name) = "TESTING"];
}
enum OperStatus {
OPERSTATUS_UNSET = 0;
OPERSTATUS_UP = 2 [(yext.yang_name) = "UP"];
OPERSTATUS_DOWN = 3 [(yext.yang_name) = "DOWN"];
OPERSTATUS_TESTING = 4 [(yext.yang_name) = "TESTING"];
OPERSTATUS_UNKNOWN = 5 [(yext.yang_name) = "UNKNOWN"];
OPERSTATUS_DORMANT = 6 [(yext.yang_name) = "DORMANT"];
OPERSTATUS_NOT_PRESENT = 7 [(yext.yang_name) = "NOT_PRESENT"];
OPERSTATUS_LOWER_LAYER_DOWN = 8 [(yext.yang_name) = "LOWER_LAYER_DOWN"];
}
AdminStatus admin_status = 474494763 [(yext.schemapath) = "/interfaces/interface/state/admin-status"];
Counters counters = 83645964 [(yext.schemapath) = "/interfaces/interface/state/counters"];
ywrapper.StringValue description = 389435287 [(yext.schemapath) = "/interfaces/interface/state/description"];
ywrapper.BoolValue enabled = 330927518 [(yext.schemapath) = "/interfaces/interface/state/enabled"];
ywrapper.UintValue ifindex = 116108202 [(yext.schemapath) = "/interfaces/interface/state/ifindex"];
ywrapper.UintValue last_change = 127348880 [(yext.schemapath) = "/interfaces/interface/state/last-change"];
ywrapper.BoolValue logical = 440460216 [(yext.schemapath) = "/interfaces/interface/state/logical"];
ywrapper.BoolValue loopback_mode = 372935512 [(yext.schemapath) = "/interfaces/interface/state/loopback-mode"];
ywrapper.UintValue mtu = 96390485 [(yext.schemapath) = "/interfaces/interface/state/mtu"];
ywrapper.StringValue name = 503495278 [(yext.schemapath) = "/interfaces/interface/state/name"];
OperStatus oper_status = 470394226 [(yext.schemapath) = "/interfaces/interface/state/oper-status"];
openconfig.enums.IETFInterfacesInterfaceType type = 358148579 [(yext.schemapath) = "/interfaces/interface/state/type"];
}
message Subinterfaces {
message Subinterface {
message Config {
ywrapper.StringValue description = 280671199 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/config/description"];
ywrapper.BoolValue enabled = 297236390 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/config/enabled"];
ywrapper.UintValue index = 279269781 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/config/index"];
}
message State {
message Counters {
ywrapper.UintValue carrier_transitions = 141120277 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/state/counters/carrier-transitions"];
ywrapper.UintValue in_broadcast_pkts = 120244022 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/state/counters/in-broadcast-pkts"];
ywrapper.UintValue in_discards = 307490461 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/state/counters/in-discards"];
ywrapper.UintValue in_errors = 319720873 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/state/counters/in-errors"];
ywrapper.UintValue in_fcs_errors = 169858424 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/state/counters/in-fcs-errors"];
ywrapper.UintValue in_multicast_pkts = 320618859 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/state/counters/in-multicast-pkts"];
ywrapper.UintValue in_octets = 530205868 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/state/counters/in-octets"];
ywrapper.UintValue in_pkts = 441153352 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/state/counters/in-pkts"];
ywrapper.UintValue in_unicast_pkts = 177838880 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/state/counters/in-unicast-pkts"];
ywrapper.UintValue in_unknown_protos = 146059814 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/state/counters/in-unknown-protos"];
ywrapper.UintValue last_clear = 518046966 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/state/counters/last-clear"];
ywrapper.UintValue out_broadcast_pkts = 501221245 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/state/counters/out-broadcast-pkts"];
ywrapper.UintValue out_discards = 159539762 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/state/counters/out-discards"];
ywrapper.UintValue out_errors = 466636898 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/state/counters/out-errors"];
ywrapper.UintValue out_multicast_pkts = 326155776 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/state/counters/out-multicast-pkts"];
ywrapper.UintValue out_octets = 50579235 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/state/counters/out-octets"];
ywrapper.UintValue out_pkts = 29497115 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/state/counters/out-pkts"];
ywrapper.UintValue out_unicast_pkts = 297910971 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/state/counters/out-unicast-pkts"];
}
enum AdminStatus {
ADMINSTATUS_UNSET = 0;
ADMINSTATUS_UP = 1 [(yext.yang_name) = "UP"];
ADMINSTATUS_DOWN = 2 [(yext.yang_name) = "DOWN"];
ADMINSTATUS_TESTING = 3 [(yext.yang_name) = "TESTING"];
}
enum OperStatus {
OPERSTATUS_UNSET = 0;
OPERSTATUS_UP = 2 [(yext.yang_name) = "UP"];
OPERSTATUS_DOWN = 3 [(yext.yang_name) = "DOWN"];
OPERSTATUS_TESTING = 4 [(yext.yang_name) = "TESTING"];
OPERSTATUS_UNKNOWN = 5 [(yext.yang_name) = "UNKNOWN"];
OPERSTATUS_DORMANT = 6 [(yext.yang_name) = "DORMANT"];
OPERSTATUS_NOT_PRESENT = 7 [(yext.yang_name) = "NOT_PRESENT"];
OPERSTATUS_LOWER_LAYER_DOWN = 8 [(yext.yang_name) = "LOWER_LAYER_DOWN"];
}
AdminStatus admin_status = 250658952 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/state/admin-status"];
Counters counters = 483442783 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/state/counters"];
ywrapper.StringValue description = 49943526 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/state/description"];
ywrapper.BoolValue enabled = 468513843 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/state/enabled"];
ywrapper.UintValue ifindex = 511987815 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/state/ifindex"];
ywrapper.UintValue index = 80745756 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/state/index"];
ywrapper.UintValue last_change = 29904521 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/state/last-change"];
ywrapper.BoolValue logical = 294124401 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/state/logical"];
ywrapper.StringValue name = 279346681 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/state/name"];
OperStatus oper_status = 401969247 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/state/oper-status"];
}
Config config = 175001476 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/config"];
State state = 501974173 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/state"];
}
message SubinterfaceKey {
uint64 index = 1 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface/index"];
Subinterface subinterface = 2;
}
repeated SubinterfaceKey subinterface = 464802819 [(yext.schemapath) = "/interfaces/interface/subinterfaces/subinterface"];
}
Config config = 334174827 [(yext.schemapath) = "/interfaces/interface/config"];
HoldTime hold_time = 175931092 [(yext.schemapath) = "/interfaces/interface/hold-time"];
State state = 387556140 [(yext.schemapath) = "/interfaces/interface/state"];
Subinterfaces subinterfaces = 327798165 [(yext.schemapath) = "/interfaces/interface/subinterfaces"];
}
message InterfaceKey {
string name = 1 [(yext.schemapath) = "/interfaces/interface/name"];
Interface interface = 2;
}
repeated InterfaceKey interface = 422482938 [(yext.schemapath) = "/interfaces/interface"];
}
package main
import (
"code.fbi.h-da.de/cocsn/gosdn/nucleus"
"context"
"fmt"
"github.com/google/uuid"
log "github.com/sirupsen/logrus"
)
func main() {
sbi := &nucleus.OpenConfig{}
device := nucleus.Device{
SBI: sbi,
Config: nucleus.DeviceConfig{
Uuid: uuid.New(),
Address: "141.100.70.170:6030",
Username: "admin",
Password: "arista",
},
}
pnd := nucleus.NewPND("openconfig", sbi)
if err := pnd.AddDevice(device); err != nil {
log.Fatal(err)
}
ctx := context.WithValue(context.Background(), "config", device.Config)
g := nucleus.Gnmi{}
resp, err := g.Capabilities(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%v", resp)
}
......@@ -141,7 +141,7 @@ func goSDNTestDB(conn *grpc.ClientConn) {
}
// TAPIGetEdge triggers the GetEdge function of the Ciena
// flavoured TAPI client
// flavoured TAPI ciena
func TAPIGetEdge(conn *grpc.ClientConn) {
c := pb.NewGrpcCliClient(conn)
......@@ -161,7 +161,7 @@ func TAPIGetEdge(conn *grpc.ClientConn) {
}
// TAPIGetEdgeNode triggers the GetEdgeNode function of the Ciena
// flavoured TAPI client
// flavoured TAPI ciena
func TAPIGetEdgeNode(conn *grpc.ClientConn) {
c := pb.NewGrpcCliClient(conn)
......@@ -180,7 +180,7 @@ func TAPIGetEdgeNode(conn *grpc.ClientConn) {
}
// TAPIGetLink triggers the GetLink function of the Ciena
// flavoured TAPI client
// flavoured TAPI ciena
func TAPIGetLink(conn *grpc.ClientConn) {
c := pb.NewGrpcCliClient(conn)
......
......@@ -169,7 +169,7 @@ func goSDNTestDB(conn *grpc.ClientConn) string {
}
// TAPIGetEdge triggers the GetEdge function of the Ciena
// flavoured TAPI client
// flavoured TAPI ciena
func TAPIGetEdge(conn *grpc.ClientConn) string {
c := pb.NewGrpcCliClient(conn)
......@@ -186,7 +186,7 @@ func TAPIGetEdge(conn *grpc.ClientConn) string {
}
// TAPIGetEdgeNode triggers the GetEdgeNode function of the Ciena
// flavoured TAPI client
// flavoured TAPI ciena
func TAPIGetEdgeNode(conn *grpc.ClientConn) string {
c := pb.NewGrpcCliClient(conn)
......@@ -202,7 +202,7 @@ func TAPIGetEdgeNode(conn *grpc.ClientConn) string {
}
// TAPIGetLink triggers the GetLink function of the Ciena
// flavoured TAPI client
// flavoured TAPI ciena
func TAPIGetLink(conn *grpc.ClientConn) string {
c := pb.NewGrpcCliClient(conn)
......
......@@ -18,7 +18,7 @@ type PND struct {
interfaces []string
}
//NewDatabaseClient creates a database client
//NewDatabaseClient creates a database ciena
func NewDatabaseClient(uri, username, password string, encrypted bool) Database {
driver := createDriver(uri, username, password, encrypted)
......
......@@ -6,6 +6,7 @@ require (
code.fbi.h-da.de/cocsn/swagger/apis v0.0.0-20200924152423-61030cab7b88
code.fbi.h-da.de/cocsn/yang-modules/generated/tapi v0.0.0-20201116134549-765aa1790752
github.com/BurntSushi/toml v0.3.1
github.com/aristanetworks/goarista v0.0.0-20201120222254-94a892eb0c6a
github.com/gdamore/tcell/v2 v2.0.1-0.20201017141208-acf90d56d591
github.com/go-openapi/runtime v0.19.22
github.com/go-openapi/strfmt v0.19.5
......@@ -13,11 +14,12 @@ require (
github.com/google/uuid v1.1.2
github.com/neo4j/neo4j-go-driver v1.8.3
github.com/onsi/ginkgo v1.13.0 // indirect
github.com/openconfig/gnmi v0.0.0-20200617225440-d2b4e6a45802
github.com/openconfig/ygot v0.8.7
github.com/rivo/tview v0.0.0-20201018122409-d551c850a743
github.com/sirupsen/logrus v1.4.2
github.com/tidwall/gjson v1.6.3
golang.org/x/net v0.0.0-20200904194848-62affa334b73 // indirect
google.golang.org/grpc v1.29.1
google.golang.org/protobuf v1.23.0
google.golang.org/protobuf v1.25.0
)
This diff is collapsed.
gosdn.png 0 → 100644
gosdn.png

132 KiB

......@@ -8,13 +8,13 @@ package nucleus
import (
"context"
"github.com/google/uuid"
"io"
"net"
"os"
"sync"
pb "code.fbi.h-da.de/cocsn/gosdn/api/proto"
"code.fbi.h-da.de/cocsn/gosdn/sbi/restconf/client/ciena"
log "github.com/sirupsen/logrus"
"google.golang.org/grpc"
"google.golang.org/grpc/health"
......@@ -34,6 +34,7 @@ type server struct {
pb.UnimplementedGrpcCliServer
core *Core
logConnections []*logConnection
devices map[uuid.UUID]Device
}
var srv *server
......@@ -52,7 +53,7 @@ func (s *server) SayHello(ctx context.Context, in *pb.HelloRequest) (*pb.HelloRe
return &pb.HelloReply{Message: "Hello " + in.GetName(), GoSDNInfo: "goSDN in version: DEVELOP"}, nil
}
//GetLog creates a continuous stream between client and server to send goSDN logs
//GetLog creates a continuous stream between ciena and server to send goSDN logs
func (s *server) CreateLogStream(req *emptypb.Empty, stream pb.GrpcCli_CreateLogStreamServer) error {
conn := &logConnection{
stream: stream,
......@@ -135,27 +136,18 @@ func getCLIGoing(core *Core) {
// SBI specific calls, by now TAPI only
func (s *server) TAPIGetEdge(ctx context.Context, in *pb.TAPIRequest) (*pb.TAPIReply, error) {
log.Info("Received: ", in.GetName())
if err := s.core.devices["ciena-mcp"].(*ciena.MCPClient).GetNodes(); err != nil {
log.Error(err)
return &pb.TAPIReply{Message: "TAPI error"}, nil
}
// TODO: Implement
return &pb.TAPIReply{Message: "Done"}, nil
}
func (s *server) TAPIGetEdgeNode(ctx context.Context, in *pb.TAPIRequest) (*pb.TAPIReply, error) {
log.Info("Received: ", in.GetName())
if err := s.core.devices["ciena-mcp"].(*ciena.MCPClient).GetNodeEdgePoints(); err != nil {
log.Error(err)
return &pb.TAPIReply{Message: "TAPI error"}, nil
}
// TODO: Implement
return &pb.TAPIReply{Message: "Done"}, nil
}
func (s *server) TAPIGetLink(ctx context.Context, in *pb.TAPIRequest) (*pb.TAPIReply, error) {
log.Info("Received: ", in.GetName())
if err := s.core.devices["ciena-mcp"].(*ciena.MCPClient).GetLinks(); err != nil {
log.Error(err)
return &pb.TAPIReply{Message: "TAPI error"}, nil
}
// TODO: Implement
return &pb.TAPIReply{Message: "Done"}, nil
}
package nucleus
// ClientConfig contains SBI client
// ClientConfig contains SBI ciena
// configuration parameters
type ClientConfig struct {
Identifier string `toml:"identifier"`
......
......@@ -2,7 +2,6 @@ package nucleus
import (
"code.fbi.h-da.de/cocsn/gosdn/database"
nucleus "code.fbi.h-da.de/cocsn/gosdn/nucleus/interfaces"
"github.com/BurntSushi/toml"
"github.com/google/uuid"
log "github.com/sirupsen/logrus"
......@@ -20,15 +19,14 @@ type controllerConfig struct {
// Core is the representation of the controllers core
type Core struct {
devices map[string]Device
southboundInterfaces map[string]nucleus.SouthboundInterface
prinipalNetworkDomains map[uuid.UUID]nucleus.PrincipalNetworkDomain
southboundInterfaces map[string]SouthboundInterface
prinipalNetworkDomains map[uuid.UUID]PrincipalNetworkDomain
database database.Database
config controllerConfig
IsRunning chan bool
}
//Init does start-up housekeeping like reading controller and client config files
//Init does start-up housekeeping like reading controller config files
func (c *Core) Init(socket, configFileController, configFileClient string, IsRunningChannel chan bool) {
if err := c.readControllerConfig(configFileController); err != nil {
log.Fatal(err)
......
package nucleus
import (
nucleus "code.fbi.h-da.de/cocsn/gosdn/nucleus/interfaces"
"github.com/google/uuid"
"github.com/openconfig/ygot/ygot"
)
type Device struct {
device ygot.GoStruct
SBI nucleus.SouthboundInterface
Config DeviceConfig
device ygot.GoStruct
SBI SouthboundInterface
Config DeviceConfig
Transport Transport
}
type DeviceConfig struct {
Identifier uuid.UUID
Endpoint string
Username string
Password string
Uuid uuid.UUID
Address string
Username string
Password string
}
package nucleus
import (
"context"
"github.com/aristanetworks/goarista/gnmi"
"github.com/google/uuid"
"github.com/openconfig/gnmi/proto/gnmi_ext"
gpb "github.com/openconfig/gnmi/proto/gnmi"
)
type Gnmi uuid.UUID
func (g *Gnmi) SetConfig(interface{}) error {
return nil
}
func (g *Gnmi) GetConfig() interface{} {
return nil
}
// Capabilities calls GNMI capabilities
func (g *Gnmi) Capabilities(ctx context.Context) (interface{}, error) {
cfg := &gnmi.Config{}
cfg.Addr = ctx.Value("config").(DeviceConfig).Address
cfg.Username = ctx.Value("config").(DeviceConfig).Username
cfg.Password = ctx.Value("config").(DeviceConfig).Password
client, err := gnmi.Dial(cfg)
if err != nil {
return nil, err
}
resp, err := client.Capabilities(ctx, &gpb.CapabilityRequest{})
if err != nil {
return nil, err
}
return resp, nil
}
// Get calls GNMI get
func (g *Gnmi) Get(ctx context.Context, cfg *gnmi.Config, paths [][]string, origin string) (interface{}, error) {
req, err := gnmi.NewGetRequest(paths, origin)
if err != nil {
return nil, err
}
return GetWithRequest(ctx, cfg, req)
}
// GetWithRequest takes a fully formed GetRequest, performs the Get,
// and displays any response.
func GetWithRequest(ctx context.Context, cfg *gnmi.Config, req *gpb.GetRequest) (interface{}, error) {
client, err := gnmi.Dial(cfg)
if err != nil {
return nil, err
}
resp, err := client.Get(ctx, req)
if err != nil {
return nil, err
}
return resp, nil
}
// Set calls GNMI set
func (g *Gnmi) Set(ctx context.Context, cfg *gnmi.Config, setOps []*gnmi.Operation,
exts ...*gnmi_ext.Extension) error {
client, err := gnmi.Dial(cfg)
if err != nil {
return err
}
return gnmi.Set(ctx, client, setOps, exts...)
}
// Subscribe calls GNMI subscribe
func (g *Gnmi) Subscribe(ctx context.Context, cfg *gnmi.Config, subscribeOptions *gnmi.SubscribeOptions,
respChan chan<- *gpb.SubscribeResponse) error {
client, err := gnmi.Dial(cfg)
if err != nil {
return err
}
return gnmi.SubscribeErr(ctx, client, subscribeOptions, respChan)
}
// Close calls GNMI close
func (g *Gnmi) Close() error {
return nil
}
package nucleus
import (
"code.fbi.h-da.de/cocsn/gosdn/nucleus"
"github.com/google/uuid"
)
// PrincipalNetworkDomain provides an
// interface for PND implementations
type PrincipalNetworkDomain interface {
Destroy() error
AddSbi() error
RemoveSbi() error
AddDevice(nucleus.Device) error
RemoveDevice(uuid uuid.UUID) error
}
// SouthboundInterface provides an
// interface for SBI implementations
type SouthboundInterface interface {
}
......@@ -2,7 +2,6 @@ package nucleus
import (
"code.fbi.h-da.de/cocsn/gosdn/database"
"code.fbi.h-da.de/cocsn/gosdn/nucleus/interfaces"
log "github.com/sirupsen/logrus"
"time"
)
......@@ -14,7 +13,6 @@ func StartAndRun(socket, filename string, IsRunningChannel chan bool) {
// Init the Core
core := Core{
devices: make(map[string]nucleus.Client),
database: database.Database{},
}
core.Init(socket, filename, "", IsRunningChannel)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment