From f84b0d60f6c08ed10dfa37457aa7ac554ec50eef Mon Sep 17 00:00:00 2001 From: Jonathan Hollocombe Date: Tue, 5 Nov 2024 10:53:44 +0000 Subject: [PATCH] Replacing XDR macros with enum class. --- source/c_api/accAPI.cpp | 2 +- source/cache/cache.cpp | 4 +- source/client/udaClient.cpp | 28 ++-- source/client2/client.cpp | 26 ++-- source/clientserver/protocol.cpp | 72 +++++----- source/clientserver/protocol.h | 5 +- source/clientserver/protocol2.cpp | 162 +++++++++++------------ source/clientserver/protocolXML.cpp | 8 +- source/clientserver/protocolXML.h | 3 +- source/clientserver/protocolXML2.cpp | 12 +- source/clientserver/protocolXML2.h | 3 +- source/clientserver/protocolXML2Put.cpp | 2 +- source/clientserver/protocolXML2Put.h | 3 +- source/clientserver/xdrlib.h | 13 +- source/security/clientAuthentication.cpp | 6 +- source/security/serverAuthentication.cpp | 8 +- source/server/fatServer.cpp | 4 +- source/server/sleepServer.cpp | 4 +- source/server/udaLegacyServer.cpp | 32 ++--- source/server/udaServer.cpp | 26 ++-- source/server2/xdr_protocol.cpp | 24 ++-- 21 files changed, 225 insertions(+), 222 deletions(-) diff --git a/source/c_api/accAPI.cpp b/source/c_api/accAPI.cpp index beb1b8a0..36082d47 100644 --- a/source/c_api/accAPI.cpp +++ b/source/c_api/accAPI.cpp @@ -3440,7 +3440,7 @@ void udaGetClientSerialisedDataBlock(int handle, void** object, size_t* objectSi DataBlockList data_block_list; data_block_list.count = 1; data_block_list.data = getDataBlock(handle); - protocol2(&xdrs, ProtocolId::DataBlockList, XDR_SEND, &token, logmalloclist, userdefinedtypelist, + protocol2(&xdrs, ProtocolId::DataBlockList, XDRStreamDirection::Send, &token, logmalloclist, userdefinedtypelist, &data_block_list, protocolVersion, log_struct_list, private_flags, malloc_source); #ifdef _WIN32 diff --git a/source/cache/cache.cpp b/source/cache/cache.cpp index 6be11629..dde37813 100644 --- a/source/cache/cache.cpp +++ b/source/cache/cache.cpp @@ -18,7 +18,7 @@ void writeCacheData(FILE* fp, LogMallocList* logmalloclist, UserDefinedTypeList* DataBlockList data_block_list; data_block_list.count = 1; data_block_list.data = (DataBlock*)data_block; - protocol2(&xdrs, ProtocolId::DataBlockList, XDR_SEND, &token, logmalloclist, userdefinedtypelist, + protocol2(&xdrs, ProtocolId::DataBlockList, XDRStreamDirection::Send, &token, logmalloclist, userdefinedtypelist, &data_block_list, protocolVersion, log_struct_list, private_flags, malloc_source); xdr_destroy(&xdrs); // Destroy before the file otherwise a segmentation error occurs @@ -35,7 +35,7 @@ DataBlock* readCacheData(FILE* fp, LogMallocList* logmalloclist, UserDefinedType init_data_block_list(&data_block_list); ProtocolId token; - protocol2(&xdrs, ProtocolId::DataBlockList, XDR_RECEIVE, &token, logmalloclist, userdefinedtypelist, + protocol2(&xdrs, ProtocolId::DataBlockList, XDRStreamDirection::Receive, &token, logmalloclist, userdefinedtypelist, &data_block_list, protocolVersion, log_struct_list, private_flags, malloc_source); xdr_destroy(&xdrs); // Destroy before the file otherwise a segmentation error occurs diff --git a/source/client/udaClient.cpp b/source/client/udaClient.cpp index 87b0091e..ea715027 100644 --- a/source/client/udaClient.cpp +++ b/source/client/udaClient.cpp @@ -377,7 +377,7 @@ static int fetchHierarchicalData(XDR* client_input, DataBlock* data_block, LogSt int err = 0; if ((err = - protocol2(client_input, protocol_id, XDR_RECEIVE, nullptr, g_log_malloc_list, g_user_defined_type_list, + protocol2(client_input, protocol_id, XDRStreamDirection::Receive, nullptr, g_log_malloc_list, g_user_defined_type_list, data_block, protocol_version, log_struct_list, private_flags, malloc_source)) != 0) { add_error(ErrorType::Code, __func__, err, "Client Side Protocol Error (Opaque Structure Type)"); return err; @@ -417,7 +417,7 @@ static int fetchMeta(XDR* client_input, DataSystem* data_system, SystemConfig* s int err = 0; #ifndef FATCLIENT // <========================== Client Server Code Only - if ((err = protocol2(client_input, ProtocolId::DataSystem, XDR_RECEIVE, nullptr, g_log_malloc_list, + if ((err = protocol2(client_input, ProtocolId::DataSystem, XDRStreamDirection::Receive, nullptr, g_log_malloc_list, g_user_defined_type_list, data_system, protocol_version, log_struct_list, private_flags, malloc_source)) != 0) { add_error(ErrorType::Code, __func__, err, "Protocol 4 Error (Data System)"); @@ -425,7 +425,7 @@ static int fetchMeta(XDR* client_input, DataSystem* data_system, SystemConfig* s } print_data_system(*data_system); - if ((err = protocol2(client_input, ProtocolId::SystemConfig, XDR_RECEIVE, nullptr, g_log_malloc_list, + if ((err = protocol2(client_input, ProtocolId::SystemConfig, XDRStreamDirection::Receive, nullptr, g_log_malloc_list, g_user_defined_type_list, system_config, protocol_version, log_struct_list, private_flags, malloc_source)) != 0) { add_error(ErrorType::Code, __func__, err, "Protocol 5 Error (System Config)"); @@ -433,7 +433,7 @@ static int fetchMeta(XDR* client_input, DataSystem* data_system, SystemConfig* s } print_system_config(*system_config); - if ((err = protocol2(client_input, ProtocolId::DataSource, XDR_RECEIVE, nullptr, g_log_malloc_list, + if ((err = protocol2(client_input, ProtocolId::DataSource, XDRStreamDirection::Receive, nullptr, g_log_malloc_list, g_user_defined_type_list, data_source, protocol_version, log_struct_list, private_flags, malloc_source)) != 0) { add_error(ErrorType::Code, __func__, err, "Protocol 6 Error (Data Source)"); @@ -441,7 +441,7 @@ static int fetchMeta(XDR* client_input, DataSystem* data_system, SystemConfig* s } print_data_source(*data_source); - if ((err = protocol2(client_input, ProtocolId::Signal, XDR_RECEIVE, nullptr, g_log_malloc_list, + if ((err = protocol2(client_input, ProtocolId::Signal, XDRStreamDirection::Receive, nullptr, g_log_malloc_list, g_user_defined_type_list, signal_rec, protocol_version, log_struct_list, private_flags, malloc_source)) != 0) { add_error(ErrorType::Code, __func__, err, "Protocol 7 Error (Signal)"); @@ -449,7 +449,7 @@ static int fetchMeta(XDR* client_input, DataSystem* data_system, SystemConfig* s } print_signal(*signal_rec); - if ((err = protocol2(client_input, ProtocolId::SignalDesc, XDR_RECEIVE, nullptr, g_log_malloc_list, + if ((err = protocol2(client_input, ProtocolId::SignalDesc, XDRStreamDirection::Receive, nullptr, g_log_malloc_list, g_user_defined_type_list, signal_desc, protocol_version, log_struct_list, private_flags, malloc_source)) != 0) { add_error(ErrorType::Code, __func__, err, "Protocol 8 Error (Signal Desc)"); @@ -811,7 +811,7 @@ int uda::client::udaClient(RequestBlock* request_block, int* indices) ProtocolId protocol_id = ProtocolId::ClientBlock; // Send Client Block (proxy for authenticationStep = 6) - if ((err = protocol2(client_output, protocol_id, XDR_SEND, nullptr, g_log_malloc_list, + if ((err = protocol2(client_output, protocol_id, XDRStreamDirection::Send, nullptr, g_log_malloc_list, g_user_defined_type_list, &client_block, protocol_version, &log_struct_list, *private_flags, malloc_source)) != 0) { add_error(ErrorType::Code, __func__, err, "Protocol 10 Error (Client Block)"); @@ -839,7 +839,7 @@ int uda::client::udaClient(RequestBlock* request_block, int* indices) protocol_id = ProtocolId::ServerBlock; // Receive Server Block: Server Aknowledgement (proxy for // authenticationStep = 8) - if ((err = protocol2(client_input, protocol_id, XDR_RECEIVE, nullptr, g_log_malloc_list, + if ((err = protocol2(client_input, protocol_id, XDRStreamDirection::Receive, nullptr, g_log_malloc_list, g_user_defined_type_list, &server_block, protocol_version, &log_struct_list, *private_flags, malloc_source)) != 0) { add_error(ErrorType::Code, __func__, err, "Protocol 11 Error (Server Block #1)"); @@ -933,7 +933,7 @@ int uda::client::udaClient(RequestBlock* request_block, int* indices) ProtocolId protocol_id = ProtocolId::ClientBlock; // Send Client Block - if ((err = protocol2(client_output, protocol_id, XDR_SEND, nullptr, g_log_malloc_list, g_user_defined_type_list, + if ((err = protocol2(client_output, protocol_id, XDRStreamDirection::Send, nullptr, g_log_malloc_list, g_user_defined_type_list, &client_block, protocol_version, &log_struct_list, *private_flags, malloc_source)) != 0) { add_error(ErrorType::Code, __func__, err, "Protocol 10 Error (Client Block)"); break; @@ -944,7 +944,7 @@ int uda::client::udaClient(RequestBlock* request_block, int* indices) protocol_id = ProtocolId::RequestBlock; // This is what the Client Wants - if ((err = protocol2(client_output, protocol_id, XDR_SEND, nullptr, g_log_malloc_list, g_user_defined_type_list, + if ((err = protocol2(client_output, protocol_id, XDRStreamDirection::Send, nullptr, g_log_malloc_list, g_user_defined_type_list, request_block, protocol_version, &log_struct_list, *private_flags, malloc_source)) != 0) { add_error(ErrorType::Code, __func__, err, "Protocol 1 Error (Request Block)"); break; @@ -959,7 +959,7 @@ int uda::client::udaClient(RequestBlock* request_block, int* indices) if (request->put) { protocol_id = ProtocolId::PutdataBlockList; - if ((err = protocol2(client_output, protocol_id, XDR_SEND, nullptr, g_log_malloc_list, + if ((err = protocol2(client_output, protocol_id, XDRStreamDirection::Send, nullptr, g_log_malloc_list, g_user_defined_type_list, &(request->putDataBlockList), protocol_version, &log_struct_list, *private_flags, malloc_source)) != 0) { add_error(ErrorType::Code, __func__, err, @@ -994,7 +994,7 @@ int uda::client::udaClient(RequestBlock* request_block, int* indices) UDA_LOG(UDA_LOG_DEBUG, "Waiting for Server Status Block"); - if ((err = protocol2(client_input, ProtocolId::ServerBlock, XDR_RECEIVE, nullptr, g_log_malloc_list, + if ((err = protocol2(client_input, ProtocolId::ServerBlock, XDRStreamDirection::Receive, nullptr, g_log_malloc_list, g_user_defined_type_list, &server_block, protocol_version, &log_struct_list, *private_flags, malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Protocol 11 Error (Server Block #2) = {}", err); @@ -1046,7 +1046,7 @@ int uda::client::udaClient(RequestBlock* request_block, int* indices) DataBlockList recv_data_block_list; - if ((err = protocol2(client_input, ProtocolId::DataBlockList, XDR_RECEIVE, nullptr, g_log_malloc_list, + if ((err = protocol2(client_input, ProtocolId::DataBlockList, XDRStreamDirection::Receive, nullptr, g_log_malloc_list, g_user_defined_type_list, &recv_data_block_list, protocol_version, &log_struct_list, *private_flags, malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Protocol 2 Error (Failure Receiving Data Block)"); @@ -1589,7 +1589,7 @@ void udaFreeAll() client_block.timeout = 0; // Surrogate CLOSEDOWN instruction client_block.clientFlags = client_block.clientFlags | client_flags::CloseDown; // Direct CLOSEDOWN instruction protocol_id = ProtocolId::ClientBlock; - protocol2(*g_client_output, protocol_id, XDR_SEND, nullptr, g_log_malloc_list, g_user_defined_type_list, + protocol2(*g_client_output, protocol_id, XDRStreamDirection::Send, nullptr, g_log_malloc_list, g_user_defined_type_list, &client_block, protocol_version, g_log_struct_list, *udaPrivateFlags(), UDA_MALLOC_SOURCE_NONE); xdrrec_endofrecord(*g_client_output, 1); } diff --git a/source/client2/client.cpp b/source/client2/client.cpp index e18ce74c..cd75005f 100644 --- a/source/client2/client.cpp +++ b/source/client2/client.cpp @@ -217,7 +217,7 @@ int uda::client::Client::fetch_meta() Signal* signal_rec = &_metadata.signal_rec; SignalDesc* signal_desc = &_metadata.signal_desc; - if ((err = protocol2(_client_input, ProtocolId::DataSystem, XDR_RECEIVE, nullptr, _logmalloclist, + if ((err = protocol2(_client_input, ProtocolId::DataSystem, XDRStreamDirection::Receive, nullptr, _logmalloclist, _userdefinedtypelist, data_system, _protocol_version, &_log_struct_list, _private_flags, _malloc_source)) != 0) { add_error(ErrorType::Code, __func__, err, "Protocol 4 Error (Data System)"); @@ -225,7 +225,7 @@ int uda::client::Client::fetch_meta() } print_data_system(*data_system); - if ((err = protocol2(_client_input, ProtocolId::SystemConfig, XDR_RECEIVE, nullptr, _logmalloclist, + if ((err = protocol2(_client_input, ProtocolId::SystemConfig, XDRStreamDirection::Receive, nullptr, _logmalloclist, _userdefinedtypelist, system_config, _protocol_version, &_log_struct_list, _private_flags, _malloc_source)) != 0) { add_error(ErrorType::Code, __func__, err, "Protocol 5 Error (System Config)"); @@ -233,7 +233,7 @@ int uda::client::Client::fetch_meta() } print_system_config(*system_config); - if ((err = protocol2(_client_input, ProtocolId::DataSource, XDR_RECEIVE, nullptr, _logmalloclist, + if ((err = protocol2(_client_input, ProtocolId::DataSource, XDRStreamDirection::Receive, nullptr, _logmalloclist, _userdefinedtypelist, data_source, _protocol_version, &_log_struct_list, _private_flags, _malloc_source)) != 0) { add_error(ErrorType::Code, __func__, err, "Protocol 6 Error (Data Source)"); @@ -241,14 +241,14 @@ int uda::client::Client::fetch_meta() } print_data_source(*data_source); - if ((err = protocol2(_client_input, ProtocolId::Signal, XDR_RECEIVE, nullptr, _logmalloclist, _userdefinedtypelist, + if ((err = protocol2(_client_input, ProtocolId::Signal, XDRStreamDirection::Receive, nullptr, _logmalloclist, _userdefinedtypelist, signal_rec, _protocol_version, &_log_struct_list, _private_flags, _malloc_source)) != 0) { add_error(ErrorType::Code, __func__, err, "Protocol 7 Error (Signal)"); return err; } print_signal(*signal_rec); - if ((err = protocol2(_client_input, ProtocolId::SignalDesc, XDR_RECEIVE, nullptr, _logmalloclist, + if ((err = protocol2(_client_input, ProtocolId::SignalDesc, XDRStreamDirection::Receive, nullptr, _logmalloclist, _userdefinedtypelist, signal_desc, _protocol_version, &_log_struct_list, _private_flags, _malloc_source)) != 0) { add_error(ErrorType::Code, __func__, err, "Protocol 8 Error (Signal Desc)"); @@ -276,7 +276,7 @@ int uda::client::Client::fetch_hierarchical_data(DataBlock* data_block) UDA_LOG(UDA_LOG_DEBUG, "Receiving Hierarchical Data Structure from Server"); int err = 0; - if ((err = protocol2(_client_input, protocol_id, XDR_RECEIVE, nullptr, _logmalloclist, _userdefinedtypelist, + if ((err = protocol2(_client_input, protocol_id, XDRStreamDirection::Receive, nullptr, _logmalloclist, _userdefinedtypelist, data_block, _protocol_version, &_log_struct_list, _private_flags, _malloc_source)) != 0) { add_error(ErrorType::Code, __func__, err, "Client Side Protocol Error (Opaque Structure Type)"); return err; @@ -445,7 +445,7 @@ int uda::client::Client::get_requests(RequestBlock& request_block, int* indices) DataBlockList recv_data_block_list; - if ((err = protocol2(_client_input, ProtocolId::DataBlockList, XDR_RECEIVE, nullptr, _logmalloclist, + if ((err = protocol2(_client_input, ProtocolId::DataBlockList, XDRStreamDirection::Receive, nullptr, _logmalloclist, _userdefinedtypelist, &recv_data_block_list, _protocol_version, &_log_struct_list, _private_flags, _malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Protocol 2 Error (Failure Receiving Data Block)"); @@ -586,7 +586,7 @@ int uda::client::Client::send_putdata(const RequestBlock& request_block) if (request->put) { ProtocolId protocol_id = ProtocolId::PutdataBlockList; int err = 0; - if ((err = protocol2(_client_output, protocol_id, XDR_SEND, nullptr, _logmalloclist, _userdefinedtypelist, + if ((err = protocol2(_client_output, protocol_id, XDRStreamDirection::Send, nullptr, _logmalloclist, _userdefinedtypelist, &(request->putDataBlockList), _protocol_version, &_log_struct_list, _private_flags, _malloc_source)) != 0) { add_error(ErrorType::Code, __func__, err, @@ -715,7 +715,7 @@ int uda::client::Client::send_request_block(RequestBlock& request_block) { ProtocolId protocol_id = ProtocolId::RequestBlock; // This is what the Client Wants int err = 0; - if ((err = protocol2(_client_output, protocol_id, XDR_SEND, nullptr, _logmalloclist, _userdefinedtypelist, + if ((err = protocol2(_client_output, protocol_id, XDRStreamDirection::Send, nullptr, _logmalloclist, _userdefinedtypelist, &request_block, _protocol_version, &_log_struct_list, _private_flags, _malloc_source)) != 0) { add_error(ErrorType::Code, __func__, err, "Protocol 1 Error (Request Block)"); throw uda::exceptions::ClientError("Protocol 1 Error (Request Block)"); @@ -728,7 +728,7 @@ int uda::client::Client::send_client_block() { ProtocolId protocol_id = ProtocolId::ClientBlock; // Send Client Block int err = 0; - if ((err = protocol2(_client_output, protocol_id, XDR_SEND, nullptr, _logmalloclist, _userdefinedtypelist, + if ((err = protocol2(_client_output, protocol_id, XDRStreamDirection::Send, nullptr, _logmalloclist, _userdefinedtypelist, &_client_block, _protocol_version, &_log_struct_list, _private_flags, _malloc_source)) != 0) { add_error(ErrorType::Code, __func__, err, "Protocol 10 Error (Client Block)"); throw uda::exceptions::ClientError("Protocol 10 Error (Client Block)"); @@ -744,7 +744,7 @@ int uda::client::Client::perform_handshake() ProtocolId protocol_id = ProtocolId::ClientBlock; // Send Client Block (proxy for authenticationStep = 6) int err = 0; - if ((err = protocol2(_client_output, protocol_id, XDR_SEND, nullptr, _logmalloclist, _userdefinedtypelist, + if ((err = protocol2(_client_output, protocol_id, XDRStreamDirection::Send, nullptr, _logmalloclist, _userdefinedtypelist, &_client_block, _protocol_version, &_log_struct_list, _private_flags, _malloc_source)) != 0) { add_error(ErrorType::Code, __func__, err, "Protocol 10 Error (Client Block)"); UDA_LOG(UDA_LOG_DEBUG, "Error Sending Client Block"); @@ -771,7 +771,7 @@ int uda::client::Client::perform_handshake() protocol_id = ProtocolId::ServerBlock; // Receive Server Block: Server Aknowledgement (proxy for authenticationStep = 8) - if ((err = protocol2(_client_input, protocol_id, XDR_RECEIVE, nullptr, _logmalloclist, _userdefinedtypelist, + if ((err = protocol2(_client_input, protocol_id, XDRStreamDirection::Receive, nullptr, _logmalloclist, _userdefinedtypelist, &_server_block, _protocol_version, &_log_struct_list, _private_flags, _malloc_source)) != 0) { add_error(ErrorType::Code, __func__, err, "Protocol 11 Error (Server Block #1)"); // Assuming the server_block is corrupted, replace with a clean copy to avoid concatonation problems @@ -834,7 +834,7 @@ int uda::client::Client::receive_server_block() UDA_LOG(UDA_LOG_DEBUG, "Waiting for Server Status Block"); int err = 0; - if ((err = protocol2(_client_input, ProtocolId::ServerBlock, XDR_RECEIVE, nullptr, _logmalloclist, + if ((err = protocol2(_client_input, ProtocolId::ServerBlock, XDRStreamDirection::Receive, nullptr, _logmalloclist, _userdefinedtypelist, &_server_block, _protocol_version, &_log_struct_list, _private_flags, _malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Protocol 11 Error (Server Block #2) = {}", err); diff --git a/source/clientserver/protocol.cpp b/source/clientserver/protocol.cpp index ee867054..1125f226 100644 --- a/source/clientserver/protocol.cpp +++ b/source/clientserver/protocol.cpp @@ -65,7 +65,7 @@ void uda::client_server::update_select_params(int fd, fd_set* rfds, struct timev } } -int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int direction, ProtocolId* token, LogMallocList* logmalloclist, +int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, XDRStreamDirection direction, ProtocolId* token, LogMallocList* logmalloclist, UserDefinedTypeList* userdefinedtypelist, void* str, int protocolVersion, LogStructList* log_struct_list, IoData* io_data, unsigned int private_flags, int malloc_source) @@ -87,7 +87,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio auto request_block = (RequestBlock*)str; switch (direction) { - case XDR_RECEIVE: + case XDRStreamDirection::Receive: if (!xdrrec_skiprecord(xdrs)) { err = UDA_PROTOCOL_ERROR_5; break; @@ -98,7 +98,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio } break; - case XDR_SEND: + case XDRStreamDirection::Send: if (!xdr_request(xdrs, request_block, protocolVersion)) { err = UDA_PROTOCOL_ERROR_2; break; @@ -109,7 +109,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio } break; - case XDR_FREE_HEAP: + case XDRStreamDirection::FreeHeap: if (!xdr_request(xdrs, request_block, protocolVersion)) { err = UDA_PROTOCOL_ERROR_3; break; @@ -132,7 +132,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio auto data_block = (DataBlock*)str; switch (direction) { - case XDR_RECEIVE: + case XDRStreamDirection::Receive: if (!xdrrec_skiprecord(xdrs)) { err = UDA_PROTOCOL_ERROR_5; break; @@ -143,7 +143,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio } // Check client/server understands new data types - // direction == XDR_RECEIVE && protocolVersion == 3 Means Client receiving data from a + // direction == XDRStreamDirection::Receive && protocolVersion == 3 Means Client receiving data from a // Version >= 3 Server (Type has to be passed first) if (protocol_version_type_test(protocolVersion, data_block->data_type) || @@ -229,11 +229,11 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio break; - case XDR_SEND: + case XDRStreamDirection::Send: // Check client/server understands new data types - // direction == XDR_SEND && protocolVersion == 3 Means Server sending data to a Version 3 Client + // direction == XDRStreamDirection::Send && protocolVersion == 3 Means Server sending data to a Version 3 Client // (Type is known) if (protocol_version_type_test(protocolVersion, data_block->data_type) || @@ -315,7 +315,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio break; - case XDR_FREE_HEAP: + case XDRStreamDirection::FreeHeap: break; default: @@ -335,7 +335,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio switch (direction) { - case XDR_RECEIVE: { + case XDRStreamDirection::Receive: { if (!xdrrec_skiprecord(xdrs)) { err = UDA_PROTOCOL_ERROR_5; @@ -385,7 +385,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio break; } - case XDR_SEND: { + case XDRStreamDirection::Send: { UDA_LOG(UDA_LOG_DEBUG, "send: putDataBlockList Count: {}", put_data_block_list->blockCount); @@ -426,7 +426,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio break; } - case XDR_FREE_HEAP: + case XDRStreamDirection::FreeHeap: break; default: @@ -444,7 +444,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio switch (direction) { - case XDR_RECEIVE: // From Client to Server + case XDRStreamDirection::Receive: // From Client to Server if (!xdrrec_skiprecord(xdrs)) { err = UDA_PROTOCOL_ERROR_5; break; @@ -455,7 +455,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio } break; - case XDR_SEND: + case XDRStreamDirection::Send: if (!xdr_int(xdrs, (int*)token)) { err = UDA_PROTOCOL_ERROR_9; break; @@ -466,7 +466,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio } break; - case XDR_FREE: + case XDRStreamDirection::FreeHeap: err = UDA_PROTOCOL_ERROR_3; break; @@ -485,7 +485,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio auto data_system = (DataSystem*)str; switch (direction) { - case XDR_RECEIVE: // From Client to Server + case XDRStreamDirection::Receive: // From Client to Server if (!xdrrec_skiprecord(xdrs)) { err = UDA_PROTOCOL_ERROR_5; break; @@ -496,7 +496,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio } break; - case XDR_SEND: + case XDRStreamDirection::Send: if (!xdr_data_system(xdrs, data_system)) { err = UDA_PROTOCOL_ERROR_10; @@ -508,7 +508,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio } break; - case XDR_FREE_HEAP: + case XDRStreamDirection::FreeHeap: if (!xdr_data_system(xdrs, data_system)) { err = UDA_PROTOCOL_ERROR_11; @@ -531,7 +531,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio auto system_config = (SystemConfig*)str; switch (direction) { - case XDR_RECEIVE: + case XDRStreamDirection::Receive: // From Client to Server if (!xdrrec_skiprecord(xdrs)) { err = UDA_PROTOCOL_ERROR_5; @@ -543,7 +543,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio } break; - case XDR_SEND: + case XDRStreamDirection::Send: if (!xdr_system_config(xdrs, system_config)) { err = UDA_PROTOCOL_ERROR_12; @@ -555,7 +555,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio } break; - case XDR_FREE_HEAP: + case XDRStreamDirection::FreeHeap: if (!xdr_system_config(xdrs, system_config)) { err = UDA_PROTOCOL_ERROR_13; @@ -578,7 +578,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio auto data_source = (DataSource*)str; switch (direction) { - case XDR_RECEIVE: + case XDRStreamDirection::Receive: // From Client to Server if (!xdrrec_skiprecord(xdrs)) { err = UDA_PROTOCOL_ERROR_5; @@ -590,7 +590,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio } break; - case XDR_SEND: + case XDRStreamDirection::Send: if (!xdr_data_source(xdrs, data_source)) { err = UDA_PROTOCOL_ERROR_14; @@ -602,7 +602,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio } break; - case XDR_FREE_HEAP: + case XDRStreamDirection::FreeHeap: if (!xdr_data_source(xdrs, data_source)) { err = UDA_PROTOCOL_ERROR_15; @@ -626,7 +626,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio switch (direction) { - case XDR_RECEIVE: + case XDRStreamDirection::Receive: // From Client to Server if (!xdrrec_skiprecord(xdrs)) { err = UDA_PROTOCOL_ERROR_5; @@ -638,7 +638,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio } break; - case XDR_SEND: + case XDRStreamDirection::Send: if (!xdr_signal(xdrs, signal)) { err = UDA_PROTOCOL_ERROR_16; @@ -650,7 +650,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio } break; - case XDR_FREE_HEAP: + case XDRStreamDirection::FreeHeap: if (!xdr_signal(xdrs, signal)) { err = UDA_PROTOCOL_ERROR_17; @@ -674,7 +674,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio switch (direction) { - case XDR_RECEIVE: + case XDRStreamDirection::Receive: // From Client to Server if (!xdrrec_skiprecord(xdrs)) { err = UDA_PROTOCOL_ERROR_5; @@ -687,7 +687,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio break; - case XDR_SEND: + case XDRStreamDirection::Send: if (!xdr_signal_desc(xdrs, signal_desc)) { err = UDA_PROTOCOL_ERROR_18; @@ -699,7 +699,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio } break; - case XDR_FREE_HEAP: + case XDRStreamDirection::FreeHeap: if (!xdr_signal_desc(xdrs, signal_desc)) { err = UDA_PROTOCOL_ERROR_19; @@ -723,7 +723,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio switch (direction) { - case XDR_RECEIVE: + case XDRStreamDirection::Receive: // From Client to Server if (!xdrrec_skiprecord(xdrs)) { err = UDA_PROTOCOL_ERROR_5; @@ -736,7 +736,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio break; - case XDR_SEND: + case XDRStreamDirection::Send: if (!xdr_client(xdrs, client_block, protocolVersion)) { err = UDA_PROTOCOL_ERROR_20; @@ -748,7 +748,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio } break; - case XDR_FREE_HEAP: + case XDRStreamDirection::FreeHeap: if (!xdr_client(xdrs, client_block, protocolVersion)) { err = UDA_PROTOCOL_ERROR_21; @@ -773,7 +773,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio switch (direction) { - case XDR_RECEIVE: + case XDRStreamDirection::Receive: if (!xdrrec_skiprecord(xdrs)) { err = UDA_PROTOCOL_ERROR_5; @@ -801,7 +801,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio break; - case XDR_SEND: + case XDRStreamDirection::Send: if (!xdr_server1(xdrs, server_block, protocolVersion)) { err = UDA_PROTOCOL_ERROR_22; break; @@ -820,7 +820,7 @@ int uda::client_server::protocol(XDR* xdrs, ProtocolId protocol_id, int directio } break; - case XDR_FREE_HEAP: + case XDRStreamDirection::FreeHeap: if (!xdr_server(xdrs, server_block)) { err = UDA_PROTOCOL_ERROR_23; diff --git a/source/clientserver/protocol.h b/source/clientserver/protocol.h index 8f16e7dc..9f491b5c 100644 --- a/source/clientserver/protocol.h +++ b/source/clientserver/protocol.h @@ -5,6 +5,7 @@ #include #include "structures/genStructs.h" +#include "xdrlib.h" //------------------------------------------------------- // Client Server Conversation Protocols @@ -95,12 +96,12 @@ void set_select_params(int fd, fd_set* rfds, struct timeval* tv, int* server_tot void update_select_params(int fd, fd_set* rfds, struct timeval* tv, int server_tot_block_time); -int protocol(XDR* xdrs, ProtocolId protocol_id, int direction, ProtocolId* token, uda::structures::LogMallocList* logmalloclist, +int protocol(XDR* xdrs, ProtocolId protocol_id, XDRStreamDirection direction, ProtocolId* token, uda::structures::LogMallocList* logmalloclist, uda::structures::UserDefinedTypeList* userdefinedtypelist, void* str, int protocolVersion, uda::structures::LogStructList* log_struct_list, IoData* io_data, unsigned int private_flags, int malloc_source); -int protocol2(XDR* xdrs, ProtocolId protocol_id, int direction, ProtocolId* token, uda::structures::LogMallocList* logmalloclist, +int protocol2(XDR* xdrs, ProtocolId protocol_id, XDRStreamDirection direction, ProtocolId* token, uda::structures::LogMallocList* logmalloclist, uda::structures::UserDefinedTypeList* userdefinedtypelist, void* str, int protocolVersion, uda::structures::LogStructList* log_struct_list, unsigned int private_flags, int malloc_source); diff --git a/source/clientserver/protocol2.cpp b/source/clientserver/protocol2.cpp index 9d504b91..f9d9138b 100644 --- a/source/clientserver/protocol2.cpp +++ b/source/clientserver/protocol2.cpp @@ -43,28 +43,28 @@ using namespace uda::client_server; using namespace uda::logging; using namespace uda::structures; -static int handle_request_block(XDR* xdrs, int direction, const void* str, int protocolVersion); -static int handle_data_block(XDR* xdrs, int direction, const void* str, int protocolVersion); -static int handle_data_block_list(XDR* xdrs, int direction, const void* str, int protocolVersion); -static int handle_putdata_block_list(XDR* xdrs, int direction, ProtocolId* token, LogMallocList* logmalloclist, +static int handle_request_block(XDR* xdrs, XDRStreamDirection direction, const void* str, int protocolVersion); +static int handle_data_block(XDR* xdrs, XDRStreamDirection direction, const void* str, int protocolVersion); +static int handle_data_block_list(XDR* xdrs, XDRStreamDirection direction, const void* str, int protocolVersion); +static int handle_putdata_block_list(XDR* xdrs, XDRStreamDirection direction, ProtocolId* token, LogMallocList* logmalloclist, UserDefinedTypeList* userdefinedtypelist, const void* str, int protocolVersion, LogStructList* log_struct_list, unsigned int private_flags, int malloc_source); -static int handle_next_protocol(XDR* xdrs, int direction, ProtocolId* token); -static int handle_data_system(XDR* xdrs, int direction, const void* str); -static int handle_system_config(XDR* xdrs, int direction, const void* str); -static int handle_data_source(XDR* xdrs, int direction, const void* str); -static int handle_signal(XDR* xdrs, int direction, const void* str); -static int handle_signal_desc(XDR* xdrs, int direction, const void* str); -static int handle_client_block(XDR* xdrs, int direction, const void* str, int protocolVersion); -static int handle_server_block(XDR* xdrs, int direction, const void* str, int protocolVersion); -static int handle_dataobject(XDR* xdrs, int direction, const void* str); -static int handle_dataobject_file(int direction, const void* str); +static int handle_next_protocol(XDR* xdrs, XDRStreamDirection direction, ProtocolId* token); +static int handle_data_system(XDR* xdrs, XDRStreamDirection direction, const void* str); +static int handle_system_config(XDR* xdrs, XDRStreamDirection direction, const void* str); +static int handle_data_source(XDR* xdrs, XDRStreamDirection direction, const void* str); +static int handle_signal(XDR* xdrs, XDRStreamDirection direction, const void* str); +static int handle_signal_desc(XDR* xdrs, XDRStreamDirection direction, const void* str); +static int handle_client_block(XDR* xdrs, XDRStreamDirection direction, const void* str, int protocolVersion); +static int handle_server_block(XDR* xdrs, XDRStreamDirection direction, const void* str, int protocolVersion); +static int handle_dataobject(XDR* xdrs, XDRStreamDirection direction, const void* str); +static int handle_dataobject_file(XDRStreamDirection direction, const void* str); #ifdef SECURITYENABLED -static int handle_security_block(XDR* xdrs, int direction, const void* str); +static int handle_security_block(XDR* xdrs, XDRStreamDirection direction, const void* str); #endif -int uda::client_server::protocol2(XDR* xdrs, ProtocolId protocol_id, int direction, ProtocolId* token, LogMallocList* logmalloclist, +int uda::client_server::protocol2(XDR* xdrs, ProtocolId protocol_id, XDRStreamDirection direction, ProtocolId* token, LogMallocList* logmalloclist, UserDefinedTypeList* userdefinedtypelist, void* str, int protocolVersion, LogStructList* log_struct_list, unsigned int private_flags, int malloc_source) { @@ -128,28 +128,28 @@ int uda::client_server::protocol2(XDR* xdrs, ProtocolId protocol_id, int directi } #ifdef SECURITYENABLED -static int handle_security_block(XDR* xdrs, int direction, const void* str) +static int handle_security_block(XDR* xdrs, XDRStreamDirection direction, const void* str) { int err = 0; ClientBlock* client_block = (ClientBlock*)str; SecurityBlock* security_block = &(client_block->securityBlock); switch (direction) { - case XDR_RECEIVE: + case XDRStreamDirection::Receive: if (!xdr_security_block1(xdrs, security_block)) { err = UDA_PROTOCOL_ERROR_23; break; } break; - case XDR_SEND: + case XDRStreamDirection::Send: if (!xdr_security_block1(xdrs, security_block)) { err = UDA_PROTOCOL_ERROR_23; break; } break; - case XDR_FREE_HEAP: + case XDRStreamDirection::FreeHeap: break; default: @@ -180,21 +180,21 @@ static int handle_security_block(XDR* xdrs, int direction, const void* str) } switch (direction) { - case XDR_RECEIVE: + case XDRStreamDirection::Receive: if (!xdr_security_block2(xdrs, security_block)) { err = UDA_PROTOCOL_ERROR_24; break; } break; - case XDR_SEND: + case XDRStreamDirection::Send: if (!xdr_security_block2(xdrs, security_block)) { err = UDA_PROTOCOL_ERROR_24; break; } break; - case XDR_FREE_HEAP: + case XDRStreamDirection::FreeHeap: break; default: @@ -205,15 +205,15 @@ static int handle_security_block(XDR* xdrs, int direction, const void* str) } #endif // SECURITYENABLED -static int handle_dataobject_file(int direction, const void* str) +static int handle_dataobject_file(XDRStreamDirection direction, const void* str) { int err = 0; switch (direction) { - case XDR_RECEIVE: + case XDRStreamDirection::Receive: break; - case XDR_SEND: + case XDRStreamDirection::Send: break; default: @@ -224,13 +224,13 @@ static int handle_dataobject_file(int direction, const void* str) return err; } -static int handle_dataobject(XDR* xdrs, int direction, const void* str) +static int handle_dataobject(XDR* xdrs, XDRStreamDirection direction, const void* str) { int err = 0; auto data_object = (DataObject*)str; switch (direction) { - case XDR_RECEIVE: + case XDRStreamDirection::Receive: if (!xdr_data_object1(xdrs, data_object)) { // Storage requirements err = UDA_PROTOCOL_ERROR_22; break; @@ -247,7 +247,7 @@ static int handle_dataobject(XDR* xdrs, int direction, const void* str) } break; - case XDR_SEND: + case XDRStreamDirection::Send: if (!xdr_data_object1(xdrs, data_object)) { err = UDA_PROTOCOL_ERROR_22; @@ -266,13 +266,13 @@ static int handle_dataobject(XDR* xdrs, int direction, const void* str) return err; } -static int handle_server_block(XDR* xdrs, int direction, const void* str, int protocolVersion) +static int handle_server_block(XDR* xdrs, XDRStreamDirection direction, const void* str, int protocolVersion) { int err = 0; auto server_block = (ServerBlock*)str; switch (direction) { - case XDR_RECEIVE: + case XDRStreamDirection::Receive: close_error(); // Free Heap associated with Previous Data Access if (!xdr_server1(xdrs, server_block, protocolVersion)) { @@ -294,7 +294,7 @@ static int handle_server_block(XDR* xdrs, int direction, const void* str, int pr break; - case XDR_SEND: + case XDRStreamDirection::Send: if (!xdr_server1(xdrs, server_block, protocolVersion)) { err = UDA_PROTOCOL_ERROR_22; break; @@ -309,7 +309,7 @@ static int handle_server_block(XDR* xdrs, int direction, const void* str, int pr break; - case XDR_FREE_HEAP: + case XDRStreamDirection::FreeHeap: break; default: @@ -319,27 +319,27 @@ static int handle_server_block(XDR* xdrs, int direction, const void* str, int pr return err; } -static int handle_client_block(XDR* xdrs, int direction, const void* str, int protocolVersion) +static int handle_client_block(XDR* xdrs, XDRStreamDirection direction, const void* str, int protocolVersion) { int err = 0; auto client_block = (ClientBlock*)str; switch (direction) { - case XDR_RECEIVE: + case XDRStreamDirection::Receive: if (!xdr_client(xdrs, client_block, protocolVersion)) { err = UDA_PROTOCOL_ERROR_20; break; } break; - case XDR_SEND: + case XDRStreamDirection::Send: if (!xdr_client(xdrs, client_block, protocolVersion)) { err = UDA_PROTOCOL_ERROR_20; break; } break; - case XDR_FREE_HEAP: + case XDRStreamDirection::FreeHeap: break; default: @@ -349,27 +349,27 @@ static int handle_client_block(XDR* xdrs, int direction, const void* str, int pr return err; } -static int handle_signal_desc(XDR* xdrs, int direction, const void* str) +static int handle_signal_desc(XDR* xdrs, XDRStreamDirection direction, const void* str) { int err = 0; auto signal_desc = (SignalDesc*)str; switch (direction) { - case XDR_RECEIVE: + case XDRStreamDirection::Receive: if (!xdr_signal_desc(xdrs, signal_desc)) { err = UDA_PROTOCOL_ERROR_18; break; } break; - case XDR_SEND: + case XDRStreamDirection::Send: if (!xdr_signal_desc(xdrs, signal_desc)) { err = UDA_PROTOCOL_ERROR_18; break; } break; - case XDR_FREE_HEAP: + case XDRStreamDirection::FreeHeap: break; default: @@ -379,27 +379,27 @@ static int handle_signal_desc(XDR* xdrs, int direction, const void* str) return err; } -static int handle_signal(XDR* xdrs, int direction, const void* str) +static int handle_signal(XDR* xdrs, XDRStreamDirection direction, const void* str) { int err = 0; auto signal = (Signal*)str; switch (direction) { - case XDR_RECEIVE: + case XDRStreamDirection::Receive: if (!xdr_signal(xdrs, signal)) { err = UDA_PROTOCOL_ERROR_16; break; } break; - case XDR_SEND: + case XDRStreamDirection::Send: if (!xdr_signal(xdrs, signal)) { err = UDA_PROTOCOL_ERROR_16; break; } break; - case XDR_FREE_HEAP: + case XDRStreamDirection::FreeHeap: break; default: @@ -409,28 +409,28 @@ static int handle_signal(XDR* xdrs, int direction, const void* str) return err; } -static int handle_data_source(XDR* xdrs, int direction, const void* str) +static int handle_data_source(XDR* xdrs, XDRStreamDirection direction, const void* str) { int err = 0; auto data_source = (DataSource*)str; switch (direction) { - case XDR_RECEIVE: + case XDRStreamDirection::Receive: if (!xdr_data_source(xdrs, data_source)) { err = UDA_PROTOCOL_ERROR_14; break; } break; - case XDR_SEND: + case XDRStreamDirection::Send: if (!xdr_data_source(xdrs, data_source)) { err = UDA_PROTOCOL_ERROR_14; break; } break; - case XDR_FREE_HEAP: + case XDRStreamDirection::FreeHeap: break; default: @@ -440,27 +440,27 @@ static int handle_data_source(XDR* xdrs, int direction, const void* str) return err; } -static int handle_system_config(XDR* xdrs, int direction, const void* str) +static int handle_system_config(XDR* xdrs, XDRStreamDirection direction, const void* str) { int err = 0; auto system_config = (SystemConfig*)str; switch (direction) { - case XDR_RECEIVE: + case XDRStreamDirection::Receive: if (!xdr_system_config(xdrs, system_config)) { err = UDA_PROTOCOL_ERROR_12; break; } break; - case XDR_SEND: + case XDRStreamDirection::Send: if (!xdr_system_config(xdrs, system_config)) { err = UDA_PROTOCOL_ERROR_12; break; } break; - case XDR_FREE_HEAP: + case XDRStreamDirection::FreeHeap: break; default: @@ -470,27 +470,27 @@ static int handle_system_config(XDR* xdrs, int direction, const void* str) return err; } -static int handle_data_system(XDR* xdrs, int direction, const void* str) +static int handle_data_system(XDR* xdrs, XDRStreamDirection direction, const void* str) { int err = 0; auto data_system = (DataSystem*)str; switch (direction) { - case XDR_RECEIVE: + case XDRStreamDirection::Receive: if (!xdr_data_system(xdrs, data_system)) { err = UDA_PROTOCOL_ERROR_10; break; } break; - case XDR_SEND: + case XDRStreamDirection::Send: if (!xdr_data_system(xdrs, data_system)) { err = UDA_PROTOCOL_ERROR_10; break; } break; - case XDR_FREE_HEAP: + case XDRStreamDirection::FreeHeap: break; default: @@ -500,11 +500,11 @@ static int handle_data_system(XDR* xdrs, int direction, const void* str) return err; } -static int handle_next_protocol(XDR* xdrs, int direction, ProtocolId* token) +static int handle_next_protocol(XDR* xdrs, XDRStreamDirection direction, ProtocolId* token) { int err = 0; switch (direction) { - case XDR_RECEIVE: // From Client to Server + case XDRStreamDirection::Receive: // From Client to Server if (!xdrrec_skiprecord(xdrs)) { err = UDA_PROTOCOL_ERROR_5; break; @@ -515,7 +515,7 @@ static int handle_next_protocol(XDR* xdrs, int direction, ProtocolId* token) } break; - case XDR_SEND: + case XDRStreamDirection::Send: if (!xdr_int(xdrs, (int*)token)) { err = UDA_PROTOCOL_ERROR_9; break; @@ -526,7 +526,7 @@ static int handle_next_protocol(XDR* xdrs, int direction, ProtocolId* token) } break; - case XDR_FREE: + case XDRStreamDirection::FreeHeap: err = UDA_PROTOCOL_ERROR_3; break; @@ -537,7 +537,7 @@ static int handle_next_protocol(XDR* xdrs, int direction, ProtocolId* token) return err; } -static int handle_putdata_block_list(XDR* xdrs, int direction, ProtocolId* token, LogMallocList* logmalloclist, +static int handle_putdata_block_list(XDR* xdrs, XDRStreamDirection direction, ProtocolId* token, LogMallocList* logmalloclist, UserDefinedTypeList* userdefinedtypelist, const void* str, int protocolVersion, LogStructList* log_struct_list, unsigned int private_flags, int malloc_source) { @@ -546,7 +546,7 @@ static int handle_putdata_block_list(XDR* xdrs, int direction, ProtocolId* token switch (direction) { - case XDR_RECEIVE: { + case XDRStreamDirection::Receive: { unsigned int blockCount = 0; if (!xdr_u_int(xdrs, &blockCount)) { @@ -621,7 +621,7 @@ static int handle_putdata_block_list(XDR* xdrs, int direction, ProtocolId* token break; } - case XDR_SEND: + case XDRStreamDirection::Send: UDA_LOG(UDA_LOG_DEBUG, "send: putDataBlockList Count: {}", putDataBlockList->blockCount); @@ -679,7 +679,7 @@ static int handle_putdata_block_list(XDR* xdrs, int direction, ProtocolId* token } break; - case XDR_FREE_HEAP: + case XDRStreamDirection::FreeHeap: break; default: @@ -689,20 +689,20 @@ static int handle_putdata_block_list(XDR* xdrs, int direction, ProtocolId* token return err; } -static int handle_data_block(XDR* xdrs, int direction, const void* str, int protocolVersion) +static int handle_data_block(XDR* xdrs, XDRStreamDirection direction, const void* str, int protocolVersion) { int err = 0; auto data_block = (DataBlock*)str; switch (direction) { - case XDR_RECEIVE: { + case XDRStreamDirection::Receive: { if (!xdr_data_block1(xdrs, data_block, protocolVersion)) { err = UDA_PROTOCOL_ERROR_61; break; } // Check client/server understands new data types - // direction == XDR_RECEIVE && protocolVersion == 3 Means Client receiving data from a + // direction == XDRStreamDirection::Receive && protocolVersion == 3 Means Client receiving data from a // Version >= 3 Server (Type has to be passed first) if (protocol_version_type_test(protocolVersion, data_block->data_type) || @@ -789,11 +789,11 @@ static int handle_data_block(XDR* xdrs, int direction, const void* str, int prot break; } - case XDR_SEND: { + case XDRStreamDirection::Send: { // Check client/server understands new data types - // direction == XDR_SEND && protocolVersion == 3 Means Server sending data to a Version 3 Client (Type is + // direction == XDRStreamDirection::Send && protocolVersion == 3 Means Server sending data to a Version 3 Client (Type is // known) UDA_LOG(UDA_LOG_DEBUG, "#1 PROTOCOL: Send/Receive Data Block"); @@ -877,7 +877,7 @@ static int handle_data_block(XDR* xdrs, int direction, const void* str, int prot break; } - case XDR_FREE_HEAP: + case XDRStreamDirection::FreeHeap: break; default: @@ -888,13 +888,13 @@ static int handle_data_block(XDR* xdrs, int direction, const void* str, int prot return err; } -static int handle_data_block_list(XDR* xdrs, int direction, const void* str, int protocolVersion) +static int handle_data_block_list(XDR* xdrs, XDRStreamDirection direction, const void* str, int protocolVersion) { int err = 0; auto data_block_list = (DataBlockList*)str; switch (direction) { - case XDR_RECEIVE: + case XDRStreamDirection::Receive: if (!xdr_data_block_list(xdrs, data_block_list, protocolVersion)) { err = UDA_PROTOCOL_ERROR_1; break; @@ -903,7 +903,7 @@ static int handle_data_block_list(XDR* xdrs, int direction, const void* str, int for (int i = 0; i < data_block_list->count; ++i) { DataBlock* data_block = &data_block_list->data[i]; init_data_block(data_block); - err = handle_data_block(xdrs, XDR_RECEIVE, data_block, protocolVersion); + err = handle_data_block(xdrs, XDRStreamDirection::Receive, data_block, protocolVersion); if (err != 0) { err = UDA_PROTOCOL_ERROR_2; break; @@ -914,14 +914,14 @@ static int handle_data_block_list(XDR* xdrs, int direction, const void* str, int } break; - case XDR_SEND: { + case XDRStreamDirection::Send: { if (!xdr_data_block_list(xdrs, data_block_list, protocolVersion)) { err = UDA_PROTOCOL_ERROR_2; break; } for (int i = 0; i < data_block_list->count; ++i) { DataBlock* data_block = &data_block_list->data[i]; - int rc = handle_data_block(xdrs, XDR_SEND, data_block, protocolVersion); + int rc = handle_data_block(xdrs, XDRStreamDirection::Send, data_block, protocolVersion); if (rc != 0) { err = UDA_PROTOCOL_ERROR_2; break; @@ -933,7 +933,7 @@ static int handle_data_block_list(XDR* xdrs, int direction, const void* str, int break; } - case XDR_FREE_HEAP: + case XDRStreamDirection::FreeHeap: break; default: @@ -943,13 +943,13 @@ static int handle_data_block_list(XDR* xdrs, int direction, const void* str, int return err; } -static int handle_request_block(XDR* xdrs, int direction, const void* str, int protocolVersion) +static int handle_request_block(XDR* xdrs, XDRStreamDirection direction, const void* str, int protocolVersion) { int err = 0; auto request_block = (RequestBlock*)str; switch (direction) { - case XDR_RECEIVE: + case XDRStreamDirection::Receive: if (!xdr_request(xdrs, request_block, protocolVersion)) { err = UDA_PROTOCOL_ERROR_1; break; @@ -967,7 +967,7 @@ static int handle_request_block(XDR* xdrs, int direction, const void* str, int p } break; - case XDR_SEND: + case XDRStreamDirection::Send: if (!xdr_request(xdrs, request_block, protocolVersion)) { err = UDA_PROTOCOL_ERROR_2; break; @@ -983,7 +983,7 @@ static int handle_request_block(XDR* xdrs, int direction, const void* str, int p } break; - case XDR_FREE_HEAP: + case XDRStreamDirection::FreeHeap: break; default: diff --git a/source/clientserver/protocolXML.cpp b/source/clientserver/protocolXML.cpp index 54508088..e6b61a1c 100644 --- a/source/clientserver/protocolXML.cpp +++ b/source/clientserver/protocolXML.cpp @@ -75,7 +75,7 @@ using namespace uda::client_server; using namespace uda::logging; using namespace uda::structures; -int uda::client_server::protocol_xml(XDR* xdrs, ProtocolId protocol_id, int direction, ProtocolId* token, +int uda::client_server::protocol_xml(XDR* xdrs, ProtocolId protocol_id, XDRStreamDirection direction, ProtocolId* token, LogMallocList* logmalloclist, UserDefinedTypeList* userdefinedtypelist, void* str, int protocolVersion, LogStructList* log_struct_list, IoData* io_data, unsigned int private_flags, int malloc_source, CreateXDRStreams create_xdr_streams) @@ -660,7 +660,7 @@ int uda::client_server::protocol_xml(XDR* xdrs, ProtocolId protocol_id, int dire data_block = (DataBlock*)str; if (data_block->opaque_type == UDA_OPAQUE_TYPE_XML_DOCUMENT && data_block->opaque_count > 0) { switch (direction) { - case XDR_RECEIVE: + case XDRStreamDirection::Receive: if (!xdrrec_skiprecord(xdrs)) { err = UDA_PROTOCOL_ERROR_5; break; @@ -677,7 +677,7 @@ int uda::client_server::protocol_xml(XDR* xdrs, ProtocolId protocol_id, int dire break; - case XDR_SEND: + case XDRStreamDirection::Send: if (!xdr_meta(xdrs, data_block)) { UDA_LOG(UDA_LOG_DEBUG, "Error sending Metadata XML Document: \n{}\n", (char*)data_block->opaque_block); @@ -690,7 +690,7 @@ int uda::client_server::protocol_xml(XDR* xdrs, ProtocolId protocol_id, int dire } break; - case XDR_FREE_HEAP: + case XDRStreamDirection::FreeHeap: break; default: diff --git a/source/clientserver/protocolXML.h b/source/clientserver/protocolXML.h index ed6d04d7..709e2c5f 100644 --- a/source/clientserver/protocolXML.h +++ b/source/clientserver/protocolXML.h @@ -5,6 +5,7 @@ #include #include "structures/genStructs.h" +#include "xdrlib.h" #ifdef FATCLIENT # define protocolXML protocolXMLFat @@ -19,7 +20,7 @@ struct IoData; using CreateXDRStreams = std::pair (*)(uda::client_server::IoData*); -int protocol_xml(XDR* xdrs, ProtocolId protocol_id, int direction, ProtocolId* token, uda::structures::LogMallocList* logmalloclist, +int protocol_xml(XDR* xdrs, ProtocolId protocol_id, XDRStreamDirection direction, ProtocolId* token, uda::structures::LogMallocList* logmalloclist, uda::structures::UserDefinedTypeList* userdefinedtypelist, void* str, int protocolVersion, uda::structures::LogStructList* log_struct_list, IoData* io_data, unsigned int private_flags, int malloc_source, CreateXDRStreams create_xdr_streams); diff --git a/source/clientserver/protocolXML2.cpp b/source/clientserver/protocolXML2.cpp index 03c45358..ec586f8f 100644 --- a/source/clientserver/protocolXML2.cpp +++ b/source/clientserver/protocolXML2.cpp @@ -97,7 +97,7 @@ int sha1File(char* name, FILE* fh, unsigned char* md); #define MAX_ELEMENT_SHA1 20 -int uda::client_server::protocol_xml2(XDR* xdrs, ProtocolId protocol_id, int direction, ProtocolId* token, +int uda::client_server::protocol_xml2(XDR* xdrs, ProtocolId protocol_id, XDRStreamDirection direction, ProtocolId* token, LogMallocList* logmalloclist, UserDefinedTypeList* userdefinedtypelist, void* str, int protocolVersion, LogStructList* log_struct_list, unsigned int private_flags, int malloc_source) @@ -1120,7 +1120,7 @@ int uda::client_server::protocol_xml2(XDR* xdrs, ProtocolId protocol_id, int dir data_block = (DataBlock*)str; if (data_block->opaque_type == UDA_OPAQUE_TYPE_XML_DOCUMENT && data_block->opaque_count > 0) { switch (direction) { - case XDR_RECEIVE: + case XDRStreamDirection::Receive: if (!(rc = xdrrec_skiprecord(xdrs))) { err = UDA_PROTOCOL_ERROR_5; break; @@ -1136,7 +1136,7 @@ int uda::client_server::protocol_xml2(XDR* xdrs, ProtocolId protocol_id, int dir } break; - case XDR_SEND: + case XDRStreamDirection::Send: if (!(rc = xdr_meta(xdrs, data_block))) { UDA_LOG(UDA_LOG_DEBUG, "Error sending Metadata XML Document: \n{}\n", @@ -1150,7 +1150,7 @@ int uda::client_server::protocol_xml2(XDR* xdrs, ProtocolId protocol_id, int dir } break; - case XDR_FREE_HEAP: + case XDRStreamDirection::FreeHeap: break; default: @@ -1452,7 +1452,7 @@ int packXDRDataBlockObject(unsigned char* object, size_t objectSize, DataBlock* DataBlockList data_block_list; data_block_list.count = 1; data_block_list.data = data_block; - err = protocol2(&xdrObject, ProtocolId::DataBlockList, XDR_SEND, nullptr, logmalloclist, userdefinedtypelist, + err = protocol2(&xdrObject, ProtocolId::DataBlockList, XDRStreamDirection::Send, nullptr, logmalloclist, userdefinedtypelist, &data_block_list, protocolVersion, log_struct_list, private_flags, malloc_source); // Close the stream and file @@ -1495,7 +1495,7 @@ int unpackXDRDataBlockObject(unsigned char* object, size_t objectSize, DataBlock DataBlockList data_block_list; data_block_list.count = 1; data_block_list.data = data_block; - err = protocol2(&xdrObject, ProtocolId::DataBlockList, XDR_RECEIVE, nullptr, logmalloclist, + err = protocol2(&xdrObject, ProtocolId::DataBlockList, XDRStreamDirection::Receive, nullptr, logmalloclist, userdefinedtypelist, &data_block_list, protocolVersion, log_struct_list, private_flags, malloc_source); diff --git a/source/clientserver/protocolXML2.h b/source/clientserver/protocolXML2.h index e607cc7e..09d9f9ba 100644 --- a/source/clientserver/protocolXML2.h +++ b/source/clientserver/protocolXML2.h @@ -1,6 +1,7 @@ #pragma once #include "structures/genStructs.h" +#include "xdrlib.h" #include #include @@ -14,7 +15,7 @@ namespace uda::client_server enum class ProtocolId; -int protocol_xml2(XDR* xdrs, ProtocolId protocol_id, int direction, ProtocolId* token, uda::structures::LogMallocList* logmalloclist, +int protocol_xml2(XDR* xdrs, ProtocolId protocol_id, XDRStreamDirection direction, ProtocolId* token, uda::structures::LogMallocList* logmalloclist, uda::structures::UserDefinedTypeList* userdefinedtypelist, void* str, int protocolVersion, uda::structures::LogStructList* log_struct_list, unsigned int private_flags, int malloc_source); diff --git a/source/clientserver/protocolXML2Put.cpp b/source/clientserver/protocolXML2Put.cpp index d65ded35..4321a8b0 100644 --- a/source/clientserver/protocolXML2Put.cpp +++ b/source/clientserver/protocolXML2Put.cpp @@ -1549,7 +1549,7 @@ bool_t uda::client_server::xdr_user_defined_type_list_put(XDR* xdrs, UserDefined return rc; } -int uda::client_server::protocol_xml2_put(XDR* xdrs, ProtocolId protocol_id, int direction, ProtocolId* token, +int uda::client_server::protocol_xml2_put(XDR* xdrs, ProtocolId protocol_id, XDRStreamDirection direction, ProtocolId* token, LogMallocList* logmalloclist, UserDefinedTypeList* userdefinedtypelist, void* str, int protocolVersion, LogStructList* log_struct_list, unsigned int private_flags, int malloc_source) diff --git a/source/clientserver/protocolXML2Put.h b/source/clientserver/protocolXML2Put.h index 400ee929..a34be146 100644 --- a/source/clientserver/protocolXML2Put.h +++ b/source/clientserver/protocolXML2Put.h @@ -4,6 +4,7 @@ #include #include "structures/genStructs.h" +#include "xdrlib.h" namespace uda::client_server { @@ -24,7 +25,7 @@ bool_t xdr_user_defined_type(XDR* xdrs, uda::structures::UserDefinedTypeList* us bool_t xdr_user_defined_type_list_put(XDR* xdrs, uda::structures::UserDefinedTypeList* str); -int protocol_xml2_put(XDR* xdrs, ProtocolId protocol_id, int direction, ProtocolId* token, +int protocol_xml2_put(XDR* xdrs, ProtocolId protocol_id, XDRStreamDirection direction, ProtocolId* token, uda::structures::LogMallocList* logmalloclist, uda::structures::UserDefinedTypeList* userdefinedtypelist, void* str, int protocolVersion, uda::structures::LogStructList* log_struct_list, unsigned int private_flags, int malloc_source); diff --git a/source/clientserver/xdrlib.h b/source/clientserver/xdrlib.h index 3ca7795a..54c93f67 100644 --- a/source/clientserver/xdrlib.h +++ b/source/clientserver/xdrlib.h @@ -5,13 +5,6 @@ #include #include -//------------------------------------------------------- -// XDR Stream Directions - -#define XDR_SEND 0 -#define XDR_RECEIVE 1 -#define XDR_FREE_HEAP 2 - #ifdef __APPLE__ # define xdr_uint64_t xdr_u_int64_t #endif @@ -19,6 +12,12 @@ namespace uda::client_server { +enum class XDRStreamDirection { + Send = 0, + Receive = 1, + FreeHeap = 2, +}; + //----------------------------------------------------------------------- // Test version's type passing capability diff --git a/source/security/clientAuthentication.cpp b/source/security/clientAuthentication.cpp index 119550d0..aa3dcc4e 100644 --- a/source/security/clientAuthentication.cpp +++ b/source/security/clientAuthentication.cpp @@ -272,7 +272,7 @@ static int issueToken(ClientBlock* client_block, LogMallocList* logmalloclist, U #ifndef TESTIDAMSECURITY ProtocolId protocol_id = ProtocolId::ClientBlock; - if ((err = protocol2(clientOutput, protocol_id, XDR_SEND, nullptr, logmalloclist, userdefinedtypelist, + if ((err = protocol2(clientOutput, protocol_id, XDRStreamDirection::Send, nullptr, logmalloclist, userdefinedtypelist, &client_block)) != 0) { UDA_THROW_ERROR(err, "Protocol 10 Error (securityBlock #1)"); } @@ -319,7 +319,7 @@ static int decryptServerToken(ServerBlock* server_block, ClientBlock* client_blo ProtocolId protocol_id = ProtocolId::ServerBlock; - if ((err = protocol2(clientInput, protocol_id, XDR_RECEIVE, nullptr, logmalloclist, userdefinedtypelist, + if ((err = protocol2(clientInput, protocol_id, XDRStreamDirection::Receive, nullptr, logmalloclist, userdefinedtypelist, &server_block)) != 0) { UDA_THROW_ERROR(err, "Protocol 11 Error (securityBlock #5)"); } @@ -412,7 +412,7 @@ static int encryptServerToken(ClientBlock* client_block, LogMallocList* logmallo #ifndef TESTIDAMSECURITY ProtocolId protocol_id = ProtocolId::ClientBlock; - if ((err = protocol2(clientOutput, protocol_id, XDR_SEND, nullptr, logmalloclist, userdefinedtypelist, + if ((err = protocol2(clientOutput, protocol_id, XDRStreamDirection::Send, nullptr, logmalloclist, userdefinedtypelist, &client_block)) != 0) { UDA_THROW_ERROR(err, "Protocol 10 Error (securityBlock #6)"); } diff --git a/source/security/serverAuthentication.cpp b/source/security/serverAuthentication.cpp index 17deccf2..23382573 100644 --- a/source/security/serverAuthentication.cpp +++ b/source/security/serverAuthentication.cpp @@ -180,7 +180,7 @@ static SECURITY_BLOCK* receiveSecurityBlock(ClientBlock* client_block, LogMalloc ProtocolId protocol_id = ProtocolId::ClientBlock; // Recieve Client Block int err = 0; - if ((err = protocol2(serverInput, protocol_id, XDR_RECEIVE, nullptr, logmalloclist, userdefinedtypelist, + if ((err = protocol2(serverInput, protocol_id, XDRStreamDirection::Receive, nullptr, logmalloclist, userdefinedtypelist, client_block)) != 0) { add_error(ErrorType::Code, __func__, err, "Protocol 10 Error (Client Block #2)"); UDA_LOG(UDA_LOG_DEBUG, "protocol error! Client Block not received!"); @@ -314,7 +314,7 @@ static int issueToken(ServerBlock* server_block, LogMallocList* logmalloclist, U # ifndef TESTIDAMSECURITY ProtocolId protocol_id = ProtocolId::ServerBlock; - if ((err = protocol2(serverOutput, protocol_id, XDR_SEND, nullptr, logmalloclist, userdefinedtypelist, + if ((err = protocol2(serverOutput, protocol_id, XDRStreamDirection::Send, nullptr, logmalloclist, userdefinedtypelist, server_block)) != 0) { add_error(ErrorType::Code, __func__, err, "Protocol 10 Error (securityBlock #4)"); } @@ -347,7 +347,7 @@ static int verifyToken(ServerBlock* server_block, ClientBlock* client_block, Log UDA_THROW_ERROR(UDA_PROTOCOL_ERROR_5, "Protocol 5 Error (Client Block #7)"); } - if ((err = protocol2(serverInput, protocol_id, XDR_RECEIVE, nullptr, logmalloclist, userdefinedtypelist, + if ((err = protocol2(serverInput, protocol_id, XDRStreamDirection::Receive, nullptr, logmalloclist, userdefinedtypelist, client_block)) != 0) { UDA_THROW_ERROR(err, "Protocol 11 Error (securityBlock #7)"); } @@ -390,7 +390,7 @@ static int verifyToken(ServerBlock* server_block, ClientBlock* client_block, Log # ifndef TESTIDAMSECURITY protocol_id = ProtocolId::ServerBlock; - if ((err = protocol2(serverOutput, protocol_id, XDR_SEND, nullptr, logmalloclist, userdefinedtypelist, + if ((err = protocol2(serverOutput, protocol_id, XDRStreamDirection::Send, nullptr, logmalloclist, userdefinedtypelist, server_block)) != 0) { UDA_THROW_ERROR(err, "Protocol 10 Error (securityBlock #7)"); } diff --git a/source/server/fatServer.cpp b/source/server/fatServer.cpp index 31a5285b..2ceb3849 100644 --- a/source/server/fatServer.cpp +++ b/source/server/fatServer.cpp @@ -214,7 +214,7 @@ static int process_hierarchical_data(DataBlock* data_block, LogStructList* log_s // Write data to the temporary file ProtocolId protocol_id = ProtocolId::Structures; - protocol_xml(&xdr_server_output, protocol_id, XDR_SEND, nullptr, log_malloc_list, user_defined_type_list, + protocol_xml(&xdr_server_output, protocol_id, XDRStreamDirection::Send, nullptr, log_malloc_list, user_defined_type_list, data_block, protocol_version, log_struct_list, io_data, ::private_flags, malloc_source, serverCreateXDRStream); @@ -240,7 +240,7 @@ static int process_hierarchical_data(DataBlock* data_block, LogStructList* log_s // Read data from the temporary file protocol_id = ProtocolId::Structures; - err = protocol_xml(&xdr_server_input, protocol_id, XDR_RECEIVE, nullptr, log_malloc_list, user_defined_type_list, + err = protocol_xml(&xdr_server_input, protocol_id, XDRStreamDirection::Receive, nullptr, log_malloc_list, user_defined_type_list, data_block, protocol_version, log_struct_list, io_data, ::private_flags, malloc_source, serverCreateXDRStream); diff --git a/source/server/sleepServer.cpp b/source/server/sleepServer.cpp index 04541be7..33571c6e 100644 --- a/source/server/sleepServer.cpp +++ b/source/server/sleepServer.cpp @@ -34,7 +34,7 @@ int uda::server::sleepServer(XDR* server_input, XDR* server_output, LogMallocLis UDA_LOG(UDA_LOG_DEBUG, "Protocol 3 Listening for Next Client Request"); - if ((err = protocol(server_input, protocol_id, XDR_RECEIVE, &next_protocol, logmalloclist, userdefinedtypelist, + if ((err = protocol(server_input, protocol_id, XDRStreamDirection::Receive, &next_protocol, logmalloclist, userdefinedtypelist, nullptr, protocolVersion, log_struct_list, io_data, private_flags, malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Protocol 3 Error Listening for Wake-up {}", err); @@ -53,7 +53,7 @@ int uda::server::sleepServer(XDR* server_input, XDR* server_output, LogMallocLis #ifndef NOCHAT // Echo Next Protocol straight back to Client - if ((err = protocol(server_output, protocol_id, XDR_SEND, &next_protocol, logmalloclist, userdefinedtypelist, + if ((err = protocol(server_output, protocol_id, XDRStreamDirection::Send, &next_protocol, logmalloclist, userdefinedtypelist, nullptr, protocolVersion, log_struct_list, io_data, private_flags, malloc_source)) != 0) { add_error(ErrorType::Code, "sleepServer", err, "Protocol 3 Error Echoing Next Protocol ID"); return 0; diff --git a/source/server/udaLegacyServer.cpp b/source/server/udaLegacyServer.cpp index 735dd950..d41074cc 100644 --- a/source/server/udaLegacyServer.cpp +++ b/source/server/udaLegacyServer.cpp @@ -127,7 +127,7 @@ int uda::server::legacyServer(config::Config& config, ClientBlock client_block, protocol_id = ProtocolId::ClientBlock; - if ((err = protocol(server_input, protocol_id, XDR_RECEIVE, nullptr, log_malloc_list, user_defined_type_list, + if ((err = protocol(server_input, protocol_id, XDRStreamDirection::Receive, nullptr, log_malloc_list, user_defined_type_list, &client_block, protocolVersion, &log_struct_list, &io_data, private_flags, malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Problem Receiving Client Data Block") @@ -177,7 +177,7 @@ int uda::server::legacyServer(config::Config& config, ClientBlock client_block, UDA_LOG(UDA_LOG_DEBUG, "Sending Server Block") - if ((err = protocol(server_output, protocol_id, XDR_SEND, nullptr, log_malloc_list, user_defined_type_list, + if ((err = protocol(server_output, protocol_id, XDRStreamDirection::Send, nullptr, log_malloc_list, user_defined_type_list, &server_block, protocolVersion, &log_struct_list, &io_data, private_flags, malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Problem Sending Server Data Block") @@ -208,7 +208,7 @@ int uda::server::legacyServer(config::Config& config, ClientBlock client_block, protocol_id = ProtocolId::RequestBlock; - if ((err = protocol(server_input, protocol_id, XDR_RECEIVE, nullptr, log_malloc_list, user_defined_type_list, + if ((err = protocol(server_input, protocol_id, XDRStreamDirection::Receive, nullptr, log_malloc_list, user_defined_type_list, &request_block, protocolVersion, &log_struct_list, &io_data, private_flags, malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Problem Receiving Client Request Block") @@ -332,7 +332,7 @@ int uda::server::legacyServer(config::Config& config, ClientBlock client_block, protocol_id = ProtocolId::PutdataBlockList; - if ((err = protocol(server_input, protocol_id, XDR_RECEIVE, nullptr, log_malloc_list, user_defined_type_list, + if ((err = protocol(server_input, protocol_id, XDRStreamDirection::Receive, nullptr, log_malloc_list, user_defined_type_list, &(request_data->putDataBlockList), protocolVersion, &log_struct_list, &io_data, private_flags, malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Problem Receiving putData Block List") @@ -472,7 +472,7 @@ int uda::server::legacyServer(config::Config& config, ClientBlock client_block, protocol_id = ProtocolId::ServerBlock; - if ((err = protocol(server_output, protocol_id, XDR_SEND, nullptr, log_malloc_list, user_defined_type_list, + if ((err = protocol(server_output, protocol_id, XDRStreamDirection::Send, nullptr, log_malloc_list, user_defined_type_list, &server_block, protocolVersion, &log_struct_list, &io_data, private_flags, malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Problem Sending Server Data Block #2") @@ -502,7 +502,7 @@ int uda::server::legacyServer(config::Config& config, ClientBlock client_block, protocol_id = ProtocolId::NextProtocol; - if ((err = protocol(server_input, protocol_id, XDR_RECEIVE, &next_protocol, log_malloc_list, + if ((err = protocol(server_input, protocol_id, XDRStreamDirection::Receive, &next_protocol, log_malloc_list, user_defined_type_list, nullptr, protocolVersion, &log_struct_list, &io_data, private_flags, malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Problem #1 Receiving Next Protocol ID") @@ -525,7 +525,7 @@ int uda::server::legacyServer(config::Config& config, ClientBlock client_block, protocol_id = ProtocolId::DataSystem; - if ((err = protocol(server_output, protocol_id, XDR_SEND, nullptr, log_malloc_list, user_defined_type_list, + if ((err = protocol(server_output, protocol_id, XDRStreamDirection::Send, nullptr, log_malloc_list, user_defined_type_list, &data_system, protocolVersion, &log_struct_list, &io_data, private_flags, malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Problem Sending Data System Structure") @@ -538,7 +538,7 @@ int uda::server::legacyServer(config::Config& config, ClientBlock client_block, protocol_id = ProtocolId::SystemConfig; - if ((err = protocol(server_output, protocol_id, XDR_SEND, nullptr, log_malloc_list, user_defined_type_list, + if ((err = protocol(server_output, protocol_id, XDRStreamDirection::Send, nullptr, log_malloc_list, user_defined_type_list, &system_config, protocolVersion, &log_struct_list, &io_data, private_flags, malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Problem Sending System Configuration Structure") @@ -551,7 +551,7 @@ int uda::server::legacyServer(config::Config& config, ClientBlock client_block, protocol_id = ProtocolId::DataSource; - if ((err = protocol(server_output, protocol_id, XDR_SEND, nullptr, log_malloc_list, user_defined_type_list, + if ((err = protocol(server_output, protocol_id, XDRStreamDirection::Send, nullptr, log_malloc_list, user_defined_type_list, &data_source, protocolVersion, &log_struct_list, &io_data, private_flags, malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Problem Sending Data Source Structure") @@ -564,7 +564,7 @@ int uda::server::legacyServer(config::Config& config, ClientBlock client_block, protocol_id = ProtocolId::Signal; - if ((err = protocol(server_output, protocol_id, XDR_SEND, nullptr, log_malloc_list, user_defined_type_list, + if ((err = protocol(server_output, protocol_id, XDRStreamDirection::Send, nullptr, log_malloc_list, user_defined_type_list, &signal_rec, protocolVersion, &log_struct_list, &io_data, private_flags, malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Problem Sending Signal Structure") @@ -577,7 +577,7 @@ int uda::server::legacyServer(config::Config& config, ClientBlock client_block, protocol_id = ProtocolId::SignalDesc; - if ((err = protocol(server_output, protocol_id, XDR_SEND, nullptr, log_malloc_list, user_defined_type_list, + if ((err = protocol(server_output, protocol_id, XDRStreamDirection::Send, nullptr, log_malloc_list, user_defined_type_list, &signal_desc, protocolVersion, &log_struct_list, &io_data, private_flags, malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Problem Sending Signal Description Structure") @@ -592,7 +592,7 @@ int uda::server::legacyServer(config::Config& config, ClientBlock client_block, protocol_id = ProtocolId::NextProtocol; - if ((err = protocol(server_input, protocol_id, XDR_RECEIVE, &next_protocol, log_malloc_list, + if ((err = protocol(server_input, protocol_id, XDRStreamDirection::Receive, &next_protocol, log_malloc_list, user_defined_type_list, nullptr, protocolVersion, &log_struct_list, &io_data, private_flags, malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Problem #2 Receiving Next Protocol ID") @@ -618,7 +618,7 @@ int uda::server::legacyServer(config::Config& config, ClientBlock client_block, protocol_id = ProtocolId::DataBlockList; - if ((err = protocol(server_output, protocol_id, XDR_SEND, nullptr, log_malloc_list, user_defined_type_list, + if ((err = protocol(server_output, protocol_id, XDRStreamDirection::Send, nullptr, log_malloc_list, user_defined_type_list, &data_block, protocolVersion, &log_struct_list, &io_data, private_flags, malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Problem Sending Data Structure") @@ -635,7 +635,7 @@ int uda::server::legacyServer(config::Config& config, ClientBlock client_block, protocol_id = ProtocolId::NextProtocol; - if ((err = protocol(server_input, protocol_id, XDR_RECEIVE, &next_protocol, log_malloc_list, + if ((err = protocol(server_input, protocol_id, XDRStreamDirection::Receive, &next_protocol, log_malloc_list, user_defined_type_list, nullptr, protocolVersion, &log_struct_list, &io_data, private_flags, malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Problem #2a Receiving Next Protocol ID") @@ -663,7 +663,7 @@ int uda::server::legacyServer(config::Config& config, ClientBlock client_block, UDA_LOG(UDA_LOG_DEBUG, "Sending Hierarchical Data Structure to Client") - if ((err = protocol(server_output, protocol_id, XDR_SEND, nullptr, log_malloc_list, user_defined_type_list, + if ((err = protocol(server_output, protocol_id, XDRStreamDirection::Send, nullptr, log_malloc_list, user_defined_type_list, &data_block, protocolVersion, &log_struct_list, &io_data, private_flags, malloc_source)) != 0) { add_error(ErrorType::Code, __func__, err, "Server Side Protocol Error (Opaque Structure Type)"); @@ -697,7 +697,7 @@ int uda::server::legacyServer(config::Config& config, ClientBlock client_block, protocol_id = ProtocolId::NextProtocol; next_protocol = ProtocolId::Start; - if ((err = protocol(server_input, protocol_id, XDR_RECEIVE, &next_protocol, log_malloc_list, user_defined_type_list, + if ((err = protocol(server_input, protocol_id, XDRStreamDirection::Receive, &next_protocol, log_malloc_list, user_defined_type_list, nullptr, protocolVersion, &log_struct_list, &io_data, private_flags, malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Problem #3 Receiving Next Protocol ID") add_error(ErrorType::Code, __func__, err, "Protocol 3 (Server Shutdown) Error"); diff --git a/source/server/udaServer.cpp b/source/server/udaServer.cpp index 40f1a0ed..3f91a200 100644 --- a/source/server/udaServer.cpp +++ b/source/server/udaServer.cpp @@ -277,7 +277,7 @@ int report_to_client(ServerBlock* server_block, DataBlockList* data_block_list, ProtocolId protocol_id = ProtocolId::ServerBlock; - if ((err = protocol2(server_output, protocol_id, XDR_SEND, nullptr, log_malloc_list, user_defined_type_list, + if ((err = protocol2(server_output, protocol_id, XDRStreamDirection::Send, nullptr, log_malloc_list, user_defined_type_list, server_block, protocol_version, log_struct_list, 0, malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Problem Sending Server Data Block #2"); add_error(ErrorType::Code, __func__, err, "Protocol 11 Error (Sending Server Block #2)"); @@ -316,7 +316,7 @@ int report_to_client(ServerBlock* server_block, DataBlockList* data_block_list, protocol_id = ProtocolId::DataSystem; - if ((err = protocol2(server_output, protocol_id, XDR_SEND, nullptr, log_malloc_list, user_defined_type_list, + if ((err = protocol2(server_output, protocol_id, XDRStreamDirection::Send, nullptr, log_malloc_list, user_defined_type_list, &metadata_block->data_system, protocol_version, log_struct_list, 0, malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Problem Sending Data System Structure"); add_error(ErrorType::Code, __func__, err, "Protocol 4 Error"); @@ -328,7 +328,7 @@ int report_to_client(ServerBlock* server_block, DataBlockList* data_block_list, protocol_id = ProtocolId::SystemConfig; - if ((err = protocol2(server_output, protocol_id, XDR_SEND, nullptr, log_malloc_list, user_defined_type_list, + if ((err = protocol2(server_output, protocol_id, XDRStreamDirection::Send, nullptr, log_malloc_list, user_defined_type_list, &metadata_block->system_config, protocol_version, log_struct_list, 0, malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Problem Sending System Configuration Structure"); @@ -341,7 +341,7 @@ int report_to_client(ServerBlock* server_block, DataBlockList* data_block_list, protocol_id = ProtocolId::DataSource; - if ((err = protocol2(server_output, protocol_id, XDR_SEND, nullptr, log_malloc_list, user_defined_type_list, + if ((err = protocol2(server_output, protocol_id, XDRStreamDirection::Send, nullptr, log_malloc_list, user_defined_type_list, &metadata_block->data_source, protocol_version, log_struct_list, 0, malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Problem Sending Data Source Structure"); add_error(ErrorType::Code, __func__, err, "Protocol 6 Error"); @@ -353,7 +353,7 @@ int report_to_client(ServerBlock* server_block, DataBlockList* data_block_list, protocol_id = ProtocolId::Signal; - if ((err = protocol2(server_output, protocol_id, XDR_SEND, nullptr, log_malloc_list, user_defined_type_list, + if ((err = protocol2(server_output, protocol_id, XDRStreamDirection::Send, nullptr, log_malloc_list, user_defined_type_list, &metadata_block->signal_rec, protocol_version, log_struct_list, 0, malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Problem Sending Signal Structure"); add_error(ErrorType::Code, __func__, err, "Protocol 7 Error"); @@ -365,7 +365,7 @@ int report_to_client(ServerBlock* server_block, DataBlockList* data_block_list, protocol_id = ProtocolId::SignalDesc; - if ((err = protocol2(server_output, protocol_id, XDR_SEND, nullptr, log_malloc_list, user_defined_type_list, + if ((err = protocol2(server_output, protocol_id, XDRStreamDirection::Send, nullptr, log_malloc_list, user_defined_type_list, &metadata_block->signal_desc, protocol_version, log_struct_list, 0, malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Problem Sending Signal Description Structure"); add_error(ErrorType::Code, __func__, err, "Protocol 8 Error"); @@ -390,7 +390,7 @@ int report_to_client(ServerBlock* server_block, DataBlockList* data_block_list, } } - if ((err = protocol2(server_output, ProtocolId::DataBlockList, XDR_SEND, nullptr, log_malloc_list, + if ((err = protocol2(server_output, ProtocolId::DataBlockList, XDRStreamDirection::Send, nullptr, log_malloc_list, user_defined_type_list, data_block_list, protocol_version, log_struct_list, 0, malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Problem Sending Data Structure"); @@ -428,7 +428,7 @@ int report_to_client(ServerBlock* server_block, DataBlockList* data_block_list, UDA_LOG(UDA_LOG_DEBUG, "Sending Hierarchical Data Structure to Client"); - if ((err = protocol2(server_output, protocol_id, XDR_SEND, nullptr, log_malloc_list, user_defined_type_list, + if ((err = protocol2(server_output, protocol_id, XDRStreamDirection::Send, nullptr, log_malloc_list, user_defined_type_list, data_block, protocol_version, log_struct_list, 0, malloc_source)) != 0) { add_error(ErrorType::Code, __func__, err, "Server Side Protocol Error (Opaque Structure Type)"); return err; @@ -470,7 +470,7 @@ int handle_request(Config& config, RequestBlock* request_block, ClientBlock* cli ProtocolId protocol_id = ProtocolId::ClientBlock; - if ((err = protocol2(server_input, protocol_id, XDR_RECEIVE, nullptr, log_malloc_list, user_defined_type_list, + if ((err = protocol2(server_input, protocol_id, XDRStreamDirection::Receive, nullptr, log_malloc_list, user_defined_type_list, client_block, protocol_version, log_struct_list, 0, malloc_source)) != 0) { if (server_tot_block_time >= 1000 * *server_timeout) { *fatal = 1; @@ -550,7 +550,7 @@ int handle_request(Config& config, RequestBlock* request_block, ClientBlock* cli // Errors: Fatal to Data Access // Pass Back and Await Client Instruction - if ((err = protocol2(server_input, ProtocolId::RequestBlock, XDR_RECEIVE, nullptr, log_malloc_list, + if ((err = protocol2(server_input, ProtocolId::RequestBlock, XDRStreamDirection::Receive, nullptr, log_malloc_list, user_defined_type_list, request_block, protocol_version, log_struct_list, private_flags, malloc_source)) != 0) { UDA_THROW_ERROR(err, "Protocol 1 Error (Receiving Client Request)"); @@ -769,7 +769,7 @@ int handle_request(Config& config, RequestBlock* request_block, ClientBlock* cli init_put_data_block_list(&request->putDataBlockList); if (request->put) { - if ((err = protocol2(server_input, ProtocolId::PutdataBlockList, XDR_RECEIVE, nullptr, log_malloc_list, + if ((err = protocol2(server_input, ProtocolId::PutdataBlockList, XDRStreamDirection::Receive, nullptr, log_malloc_list, user_defined_type_list, &request->putDataBlockList, protocol_version, log_struct_list, private_flags, malloc_source)) != 0) { UDA_THROW_ERROR(err, "Protocol 1 Error (Receiving Client putDataBlockList)"); @@ -1135,7 +1135,7 @@ int handshake_client(Config& config, ClientBlock* client_block, ServerBlock* ser ProtocolId protocol_id = ProtocolId::ClientBlock; // Recieve Client Block - if ((err = protocol2(server_input, protocol_id, XDR_RECEIVE, nullptr, log_malloc_list, user_defined_type_list, + if ((err = protocol2(server_input, protocol_id, XDRStreamDirection::Receive, nullptr, log_malloc_list, user_defined_type_list, client_block, protocol_version, log_struct_list, 0, malloc_source)) != 0) { add_error(ErrorType::Code, __func__, err, "Protocol 10 Error (Client Block)"); UDA_LOG(UDA_LOG_DEBUG, "protocol error! Client Block not received!"); @@ -1176,7 +1176,7 @@ int handshake_client(Config& config, ClientBlock* client_block, ServerBlock* ser ProtocolId protocol_id = ProtocolId::ServerBlock; // Receive Server Block: Server Aknowledgement - if ((err = protocol2(server_output, protocol_id, XDR_SEND, nullptr, log_malloc_list, user_defined_type_list, + if ((err = protocol2(server_output, protocol_id, XDRStreamDirection::Send, nullptr, log_malloc_list, user_defined_type_list, server_block, protocol_version, log_struct_list, 0, malloc_source)) != 0) { UDA_THROW_ERROR(err, "Protocol 11 Error (Server Block #1)"); } diff --git a/source/server2/xdr_protocol.cpp b/source/server2/xdr_protocol.cpp index f3e75741..065b2971 100644 --- a/source/server2/xdr_protocol.cpp +++ b/source/server2/xdr_protocol.cpp @@ -225,7 +225,7 @@ int uda::server::XdrProtocol::read_client_block(ClientBlock* client_block, LogMa ProtocolId protocol_id = ProtocolId::ClientBlock; // Recieve Client Block - if ((err = protocol2(&_server_input, protocol_id, XDR_RECEIVE, nullptr, log_malloc_list, user_defined_type_list, + if ((err = protocol2(&_server_input, protocol_id, XDRStreamDirection::Receive, nullptr, log_malloc_list, user_defined_type_list, client_block, _protocol_version, &_log_struct_list, 0, _malloc_source)) != 0) { add_error(ErrorType::Code, __func__, err, "Protocol 10 Error (Client Block)"); UDA_LOG(UDA_LOG_DEBUG, "protocol error! Client Block not received!"); @@ -251,7 +251,7 @@ int uda::server::XdrProtocol::send_server_block(ServerBlock server_block, LogMal ProtocolId protocol_id = ProtocolId::ServerBlock; // Receive Server Block: Server Aknowledgement int err; - if ((err = protocol2(&_server_output, protocol_id, XDR_SEND, nullptr, log_malloc_list, user_defined_type_list, + if ((err = protocol2(&_server_output, protocol_id, XDRStreamDirection::Send, nullptr, log_malloc_list, user_defined_type_list, (void*)&server_block, _protocol_version, &_log_struct_list, 0, _malloc_source)) != 0) { UDA_THROW_ERROR(err, "Protocol 11 Error (Server Block #1)"); } @@ -285,7 +285,7 @@ int uda::server::XdrProtocol::send_meta_data(MetadataBlock& metadata_block, LogM ProtocolId protocol_id = ProtocolId::DataSystem; int err = 0; - if ((err = protocol2(&_server_output, protocol_id, XDR_SEND, nullptr, log_malloc_list, user_defined_type_list, + if ((err = protocol2(&_server_output, protocol_id, XDRStreamDirection::Send, nullptr, log_malloc_list, user_defined_type_list, &metadata_block.data_system, _protocol_version, &_log_struct_list, 0, _malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Problem Sending Data System Structure"); add_error(ErrorType::Code, __func__, err, "Protocol 4 Error"); @@ -297,7 +297,7 @@ int uda::server::XdrProtocol::send_meta_data(MetadataBlock& metadata_block, LogM protocol_id = ProtocolId::SystemConfig; - if ((err = protocol2(&_server_output, protocol_id, XDR_SEND, nullptr, log_malloc_list, user_defined_type_list, + if ((err = protocol2(&_server_output, protocol_id, XDRStreamDirection::Send, nullptr, log_malloc_list, user_defined_type_list, &metadata_block.system_config, _protocol_version, &_log_struct_list, 0, _malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Problem Sending System Configuration Structure"); @@ -310,7 +310,7 @@ int uda::server::XdrProtocol::send_meta_data(MetadataBlock& metadata_block, LogM protocol_id = ProtocolId::DataSource; - if ((err = protocol2(&_server_output, protocol_id, XDR_SEND, nullptr, log_malloc_list, user_defined_type_list, + if ((err = protocol2(&_server_output, protocol_id, XDRStreamDirection::Send, nullptr, log_malloc_list, user_defined_type_list, &metadata_block.data_source, _protocol_version, &_log_struct_list, 0, _malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Problem Sending Data Source Structure"); add_error(ErrorType::Code, __func__, err, "Protocol 6 Error"); @@ -322,7 +322,7 @@ int uda::server::XdrProtocol::send_meta_data(MetadataBlock& metadata_block, LogM protocol_id = ProtocolId::Signal; - if ((err = protocol2(&_server_output, protocol_id, XDR_SEND, nullptr, log_malloc_list, user_defined_type_list, + if ((err = protocol2(&_server_output, protocol_id, XDRStreamDirection::Send, nullptr, log_malloc_list, user_defined_type_list, &metadata_block.signal_rec, _protocol_version, &_log_struct_list, 0, _malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Problem Sending Signal Structure"); add_error(ErrorType::Code, __func__, err, "Protocol 7 Error"); @@ -334,7 +334,7 @@ int uda::server::XdrProtocol::send_meta_data(MetadataBlock& metadata_block, LogM protocol_id = ProtocolId::SignalDesc; - if ((err = protocol2(&_server_output, protocol_id, XDR_SEND, nullptr, log_malloc_list, user_defined_type_list, + if ((err = protocol2(&_server_output, protocol_id, XDRStreamDirection::Send, nullptr, log_malloc_list, user_defined_type_list, &metadata_block.signal_desc, _protocol_version, &_log_struct_list, 0, _malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Problem Sending Signal Description Structure"); add_error(ErrorType::Code, __func__, err, "Protocol 8 Error"); @@ -355,7 +355,7 @@ int uda::server::XdrProtocol::send_data_blocks(const std::vector& dat data_block_list.data = const_cast(data_blocks.data()); int err = 0; - if ((err = protocol2(&_server_output, ProtocolId::DataBlockList, XDR_SEND, nullptr, log_malloc_list, + if ((err = protocol2(&_server_output, ProtocolId::DataBlockList, XDRStreamDirection::Send, nullptr, log_malloc_list, user_defined_type_list, (void*)&data_block_list, _protocol_version, &_log_struct_list, 0, _malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Problem Sending Data Structure"); @@ -385,7 +385,7 @@ int uda::server::XdrProtocol::send_hierachical_data(const DataBlock& data_block, UDA_LOG(UDA_LOG_DEBUG, "Sending Hierarchical Data Structure to Client"); int err = 0; - if ((err = protocol2(&_server_output, protocol_id, XDR_SEND, nullptr, log_malloc_list, user_defined_type_list, + if ((err = protocol2(&_server_output, protocol_id, XDRStreamDirection::Send, nullptr, log_malloc_list, user_defined_type_list, (void*)&data_block, _protocol_version, &_log_struct_list, 0, _malloc_source)) != 0) { add_error(ErrorType::Code, __func__, err, "Server Side Protocol Error (Opaque Structure Type)"); return err; @@ -412,7 +412,7 @@ int uda::server::XdrProtocol::recv_client_block(ServerBlock& server_block, Clien ProtocolId protocol_id = ProtocolId::ClientBlock; int err = 0; - if ((err = protocol2(&_server_input, protocol_id, XDR_RECEIVE, nullptr, log_malloc_list, user_defined_type_list, + if ((err = protocol2(&_server_input, protocol_id, XDRStreamDirection::Receive, nullptr, log_malloc_list, user_defined_type_list, client_block, _protocol_version, &_log_struct_list, 0, _malloc_source)) != 0) { if (server_tot_block_time >= 1000 * *server_timeout) { *fatal = true; @@ -441,7 +441,7 @@ int uda::server::XdrProtocol::recv_request_block(RequestBlock* request_block, Lo UserDefinedTypeList* user_defined_type_list) { int err = 0; - if ((err = protocol2(&_server_input, ProtocolId::RequestBlock, XDR_RECEIVE, nullptr, log_malloc_list, + if ((err = protocol2(&_server_input, ProtocolId::RequestBlock, XDRStreamDirection::Receive, nullptr, log_malloc_list, user_defined_type_list, request_block, _protocol_version, &_log_struct_list, _private_flags, _malloc_source)) != 0) { UDA_THROW_ERROR(err, "Protocol 1 Error (Receiving Client Request)"); @@ -456,7 +456,7 @@ int uda::server::XdrProtocol::recv_putdata_block_list(client_server::PutDataBloc UserDefinedTypeList* user_defined_type_list) { int err = 0; - if ((err = protocol2(&_server_input, ProtocolId::PutdataBlockList, XDR_RECEIVE, nullptr, log_malloc_list, + if ((err = protocol2(&_server_input, ProtocolId::PutdataBlockList, XDRStreamDirection::Receive, nullptr, log_malloc_list, user_defined_type_list, putdata_block_list, _protocol_version, &_log_struct_list, _private_flags, _malloc_source)) != 0) { UDA_THROW_ERROR(err, "Protocol 1 Error (Receiving Client putDataBlockList)");