diff options
Diffstat (limited to 'src/rpc-server/src/trex_rpc_jsonrpc_v2.cpp')
-rw-r--r-- | src/rpc-server/src/trex_rpc_jsonrpc_v2.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rpc-server/src/trex_rpc_jsonrpc_v2.cpp b/src/rpc-server/src/trex_rpc_jsonrpc_v2.cpp index f28bcbd8..0e649ac5 100644 --- a/src/rpc-server/src/trex_rpc_jsonrpc_v2.cpp +++ b/src/rpc-server/src/trex_rpc_jsonrpc_v2.cpp @@ -20,6 +20,7 @@ limitations under the License. */ #include <trex_rpc_exception_api.h> #include <trex_rpc_jsonrpc_v2.h> +#include <trex_rpc_commands.h> #include <json/json.h> @@ -131,6 +132,12 @@ void TrexJsonRpcV2Parser::parse_single_request(Json::Value &request, return; } + TrexRpcCommand * rpc_cmd = TrexRpcCommandsTable::get_instance().lookup(method_name); + if (!rpc_cmd) { + commands.push_back(new JsonRpcError(msg_id, JSONRPC_V2_ERR_METHOD_NOT_FOUND, "Method not registered")); + return; + } + /* TODO - add commands */ } |