blob: 5f46a6a0a3dd4817ef00de05deaa47aa84f13f54 [file] [log] [blame]
Shad Ansari01b0e652018-04-05 21:02:53 +00001/*
Girish Gowdraa707e7c2019-11-07 11:36:13 +05302 * Copyright 2018-present Open Networking Foundation
Shad Ansari01b0e652018-04-05 21:02:53 +00003
Girish Gowdraa707e7c2019-11-07 11:36:13 +05304 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
Shad Ansari01b0e652018-04-05 21:02:53 +00007
Girish Gowdraa707e7c2019-11-07 11:36:13 +05308 * http://www.apache.org/licenses/LICENSE-2.0
Shad Ansari01b0e652018-04-05 21:02:53 +00009
Girish Gowdraa707e7c2019-11-07 11:36:13 +053010 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
Shad Ansari01b0e652018-04-05 21:02:53 +000016
17#include <iostream>
18#include <memory>
19#include <string>
nick7be062f2018-05-25 17:52:56 -040020#include <time.h>
Nicolas Palpacuer0f19b1a2018-06-07 17:29:31 -040021#include <pthread.h>
Shad Ansari01b0e652018-04-05 21:02:53 +000022
23#include "Queue.h"
24#include <iostream>
25#include <sstream>
26
27#include "server.h"
Shad Ansarib7b0ced2018-05-11 21:53:32 +000028#include "core.h"
Nicolas Palpacuer3cad49d2018-07-02 14:03:24 -040029#include "state.h"
Orhan Kupusoglu1fd77072021-03-23 08:13:25 -070030#include "../src/core_utils.h"
Shad Ansari01b0e652018-04-05 21:02:53 +000031
Shad Ansarib7b0ced2018-05-11 21:53:32 +000032#include <grpc++/grpc++.h>
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +000033#include <voltha_protos/openolt.grpc.pb.h>
Akash Reddy Kankanaladec6e7e2025-05-22 09:49:28 +053034#include <voltha_protos/common.grpc.pb.h>
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +000035#include <voltha_protos/tech_profile.grpc.pb.h>
Shad Ansari01b0e652018-04-05 21:02:53 +000036
37using grpc::Server;
38using grpc::ServerBuilder;
Girish Gowdra252f4972020-09-07 21:24:01 -070039using grpc::ResourceQuota;
Shad Ansari01b0e652018-04-05 21:02:53 +000040using grpc::ServerContext;
41using grpc::ServerWriter;
Shad Ansarib7b0ced2018-05-11 21:53:32 +000042using grpc::Status;
Shad Ansari01b0e652018-04-05 21:02:53 +000043
44const char *serverPort = "0.0.0.0:9191";
nick7be062f2018-05-25 17:52:56 -040045int signature;
Arthur Syu094df162022-04-21 17:50:06 +080046std::unique_ptr<Server> server;
Shad Ansari01b0e652018-04-05 21:02:53 +000047
Shad Ansari627b5782018-08-13 22:49:32 +000048Queue<openolt::Indication> oltIndQ;
49
Shad Ansari01b0e652018-04-05 21:02:53 +000050class OpenoltService final : public openolt::Openolt::Service {
51
Nicolas Palpacuere3fc0d22018-08-02 16:51:05 -040052 Status DisableOlt(
53 ServerContext* context,
54 const openolt::Empty* request,
55 openolt::Empty* response) override {
56 return Disable_();
57 }
58
59 Status ReenableOlt(
60 ServerContext* context,
61 const openolt::Empty* request,
62 openolt::Empty* response) override {
63 return Reenable_();
64 }
65
Shad Ansari01b0e652018-04-05 21:02:53 +000066 Status ActivateOnu(
67 ServerContext* context,
68 const openolt::Onu* request,
69 openolt::Empty* response) override {
70 return ActivateOnu_(
71 request->intf_id(),
72 request->onu_id(),
73 ((request->serial_number()).vendor_id()).c_str(),
kesavandc1f2db92020-08-31 15:32:06 +053074 ((request->serial_number()).vendor_specific()).c_str(), request->pir(), request->omcc_encryption());
Shad Ansari01b0e652018-04-05 21:02:53 +000075 }
76
Jonathan Davis70c21812018-07-19 15:32:10 -040077 Status DeactivateOnu(
78 ServerContext* context,
79 const openolt::Onu* request,
80 openolt::Empty* response) override {
81 return DeactivateOnu_(
82 request->intf_id(),
83 request->onu_id(),
84 ((request->serial_number()).vendor_id()).c_str(),
85 ((request->serial_number()).vendor_specific()).c_str());
86 }
87
88 Status DeleteOnu(
89 ServerContext* context,
90 const openolt::Onu* request,
91 openolt::Empty* response) override {
92 return DeleteOnu_(
93 request->intf_id(),
94 request->onu_id(),
95 ((request->serial_number()).vendor_id()).c_str(),
Girish Gowdru7c4ec2d2018-10-25 00:29:54 -070096 ((request->serial_number()).vendor_specific()).c_str());
Jonathan Davis70c21812018-07-19 15:32:10 -040097 }
98
Shad Ansari01b0e652018-04-05 21:02:53 +000099 Status OmciMsgOut(
100 ServerContext* context,
101 const openolt::OmciMsg* request,
102 openolt::Empty* response) override {
103 return OmciMsgOut_(
104 request->intf_id(),
105 request->onu_id(),
106 request->pkt());
107 }
108
Shad Ansarif2e27a42018-04-26 22:37:38 +0000109 Status OnuPacketOut(
110 ServerContext* context,
111 const openolt::OnuPacket* request,
112 openolt::Empty* response) override {
113 return OnuPacketOut_(
114 request->intf_id(),
115 request->onu_id(),
Craig Lutgen967a1d02018-11-27 10:41:51 -0600116 request->port_no(),
Girish Gowdruc8ed2ef2019-02-13 08:18:44 -0800117 request->gemport_id(),
Shad Ansarif2e27a42018-04-26 22:37:38 +0000118 request->pkt());
119 }
120
Nicolas Palpacuerb78def42018-06-07 12:55:26 -0400121 Status UplinkPacketOut(
122 ServerContext* context,
123 const openolt::UplinkPacket* request,
124 openolt::Empty* response) override {
125 return UplinkPacketOut_(
126 request->intf_id(),
127 request->pkt());
128 }
129
Shad Ansari01b0e652018-04-05 21:02:53 +0000130 Status FlowAdd(
131 ServerContext* context,
132 const openolt::Flow* request,
133 openolt::Empty* response) override {
Girish Gowdra252f4972020-09-07 21:24:01 -0700134 return FlowAddWrapper_(request);
135
Shad Ansari01b0e652018-04-05 21:02:53 +0000136 }
137
Nicolas Palpacueredfaa0c2018-07-05 15:05:27 -0400138 Status FlowRemove(
139 ServerContext* context,
140 const openolt::Flow* request,
141 openolt::Empty* response) override {
Girish Gowdra252f4972020-09-07 21:24:01 -0700142 return FlowRemoveWrapper_(request);
Nicolas Palpacueredfaa0c2018-07-05 15:05:27 -0400143 }
144
Shad Ansari01b0e652018-04-05 21:02:53 +0000145 Status EnableIndication(
146 ServerContext* context,
147 const ::openolt::Empty* request,
148 ServerWriter<openolt::Indication>* writer) override {
Shad Ansariedef2132018-08-10 22:14:50 +0000149
nick7be062f2018-05-25 17:52:56 -0400150 std::cout << "Connection to Voltha established. Indications enabled"
151 << std::endl;
Nicolas Palpacuer3cad49d2018-07-02 14:03:24 -0400152
Burak Gurdag30db4822021-03-10 21:30:01 +0000153 if (state.previously_connected()) {
Nicolas Palpacuerfbc0d7d2018-08-23 14:46:42 -0400154 // Reconciliation / recovery case
Nicolas Palpacuer135ce812018-08-30 09:04:34 -0400155 std::cout << "Reconciliation / Recovery case" << std::endl;
Nicolas Palpacuerfbc0d7d2018-08-23 14:46:42 -0400156 if (state.is_activated()){
157 // Adding extra olt indication of current state
158 openolt::Indication ind;
159 openolt::OltIndication* oltInd = new openolt::OltIndication();
160 if (state.is_activated()) {
161 oltInd->set_oper_state("up");
Nicolas Palpacuer135ce812018-08-30 09:04:34 -0400162 std::cout << "Extra OLT indication up" << std::endl;
Nicolas Palpacuerfbc0d7d2018-08-23 14:46:42 -0400163 } else {
164 oltInd->set_oper_state("down");
Nicolas Palpacuer135ce812018-08-30 09:04:34 -0400165 std::cout << "Extra OLT indication down" << std::endl;
Nicolas Palpacuerfbc0d7d2018-08-23 14:46:42 -0400166 }
167 ind.set_allocated_olt_ind(oltInd);
168 oltIndQ.push(ind);
169 }
170 }
171
Shad Ansariedef2132018-08-10 22:14:50 +0000172 state.connect();
173
174 while (state.is_connected()) {
Girish Gowdra96461052019-11-22 20:13:59 +0530175 std::pair<openolt::Indication, bool> ind = oltIndQ.pop(COLLECTION_PERIOD*1000, 1000);
Shad Ansariedef2132018-08-10 22:14:50 +0000176 if (ind.second == false) {
177 /* timeout - do lower priority periodic stuff like stats */
178 stats_collection();
179 continue;
180 }
181 openolt::Indication oltInd = ind.first;
Nicolas Palpacuer3cad49d2018-07-02 14:03:24 -0400182 bool isConnected = writer->Write(oltInd);
Nicolas Palpacuer58d252c2018-06-06 11:19:04 -0400183 if (!isConnected) {
184 //Lost connectivity to this Voltha instance
185 //Put the indication back in the queue for next connecting instance
186 oltIndQ.push(oltInd);
Shad Ansariedef2132018-08-10 22:14:50 +0000187 state.disconnect();
Nicolas Palpacuer58d252c2018-06-06 11:19:04 -0400188 }
Shad Ansari01b0e652018-04-05 21:02:53 +0000189 //oltInd.release_olt_ind()
190 }
Nicolas Palpacuer3cad49d2018-07-02 14:03:24 -0400191
Shad Ansari01b0e652018-04-05 21:02:53 +0000192 return Status::OK;
193 }
nick7be062f2018-05-25 17:52:56 -0400194
195 Status HeartbeatCheck(
196 ServerContext* context,
197 const openolt::Empty* request,
198 openolt::Heartbeat* response) override {
199 response->set_heartbeat_signature(signature);
200
201 return Status::OK;
202 }
Nicolas Palpacuer0f19b1a2018-06-07 17:29:31 -0400203
Nicolas Palpacuer05ea0ea2018-07-06 11:47:21 -0400204 Status EnablePonIf(
205 ServerContext* context,
206 const openolt::Interface* request,
207 openolt::Empty* response) override {
208
209 return EnablePonIf_(request->intf_id());
210 }
211
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +0000212 /*Status GetPonIf(
Shad Ansaricb208782019-07-02 20:53:40 +0000213 ServerContext* context,
214 const openolt::Interface* request,
215 openolt::IntfIndication* response) override {
216
217 // TODO - Return the oper status of the pon interface
218 return Status::OK;
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +0000219 }*/
Shad Ansaricb208782019-07-02 20:53:40 +0000220
Nicolas Palpacuer05ea0ea2018-07-06 11:47:21 -0400221 Status DisablePonIf(
222 ServerContext* context,
223 const openolt::Interface* request,
224 openolt::Empty* response) override {
225
226 return DisablePonIf_(request->intf_id());
227 }
Nicolas Palpacuer0f19b1a2018-06-07 17:29:31 -0400228
balaji.nagarajan394c7e42025-06-30 18:45:59 +0530229 Status DisableOnuSerialNumber(
230 ServerContext* context,
231 const openolt::InterfaceOnuSerialNumber* request,
232 openolt::Empty* response) override {
233
234 return DisableOnuSerialNumber_(request);
235 }
236
237 Status EnableOnuSerialNumber(
238 ServerContext* context,
239 const openolt::InterfaceOnuSerialNumber* request,
240 openolt::Empty* response) override {
241
242 return EnableOnuSerialNumber_(request);
243 }
244
245 Status DisableOnu(
246 ServerContext* context,
247 const openolt::InterfaceOnuSerialNumberOnuId* request,
248 openolt::Empty* response) override {
249
250 return DisableOnu_(request);
251 }
252
253 Status EnableOnu(
254 ServerContext* context,
255 const openolt::InterfaceOnuSerialNumberOnuId* request,
256 openolt::Empty* response) override {
257
258 return EnableOnu_(request);
259 }
260
Nicolas Palpacuer65d04472018-09-06 15:53:37 -0400261 Status CollectStatistics(
262 ServerContext* context,
263 const openolt::Empty* request,
264 openolt::Empty* response) override {
265
266 stats_collection();
267
268 return Status::OK;
269 }
270
Nicolas Palpacuer45180662018-08-02 14:01:51 -0400271 Status Reboot(
272 ServerContext* context,
273 const openolt::Empty* request,
274 openolt::Empty* response) override {
275
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +0000276 uint8_t ret = system("shutdown -r now");
Arthur Syu094df162022-04-21 17:50:06 +0800277 server->Shutdown();
Nicolas Palpacuer45180662018-08-02 14:01:51 -0400278
279 return Status::OK;
280
281 }
282
Nicolas Palpacuerdff96792018-09-06 14:59:32 -0400283 Status GetDeviceInfo(
284 ServerContext* context,
285 const openolt::Empty* request,
286 openolt::DeviceInfo* response) override {
287
288 GetDeviceInfo_(response);
289
290 return Status::OK;
291
292 }
293
Girish Gowdruc8ed2ef2019-02-13 08:18:44 -0800294 Status CreateTrafficSchedulers(
Girish Gowdru7c4ec2d2018-10-25 00:29:54 -0700295 ServerContext* context,
Girish Gowdruc8ed2ef2019-02-13 08:18:44 -0800296 const tech_profile::TrafficSchedulers* request,
Girish Gowdru7c4ec2d2018-10-25 00:29:54 -0700297 openolt::Empty* response) override {
Burak Gurdag9c039982021-11-23 11:23:57 +0000298 return CreateTrafficSchedulers_(request);
Girish Gowdru7c4ec2d2018-10-25 00:29:54 -0700299 };
Nicolas Palpacuerdff96792018-09-06 14:59:32 -0400300
Girish Gowdruc8ed2ef2019-02-13 08:18:44 -0800301 Status RemoveTrafficSchedulers(
Girish Gowdru7c4ec2d2018-10-25 00:29:54 -0700302 ServerContext* context,
Girish Gowdruc8ed2ef2019-02-13 08:18:44 -0800303 const tech_profile::TrafficSchedulers* request,
Girish Gowdru7c4ec2d2018-10-25 00:29:54 -0700304 openolt::Empty* response) override {
Burak Gurdag9c039982021-11-23 11:23:57 +0000305 return RemoveTrafficSchedulers_(request);
Girish Gowdruc8ed2ef2019-02-13 08:18:44 -0800306 };
307
308 Status CreateTrafficQueues(
309 ServerContext* context,
310 const tech_profile::TrafficQueues* request,
311 openolt::Empty* response) override {
Burak Gurdag9c039982021-11-23 11:23:57 +0000312 return CreateTrafficQueues_(request);
Girish Gowdruc8ed2ef2019-02-13 08:18:44 -0800313 };
314
315 Status RemoveTrafficQueues(
316 ServerContext* context,
317 const tech_profile::TrafficQueues* request,
318 openolt::Empty* response) override {
Burak Gurdag9c039982021-11-23 11:23:57 +0000319 return RemoveTrafficQueues_(request);
Girish Gowdru7c4ec2d2018-10-25 00:29:54 -0700320 };
Nicolas Palpacuer45180662018-08-02 14:01:51 -0400321
Burak Gurdagc78b9e12019-11-29 11:14:51 +0000322 Status PerformGroupOperation(
323 ServerContext* context,
324 const openolt::Group* request,
325 openolt::Empty* response) override {
326 return PerformGroupOperation_(request);
327 };
Jason Huang5d9ab1a2020-04-15 16:53:49 +0800328
Burak Gurdageb4ca2e2020-06-15 07:48:26 +0000329 Status DeleteGroup(
330 ServerContext* context,
331 const openolt::Group* request,
332 openolt::Empty* response) override {
333 return DeleteGroup_(request->group_id());
334 };
335
Jason Huang5d9ab1a2020-04-15 16:53:49 +0800336 Status OnuItuPonAlarmSet(
337 ServerContext* context,
kesavandc1f2db92020-08-31 15:32:06 +0530338 const config::OnuItuPonAlarm* request,
Jason Huang5d9ab1a2020-04-15 16:53:49 +0800339 openolt::Empty* response) override {
340 return OnuItuPonAlarmSet_(request);
341 };
Jason Huang1d9cfce2020-05-20 22:58:47 +0800342
343 Status GetLogicalOnuDistanceZero(
344 ServerContext* context,
345 const openolt::Onu* request,
346 openolt::OnuLogicalDistance* response) override {
347 return GetLogicalOnuDistanceZero_(
348 request->intf_id(),
349 response);
350 };
351
352 Status GetLogicalOnuDistance(
353 ServerContext* context,
354 const openolt::Onu* request,
355 openolt::OnuLogicalDistance* response) override {
356 return GetLogicalOnuDistance_(
357 request->intf_id(),
358 request->onu_id(),
359 response);
360 };
Burak Gurdag74e3ab82020-12-17 13:35:06 +0000361
362 Status GetOnuStatistics(
363 ServerContext* context,
364 const openolt::Onu* request,
365 openolt::OnuStatistics* response) override {
366 return GetOnuStatistics_(
367 request->intf_id(),
368 request->onu_id(),
369 response);
370 }
371
372 Status GetGemPortStatistics(
373 ServerContext* context,
374 const openolt::OnuPacket* request,
375 openolt::GemPortStatistics* response) override {
376 return GetGemPortStatistics_(
377 request->intf_id(),
378 request->gemport_id(),
379 response);
380 }
Orhan Kupusogluec57af02021-05-12 12:38:17 +0000381
382 Status GetPonRxPower(
383 ServerContext* context,
384 const openolt::Onu* request,
385 openolt::PonRxPowerData* response) override {
386 return GetPonRxPower_(
387 request->intf_id(),
388 request->onu_id(),
389 response);
390 }
nikesh.krishnan331d38c2023-04-06 03:24:53 +0530391
392 Status GetOnuInfo(
393 ServerContext* context,
394 const openolt::Onu* request,
395 openolt::OnuInfo* response) override {
396 return GetOnuInfo_(
397 request->intf_id(),
398 request->onu_id(),
399 response);
400 }
401
402
403 Status GetPonInterfaceInfo(
404 ServerContext* context,
405 const openolt::Interface* request,
406 openolt::PonIntfInfo* response) override {
407 return GetPonInterfaceInfo_(
408 request->intf_id(),
409 response);
410 }
411
412
Akash Reddy Kankanaladec6e7e2025-05-22 09:49:28 +0530413 Status GetPonPortStatistics(
414 ServerContext* context,
415 const openolt::Interface* request,
416 common::PortStatistics* response) override {
417 return GetPonPortStatistics_(
418 request->intf_id(),
419 response);
420 }
421
422 Status GetNniPortStatistics(
423 ServerContext* context,
424 const openolt::Interface* request,
425 common::PortStatistics* response) override {
426 return GetNniPortStatistics_(
427 request->intf_id(),
428 response);
429 }
430
431 Status GetAllocIdStatistics(
432 ServerContext* context,
433 const openolt::OnuPacket* request,
434 openolt::OnuAllocIdStatistics* response) override {
435 return GetAllocIdStatistics_(
436 request->intf_id(),
437 request->alloc_id(),
438 response);
439 }
nikesh.krishnan331d38c2023-04-06 03:24:53 +0530440
441
Shad Ansari01b0e652018-04-05 21:02:53 +0000442};
443
Orhan Kupusoglu1fd77072021-03-23 08:13:25 -0700444bool RunServer(int argc, char** argv) {
Thiyagarajan Subramani03bc66f2020-04-01 15:58:53 +0530445 std::string ipAddress = "0.0.0.0";
Orhan Kupusoglu1fd77072021-03-23 08:13:25 -0700446 bool tls_enabled = false;
447 std::pair<grpc_ssl_client_certificate_request_type, bool> grpc_security;
448 std::shared_ptr<grpc::ServerCredentials> credentials;
Shad Ansari01b0e652018-04-05 21:02:53 +0000449
Thiyagarajan Subramani03bc66f2020-04-01 15:58:53 +0530450 for (int i = 1; i < argc; ++i) {
451 if(strcmp(argv[i-1], "--interface") == 0 || (strcmp(argv[i-1], "--intf") == 0)) {
452 ipAddress = get_ip_address(argv[i]);
453 break;
454 }
455 }
Shad Ansari01b0e652018-04-05 21:02:53 +0000456
Orhan Kupusoglu1fd77072021-03-23 08:13:25 -0700457 for (int i = 1; i < argc; ++i) {
458 if (strcmp(argv[i-1], "--enable-tls") == 0) {
459 grpc_security = get_grpc_tls_option(argv[i]);
460 if (grpc_security.second) {
461 tls_enabled = true;
462 } else {
463 std::cerr << "unknown security option: \"" << argv[i-1] << " " << argv[i] << "\"\n";
464 return false;
465 };
466 break;
467 }
468 }
469
470 if (tls_enabled) {
471 std::string dir_cert{"./keystore"};
472 auto read_root_crt = read_from_txt_file(dir_cert + "/root.crt");
473 auto read_server_key = read_from_txt_file(dir_cert + "/server.key");
474 auto read_server_crt = read_from_txt_file(dir_cert + "/server.crt");
475
476 if (read_root_crt.second && read_server_key.second && read_server_crt.second) {
477 std::cout << "certificate files read successfully\n";
478 } else {
479 std::cerr << std::boolalpha << "certificate files read failed - root.crt: " << read_root_crt.second
480 << ", server.key: " << read_server_key.second
481 << ", server.crt: " << read_server_crt.second << '\n';
482 return false;
483 }
484
485 std::string root_crt = read_root_crt.first;
486 std::string server_key = read_server_key.first;
487 std::string server_crt = read_server_crt.first;
488
489 grpc::SslServerCredentialsOptions ssl_opts{grpc_security.first};
490 ssl_opts.pem_root_certs = root_crt;
491 grpc::SslServerCredentialsOptions::PemKeyCertPair keycert = {server_key, server_crt};
492 ssl_opts.pem_key_cert_pairs.push_back(keycert);
493 credentials = grpc::SslServerCredentials(ssl_opts);
494 } else {
495 credentials = grpc::InsecureServerCredentials();
496 }
497
Thiyagarajan Subramani03bc66f2020-04-01 15:58:53 +0530498 serverPort = ipAddress.append(":9191").c_str();
499 OpenoltService service;
500 std::string server_address(serverPort);
Girish Gowdra252f4972020-09-07 21:24:01 -0700501 ::ServerBuilder builder;
502 ::ResourceQuota quota;
503 quota.SetMaxThreads(GRPC_THREAD_POOL_SIZE);
504 builder.SetResourceQuota(quota);
Orhan Kupusoglu1fd77072021-03-23 08:13:25 -0700505 builder.AddListeningPort(server_address, credentials);
Thiyagarajan Subramani03bc66f2020-04-01 15:58:53 +0530506 builder.RegisterService(&service);
nick7be062f2018-05-25 17:52:56 -0400507
Arthur Syu094df162022-04-21 17:50:06 +0800508 server = builder.BuildAndStart();
nick7be062f2018-05-25 17:52:56 -0400509
Thiyagarajan Subramani03bc66f2020-04-01 15:58:53 +0530510 time_t now;
511 time(&now);
512 signature = (int)now;
Shad Ansari01b0e652018-04-05 21:02:53 +0000513
Thiyagarajan Subramani03bc66f2020-04-01 15:58:53 +0530514 std::cout << "Server listening on " << server_address
515 << ", connection signature : " << signature << std::endl;
516
Orhan Kupusoglu1fd77072021-03-23 08:13:25 -0700517#ifdef TEST_MODE
518 server->Shutdown();
519#else
Thiyagarajan Subramani03bc66f2020-04-01 15:58:53 +0530520 server->Wait();
Orhan Kupusoglu1fd77072021-03-23 08:13:25 -0700521#endif
522
523 return true;
Shad Ansari01b0e652018-04-05 21:02:53 +0000524}