diff --git a/WORKSPACE b/WORKSPACE index 35acbfa3..ae165d00 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -131,6 +131,8 @@ http_archive( http_archive( name = "com_github_opencomputeproject_sai", + patch_args = ["-p1"], + patches = ["//patches:sai.patch"], build_file_content = """ cc_library( name = "sai", diff --git a/dataplane/standalone/entrypoint.cc b/dataplane/standalone/entrypoint.cc index 981309d8..1e9947b9 100644 --- a/dataplane/standalone/entrypoint.cc +++ b/dataplane/standalone/entrypoint.cc @@ -181,7 +181,7 @@ std::unique_ptr entry; // TODO(dgrau): implement this without using gRPC. sai_status_t sai_api_initialize( _In_ uint64_t flags, _In_ const sai_service_method_table_t *services) { - FLAGS_log_dir = "/var/log"; + FLAGS_log_dir = "/var/log/syncd"; google::InitGoogleLogging("lucius"); google::InstallFailureSignalHandler(); @@ -492,7 +492,8 @@ sai_status_t sai_query_attribute_enum_values_capability( _In_ sai_object_id_t switch_id, _In_ sai_object_type_t object_type, _In_ sai_attr_id_t attr_id, _Inout_ sai_s32_list_t *enum_values_capability) { - return SAI_STATUS_SUCCESS; + + return SAI_STATUS_NOT_IMPLEMENTED; } sai_status_t sai_object_type_get_availability( @@ -500,7 +501,66 @@ sai_status_t sai_object_type_get_availability( _In_ uint32_t attr_count, _In_ const sai_attribute_t *attr_list, _Out_ uint64_t *count) { *count = 1024; - return SAI_STATUS_SUCCESS; + return SAI_STATUS_NOT_IMPLEMENTED; +} + +sai_status_t sai_query_stats_capability( + _In_ sai_object_id_t switch_id, _In_ sai_object_type_t object_type, + _Inout_ sai_stat_capability_list_t *stats_capability) { + return SAI_STATUS_NOT_IMPLEMENTED; +} + +sai_status_t sai_get_maximum_attribute_count(_In_ sai_object_id_t switch_id, + _In_ sai_object_type_t object_type, + _Out_ uint32_t *count) { + return SAI_STATUS_NOT_IMPLEMENTED; +} +sai_status_t sai_get_object_count(_In_ sai_object_id_t switch_id, + _In_ sai_object_type_t object_type, + _Out_ uint32_t *count) { + return SAI_STATUS_NOT_IMPLEMENTED; +} + +sai_status_t sai_get_object_key(_In_ sai_object_id_t switch_id, + _In_ sai_object_type_t object_type, + _Inout_ uint32_t *object_count, + _Inout_ sai_object_key_t *object_list) { + return SAI_STATUS_NOT_IMPLEMENTED; +} + +sai_status_t sai_bulk_get_attribute(_In_ sai_object_id_t switch_id, + _In_ sai_object_type_t object_type, + _In_ uint32_t object_count, + _In_ const sai_object_key_t *object_key, + _Inout_ uint32_t *attr_count, + _Inout_ sai_attribute_t **attr_list, + _Inout_ sai_status_t *object_statuses) { + return SAI_STATUS_NOT_IMPLEMENTED; +} + +sai_status_t sai_bulk_object_get_stats( + _In_ sai_object_id_t switch_id, _In_ sai_object_type_t object_type, + _In_ uint32_t object_count, _In_ const sai_object_key_t *object_key, + _In_ uint32_t number_of_counters, _In_ const sai_stat_id_t *counter_ids, + _In_ sai_stats_mode_t mode, _Inout_ sai_status_t *object_statuses, + _Out_ uint64_t *counters) { + return SAI_STATUS_NOT_IMPLEMENTED; +} + +sai_status_t sai_bulk_object_clear_stats( + _In_ sai_object_id_t switch_id, _In_ sai_object_type_t object_type, + _In_ uint32_t object_count, _In_ const sai_object_key_t *object_key, + _In_ uint32_t number_of_counters, _In_ const sai_stat_id_t *counter_ids, + _In_ sai_stats_mode_t mode, _Inout_ sai_status_t *object_statuses) { + return SAI_STATUS_NOT_IMPLEMENTED; +} + +sai_status_t sai_query_object_stage(_In_ sai_object_id_t switch_id, + _In_ sai_object_type_t object_type, + _In_ uint32_t attr_count, + _In_ const sai_attribute_t *attr_list, + _Out_ sai_object_stage_t *stage) { + return SAI_STATUS_NOT_IMPLEMENTED; } int main() {} diff --git a/dataplane/standalone/proto/next_hop.pb.go b/dataplane/standalone/proto/next_hop.pb.go index f5b704bf..209ba100 100644 --- a/dataplane/standalone/proto/next_hop.pb.go +++ b/dataplane/standalone/proto/next_hop.pb.go @@ -689,6 +689,100 @@ func (x *GetNextHopAttributeResponse) GetAttr() *NextHopAttribute { return nil } +type CreateNextHopsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Reqs []*CreateNextHopRequest `protobuf:"bytes,1,rep,name=reqs,proto3" json:"reqs,omitempty"` +} + +func (x *CreateNextHopsRequest) Reset() { + *x = CreateNextHopsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_dataplane_standalone_proto_next_hop_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateNextHopsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateNextHopsRequest) ProtoMessage() {} + +func (x *CreateNextHopsRequest) ProtoReflect() protoreflect.Message { + mi := &file_dataplane_standalone_proto_next_hop_proto_msgTypes[8] + 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 CreateNextHopsRequest.ProtoReflect.Descriptor instead. +func (*CreateNextHopsRequest) Descriptor() ([]byte, []int) { + return file_dataplane_standalone_proto_next_hop_proto_rawDescGZIP(), []int{8} +} + +func (x *CreateNextHopsRequest) GetReqs() []*CreateNextHopRequest { + if x != nil { + return x.Reqs + } + return nil +} + +type CreateNextHopsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Resps []*CreateNextHopResponse `protobuf:"bytes,1,rep,name=resps,proto3" json:"resps,omitempty"` +} + +func (x *CreateNextHopsResponse) Reset() { + *x = CreateNextHopsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_dataplane_standalone_proto_next_hop_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateNextHopsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateNextHopsResponse) ProtoMessage() {} + +func (x *CreateNextHopsResponse) ProtoReflect() protoreflect.Message { + mi := &file_dataplane_standalone_proto_next_hop_proto_msgTypes[9] + 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 CreateNextHopsResponse.ProtoReflect.Descriptor instead. +func (*CreateNextHopsResponse) Descriptor() ([]byte, []int) { + return file_dataplane_standalone_proto_next_hop_proto_rawDescGZIP(), []int{9} +} + +func (x *CreateNextHopsResponse) GetResps() []*CreateNextHopResponse { + if x != nil { + return x.Resps + } + return nil +} + var File_dataplane_standalone_proto_next_hop_proto protoreflect.FileDescriptor var file_dataplane_standalone_proto_next_hop_proto_rawDesc = []byte{ @@ -853,79 +947,97 @@ var file_dataplane_standalone_proto_next_hop_proto_rawDesc = []byte{ 0x12, 0x3b, 0x0a, 0x04, 0x61, 0x74, 0x74, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6c, 0x65, 0x6d, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x61, 0x69, 0x2e, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x6f, 0x70, 0x41, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x04, 0x61, 0x74, 0x74, 0x72, 0x2a, 0xc3, 0x04, - 0x0a, 0x0b, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x6f, 0x70, 0x41, 0x74, 0x74, 0x72, 0x12, 0x1d, 0x0a, - 0x19, 0x4e, 0x45, 0x58, 0x54, 0x5f, 0x48, 0x4f, 0x50, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x55, - 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, - 0x4e, 0x45, 0x58, 0x54, 0x5f, 0x48, 0x4f, 0x50, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x4e, 0x45, 0x58, 0x54, 0x5f, 0x48, 0x4f, 0x50, - 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x49, 0x50, 0x10, 0x02, 0x12, 0x25, 0x0a, 0x21, 0x4e, 0x45, - 0x58, 0x54, 0x5f, 0x48, 0x4f, 0x50, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x52, 0x4f, 0x55, 0x54, - 0x45, 0x52, 0x5f, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x46, 0x41, 0x43, 0x45, 0x5f, 0x49, 0x44, 0x10, - 0x03, 0x12, 0x1b, 0x0a, 0x17, 0x4e, 0x45, 0x58, 0x54, 0x5f, 0x48, 0x4f, 0x50, 0x5f, 0x41, 0x54, - 0x54, 0x52, 0x5f, 0x54, 0x55, 0x4e, 0x4e, 0x45, 0x4c, 0x5f, 0x49, 0x44, 0x10, 0x04, 0x12, 0x1c, - 0x0a, 0x18, 0x4e, 0x45, 0x58, 0x54, 0x5f, 0x48, 0x4f, 0x50, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, - 0x54, 0x55, 0x4e, 0x4e, 0x45, 0x4c, 0x5f, 0x56, 0x4e, 0x49, 0x10, 0x05, 0x12, 0x1c, 0x0a, 0x18, - 0x4e, 0x45, 0x58, 0x54, 0x5f, 0x48, 0x4f, 0x50, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x54, 0x55, - 0x4e, 0x4e, 0x45, 0x4c, 0x5f, 0x4d, 0x41, 0x43, 0x10, 0x06, 0x12, 0x21, 0x0a, 0x1d, 0x4e, 0x45, - 0x58, 0x54, 0x5f, 0x48, 0x4f, 0x50, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x53, 0x52, 0x56, 0x36, - 0x5f, 0x53, 0x49, 0x44, 0x4c, 0x49, 0x53, 0x54, 0x5f, 0x49, 0x44, 0x10, 0x07, 0x12, 0x1c, 0x0a, - 0x18, 0x4e, 0x45, 0x58, 0x54, 0x5f, 0x48, 0x4f, 0x50, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x4c, - 0x41, 0x42, 0x45, 0x4c, 0x53, 0x54, 0x41, 0x43, 0x4b, 0x10, 0x08, 0x12, 0x1c, 0x0a, 0x18, 0x4e, - 0x45, 0x58, 0x54, 0x5f, 0x48, 0x4f, 0x50, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x43, 0x4f, 0x55, - 0x4e, 0x54, 0x45, 0x52, 0x5f, 0x49, 0x44, 0x10, 0x09, 0x12, 0x27, 0x0a, 0x23, 0x4e, 0x45, 0x58, - 0x54, 0x5f, 0x48, 0x4f, 0x50, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x42, - 0x4c, 0x45, 0x5f, 0x44, 0x45, 0x43, 0x52, 0x45, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x54, 0x4c, - 0x10, 0x0a, 0x12, 0x1d, 0x0a, 0x19, 0x4e, 0x45, 0x58, 0x54, 0x5f, 0x48, 0x4f, 0x50, 0x5f, 0x41, - 0x54, 0x54, 0x52, 0x5f, 0x4f, 0x55, 0x54, 0x53, 0x45, 0x47, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, - 0x0b, 0x12, 0x21, 0x0a, 0x1d, 0x4e, 0x45, 0x58, 0x54, 0x5f, 0x48, 0x4f, 0x50, 0x5f, 0x41, 0x54, - 0x54, 0x52, 0x5f, 0x4f, 0x55, 0x54, 0x53, 0x45, 0x47, 0x5f, 0x54, 0x54, 0x4c, 0x5f, 0x4d, 0x4f, - 0x44, 0x45, 0x10, 0x0c, 0x12, 0x22, 0x0a, 0x1e, 0x4e, 0x45, 0x58, 0x54, 0x5f, 0x48, 0x4f, 0x50, - 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x4f, 0x55, 0x54, 0x53, 0x45, 0x47, 0x5f, 0x54, 0x54, 0x4c, - 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x10, 0x0d, 0x12, 0x21, 0x0a, 0x1d, 0x4e, 0x45, 0x58, 0x54, - 0x5f, 0x48, 0x4f, 0x50, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x4f, 0x55, 0x54, 0x53, 0x45, 0x47, - 0x5f, 0x45, 0x58, 0x50, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x10, 0x0e, 0x12, 0x22, 0x0a, 0x1e, 0x4e, - 0x45, 0x58, 0x54, 0x5f, 0x48, 0x4f, 0x50, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x4f, 0x55, 0x54, - 0x53, 0x45, 0x47, 0x5f, 0x45, 0x58, 0x50, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x10, 0x0f, 0x12, - 0x32, 0x0a, 0x2e, 0x4e, 0x45, 0x58, 0x54, 0x5f, 0x48, 0x4f, 0x50, 0x5f, 0x41, 0x54, 0x54, 0x52, - 0x5f, 0x51, 0x4f, 0x53, 0x5f, 0x54, 0x43, 0x5f, 0x41, 0x4e, 0x44, 0x5f, 0x43, 0x4f, 0x4c, 0x4f, - 0x52, 0x5f, 0x54, 0x4f, 0x5f, 0x4d, 0x50, 0x4c, 0x53, 0x5f, 0x45, 0x58, 0x50, 0x5f, 0x4d, 0x41, - 0x50, 0x10, 0x10, 0x32, 0xe5, 0x03, 0x0a, 0x07, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x6f, 0x70, 0x12, - 0x6c, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x6f, 0x70, - 0x12, 0x2b, 0x2e, 0x6c, 0x65, 0x6d, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x70, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x04, 0x61, 0x74, 0x74, 0x72, 0x22, 0x58, 0x0a, + 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x6f, 0x70, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x04, 0x72, 0x65, 0x71, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6c, 0x65, 0x6d, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x64, + 0x61, 0x74, 0x61, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x61, 0x69, 0x2e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x52, 0x04, 0x72, 0x65, 0x71, 0x73, 0x22, 0x5c, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x6f, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x42, 0x0a, 0x05, 0x72, 0x65, 0x73, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x2c, 0x2e, 0x6c, 0x65, 0x6d, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x61, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, - 0x65, 0x78, 0x74, 0x48, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, + 0x65, 0x78, 0x74, 0x48, 0x6f, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x05, + 0x72, 0x65, 0x73, 0x70, 0x73, 0x2a, 0xc3, 0x04, 0x0a, 0x0b, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x6f, + 0x70, 0x41, 0x74, 0x74, 0x72, 0x12, 0x1d, 0x0a, 0x19, 0x4e, 0x45, 0x58, 0x54, 0x5f, 0x48, 0x4f, + 0x50, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x4e, 0x45, 0x58, 0x54, 0x5f, 0x48, 0x4f, 0x50, + 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, + 0x4e, 0x45, 0x58, 0x54, 0x5f, 0x48, 0x4f, 0x50, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x49, 0x50, + 0x10, 0x02, 0x12, 0x25, 0x0a, 0x21, 0x4e, 0x45, 0x58, 0x54, 0x5f, 0x48, 0x4f, 0x50, 0x5f, 0x41, + 0x54, 0x54, 0x52, 0x5f, 0x52, 0x4f, 0x55, 0x54, 0x45, 0x52, 0x5f, 0x49, 0x4e, 0x54, 0x45, 0x52, + 0x46, 0x41, 0x43, 0x45, 0x5f, 0x49, 0x44, 0x10, 0x03, 0x12, 0x1b, 0x0a, 0x17, 0x4e, 0x45, 0x58, + 0x54, 0x5f, 0x48, 0x4f, 0x50, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x54, 0x55, 0x4e, 0x4e, 0x45, + 0x4c, 0x5f, 0x49, 0x44, 0x10, 0x04, 0x12, 0x1c, 0x0a, 0x18, 0x4e, 0x45, 0x58, 0x54, 0x5f, 0x48, + 0x4f, 0x50, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x54, 0x55, 0x4e, 0x4e, 0x45, 0x4c, 0x5f, 0x56, + 0x4e, 0x49, 0x10, 0x05, 0x12, 0x1c, 0x0a, 0x18, 0x4e, 0x45, 0x58, 0x54, 0x5f, 0x48, 0x4f, 0x50, + 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x54, 0x55, 0x4e, 0x4e, 0x45, 0x4c, 0x5f, 0x4d, 0x41, 0x43, + 0x10, 0x06, 0x12, 0x21, 0x0a, 0x1d, 0x4e, 0x45, 0x58, 0x54, 0x5f, 0x48, 0x4f, 0x50, 0x5f, 0x41, + 0x54, 0x54, 0x52, 0x5f, 0x53, 0x52, 0x56, 0x36, 0x5f, 0x53, 0x49, 0x44, 0x4c, 0x49, 0x53, 0x54, + 0x5f, 0x49, 0x44, 0x10, 0x07, 0x12, 0x1c, 0x0a, 0x18, 0x4e, 0x45, 0x58, 0x54, 0x5f, 0x48, 0x4f, + 0x50, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x53, 0x54, 0x41, 0x43, + 0x4b, 0x10, 0x08, 0x12, 0x1c, 0x0a, 0x18, 0x4e, 0x45, 0x58, 0x54, 0x5f, 0x48, 0x4f, 0x50, 0x5f, + 0x41, 0x54, 0x54, 0x52, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x45, 0x52, 0x5f, 0x49, 0x44, 0x10, + 0x09, 0x12, 0x27, 0x0a, 0x23, 0x4e, 0x45, 0x58, 0x54, 0x5f, 0x48, 0x4f, 0x50, 0x5f, 0x41, 0x54, + 0x54, 0x52, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x42, 0x4c, 0x45, 0x5f, 0x44, 0x45, 0x43, 0x52, 0x45, + 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x54, 0x4c, 0x10, 0x0a, 0x12, 0x1d, 0x0a, 0x19, 0x4e, 0x45, + 0x58, 0x54, 0x5f, 0x48, 0x4f, 0x50, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x4f, 0x55, 0x54, 0x53, + 0x45, 0x47, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x0b, 0x12, 0x21, 0x0a, 0x1d, 0x4e, 0x45, 0x58, + 0x54, 0x5f, 0x48, 0x4f, 0x50, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x4f, 0x55, 0x54, 0x53, 0x45, + 0x47, 0x5f, 0x54, 0x54, 0x4c, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x10, 0x0c, 0x12, 0x22, 0x0a, 0x1e, + 0x4e, 0x45, 0x58, 0x54, 0x5f, 0x48, 0x4f, 0x50, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x4f, 0x55, + 0x54, 0x53, 0x45, 0x47, 0x5f, 0x54, 0x54, 0x4c, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x10, 0x0d, + 0x12, 0x21, 0x0a, 0x1d, 0x4e, 0x45, 0x58, 0x54, 0x5f, 0x48, 0x4f, 0x50, 0x5f, 0x41, 0x54, 0x54, + 0x52, 0x5f, 0x4f, 0x55, 0x54, 0x53, 0x45, 0x47, 0x5f, 0x45, 0x58, 0x50, 0x5f, 0x4d, 0x4f, 0x44, + 0x45, 0x10, 0x0e, 0x12, 0x22, 0x0a, 0x1e, 0x4e, 0x45, 0x58, 0x54, 0x5f, 0x48, 0x4f, 0x50, 0x5f, + 0x41, 0x54, 0x54, 0x52, 0x5f, 0x4f, 0x55, 0x54, 0x53, 0x45, 0x47, 0x5f, 0x45, 0x58, 0x50, 0x5f, + 0x56, 0x41, 0x4c, 0x55, 0x45, 0x10, 0x0f, 0x12, 0x32, 0x0a, 0x2e, 0x4e, 0x45, 0x58, 0x54, 0x5f, + 0x48, 0x4f, 0x50, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x51, 0x4f, 0x53, 0x5f, 0x54, 0x43, 0x5f, + 0x41, 0x4e, 0x44, 0x5f, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x5f, 0x54, 0x4f, 0x5f, 0x4d, 0x50, 0x4c, + 0x53, 0x5f, 0x45, 0x58, 0x50, 0x5f, 0x4d, 0x41, 0x50, 0x10, 0x10, 0x32, 0xd6, 0x04, 0x0a, 0x07, + 0x4e, 0x65, 0x78, 0x74, 0x48, 0x6f, 0x70, 0x12, 0x6c, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x6f, 0x70, 0x12, 0x2b, 0x2e, 0x6c, 0x65, 0x6d, 0x6d, 0x69, + 0x6e, 0x67, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x61, 0x69, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x6f, 0x70, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x6c, 0x65, 0x6d, 0x6d, 0x69, 0x6e, 0x67, 0x2e, + 0x64, 0x61, 0x74, 0x61, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x61, 0x69, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x6f, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6c, 0x0a, 0x0d, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, + 0x65, 0x78, 0x74, 0x48, 0x6f, 0x70, 0x12, 0x2b, 0x2e, 0x6c, 0x65, 0x6d, 0x6d, 0x69, 0x6e, 0x67, + 0x2e, 0x64, 0x61, 0x74, 0x61, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x61, 0x69, 0x2e, 0x52, + 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x6c, 0x65, 0x6d, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x64, 0x61, + 0x74, 0x61, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x61, 0x69, 0x2e, 0x52, 0x65, 0x6d, 0x6f, + 0x76, 0x65, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x6f, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x7e, 0x0a, 0x13, 0x53, 0x65, 0x74, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x6f, + 0x70, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x31, 0x2e, 0x6c, 0x65, 0x6d, + 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, + 0x61, 0x69, 0x2e, 0x53, 0x65, 0x74, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x6f, 0x70, 0x41, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x6c, 0x65, 0x6d, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x70, 0x6c, 0x61, 0x6e, - 0x65, 0x2e, 0x73, 0x61, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x65, 0x78, 0x74, - 0x48, 0x6f, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6c, 0x0a, - 0x0d, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x6f, 0x70, 0x12, 0x2b, - 0x2e, 0x6c, 0x65, 0x6d, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x70, 0x6c, 0x61, - 0x6e, 0x65, 0x2e, 0x73, 0x61, 0x69, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x65, 0x78, - 0x74, 0x48, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x6c, 0x65, - 0x6d, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, - 0x73, 0x61, 0x69, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x6f, - 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7e, 0x0a, 0x13, 0x53, - 0x65, 0x74, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x6f, 0x70, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x65, 0x12, 0x31, 0x2e, 0x6c, 0x65, 0x6d, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x64, 0x61, 0x74, - 0x61, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x61, 0x69, 0x2e, 0x53, 0x65, 0x74, 0x4e, 0x65, - 0x78, 0x74, 0x48, 0x6f, 0x70, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x6c, 0x65, 0x6d, 0x6d, 0x69, 0x6e, 0x67, 0x2e, - 0x64, 0x61, 0x74, 0x61, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x61, 0x69, 0x2e, 0x53, 0x65, - 0x74, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x6f, 0x70, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7e, 0x0a, 0x13, 0x47, - 0x65, 0x74, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x6f, 0x70, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x65, 0x12, 0x31, 0x2e, 0x6c, 0x65, 0x6d, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x64, 0x61, 0x74, - 0x61, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x61, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x65, - 0x78, 0x74, 0x48, 0x6f, 0x70, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x6c, 0x65, 0x6d, 0x6d, 0x69, 0x6e, 0x67, 0x2e, - 0x64, 0x61, 0x74, 0x61, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x61, 0x69, 0x2e, 0x47, 0x65, - 0x74, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x6f, 0x70, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x3e, 0x5a, 0x3c, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x6c, 0x65, 0x6d, 0x6d, 0x69, 0x6e, 0x67, 0x2f, 0x64, 0x61, 0x74, - 0x61, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x6c, 0x6f, 0x6e, - 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b, 0x73, 0x61, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x65, 0x2e, 0x73, 0x61, 0x69, 0x2e, 0x53, 0x65, 0x74, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x6f, 0x70, + 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x7e, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x6f, + 0x70, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x31, 0x2e, 0x6c, 0x65, 0x6d, + 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, + 0x61, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x6f, 0x70, 0x41, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, + 0x6c, 0x65, 0x6d, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x73, 0x61, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x6f, 0x70, + 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x6f, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x65, 0x78, + 0x74, 0x48, 0x6f, 0x70, 0x73, 0x12, 0x2c, 0x2e, 0x6c, 0x65, 0x6d, 0x6d, 0x69, 0x6e, 0x67, 0x2e, + 0x64, 0x61, 0x74, 0x61, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x61, 0x69, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x6f, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x6c, 0x65, 0x6d, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x64, 0x61, + 0x74, 0x61, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x73, 0x61, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x6f, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x42, 0x3e, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x6c, 0x65, + 0x6d, 0x6d, 0x69, 0x6e, 0x67, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, + 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x6c, 0x6f, 0x6e, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x3b, 0x73, 0x61, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -941,7 +1053,7 @@ func file_dataplane_standalone_proto_next_hop_proto_rawDescGZIP() []byte { } var file_dataplane_standalone_proto_next_hop_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_dataplane_standalone_proto_next_hop_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_dataplane_standalone_proto_next_hop_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_dataplane_standalone_proto_next_hop_proto_goTypes = []interface{}{ (NextHopAttr)(0), // 0: lemming.dataplane.sai.NextHopAttr (*CreateNextHopRequest)(nil), // 1: lemming.dataplane.sai.CreateNextHopRequest @@ -952,35 +1064,41 @@ var file_dataplane_standalone_proto_next_hop_proto_goTypes = []interface{}{ (*SetNextHopAttributeResponse)(nil), // 6: lemming.dataplane.sai.SetNextHopAttributeResponse (*GetNextHopAttributeRequest)(nil), // 7: lemming.dataplane.sai.GetNextHopAttributeRequest (*GetNextHopAttributeResponse)(nil), // 8: lemming.dataplane.sai.GetNextHopAttributeResponse - (NextHopType)(0), // 9: lemming.dataplane.sai.NextHopType - (OutsegType)(0), // 10: lemming.dataplane.sai.OutsegType - (OutsegTtlMode)(0), // 11: lemming.dataplane.sai.OutsegTtlMode - (OutsegExpMode)(0), // 12: lemming.dataplane.sai.OutsegExpMode - (*NextHopAttribute)(nil), // 13: lemming.dataplane.sai.NextHopAttribute + (*CreateNextHopsRequest)(nil), // 9: lemming.dataplane.sai.CreateNextHopsRequest + (*CreateNextHopsResponse)(nil), // 10: lemming.dataplane.sai.CreateNextHopsResponse + (NextHopType)(0), // 11: lemming.dataplane.sai.NextHopType + (OutsegType)(0), // 12: lemming.dataplane.sai.OutsegType + (OutsegTtlMode)(0), // 13: lemming.dataplane.sai.OutsegTtlMode + (OutsegExpMode)(0), // 14: lemming.dataplane.sai.OutsegExpMode + (*NextHopAttribute)(nil), // 15: lemming.dataplane.sai.NextHopAttribute } var file_dataplane_standalone_proto_next_hop_proto_depIdxs = []int32{ - 9, // 0: lemming.dataplane.sai.CreateNextHopRequest.type:type_name -> lemming.dataplane.sai.NextHopType - 10, // 1: lemming.dataplane.sai.CreateNextHopRequest.outseg_type:type_name -> lemming.dataplane.sai.OutsegType - 11, // 2: lemming.dataplane.sai.CreateNextHopRequest.outseg_ttl_mode:type_name -> lemming.dataplane.sai.OutsegTtlMode - 12, // 3: lemming.dataplane.sai.CreateNextHopRequest.outseg_exp_mode:type_name -> lemming.dataplane.sai.OutsegExpMode - 10, // 4: lemming.dataplane.sai.SetNextHopAttributeRequest.outseg_type:type_name -> lemming.dataplane.sai.OutsegType - 11, // 5: lemming.dataplane.sai.SetNextHopAttributeRequest.outseg_ttl_mode:type_name -> lemming.dataplane.sai.OutsegTtlMode - 12, // 6: lemming.dataplane.sai.SetNextHopAttributeRequest.outseg_exp_mode:type_name -> lemming.dataplane.sai.OutsegExpMode + 11, // 0: lemming.dataplane.sai.CreateNextHopRequest.type:type_name -> lemming.dataplane.sai.NextHopType + 12, // 1: lemming.dataplane.sai.CreateNextHopRequest.outseg_type:type_name -> lemming.dataplane.sai.OutsegType + 13, // 2: lemming.dataplane.sai.CreateNextHopRequest.outseg_ttl_mode:type_name -> lemming.dataplane.sai.OutsegTtlMode + 14, // 3: lemming.dataplane.sai.CreateNextHopRequest.outseg_exp_mode:type_name -> lemming.dataplane.sai.OutsegExpMode + 12, // 4: lemming.dataplane.sai.SetNextHopAttributeRequest.outseg_type:type_name -> lemming.dataplane.sai.OutsegType + 13, // 5: lemming.dataplane.sai.SetNextHopAttributeRequest.outseg_ttl_mode:type_name -> lemming.dataplane.sai.OutsegTtlMode + 14, // 6: lemming.dataplane.sai.SetNextHopAttributeRequest.outseg_exp_mode:type_name -> lemming.dataplane.sai.OutsegExpMode 0, // 7: lemming.dataplane.sai.GetNextHopAttributeRequest.attr_type:type_name -> lemming.dataplane.sai.NextHopAttr - 13, // 8: lemming.dataplane.sai.GetNextHopAttributeResponse.attr:type_name -> lemming.dataplane.sai.NextHopAttribute - 1, // 9: lemming.dataplane.sai.NextHop.CreateNextHop:input_type -> lemming.dataplane.sai.CreateNextHopRequest - 3, // 10: lemming.dataplane.sai.NextHop.RemoveNextHop:input_type -> lemming.dataplane.sai.RemoveNextHopRequest - 5, // 11: lemming.dataplane.sai.NextHop.SetNextHopAttribute:input_type -> lemming.dataplane.sai.SetNextHopAttributeRequest - 7, // 12: lemming.dataplane.sai.NextHop.GetNextHopAttribute:input_type -> lemming.dataplane.sai.GetNextHopAttributeRequest - 2, // 13: lemming.dataplane.sai.NextHop.CreateNextHop:output_type -> lemming.dataplane.sai.CreateNextHopResponse - 4, // 14: lemming.dataplane.sai.NextHop.RemoveNextHop:output_type -> lemming.dataplane.sai.RemoveNextHopResponse - 6, // 15: lemming.dataplane.sai.NextHop.SetNextHopAttribute:output_type -> lemming.dataplane.sai.SetNextHopAttributeResponse - 8, // 16: lemming.dataplane.sai.NextHop.GetNextHopAttribute:output_type -> lemming.dataplane.sai.GetNextHopAttributeResponse - 13, // [13:17] is the sub-list for method output_type - 9, // [9:13] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name + 15, // 8: lemming.dataplane.sai.GetNextHopAttributeResponse.attr:type_name -> lemming.dataplane.sai.NextHopAttribute + 1, // 9: lemming.dataplane.sai.CreateNextHopsRequest.reqs:type_name -> lemming.dataplane.sai.CreateNextHopRequest + 2, // 10: lemming.dataplane.sai.CreateNextHopsResponse.resps:type_name -> lemming.dataplane.sai.CreateNextHopResponse + 1, // 11: lemming.dataplane.sai.NextHop.CreateNextHop:input_type -> lemming.dataplane.sai.CreateNextHopRequest + 3, // 12: lemming.dataplane.sai.NextHop.RemoveNextHop:input_type -> lemming.dataplane.sai.RemoveNextHopRequest + 5, // 13: lemming.dataplane.sai.NextHop.SetNextHopAttribute:input_type -> lemming.dataplane.sai.SetNextHopAttributeRequest + 7, // 14: lemming.dataplane.sai.NextHop.GetNextHopAttribute:input_type -> lemming.dataplane.sai.GetNextHopAttributeRequest + 9, // 15: lemming.dataplane.sai.NextHop.CreateNextHops:input_type -> lemming.dataplane.sai.CreateNextHopsRequest + 2, // 16: lemming.dataplane.sai.NextHop.CreateNextHop:output_type -> lemming.dataplane.sai.CreateNextHopResponse + 4, // 17: lemming.dataplane.sai.NextHop.RemoveNextHop:output_type -> lemming.dataplane.sai.RemoveNextHopResponse + 6, // 18: lemming.dataplane.sai.NextHop.SetNextHopAttribute:output_type -> lemming.dataplane.sai.SetNextHopAttributeResponse + 8, // 19: lemming.dataplane.sai.NextHop.GetNextHopAttribute:output_type -> lemming.dataplane.sai.GetNextHopAttributeResponse + 10, // 20: lemming.dataplane.sai.NextHop.CreateNextHops:output_type -> lemming.dataplane.sai.CreateNextHopsResponse + 16, // [16:21] is the sub-list for method output_type + 11, // [11:16] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name } func init() { file_dataplane_standalone_proto_next_hop_proto_init() } @@ -1086,6 +1204,30 @@ func file_dataplane_standalone_proto_next_hop_proto_init() { return nil } } + file_dataplane_standalone_proto_next_hop_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateNextHopsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_dataplane_standalone_proto_next_hop_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateNextHopsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_dataplane_standalone_proto_next_hop_proto_msgTypes[0].OneofWrappers = []interface{}{} file_dataplane_standalone_proto_next_hop_proto_msgTypes[4].OneofWrappers = []interface{}{} @@ -1095,7 +1237,7 @@ func file_dataplane_standalone_proto_next_hop_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_dataplane_standalone_proto_next_hop_proto_rawDesc, NumEnums: 1, - NumMessages: 8, + NumMessages: 10, NumExtensions: 0, NumServices: 1, }, @@ -1126,6 +1268,7 @@ type NextHopClient interface { RemoveNextHop(ctx context.Context, in *RemoveNextHopRequest, opts ...grpc.CallOption) (*RemoveNextHopResponse, error) SetNextHopAttribute(ctx context.Context, in *SetNextHopAttributeRequest, opts ...grpc.CallOption) (*SetNextHopAttributeResponse, error) GetNextHopAttribute(ctx context.Context, in *GetNextHopAttributeRequest, opts ...grpc.CallOption) (*GetNextHopAttributeResponse, error) + CreateNextHops(ctx context.Context, in *CreateNextHopsRequest, opts ...grpc.CallOption) (*CreateNextHopsResponse, error) } type nextHopClient struct { @@ -1172,12 +1315,22 @@ func (c *nextHopClient) GetNextHopAttribute(ctx context.Context, in *GetNextHopA return out, nil } +func (c *nextHopClient) CreateNextHops(ctx context.Context, in *CreateNextHopsRequest, opts ...grpc.CallOption) (*CreateNextHopsResponse, error) { + out := new(CreateNextHopsResponse) + err := c.cc.Invoke(ctx, "/lemming.dataplane.sai.NextHop/CreateNextHops", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // NextHopServer is the server API for NextHop service. type NextHopServer interface { CreateNextHop(context.Context, *CreateNextHopRequest) (*CreateNextHopResponse, error) RemoveNextHop(context.Context, *RemoveNextHopRequest) (*RemoveNextHopResponse, error) SetNextHopAttribute(context.Context, *SetNextHopAttributeRequest) (*SetNextHopAttributeResponse, error) GetNextHopAttribute(context.Context, *GetNextHopAttributeRequest) (*GetNextHopAttributeResponse, error) + CreateNextHops(context.Context, *CreateNextHopsRequest) (*CreateNextHopsResponse, error) } // UnimplementedNextHopServer can be embedded to have forward compatible implementations. @@ -1196,6 +1349,9 @@ func (*UnimplementedNextHopServer) SetNextHopAttribute(context.Context, *SetNext func (*UnimplementedNextHopServer) GetNextHopAttribute(context.Context, *GetNextHopAttributeRequest) (*GetNextHopAttributeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetNextHopAttribute not implemented") } +func (*UnimplementedNextHopServer) CreateNextHops(context.Context, *CreateNextHopsRequest) (*CreateNextHopsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateNextHops not implemented") +} func RegisterNextHopServer(s *grpc.Server, srv NextHopServer) { s.RegisterService(&_NextHop_serviceDesc, srv) @@ -1273,6 +1429,24 @@ func _NextHop_GetNextHopAttribute_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _NextHop_CreateNextHops_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateNextHopsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NextHopServer).CreateNextHops(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lemming.dataplane.sai.NextHop/CreateNextHops", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NextHopServer).CreateNextHops(ctx, req.(*CreateNextHopsRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _NextHop_serviceDesc = grpc.ServiceDesc{ ServiceName: "lemming.dataplane.sai.NextHop", HandlerType: (*NextHopServer)(nil), @@ -1293,6 +1467,10 @@ var _NextHop_serviceDesc = grpc.ServiceDesc{ MethodName: "GetNextHopAttribute", Handler: _NextHop_GetNextHopAttribute_Handler, }, + { + MethodName: "CreateNextHops", + Handler: _NextHop_CreateNextHops_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "dataplane/standalone/proto/next_hop.proto", diff --git a/dataplane/standalone/proto/next_hop.proto b/dataplane/standalone/proto/next_hop.proto index eca7a310..8ba8e2af 100644 --- a/dataplane/standalone/proto/next_hop.proto +++ b/dataplane/standalone/proto/next_hop.proto @@ -85,6 +85,14 @@ message GetNextHopAttributeResponse { NextHopAttribute attr = 1; } +message CreateNextHopsRequest { + repeated CreateNextHopRequest reqs = 1; +} + +message CreateNextHopsResponse { + repeated CreateNextHopResponse resps = 1; +} + service NextHop { rpc CreateNextHop(CreateNextHopRequest) returns (CreateNextHopResponse) {} rpc RemoveNextHop(RemoveNextHopRequest) returns (RemoveNextHopResponse) {} @@ -92,4 +100,5 @@ service NextHop { returns (SetNextHopAttributeResponse) {} rpc GetNextHopAttribute(GetNextHopAttributeRequest) returns (GetNextHopAttributeResponse) {} + rpc CreateNextHops(CreateNextHopsRequest) returns (CreateNextHopsResponse) {} } diff --git a/dataplane/standalone/sai/common.h b/dataplane/standalone/sai/common.h index c71d0e47..f7c6141a 100644 --- a/dataplane/standalone/sai/common.h +++ b/dataplane/standalone/sai/common.h @@ -155,7 +155,8 @@ lemming::dataplane::sai::NeighborEntry convert_from_neighbor_entry( sai_neighbor_entry_t convert_to_neighbor_entry( const lemming::dataplane::sai::NeighborEntry &entry); -void convert_to_acl_capability(sai_acl_capability_t &out, +void convert_to_acl_capability( + sai_acl_capability_t &out, const lemming::dataplane::sai::ACLCapability &in); // copy_list copies a scalar proto list to an attribute. diff --git a/dataplane/standalone/sai/next_hop.cc b/dataplane/standalone/sai/next_hop.cc index b28a6404..02b327b9 100644 --- a/dataplane/standalone/sai/next_hop.cc +++ b/dataplane/standalone/sai/next_hop.cc @@ -27,6 +27,10 @@ const sai_next_hop_api_t l_next_hop = { .remove_next_hop = l_remove_next_hop, .set_next_hop_attribute = l_set_next_hop_attribute, .get_next_hop_attribute = l_get_next_hop_attribute, + .create_next_hops = l_create_next_hops, + .remove_next_hops = l_remove_next_hops, + .set_next_hops_attribute = l_set_next_hops_attribute, + .get_next_hops_attribute = l_get_next_hops_attribute, }; lemming::dataplane::sai::CreateNextHopRequest convert_create_next_hop( @@ -272,3 +276,61 @@ sai_status_t l_get_next_hop_attribute(sai_object_id_t next_hop_id, return SAI_STATUS_SUCCESS; } + +sai_status_t l_create_next_hops(sai_object_id_t switch_id, + uint32_t object_count, + const uint32_t *attr_count, + const sai_attribute_t **attr_list, + sai_bulk_op_error_mode_t mode, + sai_object_id_t *object_id, + sai_status_t *object_statuses) { + LOG(INFO) << "Func: " << __PRETTY_FUNCTION__; + + lemming::dataplane::sai::CreateNextHopsRequest req; + lemming::dataplane::sai::CreateNextHopsResponse resp; + grpc::ClientContext context; + + for (uint32_t i = 0; i < object_count; i++) { + auto r = convert_create_next_hop(switch_id, attr_count[i], attr_list[i]); + *req.add_reqs() = r; + } + + grpc::Status status = next_hop->CreateNextHops(&context, req, &resp); + if (!status.ok()) { + LOG(ERROR) << status.error_message(); + return SAI_STATUS_FAILURE; + } + for (uint32_t i = 0; i < object_count; i++) { + switch_id = object_id[i] = resp.resps(i).oid(); + object_statuses[i] = SAI_STATUS_SUCCESS; + } + + return SAI_STATUS_SUCCESS; +} + +sai_status_t l_remove_next_hops(uint32_t object_count, + const sai_object_id_t *object_id, + sai_bulk_op_error_mode_t mode, + sai_status_t *object_statuses) { + LOG(INFO) << "Func: " << __PRETTY_FUNCTION__; + return SAI_STATUS_NOT_IMPLEMENTED; +} + +sai_status_t l_set_next_hops_attribute(uint32_t object_count, + const sai_object_id_t *object_id, + const sai_attribute_t *attr_list, + sai_bulk_op_error_mode_t mode, + sai_status_t *object_statuses) { + LOG(INFO) << "Func: " << __PRETTY_FUNCTION__; + return SAI_STATUS_NOT_IMPLEMENTED; +} + +sai_status_t l_get_next_hops_attribute(uint32_t object_count, + const sai_object_id_t *object_id, + const uint32_t *attr_count, + sai_attribute_t **attr_list, + sai_bulk_op_error_mode_t mode, + sai_status_t *object_statuses) { + LOG(INFO) << "Func: " << __PRETTY_FUNCTION__; + return SAI_STATUS_NOT_IMPLEMENTED; +} diff --git a/dataplane/standalone/sai/next_hop.h b/dataplane/standalone/sai/next_hop.h index 50a740d7..69825c2c 100644 --- a/dataplane/standalone/sai/next_hop.h +++ b/dataplane/standalone/sai/next_hop.h @@ -35,4 +35,30 @@ sai_status_t l_get_next_hop_attribute(sai_object_id_t next_hop_id, uint32_t attr_count, sai_attribute_t *attr_list); +sai_status_t l_create_next_hops(sai_object_id_t switch_id, + uint32_t object_count, + const uint32_t *attr_count, + const sai_attribute_t **attr_list, + sai_bulk_op_error_mode_t mode, + sai_object_id_t *object_id, + sai_status_t *object_statuses); + +sai_status_t l_remove_next_hops(uint32_t object_count, + const sai_object_id_t *object_id, + sai_bulk_op_error_mode_t mode, + sai_status_t *object_statuses); + +sai_status_t l_set_next_hops_attribute(uint32_t object_count, + const sai_object_id_t *object_id, + const sai_attribute_t *attr_list, + sai_bulk_op_error_mode_t mode, + sai_status_t *object_statuses); + +sai_status_t l_get_next_hops_attribute(uint32_t object_count, + const sai_object_id_t *object_id, + const uint32_t *attr_count, + sai_attribute_t **attr_list, + sai_bulk_op_error_mode_t mode, + sai_status_t *object_statuses); + #endif // DATAPLANE_STANDALONE_SAI_NEXT_HOP_H_ diff --git a/dataplane/standalone/saiserver/ports.go b/dataplane/standalone/saiserver/ports.go index 15998ef3..14b8dc72 100644 --- a/dataplane/standalone/saiserver/ports.go +++ b/dataplane/standalone/saiserver/ports.go @@ -42,7 +42,7 @@ func newPort(mgr *attrmgr.AttrMgr, dataplane portDataplaneAPI, s *grpc.Server) * mgr: mgr, dataplane: dataplane, portToEth: make(map[uint64]string), - nextEth: 2, // Start at eth2 + nextEth: 1, // Start at eth1 } saipb.RegisterPortServer(s, p) return p @@ -68,13 +68,59 @@ func (port *port) CreatePort(ctx context.Context, _ *saipb.CreatePortRequest) (* port.nextEth++ attrs := &saipb.PortAttribute{ - OperSpeed: proto.Uint32(1024), - NumberOfIngressPriorityGroups: proto.Uint32(0), - QosNumberOfQueues: proto.Uint32(0), - QosMaximumHeadroomSize: proto.Uint32(0), - AdminState: proto.Bool(true), - AutoNegMode: proto.Bool(false), - Mtu: proto.Uint32(1514), + QosNumberOfQueues: proto.Uint32(0), + QosQueueList: []uint64{}, + QosNumberOfSchedulerGroups: proto.Uint32(0), + QosSchedulerGroupList: []uint64{}, + IngressPriorityGroupList: []uint64{}, + FloodStormControlPolicerId: proto.Uint64(0), + BroadcastStormControlPolicerId: proto.Uint64(0), + MulticastStormControlPolicerId: proto.Uint64(0), + IngressAcl: proto.Uint64(0), + EgressAcl: proto.Uint64(0), + IngressMacsecAcl: proto.Uint64(0), + EgressMacsecAcl: proto.Uint64(0), + MacsecPortList: []uint64{}, + IngressMirrorSession: []uint64{}, + EgressMirrorSession: []uint64{}, + IngressSamplepacketEnable: proto.Uint64(0), + EgressSamplepacketEnable: proto.Uint64(0), + IngressSampleMirrorSession: []uint64{}, + EgressSampleMirrorSession: []uint64{}, + PolicerId: proto.Uint64(0), + QosDot1PToTcMap: proto.Uint64(0), + QosDot1PToColorMap: proto.Uint64(0), + QosDscpToTcMap: proto.Uint64(0), + QosDscpToColorMap: proto.Uint64(0), + QosTcToQueueMap: proto.Uint64(0), + QosTcAndColorToDot1PMap: proto.Uint64(0), + QosTcAndColorToDscpMap: proto.Uint64(0), + QosTcToPriorityGroupMap: proto.Uint64(0), + QosPfcPriorityToPriorityGroupMap: proto.Uint64(0), + QosPfcPriorityToQueueMap: proto.Uint64(0), + QosSchedulerProfileId: proto.Uint64(0), + QosIngressBufferProfileList: []uint64{}, + QosEgressBufferProfileList: []uint64{}, + EgressBlockPortList: []uint64{}, + PortPoolList: []uint64{}, + IsolationGroup: proto.Uint64(0), + TamObject: []uint64{}, + PortSerdesId: proto.Uint64(0), + QosMplsExpToTcMap: proto.Uint64(0), + QosMplsExpToColorMap: proto.Uint64(0), + QosTcAndColorToMplsExpMap: proto.Uint64(0), + SystemPort: proto.Uint64(0), + QosDscpToForwardingClassMap: proto.Uint64(0), + QosMplsExpToForwardingClassMap: proto.Uint64(0), + IpsecPort: proto.Uint64(0), + SupportedSpeed: []uint32{1024}, + OperSpeed: proto.Uint32(1024), + SupportedFecMode: []saipb.PortFecMode{saipb.PortFecMode_PORT_FEC_MODE_NONE}, + NumberOfIngressPriorityGroups: proto.Uint32(0), + QosMaximumHeadroomSize: proto.Uint32(0), + AdminState: proto.Bool(true), + AutoNegMode: proto.Bool(false), + Mtu: proto.Uint32(1514), } // For ports that don't exist, do not create dataplane ports. @@ -117,7 +163,60 @@ func (port *port) createCPUPort(ctx context.Context) (uint64, error) { } cpuPort := &saipb.PortAttribute{ - Type: saipb.PortType_PORT_TYPE_CPU.Enum(), + Type: saipb.PortType_PORT_TYPE_CPU.Enum(), + QosNumberOfQueues: proto.Uint32(0), + QosQueueList: []uint64{}, + QosNumberOfSchedulerGroups: proto.Uint32(0), + QosSchedulerGroupList: []uint64{}, + IngressPriorityGroupList: []uint64{}, + FloodStormControlPolicerId: proto.Uint64(0), + BroadcastStormControlPolicerId: proto.Uint64(0), + MulticastStormControlPolicerId: proto.Uint64(0), + IngressAcl: proto.Uint64(0), + EgressAcl: proto.Uint64(0), + IngressMacsecAcl: proto.Uint64(0), + EgressMacsecAcl: proto.Uint64(0), + MacsecPortList: []uint64{}, + IngressMirrorSession: []uint64{}, + EgressMirrorSession: []uint64{}, + IngressSamplepacketEnable: proto.Uint64(0), + EgressSamplepacketEnable: proto.Uint64(0), + IngressSampleMirrorSession: []uint64{}, + EgressSampleMirrorSession: []uint64{}, + PolicerId: proto.Uint64(0), + QosDot1PToTcMap: proto.Uint64(0), + QosDot1PToColorMap: proto.Uint64(0), + QosDscpToTcMap: proto.Uint64(0), + QosDscpToColorMap: proto.Uint64(0), + QosTcToQueueMap: proto.Uint64(0), + QosTcAndColorToDot1PMap: proto.Uint64(0), + QosTcAndColorToDscpMap: proto.Uint64(0), + QosTcToPriorityGroupMap: proto.Uint64(0), + QosPfcPriorityToPriorityGroupMap: proto.Uint64(0), + QosPfcPriorityToQueueMap: proto.Uint64(0), + QosSchedulerProfileId: proto.Uint64(0), + QosIngressBufferProfileList: []uint64{}, + QosEgressBufferProfileList: []uint64{}, + EgressBlockPortList: []uint64{}, + PortPoolList: []uint64{}, + IsolationGroup: proto.Uint64(0), + TamObject: []uint64{}, + PortSerdesId: proto.Uint64(0), + QosMplsExpToTcMap: proto.Uint64(0), + QosMplsExpToColorMap: proto.Uint64(0), + QosTcAndColorToMplsExpMap: proto.Uint64(0), + SystemPort: proto.Uint64(0), + QosDscpToForwardingClassMap: proto.Uint64(0), + QosMplsExpToForwardingClassMap: proto.Uint64(0), + IpsecPort: proto.Uint64(0), + SupportedSpeed: []uint32{1024}, + OperSpeed: proto.Uint32(1024), + SupportedFecMode: []saipb.PortFecMode{saipb.PortFecMode_PORT_FEC_MODE_NONE}, + NumberOfIngressPriorityGroups: proto.Uint32(0), + QosMaximumHeadroomSize: proto.Uint32(0), + AdminState: proto.Bool(true), + AutoNegMode: proto.Bool(false), + Mtu: proto.Uint32(1514), } port.mgr.SetType(fmt.Sprint(id), saipb.ObjectType_OBJECT_TYPE_PORT) port.mgr.StoreAttributes(id, cpuPort) diff --git a/dataplane/standalone/saiserver/ports_test.go b/dataplane/standalone/saiserver/ports_test.go index 0fcadf8c..1fe3b379 100644 --- a/dataplane/standalone/saiserver/ports_test.go +++ b/dataplane/standalone/saiserver/ports_test.go @@ -48,14 +48,60 @@ func TestCreatePort(t *testing.T) { Oid: 1, }, wantAttr: &saipb.PortAttribute{ - OperStatus: saipb.PortOperStatus_PORT_OPER_STATUS_NOT_PRESENT.Enum(), - OperSpeed: proto.Uint32(1024), - NumberOfIngressPriorityGroups: proto.Uint32(0), - QosNumberOfQueues: proto.Uint32(0), - QosMaximumHeadroomSize: proto.Uint32(0), - AdminState: proto.Bool(true), - AutoNegMode: proto.Bool(false), - Mtu: proto.Uint32(1514), + OperStatus: saipb.PortOperStatus_PORT_OPER_STATUS_NOT_PRESENT.Enum(), + QosNumberOfQueues: proto.Uint32(0), + QosQueueList: []uint64{}, + QosNumberOfSchedulerGroups: proto.Uint32(0), + QosSchedulerGroupList: []uint64{}, + IngressPriorityGroupList: []uint64{}, + FloodStormControlPolicerId: proto.Uint64(0), + BroadcastStormControlPolicerId: proto.Uint64(0), + MulticastStormControlPolicerId: proto.Uint64(0), + IngressAcl: proto.Uint64(0), + EgressAcl: proto.Uint64(0), + IngressMacsecAcl: proto.Uint64(0), + EgressMacsecAcl: proto.Uint64(0), + MacsecPortList: []uint64{}, + IngressMirrorSession: []uint64{}, + EgressMirrorSession: []uint64{}, + IngressSamplepacketEnable: proto.Uint64(0), + EgressSamplepacketEnable: proto.Uint64(0), + IngressSampleMirrorSession: []uint64{}, + EgressSampleMirrorSession: []uint64{}, + PolicerId: proto.Uint64(0), + QosDot1PToTcMap: proto.Uint64(0), + QosDot1PToColorMap: proto.Uint64(0), + QosDscpToTcMap: proto.Uint64(0), + QosDscpToColorMap: proto.Uint64(0), + QosTcToQueueMap: proto.Uint64(0), + QosTcAndColorToDot1PMap: proto.Uint64(0), + QosTcAndColorToDscpMap: proto.Uint64(0), + QosTcToPriorityGroupMap: proto.Uint64(0), + QosPfcPriorityToPriorityGroupMap: proto.Uint64(0), + QosPfcPriorityToQueueMap: proto.Uint64(0), + QosSchedulerProfileId: proto.Uint64(0), + QosIngressBufferProfileList: []uint64{}, + QosEgressBufferProfileList: []uint64{}, + EgressBlockPortList: []uint64{}, + PortPoolList: []uint64{}, + IsolationGroup: proto.Uint64(0), + TamObject: []uint64{}, + PortSerdesId: proto.Uint64(0), + QosMplsExpToTcMap: proto.Uint64(0), + QosMplsExpToColorMap: proto.Uint64(0), + QosTcAndColorToMplsExpMap: proto.Uint64(0), + SystemPort: proto.Uint64(0), + QosDscpToForwardingClassMap: proto.Uint64(0), + QosMplsExpToForwardingClassMap: proto.Uint64(0), + IpsecPort: proto.Uint64(0), + SupportedSpeed: []uint32{1024}, + OperSpeed: proto.Uint32(1024), + SupportedFecMode: []saipb.PortFecMode{saipb.PortFecMode_PORT_FEC_MODE_NONE}, + NumberOfIngressPriorityGroups: proto.Uint32(0), + QosMaximumHeadroomSize: proto.Uint32(0), + AdminState: proto.Bool(true), + AutoNegMode: proto.Bool(false), + Mtu: proto.Uint32(1514), }, }, { desc: "existing interface", @@ -64,14 +110,60 @@ func TestCreatePort(t *testing.T) { Oid: 1, }, wantAttr: &saipb.PortAttribute{ - OperStatus: saipb.PortOperStatus_PORT_OPER_STATUS_UP.Enum(), - OperSpeed: proto.Uint32(1024), - NumberOfIngressPriorityGroups: proto.Uint32(0), - QosNumberOfQueues: proto.Uint32(0), - QosMaximumHeadroomSize: proto.Uint32(0), - AdminState: proto.Bool(true), - AutoNegMode: proto.Bool(false), - Mtu: proto.Uint32(1514), + OperStatus: saipb.PortOperStatus_PORT_OPER_STATUS_UP.Enum(), + QosNumberOfQueues: proto.Uint32(0), + QosQueueList: []uint64{}, + QosNumberOfSchedulerGroups: proto.Uint32(0), + QosSchedulerGroupList: []uint64{}, + IngressPriorityGroupList: []uint64{}, + FloodStormControlPolicerId: proto.Uint64(0), + BroadcastStormControlPolicerId: proto.Uint64(0), + MulticastStormControlPolicerId: proto.Uint64(0), + IngressAcl: proto.Uint64(0), + EgressAcl: proto.Uint64(0), + IngressMacsecAcl: proto.Uint64(0), + EgressMacsecAcl: proto.Uint64(0), + MacsecPortList: []uint64{}, + IngressMirrorSession: []uint64{}, + EgressMirrorSession: []uint64{}, + IngressSamplepacketEnable: proto.Uint64(0), + EgressSamplepacketEnable: proto.Uint64(0), + IngressSampleMirrorSession: []uint64{}, + EgressSampleMirrorSession: []uint64{}, + PolicerId: proto.Uint64(0), + QosDot1PToTcMap: proto.Uint64(0), + QosDot1PToColorMap: proto.Uint64(0), + QosDscpToTcMap: proto.Uint64(0), + QosDscpToColorMap: proto.Uint64(0), + QosTcToQueueMap: proto.Uint64(0), + QosTcAndColorToDot1PMap: proto.Uint64(0), + QosTcAndColorToDscpMap: proto.Uint64(0), + QosTcToPriorityGroupMap: proto.Uint64(0), + QosPfcPriorityToPriorityGroupMap: proto.Uint64(0), + QosPfcPriorityToQueueMap: proto.Uint64(0), + QosSchedulerProfileId: proto.Uint64(0), + QosIngressBufferProfileList: []uint64{}, + QosEgressBufferProfileList: []uint64{}, + EgressBlockPortList: []uint64{}, + PortPoolList: []uint64{}, + IsolationGroup: proto.Uint64(0), + TamObject: []uint64{}, + PortSerdesId: proto.Uint64(0), + QosMplsExpToTcMap: proto.Uint64(0), + QosMplsExpToColorMap: proto.Uint64(0), + QosTcAndColorToMplsExpMap: proto.Uint64(0), + SystemPort: proto.Uint64(0), + QosDscpToForwardingClassMap: proto.Uint64(0), + QosMplsExpToForwardingClassMap: proto.Uint64(0), + IpsecPort: proto.Uint64(0), + SupportedSpeed: []uint32{1024}, + OperSpeed: proto.Uint32(1024), + SupportedFecMode: []saipb.PortFecMode{saipb.PortFecMode_PORT_FEC_MODE_NONE}, + NumberOfIngressPriorityGroups: proto.Uint32(0), + QosMaximumHeadroomSize: proto.Uint32(0), + AdminState: proto.Bool(true), + AutoNegMode: proto.Bool(false), + Mtu: proto.Uint32(1514), }, }} for _, tt := range tests { diff --git a/dataplane/standalone/saiserver/routing.go b/dataplane/standalone/saiserver/routing.go index 05ee0119..ef1ec8d6 100644 --- a/dataplane/standalone/saiserver/routing.go +++ b/dataplane/standalone/saiserver/routing.go @@ -21,6 +21,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" "github.com/openconfig/lemming/dataplane/standalone/saiserver/attrmgr" @@ -162,6 +163,18 @@ func (nh *nextHop) CreateNextHop(ctx context.Context, req *saipb.CreateNextHopRe }, nil } +func (nh *nextHop) CreateNextHops(ctx context.Context, r *saipb.CreateNextHopsRequest) (*saipb.CreateNextHopsResponse, error) { + resp := &saipb.CreateNextHopsResponse{} + for _, req := range r.GetReqs() { + res, err := attrmgr.InvokeAndSave(ctx, nh.mgr, nh.CreateNextHop, req) + if err != nil { + return nil, err + } + resp.Resps = append(resp.Resps, res) + } + return resp, nil +} + type route struct { saipb.UnimplementedRouteServer mgr *attrmgr.AttrMgr @@ -203,6 +216,8 @@ func (r *route) CreateRouteEntry(ctx context.Context, req *saipb.CreateRouteEntr saipb.PacketAction_PACKET_ACTION_LOG, // COPY and FORWARD saipb.PacketAction_PACKET_ACTION_TRANSIT: // COPY_CANCEL and FORWARD rReq.Route.Action = dpb.PacketAction_PACKET_ACTION_FORWARD + case saipb.PacketAction_PACKET_ACTION_UNSPECIFIED: // Default action is forward. + rReq.Route.Action = dpb.PacketAction_PACKET_ACTION_FORWARD default: return nil, status.Errorf(codes.InvalidArgument, "unknown action type: %v", req.GetPacketAction()) } @@ -231,6 +246,18 @@ func (r *route) CreateRouteEntry(ctx context.Context, req *saipb.CreateRouteEntr return &saipb.CreateRouteEntryResponse{}, nil } +func (r *route) CreateRouteEntries(ctx context.Context, re *saipb.CreateRouteEntriesRequest) (*saipb.CreateRouteEntriesResponse, error) { + resp := &saipb.CreateRouteEntriesResponse{} + for _, req := range re.GetReqs() { + res, err := attrmgr.InvokeAndSave(ctx, r.mgr, r.CreateRouteEntry, req) + if err != nil { + return nil, err + } + resp.Resps = append(resp.Resps, res) + } + return resp, nil +} + type routerInterface struct { saipb.UnimplementedRouterInterfaceServer mgr *attrmgr.AttrMgr @@ -272,3 +299,77 @@ func (ri *routerInterface) CreateRouterInterface(ctx context.Context, req *saipb return &saipb.CreateRouterInterfaceResponse{Oid: id}, nil } + +type vlan struct { + saipb.UnimplementedVlanServer + mgr *attrmgr.AttrMgr + dataplane routingDataplaneAPI +} + +func newVlan(mgr *attrmgr.AttrMgr, dataplane routingDataplaneAPI, s *grpc.Server) *vlan { + v := &vlan{ + mgr: mgr, + dataplane: dataplane, + } + saipb.RegisterVlanServer(s, v) + return v +} + +func (vlan *vlan) CreateVlan(context.Context, *saipb.CreateVlanRequest) (*saipb.CreateVlanResponse, error) { + id := vlan.mgr.NextID() + + req := &saipb.GetSwitchAttributeRequest{Oid: 1, AttrType: []saipb.SwitchAttr{saipb.SwitchAttr_SWITCH_ATTR_DEFAULT_STP_INST_ID}} + resp := &saipb.GetSwitchAttributeResponse{} + + if err := vlan.mgr.PopulateAttributes(req, resp); err != nil { + return nil, err + } + + attrs := &saipb.VlanAttribute{ + MemberList: []uint64{}, + StpInstance: resp.Attr.DefaultStpInstId, + UnknownNonIpMcastOutputGroupId: proto.Uint64(0), + UnknownIpv4McastOutputGroupId: proto.Uint64(0), + UnknownIpv6McastOutputGroupId: proto.Uint64(0), + UnknownLinklocalMcastOutputGroupId: proto.Uint64(0), + IngressAcl: proto.Uint64(0), + EgressAcl: proto.Uint64(0), + UnknownUnicastFloodGroup: proto.Uint64(0), + UnknownMulticastFloodGroup: proto.Uint64(0), + BroadcastFloodGroup: proto.Uint64(0), + TamObject: []uint64{}, + } + vlan.mgr.StoreAttributes(id, attrs) + return &saipb.CreateVlanResponse{ + Oid: id, + }, nil +} + +type bridge struct { + saipb.UnimplementedBridgeServer + mgr *attrmgr.AttrMgr + dataplane routingDataplaneAPI +} + +func newBridge(mgr *attrmgr.AttrMgr, dataplane routingDataplaneAPI, s *grpc.Server) *bridge { + b := &bridge{ + mgr: mgr, + dataplane: dataplane, + } + saipb.RegisterBridgeServer(s, b) + return b +} + +func (br *bridge) CreateBridge(context.Context, *saipb.CreateBridgeRequest) (*saipb.CreateBridgeResponse, error) { + id := br.mgr.NextID() + attrs := &saipb.BridgeAttribute{ + PortList: []uint64{}, + UnknownUnicastFloodGroup: proto.Uint64(0), + UnknownMulticastFloodGroup: proto.Uint64(0), + BroadcastFloodGroup: proto.Uint64(0), + } + br.mgr.StoreAttributes(id, attrs) + return &saipb.CreateBridgeResponse{ + Oid: id, + }, nil +} diff --git a/dataplane/standalone/saiserver/saiserver.go b/dataplane/standalone/saiserver/saiserver.go index 7ef1747b..7e5ee7a3 100644 --- a/dataplane/standalone/saiserver/saiserver.go +++ b/dataplane/standalone/saiserver/saiserver.go @@ -39,10 +39,6 @@ type buffer struct { saipb.UnimplementedBufferServer } -type bridge struct { - saipb.UnimplementedBridgeServer -} - type counter struct { saipb.UnimplementedCounterServer } @@ -51,6 +47,10 @@ type debugCounter struct { saipb.UnimplementedDebugCounterServer } +type dtel struct { + saipb.UnimplementedDtelServer +} + type fdb struct { saipb.UnimplementedFdbServer } @@ -167,10 +167,6 @@ type virtualRouter struct { saipb.UnimplementedVirtualRouterServer } -type vlan struct { - saipb.UnimplementedVlanServer -} - type wred struct { saipb.UnimplementedWredServer } @@ -183,6 +179,7 @@ type Server struct { buffer *buffer counter *counter debugCounter *debugCounter + dtel *dtel fdb *fdb ipmcGroup *ipmcGroup ipmc *ipmc @@ -231,6 +228,7 @@ func New(mgr *attrmgr.AttrMgr, engine switchDataplaneAPI, s *grpc.Server) *Serve buffer: &buffer{}, counter: &counter{}, debugCounter: &debugCounter{}, + dtel: &dtel{}, fdb: &fdb{}, ipmcGroup: &ipmcGroup{}, ipmc: &ipmc{}, @@ -265,6 +263,7 @@ func New(mgr *attrmgr.AttrMgr, engine switchDataplaneAPI, s *grpc.Server) *Serve saipb.RegisterBfdServer(s, srv.bfd) saipb.RegisterCounterServer(s, srv.counter) saipb.RegisterDebugCounterServer(s, srv.debugCounter) + saipb.RegisterDtelServer(s, srv.dtel) saipb.RegisterFdbServer(s, srv.fdb) saipb.RegisterIpmcGroupServer(s, srv.ipmcGroup) saipb.RegisterIpmcServer(s, srv.ipmc) diff --git a/dataplane/standalone/saiserver/switch.go b/dataplane/standalone/saiserver/switch.go index 84d5ae6b..69608be3 100644 --- a/dataplane/standalone/saiserver/switch.go +++ b/dataplane/standalone/saiserver/switch.go @@ -57,10 +57,10 @@ func newSwitch(mgr *attrmgr.AttrMgr, engine switchDataplaneAPI, s *grpc.Server) sw := &saiSwitch{ dataplane: engine, port: newPort(mgr, engine, s), - vlan: &vlan{}, + vlan: newVlan(mgr, engine, s), stp: &stp{}, vr: &virtualRouter{}, - bridge: &bridge{}, + bridge: newBridge(mgr, engine, s), hostif: newHostif(mgr, engine, s), hash: &hash{}, neighbor: newNeighbor(mgr, engine, s), @@ -71,10 +71,8 @@ func newSwitch(mgr *attrmgr.AttrMgr, engine switchDataplaneAPI, s *grpc.Server) mgr: mgr, } saipb.RegisterSwitchServer(s, sw) - saipb.RegisterVlanServer(s, sw.vlan) saipb.RegisterStpServer(s, sw.stp) saipb.RegisterVirtualRouterServer(s, sw.vr) - saipb.RegisterBridgeServer(s, sw.bridge) saipb.RegisterHashServer(s, sw.hash) return sw } @@ -88,18 +86,21 @@ func (sw *saiSwitch) CreateSwitch(ctx context.Context, _ *saipb.CreateSwitchRequ return nil, err } - vlanResp, err := attrmgr.InvokeAndSave(ctx, sw.mgr, sw.vlan.CreateVlan, &saipb.CreateVlanRequest{ + stpResp, err := attrmgr.InvokeAndSave(ctx, sw.mgr, sw.stp.CreateStp, &saipb.CreateStpRequest{ Switch: swID, }) if err != nil { return nil, err } - stpResp, err := attrmgr.InvokeAndSave(ctx, sw.mgr, sw.stp.CreateStp, &saipb.CreateStpRequest{ + sw.mgr.StoreAttributes(swID, &saipb.SwitchAttribute{DefaultStpInstId: &stpResp.Oid}) + + vlanResp, err := attrmgr.InvokeAndSave(ctx, sw.mgr, sw.vlan.CreateVlan, &saipb.CreateVlanRequest{ Switch: swID, }) if err != nil { return nil, err } + vrResp, err := attrmgr.InvokeAndSave(ctx, sw.mgr, sw.vr.CreateVirtualRouter, &saipb.CreateVirtualRouterRequest{ Switch: swID, }) @@ -132,19 +133,21 @@ func (sw *saiSwitch) CreateSwitch(ctx context.Context, _ *saipb.CreateSwitchRequ CpuPort: proto.Uint64(cpuPortID), NumberOfActivePorts: proto.Uint32(0), AclEntryMinimumPriority: proto.Uint32(1), + AclEntryMaximumPriority: proto.Uint32(100), + AclTableMinimumPriority: proto.Uint32(1), AclTableMaximumPriority: proto.Uint32(100), MaxAclActionCount: proto.Uint32(50), NumberOfEcmpGroups: proto.Uint32(1024), + PortList: []uint64{cpuPortID}, + SwitchHardwareInfo: []int32{}, DefaultVlanId: &vlanResp.Oid, - DefaultStpInstId: &stpResp.Oid, DefaultVirtualRouterId: &vrResp.Oid, DefaultOverrideVirtualRouterId: &vrResp.Oid, Default_1QBridgeId: &brResp.Oid, DefaultTrapGroup: &trGroupResp.Oid, IngressAcl: proto.Uint64(0), EgressAcl: proto.Uint64(0), - QosMaxNumberOfTrafficClasses: proto.Uint32(0), - TotalBufferSize: proto.Uint64(1024 * 1024), + PreIngressAcl: proto.Uint64(0), AvailableIpv4RouteEntry: proto.Uint32(1024), AvailableIpv6RouteEntry: proto.Uint32(1024), AvailableIpv4NexthopEntry: proto.Uint32(1024), @@ -158,23 +161,54 @@ func (sw *saiSwitch) CreateSwitch(ctx context.Context, _ *saipb.CreateSwitchRequ AvailableIpmcEntry: proto.Uint32(1024), AvailableSnatEntry: proto.Uint32(1024), AvailableDnatEntry: proto.Uint32(1024), - EcmpHash: &hashResp.Oid, - LagHash: &hashResp.Oid, - RestartWarm: proto.Bool(false), - WarmRecover: proto.Bool(false), - LagDefaultHashAlgorithm: saipb.HashAlgorithm_HASH_ALGORITHM_CRC.Enum(), - LagDefaultHashSeed: proto.Uint32(0), - LagDefaultSymmetricHash: proto.Bool(false), - QosDefaultTc: proto.Uint32(0), - QosDot1PToTcMap: proto.Uint64(0), - QosDot1PToColorMap: proto.Uint64(0), - QosTcToQueueMap: proto.Uint64(0), - QosTcAndColorToDot1PMap: proto.Uint64(0), - QosTcAndColorToDscpMap: proto.Uint64(0), - QosTcAndColorToMplsExpMap: proto.Uint64(0), - SwitchShellEnable: proto.Bool(false), - SwitchProfileId: proto.Uint32(0), - NatZoneCounterObjectId: proto.Uint64(0), + MaxAclRangeCount: proto.Uint32(10), + AclStageIngress: &saipb.ACLCapability{ + IsActionListMandatory: false, + ActionList: []saipb.AclActionType{saipb.AclActionType_ACL_ACTION_TYPE_PACKET_ACTION, saipb.AclActionType_ACL_ACTION_TYPE_MIRROR_INGRESS, saipb.AclActionType_ACL_ACTION_TYPE_NO_NAT}, + }, + AclStageEgress: &saipb.ACLCapability{ + IsActionListMandatory: false, + ActionList: []saipb.AclActionType{saipb.AclActionType_ACL_ACTION_TYPE_PACKET_ACTION}, + }, + EcmpHash: &hashResp.Oid, + LagHash: &hashResp.Oid, + EcmpHashIpv4: &hashResp.Oid, + EcmpHashIpv4InIpv4: &hashResp.Oid, + EcmpHashIpv6: &hashResp.Oid, + LagHashIpv4: &hashResp.Oid, + LagHashIpv4InIpv4: &hashResp.Oid, + LagHashIpv6: &hashResp.Oid, + RestartWarm: proto.Bool(false), + WarmRecover: proto.Bool(false), + LagDefaultHashAlgorithm: saipb.HashAlgorithm_HASH_ALGORITHM_CRC.Enum(), + LagDefaultHashSeed: proto.Uint32(0), + LagDefaultSymmetricHash: proto.Bool(false), + QosDefaultTc: proto.Uint32(0), + QosDot1PToTcMap: proto.Uint64(0), + QosDot1PToColorMap: proto.Uint64(0), + QosTcToQueueMap: proto.Uint64(0), + QosTcAndColorToDot1PMap: proto.Uint64(0), + QosTcAndColorToDscpMap: proto.Uint64(0), + QosTcAndColorToMplsExpMap: proto.Uint64(0), + QosDscpToTcMap: proto.Uint64(0), + QosDscpToColorMap: proto.Uint64(0), + QosMplsExpToTcMap: proto.Uint64(0), + QosMplsExpToColorMap: proto.Uint64(0), + QosDscpToForwardingClassMap: proto.Uint64(0), + QosMplsExpToForwardingClassMap: proto.Uint64(0), + IpsecObjectId: proto.Uint64(0), + TamObjectId: []uint64{}, + PortConnectorList: []uint64{}, + MacsecObjectList: []uint64{}, + SystemPortList: []uint64{}, + FabricPortList: []uint64{}, + TunnelObjectsList: []uint64{}, + MyMacList: []uint64{}, + Type: saipb.SwitchType_SWITCH_TYPE_NPU.Enum(), + NumberOfSystemPorts: proto.Uint32(0), + SwitchShellEnable: proto.Bool(false), + SwitchProfileId: proto.Uint32(0), + NatZoneCounterObjectId: proto.Uint64(0), } sw.mgr.StoreAttributes(swID, attrs) diff --git a/dataplane/standalone/saiserver/switch_test.go b/dataplane/standalone/saiserver/switch_test.go index 92ee0c51..897dfd81 100644 --- a/dataplane/standalone/saiserver/switch_test.go +++ b/dataplane/standalone/saiserver/switch_test.go @@ -21,15 +21,13 @@ import ( "net" "testing" + "github.com/google/go-cmp/cmp" + "github.com/openconfig/gnmi/errdiff" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/testing/protocmp" - "github.com/google/go-cmp/cmp" - - "github.com/openconfig/gnmi/errdiff" - "github.com/openconfig/lemming/dataplane/standalone/saiserver/attrmgr" fwdpb "github.com/openconfig/lemming/proto/forwarding" @@ -53,19 +51,22 @@ func TestCreateSwitch(t *testing.T) { CpuPort: proto.Uint64(2), NumberOfActivePorts: proto.Uint32(0), AclEntryMinimumPriority: proto.Uint32(1), + AclEntryMaximumPriority: proto.Uint32(100), + AclTableMinimumPriority: proto.Uint32(1), AclTableMaximumPriority: proto.Uint32(100), MaxAclActionCount: proto.Uint32(50), NumberOfEcmpGroups: proto.Uint32(1024), - DefaultVlanId: proto.Uint64(3), - DefaultStpInstId: proto.Uint64(4), + PortList: []uint64{2}, + SwitchHardwareInfo: []int32{}, + DefaultStpInstId: proto.Uint64(3), + DefaultVlanId: proto.Uint64(4), DefaultVirtualRouterId: proto.Uint64(5), DefaultOverrideVirtualRouterId: proto.Uint64(5), Default_1QBridgeId: proto.Uint64(6), DefaultTrapGroup: proto.Uint64(7), IngressAcl: proto.Uint64(0), EgressAcl: proto.Uint64(0), - QosMaxNumberOfTrafficClasses: proto.Uint32(0), - TotalBufferSize: proto.Uint64(1024 * 1024), + PreIngressAcl: proto.Uint64(0), AvailableIpv4RouteEntry: proto.Uint32(1024), AvailableIpv6RouteEntry: proto.Uint32(1024), AvailableIpv4NexthopEntry: proto.Uint32(1024), @@ -79,23 +80,54 @@ func TestCreateSwitch(t *testing.T) { AvailableIpmcEntry: proto.Uint32(1024), AvailableSnatEntry: proto.Uint32(1024), AvailableDnatEntry: proto.Uint32(1024), - EcmpHash: proto.Uint64(8), - LagHash: proto.Uint64(8), - RestartWarm: proto.Bool(false), - WarmRecover: proto.Bool(false), - LagDefaultHashAlgorithm: saipb.HashAlgorithm_HASH_ALGORITHM_CRC.Enum(), - LagDefaultHashSeed: proto.Uint32(0), - LagDefaultSymmetricHash: proto.Bool(false), - QosDefaultTc: proto.Uint32(0), - QosDot1PToTcMap: proto.Uint64(0), - QosDot1PToColorMap: proto.Uint64(0), - QosTcToQueueMap: proto.Uint64(0), - QosTcAndColorToDot1PMap: proto.Uint64(0), - QosTcAndColorToDscpMap: proto.Uint64(0), - QosTcAndColorToMplsExpMap: proto.Uint64(0), - SwitchShellEnable: proto.Bool(false), - SwitchProfileId: proto.Uint32(0), - NatZoneCounterObjectId: proto.Uint64(0), + MaxAclRangeCount: proto.Uint32(10), + AclStageIngress: &saipb.ACLCapability{ + IsActionListMandatory: false, + ActionList: []saipb.AclActionType{saipb.AclActionType_ACL_ACTION_TYPE_PACKET_ACTION, saipb.AclActionType_ACL_ACTION_TYPE_MIRROR_INGRESS, saipb.AclActionType_ACL_ACTION_TYPE_NO_NAT}, + }, + AclStageEgress: &saipb.ACLCapability{ + IsActionListMandatory: false, + ActionList: []saipb.AclActionType{saipb.AclActionType_ACL_ACTION_TYPE_PACKET_ACTION}, + }, + EcmpHash: proto.Uint64(8), + LagHash: proto.Uint64(8), + EcmpHashIpv4: proto.Uint64(8), + EcmpHashIpv4InIpv4: proto.Uint64(8), + EcmpHashIpv6: proto.Uint64(8), + LagHashIpv4: proto.Uint64(8), + LagHashIpv4InIpv4: proto.Uint64(8), + LagHashIpv6: proto.Uint64(8), + RestartWarm: proto.Bool(false), + WarmRecover: proto.Bool(false), + LagDefaultHashAlgorithm: saipb.HashAlgorithm_HASH_ALGORITHM_CRC.Enum(), + LagDefaultHashSeed: proto.Uint32(0), + LagDefaultSymmetricHash: proto.Bool(false), + QosDefaultTc: proto.Uint32(0), + QosDot1PToTcMap: proto.Uint64(0), + QosDot1PToColorMap: proto.Uint64(0), + QosTcToQueueMap: proto.Uint64(0), + QosTcAndColorToDot1PMap: proto.Uint64(0), + QosTcAndColorToDscpMap: proto.Uint64(0), + QosTcAndColorToMplsExpMap: proto.Uint64(0), + QosDscpToTcMap: proto.Uint64(0), + QosDscpToColorMap: proto.Uint64(0), + QosMplsExpToTcMap: proto.Uint64(0), + QosMplsExpToColorMap: proto.Uint64(0), + QosDscpToForwardingClassMap: proto.Uint64(0), + QosMplsExpToForwardingClassMap: proto.Uint64(0), + IpsecObjectId: proto.Uint64(0), + TamObjectId: []uint64{}, + PortConnectorList: []uint64{}, + MacsecObjectList: []uint64{}, + SystemPortList: []uint64{}, + FabricPortList: []uint64{}, + TunnelObjectsList: []uint64{}, + MyMacList: []uint64{}, + Type: saipb.SwitchType_SWITCH_TYPE_NPU.Enum(), + NumberOfSystemPorts: proto.Uint32(0), + SwitchShellEnable: proto.Bool(false), + SwitchProfileId: proto.Uint32(0), + NatZoneCounterObjectId: proto.Uint64(0), } attr := &saipb.SwitchAttribute{} if err := mgr.PopulateAllAttributes("1", attr); err != nil { diff --git a/patches/sai.patch b/patches/sai.patch new file mode 100644 index 00000000..66c427fe --- /dev/null +++ b/patches/sai.patch @@ -0,0 +1,33 @@ +diff --git a/inc/sainexthop.h b/inc/sainexthop.h +index ae137f4..163e885 100644 +--- a/inc/sainexthop.h ++++ b/inc/sainexthop.h +@@ -126,6 +126,7 @@ typedef enum _sai_next_hop_attr_t + * @type sai_object_id_t + * @flags MANDATORY_ON_CREATE | CREATE_ONLY + * @objects SAI_OBJECT_TYPE_SRV6_SIDLIST ++ * @allownull true + * @condition SAI_NEXT_HOP_ATTR_TYPE == SAI_NEXT_HOP_TYPE_SRV6_SIDLIST + */ + SAI_NEXT_HOP_ATTR_SRV6_SIDLIST_ID, +@@ -297,11 +298,15 @@ typedef sai_status_t (*sai_get_next_hop_attribute_fn)( + */ + typedef struct _sai_next_hop_api_t + { +- sai_create_next_hop_fn create_next_hop; +- sai_remove_next_hop_fn remove_next_hop; +- sai_set_next_hop_attribute_fn set_next_hop_attribute; +- sai_get_next_hop_attribute_fn get_next_hop_attribute; +- ++ sai_create_next_hop_fn create_next_hop; ++ sai_remove_next_hop_fn remove_next_hop; ++ sai_set_next_hop_attribute_fn set_next_hop_attribute; ++ sai_get_next_hop_attribute_fn get_next_hop_attribute; ++ ++ sai_bulk_object_create_fn create_next_hops; ++ sai_bulk_object_remove_fn remove_next_hops; ++ sai_bulk_object_set_attribute_fn set_next_hops_attribute; ++ sai_bulk_object_get_attribute_fn get_next_hops_attribute; + } sai_next_hop_api_t; + + /**