Skip to content

Nokia collection - functional POC (#1) #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ get_filename_component(juniper_gnmi_proto_path "${juniper_gnmi_proto}" PATH)
get_filename_component(juniper_gnmi_ext_proto "proto/Juniper/juniper_gnmi_ext.proto" ABSOLUTE)
get_filename_component(juniper_gnmi_ext_proto_path "${juniper_gnmi_ext_proto}" PATH)

# Proto file gRPC dial-out / gnmi / gnmi extensions - Nokia
get_filename_component(nokia_gnmi_dialout_proto "proto/Nokia/nokia_dialout.proto" ABSOLUTE)
get_filename_component(nokia_gnmi_dialout_proto_path "${nokia_gnmi_dialout_proto}" PATH)

get_filename_component(nokia_gnmi_proto "proto/Nokia/nokia_gnmi.proto" ABSOLUTE)
get_filename_component(nokia_gnmi_proto_path "${nokia_gnmi_proto}" PATH)

get_filename_component(nokia_gnmi_ext_proto "proto/Nokia/nokia_gnmi_ext.proto" ABSOLUTE)
get_filename_component(nokia_gnmi_ext_proto_path "${nokia_gnmi_ext_proto}" PATH)

# Proto file gRPC dial-out - Huawei
get_filename_component(huawei_dialout_proto "proto/Huawei/huawei_dialout.proto" ABSOLUTE)
get_filename_component(huawei_dialout_proto_path "${huawei_dialout_proto}" PATH)
Expand Down Expand Up @@ -193,6 +203,57 @@ add_custom_command(
"${juniper_gnmi_dialout_proto}"
)

# Protobuf generated "gRPC dial-out" - Nokia
set(nokia_gnmi_ext_pb_cc
"${CMAKE_CURRENT_SOURCE_DIR}/src/proto/Nokia/nokia_gnmi_ext.pb.cc")
set(nokia_gnmi_ext_pb_h
"${CMAKE_CURRENT_SOURCE_DIR}/src/proto/Nokia/nokia_gnmi_ext.pb.h")
set(nokia_gnmi_pb_cc
"${CMAKE_CURRENT_SOURCE_DIR}/src/proto/Nokia/nokia_gnmi.pb.cc")
set(nokia_gnmi_pb_h
"${CMAKE_CURRENT_SOURCE_DIR}/src/proto/Nokia/nokia_gnmi.pb.h")
set(nokia_gnmi_pb_grpc_cc
"${CMAKE_CURRENT_SOURCE_DIR}/src/proto/Nokia/nokia_gnmi.grpc.pb.cc")
set(nokia_gnmi_pb_grpc_h
"${CMAKE_CURRENT_SOURCE_DIR}/src/proto/Nokia/nokia_gnmi.grpc.pb.h")
set(nokia_gnmi_dialout_pb_cc
"${CMAKE_CURRENT_SOURCE_DIR}/src/proto/Nokia/nokia_dialout.pb.cc")
set(nokia_gnmi_dialout_pb_h
"${CMAKE_CURRENT_SOURCE_DIR}/src/proto/Nokia/nokia_dialout.pb.h")
set(nokia_gnmi_dialout_pb_grpc_cc
"${CMAKE_CURRENT_SOURCE_DIR}/src/proto/Nokia/nokia_dialout.grpc.pb.cc")
set(nokia_gnmi_dialout_pb_grpc_h
"${CMAKE_CURRENT_SOURCE_DIR}/src/proto/Nokia/nokia_dialout.grpc.pb.h")
add_custom_command(
OUTPUT
"${nokia_gnmi_ext_pb_cc}"
"${nokia_gnmi_ext_pb_h}"
"${nokia_gnmi_pb_cc}"
"${nokia_gnmi_pb_h}"
"${nokia_gnmi_pb_grpc_cc}"
"${nokia_gnmi_pb_grpc_h}"
"${nokia_gnmi_dialout_pb_cc}"
"${nokia_gnmi_dialout_pb_h}"
"${nokia_gnmi_dialout_pb_grpc_cc}"
"${nokia_gnmi_dialout_pb_grpc_h}"
COMMAND
${_PROTOBUF_PROTOC}
ARGS
-I "${nokia_gnmi_ext_proto_path}"
-I "${nokia_gnmi_proto_path}"
-I "${nokia_gnmi_dialout_proto_path}"
--cpp_out "${CMAKE_CURRENT_SOURCE_DIR}/src/proto/Nokia"
"${nokia_gnmi_ext_proto}"
"${nokia_gnmi_proto}"
"${nokia_gnmi_dialout_proto}"
--grpc_out "${CMAKE_CURRENT_SOURCE_DIR}/src/proto/Nokia"
--plugin=protoc-gen-grpc="${_GRPC_CPP_PLUGIN_EXECUTABLE}"
DEPENDS
"${nokia_gnmi_ext_proto}"
"${nokia_gnmi_proto}"
"${nokia_gnmi_dialout_proto}"
)

# Protobuf generated "gRPC dial-out" - Huawei
set(huawei_dialout_pb_cc
"${CMAKE_CURRENT_SOURCE_DIR}/src/proto/Huawei/huawei_dialout.pb.cc")
Expand Down Expand Up @@ -368,6 +429,10 @@ foreach(sourcefile ${APP_SOURCES})
${juniper_telemetry_pb_cc}
${juniper_telemetry_header_pb_cc}
${juniper_telemetry_header_extension_pb_cc}
${nokia_gnmi_pb_cc}
${nokia_gnmi_ext_pb_cc}
${nokia_gnmi_dialout_pb_cc}
${nokia_gnmi_dialout_pb_grpc_cc}
${huawei_dialout_pb_cc}
${huawei_dialout_pb_grpc_cc}
${huawei_telemetry_pb_cc}
Expand Down
17 changes: 17 additions & 0 deletions doc/CONFIG-KEYS
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ DESC: Defining the network end-point receiving the gRPC data-stream from Ju
value is set and if the configuration key is specified its value can't be empty.
DEFAULT: none

KEY: ipv4_socket_nokia
DESC: Defining the network end-point receiving the gRPC data-stream from Nokia devices. The end-point information must include both the
IPv4 and port separated by colon, for example "192.18.0.2:10002" is considered to be a valid end-point. No default
value is set and if the configuration key is specified its value can't be empty.
DEFAULT: none

KEY: ipv4_socket_huawei
DESC: Defining the network end-point receiving the gRPC data-stream from Huawei devices. The end-point information must include both the
IPv4 and port separated by colon, for example "192.18.0.3:10003" is considered to be a valid end-point. No default
Expand All @@ -41,6 +47,12 @@ DESC: This is ment mainly for debugging. With this configuration key you ca
a single receiving session. The default value is set to "0" which means unlimited.
DEFAULT: "0"

KEY: replies_nokia
VALUES: [value >= "0" and value <= "1000"]
DESC: This is ment mainly for debugging. With this configuration key you can rate limit the amount of Nokia's gRPC messages processed within
a single receiving session. The default value is set to "0" which means unlimited.
DEFAULT: "0"

KEY: replies_huawei
VALUES: [value >= "0" and value <= "1000"]
DESC: This is ment mainly for debugging. With this configuration key you can rate limit the amount of Huawei's gRPC messages processed within
Expand All @@ -57,6 +69,11 @@ VALUES: [value >= "1" and value <= "5"]
DESC: Defining the amount of running threads busy with processing incoming Juniper's gRPC messages.
DEFAULT: "1"

KEY: nokia_workers
VALUES: [value >= "1" and value <= "5"]
DESC: Defining the amount of running threads busy with processing incoming Nokia's gRPC messages.
DEFAULT: "1"

KEY: huawei_workers
VALUES: [value >= "1" and value <= "5"]
DESC: Defining the amount of running threads busy with processing incoming Huawei's gRPC messages.
Expand Down
2 changes: 1 addition & 1 deletion proto/Juniper/juniper_dialout.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ service Subscriber {
https://github.com/openconfig/public/blob/master/release/models/telemetry/openconfig-telemetry.yang
*/

rpc DialOutSubscriber(stream gnmi.SubscribeResponse) returns (stream gnmi.SubscribeRequest);
rpc DialOutSubscriber(stream juniper_gnmi.SubscribeResponse) returns (stream juniper_gnmi.SubscribeRequest);

}

20 changes: 10 additions & 10 deletions proto/Juniper/juniper_gnmi.proto
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import "juniper_gnmi_ext.proto";
//
// This document references the gNMI Specification which can be found at
// http://github.com/openconfig/reference/blob/master/rpc/gnmi
package gnmi;
package juniper_gnmi;

// Define a protobuf FileOption that defines the gNMI service version.
extend google.protobuf.FileOptions {
Expand All @@ -37,7 +37,7 @@ extend google.protobuf.FileOptions {

// gNMI_service is the current version of the gNMI service, returned through
// the Capabilities RPC.
option (gnmi_service) = "0.7.0";
option (gnmi_service) = "0.8.0";

service gNMI {
// Capabilities allows the client to retrieve the set of capabilities that
Expand Down Expand Up @@ -211,7 +211,7 @@ message SubscribeRequest {
}
// Extension messages associated with the SubscribeRequest. See the
// gNMI extension specification for further definition.
repeated gnmi_ext.Extension extension = 5;
repeated juniper_gnmi_ext.Extension extension = 5;
}

// Poll is sent within a SubscribeRequest to trigger the device to
Expand All @@ -238,7 +238,7 @@ message SubscribeResponse {
}
// Extension messages associated with the SubscribeResponse. See the
// gNMI extension specification for further definition.
repeated gnmi_ext.Extension extension = 5;
repeated juniper_gnmi_ext.Extension extension = 5;
}

// SubscriptionList is used within a Subscribe message to specify the list of
Expand Down Expand Up @@ -341,7 +341,7 @@ message SetRequest {
repeated Update update = 4; // Updates specifying elements to updated.
// Extension messages associated with the SetRequest. See the
// gNMI extension specification for further definition.
repeated gnmi_ext.Extension extension = 5;
repeated juniper_gnmi_ext.Extension extension = 5;
}

// SetResponse is the response to a SetRequest, sent from the target to the
Expand All @@ -360,7 +360,7 @@ message SetResponse {
int64 timestamp = 4; // Timestamp of transaction (ns since epoch).
// Extension messages associated with the SetResponse. See the
// gNMI extension specification for further definition.
repeated gnmi_ext.Extension extension = 5;
repeated juniper_gnmi_ext.Extension extension = 5;
}

// UpdateResult is used within the SetResponse message to communicate the
Expand Down Expand Up @@ -408,7 +408,7 @@ message GetRequest {
repeated ModelData use_models = 6; // The schema models to be used.
// Extension messages associated with the GetRequest. See the
// gNMI extension specification for further definition.
repeated gnmi_ext.Extension extension = 7;
repeated juniper_gnmi_ext.Extension extension = 7;
}

// GetResponse is used by the target to respond to a GetRequest from a client.
Expand All @@ -420,7 +420,7 @@ message GetResponse {
Error error = 2 [deprecated=true]; // Errors that occurred in the Get.
// Extension messages associated with the GetResponse. See the
// gNMI extension specification for further definition.
repeated gnmi_ext.Extension extension = 3;
repeated juniper_gnmi_ext.Extension extension = 3;
}

// CapabilityRequest is sent by the client in the Capabilities RPC to request
Expand All @@ -429,7 +429,7 @@ message GetResponse {
message CapabilityRequest {
// Extension messages associated with the CapabilityRequest. See the
// gNMI extension specification for further definition.
repeated gnmi_ext.Extension extension = 1;
repeated juniper_gnmi_ext.Extension extension = 1;
}

// CapabilityResponse is used by the target to report its capabilities to the
Expand All @@ -441,7 +441,7 @@ message CapabilityResponse {
string gNMI_version = 3; // Supported gNMI version.
// Extension messages associated with the CapabilityResponse. See the
// gNMI extension specification for further definition.
repeated gnmi_ext.Extension extension = 4;
repeated juniper_gnmi_ext.Extension extension = 4;
}

// ModelData is used to describe a set of schema modules. It can be used in a
Expand Down
2 changes: 1 addition & 1 deletion proto/Juniper/juniper_gnmi_ext.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ syntax = "proto3";
// included with the request and response messages of gNMI RPCs. A set of
// well-known extensions are defined within this file, along with a registry for
// extensions defined outside of this package.
package gnmi_ext;
package juniper_gnmi_ext;

// The Extension message contains a single gNMI extension.
message Extension {
Expand Down
18 changes: 17 additions & 1 deletion proto/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ all:
echo "Autogenerated files up-to-date..."; \
fi

_all: dirs grpc_cisco grpc_huawei grpc_juniper openconfig
_all: dirs grpc_cisco grpc_huawei grpc_juniper grpc_nokia openconfig
echo "$(MD5SUM_HASH)" > .proto_mark
dirs:
mkdir -p ${top_builddir}/src/proto
mkdir -p ${top_builddir}/src/proto/Cisco
mkdir -p ${top_builddir}/src/proto/Huawei
mkdir -p ${top_builddir}/src/proto/Juniper
mkdir -p ${top_builddir}/src/proto/Nokia
mkdir -p ${top_builddir}/src/proto/OpenConfig

grpc_cisco:
Expand Down Expand Up @@ -68,6 +69,21 @@ grpc_juniper:
--cpp_out ${top_builddir}/src/proto/Juniper \
--grpc_out ${top_builddir}/src/proto/Juniper \
--plugin=protoc-gen-grpc="/usr/local/bin/grpc_cpp_plugin" juniper_gnmi_ext.proto

grpc_nokia:
$(PROTOC) -I ${top_srcdir}/proto/Nokia/ \
--cpp_out ${top_builddir}/src/proto/Nokia \
--grpc_out ${top_builddir}/src/proto/Nokia \
--plugin=protoc-gen-grpc="/usr/local/bin/grpc_cpp_plugin" nokia_dialout.proto
$(PROTOC) -I ${top_srcdir}/proto/Nokia/ \
--cpp_out ${top_builddir}/src/proto/Nokia \
--grpc_out ${top_builddir}/src/proto/Nokia \
--plugin=protoc-gen-grpc="/usr/local/bin/grpc_cpp_plugin" nokia_gnmi.proto
$(PROTOC) -I ${top_srcdir}/proto/Nokia/ \
--cpp_out ${top_builddir}/src/proto/Nokia \
--grpc_out ${top_builddir}/src/proto/Nokia \
--plugin=protoc-gen-grpc="/usr/local/bin/grpc_cpp_plugin" nokia_gnmi_ext.proto

openconfig:
$(PROTOC) -I ${top_srcdir}/proto/OpenConfig/ \
--cpp_out ${top_builddir}/src/proto/OpenConfig \
Expand Down
9 changes: 9 additions & 0 deletions proto/Nokia/nokia_dialout.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
syntax = "proto3";
import "nokia_gnmi.proto";

package Nokia.SROS;

service DialoutTelemetry {
rpc Publish(stream nokia_gnmi.SubscribeResponse) returns (stream PublishResponse);
}
message PublishResponse {}
Loading
Loading