Skip to content

Commit 7829ae6

Browse files
Nokia collection - functional POC (#1) (#39)
* Nokia collection, functional POC (#1) * fix typo in Huawei code * Updating including the required Nokia proto's headers ... --------- Co-authored-by: Salvatore Cuzzilla <salvatore@cuzzilla.org>
1 parent f8220df commit 7829ae6

22 files changed

+1331
-26
lines changed

CMakeLists.txt

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ get_filename_component(juniper_gnmi_proto_path "${juniper_gnmi_proto}" PATH)
4646
get_filename_component(juniper_gnmi_ext_proto "proto/Juniper/juniper_gnmi_ext.proto" ABSOLUTE)
4747
get_filename_component(juniper_gnmi_ext_proto_path "${juniper_gnmi_ext_proto}" PATH)
4848

49+
# Proto file gRPC dial-out / gnmi / gnmi extensions - Nokia
50+
get_filename_component(nokia_gnmi_dialout_proto "proto/Nokia/nokia_dialout.proto" ABSOLUTE)
51+
get_filename_component(nokia_gnmi_dialout_proto_path "${nokia_gnmi_dialout_proto}" PATH)
52+
53+
get_filename_component(nokia_gnmi_proto "proto/Nokia/nokia_gnmi.proto" ABSOLUTE)
54+
get_filename_component(nokia_gnmi_proto_path "${nokia_gnmi_proto}" PATH)
55+
56+
get_filename_component(nokia_gnmi_ext_proto "proto/Nokia/nokia_gnmi_ext.proto" ABSOLUTE)
57+
get_filename_component(nokia_gnmi_ext_proto_path "${nokia_gnmi_ext_proto}" PATH)
58+
4959
# Proto file gRPC dial-out - Huawei
5060
get_filename_component(huawei_dialout_proto "proto/Huawei/huawei_dialout.proto" ABSOLUTE)
5161
get_filename_component(huawei_dialout_proto_path "${huawei_dialout_proto}" PATH)
@@ -193,6 +203,57 @@ add_custom_command(
193203
"${juniper_gnmi_dialout_proto}"
194204
)
195205

206+
# Protobuf generated "gRPC dial-out" - Nokia
207+
set(nokia_gnmi_ext_pb_cc
208+
"${CMAKE_CURRENT_SOURCE_DIR}/src/proto/Nokia/nokia_gnmi_ext.pb.cc")
209+
set(nokia_gnmi_ext_pb_h
210+
"${CMAKE_CURRENT_SOURCE_DIR}/src/proto/Nokia/nokia_gnmi_ext.pb.h")
211+
set(nokia_gnmi_pb_cc
212+
"${CMAKE_CURRENT_SOURCE_DIR}/src/proto/Nokia/nokia_gnmi.pb.cc")
213+
set(nokia_gnmi_pb_h
214+
"${CMAKE_CURRENT_SOURCE_DIR}/src/proto/Nokia/nokia_gnmi.pb.h")
215+
set(nokia_gnmi_pb_grpc_cc
216+
"${CMAKE_CURRENT_SOURCE_DIR}/src/proto/Nokia/nokia_gnmi.grpc.pb.cc")
217+
set(nokia_gnmi_pb_grpc_h
218+
"${CMAKE_CURRENT_SOURCE_DIR}/src/proto/Nokia/nokia_gnmi.grpc.pb.h")
219+
set(nokia_gnmi_dialout_pb_cc
220+
"${CMAKE_CURRENT_SOURCE_DIR}/src/proto/Nokia/nokia_dialout.pb.cc")
221+
set(nokia_gnmi_dialout_pb_h
222+
"${CMAKE_CURRENT_SOURCE_DIR}/src/proto/Nokia/nokia_dialout.pb.h")
223+
set(nokia_gnmi_dialout_pb_grpc_cc
224+
"${CMAKE_CURRENT_SOURCE_DIR}/src/proto/Nokia/nokia_dialout.grpc.pb.cc")
225+
set(nokia_gnmi_dialout_pb_grpc_h
226+
"${CMAKE_CURRENT_SOURCE_DIR}/src/proto/Nokia/nokia_dialout.grpc.pb.h")
227+
add_custom_command(
228+
OUTPUT
229+
"${nokia_gnmi_ext_pb_cc}"
230+
"${nokia_gnmi_ext_pb_h}"
231+
"${nokia_gnmi_pb_cc}"
232+
"${nokia_gnmi_pb_h}"
233+
"${nokia_gnmi_pb_grpc_cc}"
234+
"${nokia_gnmi_pb_grpc_h}"
235+
"${nokia_gnmi_dialout_pb_cc}"
236+
"${nokia_gnmi_dialout_pb_h}"
237+
"${nokia_gnmi_dialout_pb_grpc_cc}"
238+
"${nokia_gnmi_dialout_pb_grpc_h}"
239+
COMMAND
240+
${_PROTOBUF_PROTOC}
241+
ARGS
242+
-I "${nokia_gnmi_ext_proto_path}"
243+
-I "${nokia_gnmi_proto_path}"
244+
-I "${nokia_gnmi_dialout_proto_path}"
245+
--cpp_out "${CMAKE_CURRENT_SOURCE_DIR}/src/proto/Nokia"
246+
"${nokia_gnmi_ext_proto}"
247+
"${nokia_gnmi_proto}"
248+
"${nokia_gnmi_dialout_proto}"
249+
--grpc_out "${CMAKE_CURRENT_SOURCE_DIR}/src/proto/Nokia"
250+
--plugin=protoc-gen-grpc="${_GRPC_CPP_PLUGIN_EXECUTABLE}"
251+
DEPENDS
252+
"${nokia_gnmi_ext_proto}"
253+
"${nokia_gnmi_proto}"
254+
"${nokia_gnmi_dialout_proto}"
255+
)
256+
196257
# Protobuf generated "gRPC dial-out" - Huawei
197258
set(huawei_dialout_pb_cc
198259
"${CMAKE_CURRENT_SOURCE_DIR}/src/proto/Huawei/huawei_dialout.pb.cc")
@@ -368,6 +429,10 @@ foreach(sourcefile ${APP_SOURCES})
368429
${juniper_telemetry_pb_cc}
369430
${juniper_telemetry_header_pb_cc}
370431
${juniper_telemetry_header_extension_pb_cc}
432+
${nokia_gnmi_pb_cc}
433+
${nokia_gnmi_ext_pb_cc}
434+
${nokia_gnmi_dialout_pb_cc}
435+
${nokia_gnmi_dialout_pb_grpc_cc}
371436
${huawei_dialout_pb_cc}
372437
${huawei_dialout_pb_grpc_cc}
373438
${huawei_telemetry_pb_cc}

doc/CONFIG-KEYS

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ DESC: Defining the network end-point receiving the gRPC data-stream from Ju
2323
value is set and if the configuration key is specified its value can't be empty.
2424
DEFAULT: none
2525

26+
KEY: ipv4_socket_nokia
27+
DESC: Defining the network end-point receiving the gRPC data-stream from Nokia devices. The end-point information must include both the
28+
IPv4 and port separated by colon, for example "192.18.0.2:10002" is considered to be a valid end-point. No default
29+
value is set and if the configuration key is specified its value can't be empty.
30+
DEFAULT: none
31+
2632
KEY: ipv4_socket_huawei
2733
DESC: Defining the network end-point receiving the gRPC data-stream from Huawei devices. The end-point information must include both the
2834
IPv4 and port separated by colon, for example "192.18.0.3:10003" is considered to be a valid end-point. No default
@@ -41,6 +47,12 @@ DESC: This is ment mainly for debugging. With this configuration key you ca
4147
a single receiving session. The default value is set to "0" which means unlimited.
4248
DEFAULT: "0"
4349

50+
KEY: replies_nokia
51+
VALUES: [value >= "0" and value <= "1000"]
52+
DESC: This is ment mainly for debugging. With this configuration key you can rate limit the amount of Nokia's gRPC messages processed within
53+
a single receiving session. The default value is set to "0" which means unlimited.
54+
DEFAULT: "0"
55+
4456
KEY: replies_huawei
4557
VALUES: [value >= "0" and value <= "1000"]
4658
DESC: This is ment mainly for debugging. With this configuration key you can rate limit the amount of Huawei's gRPC messages processed within
@@ -57,6 +69,11 @@ VALUES: [value >= "1" and value <= "5"]
5769
DESC: Defining the amount of running threads busy with processing incoming Juniper's gRPC messages.
5870
DEFAULT: "1"
5971

72+
KEY: nokia_workers
73+
VALUES: [value >= "1" and value <= "5"]
74+
DESC: Defining the amount of running threads busy with processing incoming Nokia's gRPC messages.
75+
DEFAULT: "1"
76+
6077
KEY: huawei_workers
6178
VALUES: [value >= "1" and value <= "5"]
6279
DESC: Defining the amount of running threads busy with processing incoming Huawei's gRPC messages.

proto/Juniper/juniper_dialout.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ service Subscriber {
2020
https://github.com/openconfig/public/blob/master/release/models/telemetry/openconfig-telemetry.yang
2121
*/
2222

23-
rpc DialOutSubscriber(stream gnmi.SubscribeResponse) returns (stream gnmi.SubscribeRequest);
23+
rpc DialOutSubscriber(stream juniper_gnmi.SubscribeResponse) returns (stream juniper_gnmi.SubscribeRequest);
2424

2525
}
2626

proto/Juniper/juniper_gnmi.proto

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import "juniper_gnmi_ext.proto";
2727
//
2828
// This document references the gNMI Specification which can be found at
2929
// http://github.com/openconfig/reference/blob/master/rpc/gnmi
30-
package gnmi;
30+
package juniper_gnmi;
3131

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

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

4242
service gNMI {
4343
// Capabilities allows the client to retrieve the set of capabilities that
@@ -211,7 +211,7 @@ message SubscribeRequest {
211211
}
212212
// Extension messages associated with the SubscribeRequest. See the
213213
// gNMI extension specification for further definition.
214-
repeated gnmi_ext.Extension extension = 5;
214+
repeated juniper_gnmi_ext.Extension extension = 5;
215215
}
216216

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

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

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

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

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

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

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

447447
// ModelData is used to describe a set of schema modules. It can be used in a

proto/Juniper/juniper_gnmi_ext.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ syntax = "proto3";
1919
// included with the request and response messages of gNMI RPCs. A set of
2020
// well-known extensions are defined within this file, along with a registry for
2121
// extensions defined outside of this package.
22-
package gnmi_ext;
22+
package juniper_gnmi_ext;
2323

2424
// The Extension message contains a single gNMI extension.
2525
message Extension {

proto/Makefile.am

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@ all:
1919
echo "Autogenerated files up-to-date..."; \
2020
fi
2121

22-
_all: dirs grpc_cisco grpc_huawei grpc_juniper openconfig
22+
_all: dirs grpc_cisco grpc_huawei grpc_juniper grpc_nokia openconfig
2323
echo "$(MD5SUM_HASH)" > .proto_mark
2424
dirs:
2525
mkdir -p ${top_builddir}/src/proto
2626
mkdir -p ${top_builddir}/src/proto/Cisco
2727
mkdir -p ${top_builddir}/src/proto/Huawei
2828
mkdir -p ${top_builddir}/src/proto/Juniper
29+
mkdir -p ${top_builddir}/src/proto/Nokia
2930
mkdir -p ${top_builddir}/src/proto/OpenConfig
3031

3132
grpc_cisco:
@@ -68,6 +69,21 @@ grpc_juniper:
6869
--cpp_out ${top_builddir}/src/proto/Juniper \
6970
--grpc_out ${top_builddir}/src/proto/Juniper \
7071
--plugin=protoc-gen-grpc="/usr/local/bin/grpc_cpp_plugin" juniper_gnmi_ext.proto
72+
73+
grpc_nokia:
74+
$(PROTOC) -I ${top_srcdir}/proto/Nokia/ \
75+
--cpp_out ${top_builddir}/src/proto/Nokia \
76+
--grpc_out ${top_builddir}/src/proto/Nokia \
77+
--plugin=protoc-gen-grpc="/usr/local/bin/grpc_cpp_plugin" nokia_dialout.proto
78+
$(PROTOC) -I ${top_srcdir}/proto/Nokia/ \
79+
--cpp_out ${top_builddir}/src/proto/Nokia \
80+
--grpc_out ${top_builddir}/src/proto/Nokia \
81+
--plugin=protoc-gen-grpc="/usr/local/bin/grpc_cpp_plugin" nokia_gnmi.proto
82+
$(PROTOC) -I ${top_srcdir}/proto/Nokia/ \
83+
--cpp_out ${top_builddir}/src/proto/Nokia \
84+
--grpc_out ${top_builddir}/src/proto/Nokia \
85+
--plugin=protoc-gen-grpc="/usr/local/bin/grpc_cpp_plugin" nokia_gnmi_ext.proto
86+
7187
openconfig:
7288
$(PROTOC) -I ${top_srcdir}/proto/OpenConfig/ \
7389
--cpp_out ${top_builddir}/src/proto/OpenConfig \

proto/Nokia/nokia_dialout.proto

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
syntax = "proto3";
2+
import "nokia_gnmi.proto";
3+
4+
package Nokia.SROS;
5+
6+
service DialoutTelemetry {
7+
rpc Publish(stream nokia_gnmi.SubscribeResponse) returns (stream PublishResponse);
8+
}
9+
message PublishResponse {}

0 commit comments

Comments
 (0)