From f79004c8d2a33055071733aaae653205424d2c52 Mon Sep 17 00:00:00 2001 From: Vivek R Date: Sat, 25 Jun 2022 01:40:10 -0700 Subject: [PATCH] Add thr missing API into saithriftv2 missing for syncd (#1503) Signed-off-by: Vivek Reddy Co-authored-by: Vivek Reddy Karri --- meta/sai_rpc_frontend.cpp | 10 ++++++++++ test/saithriftv2/src/saiserver.cpp | 7 ------- test/saithriftv2/src/switch_sai_rpc_server.h | 1 + 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/meta/sai_rpc_frontend.cpp b/meta/sai_rpc_frontend.cpp index be8212d78..5da527a09 100644 --- a/meta/sai_rpc_frontend.cpp +++ b/meta/sai_rpc_frontend.cpp @@ -929,6 +929,16 @@ int start_p4_sai_thrift_rpc_server(char *port) { return status; } +/** + * @brief Start Thrift RPC server Wrapper + */ +int start_sai_thrift_rpc_server(int port) +{ + static char port_str[10]; + snprintf(port_str, sizeof(port_str), "%d", port); + return start_p4_sai_thrift_rpc_server(port_str); +} + /** * @brief Stop Thrift RPC server */ diff --git a/test/saithriftv2/src/saiserver.cpp b/test/saithriftv2/src/saiserver.cpp index 786ebd10d..98596b5f6 100644 --- a/test/saithriftv2/src/saiserver.cpp +++ b/test/saithriftv2/src/saiserver.cpp @@ -266,13 +266,6 @@ void handleInitScript(const std::string& initScript) system(initScript.c_str()); } -int start_sai_thrift_rpc_server(int port) -{ - static char port_str[10]; - snprintf(port_str, sizeof(port_str), "%d", port); - return start_p4_sai_thrift_rpc_server(port_str); -} - int main(int argc, char* argv[]) { diff --git a/test/saithriftv2/src/switch_sai_rpc_server.h b/test/saithriftv2/src/switch_sai_rpc_server.h index ea1765dbc..21c7ca631 100644 --- a/test/saithriftv2/src/switch_sai_rpc_server.h +++ b/test/saithriftv2/src/switch_sai_rpc_server.h @@ -1,3 +1,4 @@ extern "C" { int start_p4_sai_thrift_rpc_server(char *port); +int start_sai_thrift_rpc_server(int port); }