ua_pubsub_manager.c 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  4. *
  5. * Copyright (c) 2017-2018 Fraunhofer IOSB (Author: Andreas Ebner)
  6. * Copyright (c) 2018 Fraunhofer IOSB (Author: Julius Pfrommer)
  7. */
  8. #include "server/ua_server_internal.h"
  9. #include "ua_pubsub_ns0.h"
  10. #ifdef UA_ENABLE_PUBSUB /* conditional compilation */
  11. #define UA_DATETIMESTAMP_2000 125911584000000000
  12. UA_StatusCode
  13. UA_Server_addPubSubConnection(UA_Server *server,
  14. const UA_PubSubConnectionConfig *connectionConfig,
  15. UA_NodeId *connectionIdentifier) {
  16. /* Find the matching UA_PubSubTransportLayers */
  17. UA_PubSubTransportLayer *tl = NULL;
  18. for(size_t i = 0; i < server->config.pubsubTransportLayersSize; i++) {
  19. if(connectionConfig &&
  20. UA_String_equal(&server->config.pubsubTransportLayers[i].transportProfileUri,
  21. &connectionConfig->transportProfileUri)) {
  22. tl = &server->config.pubsubTransportLayers[i];
  23. }
  24. }
  25. if(!tl) {
  26. UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER,
  27. "PubSub Connection creation failed. Requested transport layer not found.");
  28. return UA_STATUSCODE_BADNOTFOUND;
  29. }
  30. /* Create a copy of the connection config */
  31. UA_PubSubConnectionConfig *tmpConnectionConfig = (UA_PubSubConnectionConfig *)
  32. UA_calloc(1, sizeof(UA_PubSubConnectionConfig));
  33. if(!tmpConnectionConfig){
  34. UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER,
  35. "PubSub Connection creation failed. Out of Memory.");
  36. return UA_STATUSCODE_BADOUTOFMEMORY;
  37. }
  38. UA_StatusCode retval = UA_PubSubConnectionConfig_copy(connectionConfig, tmpConnectionConfig);
  39. if(retval != UA_STATUSCODE_GOOD){
  40. UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER,
  41. "PubSub Connection creation failed. Could not copy the config.");
  42. return retval;
  43. }
  44. /* Create new connection and add to UA_PubSubManager */
  45. UA_PubSubConnection *newConnectionsField = (UA_PubSubConnection *)
  46. UA_realloc(server->pubSubManager.connections,
  47. sizeof(UA_PubSubConnection) * (server->pubSubManager.connectionsSize + 1));
  48. if(!newConnectionsField) {
  49. UA_PubSubConnectionConfig_clear(tmpConnectionConfig);
  50. UA_free(tmpConnectionConfig);
  51. UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER,
  52. "PubSub Connection creation failed. Out of Memory.");
  53. return UA_STATUSCODE_BADOUTOFMEMORY;
  54. }
  55. server->pubSubManager.connections = newConnectionsField;
  56. server->pubSubManager.connectionsSize++;
  57. UA_PubSubConnection *newConnection =
  58. &server->pubSubManager.connections[server->pubSubManager.connectionsSize-1];
  59. /* Initialize the new connection */
  60. memset(newConnection, 0, sizeof(UA_PubSubConnection));
  61. LIST_INIT(&newConnection->writerGroups);
  62. //workaround - fixing issue with queue.h and realloc.
  63. for(size_t n = 0; n < server->pubSubManager.connectionsSize; n++){
  64. if(server->pubSubManager.connections[n].writerGroups.lh_first){
  65. server->pubSubManager.connections[n].writerGroups.lh_first->listEntry.le_prev = &server->pubSubManager.connections[n].writerGroups.lh_first;
  66. }
  67. }
  68. newConnection->config = tmpConnectionConfig;
  69. /* Open the channel */
  70. newConnection->channel = tl->createPubSubChannel(newConnection->config);
  71. if(!newConnection->channel) {
  72. UA_PubSubConnection_clear(server, newConnection);
  73. server->pubSubManager.connectionsSize--;
  74. /* Keep the realloced (longer) array if entries remain */
  75. if(server->pubSubManager.connectionsSize == 0) {
  76. UA_free(server->pubSubManager.connections);
  77. server->pubSubManager.connections = NULL;
  78. }
  79. UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER,
  80. "PubSub Connection creation failed. Transport layer creation problem.");
  81. return UA_STATUSCODE_BADINTERNALERROR;
  82. }
  83. UA_PubSubManager_generateUniqueNodeId(server, &newConnection->identifier);
  84. if(connectionIdentifier)
  85. UA_NodeId_copy(&newConnection->identifier, connectionIdentifier);
  86. /* update all writerGroups and set new PTR */
  87. for(size_t i = 0; i < server->pubSubManager.connectionsSize; i++){
  88. UA_WriterGroup *wg;
  89. LIST_FOREACH(wg, &server->pubSubManager.connections[i].writerGroups, listEntry){
  90. UA_PubSubConnection *connection = UA_PubSubConnection_findConnectionbyId(server, wg->linkedConnection);
  91. /* TODO Check if the value is null -> how can we ensure consistency in this case? */
  92. if(connection)
  93. wg->linkedConnectionPtr = connection;
  94. }
  95. }
  96. #ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL
  97. addPubSubConnectionRepresentation(server, newConnection);
  98. #endif
  99. return UA_STATUSCODE_GOOD;
  100. }
  101. UA_StatusCode
  102. UA_Server_removePubSubConnection(UA_Server *server, const UA_NodeId connection) {
  103. //search the identified Connection and store the Connection index
  104. size_t connectionIndex;
  105. UA_PubSubConnection *currentConnection = NULL;
  106. for(connectionIndex = 0; connectionIndex < server->pubSubManager.connectionsSize; connectionIndex++){
  107. if(UA_NodeId_equal(&connection, &server->pubSubManager.connections[connectionIndex].identifier)){
  108. currentConnection = &server->pubSubManager.connections[connectionIndex];
  109. break;
  110. }
  111. }
  112. if(!currentConnection)
  113. return UA_STATUSCODE_BADNOTFOUND;
  114. #ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL
  115. removePubSubConnectionRepresentation(server, currentConnection);
  116. #endif
  117. UA_PubSubConnection_clear(server, currentConnection);
  118. server->pubSubManager.connectionsSize--;
  119. //remove the connection from the pubSubManager, move the last connection
  120. //into the allocated memory of the deleted connection
  121. if(server->pubSubManager.connectionsSize != connectionIndex){
  122. memcpy(&server->pubSubManager.connections[connectionIndex],
  123. &server->pubSubManager.connections[server->pubSubManager.connectionsSize],
  124. sizeof(UA_PubSubConnection));
  125. }
  126. if(server->pubSubManager.connectionsSize <= 0){
  127. UA_free(server->pubSubManager.connections);
  128. server->pubSubManager.connections = NULL;
  129. } else {
  130. server->pubSubManager.connections = (UA_PubSubConnection *)
  131. UA_realloc(server->pubSubManager.connections, sizeof(UA_PubSubConnection) * server->pubSubManager.connectionsSize);
  132. if(!server->pubSubManager.connections){
  133. return UA_STATUSCODE_BADINTERNALERROR;
  134. }
  135. //workaround - fixing issue with queue.h and realloc.
  136. for(size_t n = 0; n < server->pubSubManager.connectionsSize; n++){
  137. if(server->pubSubManager.connections[n].writerGroups.lh_first){
  138. server->pubSubManager.connections[n].writerGroups.lh_first->listEntry.le_prev = &server->pubSubManager.connections[n].writerGroups.lh_first;
  139. }
  140. }
  141. /* update all writerGroups and set new PTR */
  142. for(size_t i = 0; i < server->pubSubManager.connectionsSize; i++){
  143. UA_WriterGroup *wg;
  144. LIST_FOREACH(wg, &server->pubSubManager.connections[i].writerGroups, listEntry){
  145. UA_PubSubConnection *tmp_connection = UA_PubSubConnection_findConnectionbyId(server, wg->linkedConnection);
  146. /* TODO Check if the value is null -> how can we ensure consistency in this case? */
  147. if(tmp_connection)
  148. wg->linkedConnectionPtr = tmp_connection;
  149. }
  150. }
  151. }
  152. return UA_STATUSCODE_GOOD;
  153. }
  154. UA_AddPublishedDataSetResult
  155. UA_Server_addPublishedDataSet(UA_Server *server, const UA_PublishedDataSetConfig *publishedDataSetConfig,
  156. UA_NodeId *pdsIdentifier) {
  157. UA_AddPublishedDataSetResult result = {UA_STATUSCODE_BADINVALIDARGUMENT, 0, NULL, {0, 0}};
  158. if(!publishedDataSetConfig){
  159. UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER,
  160. "PublishedDataSet creation failed. No config passed in.");
  161. return result;
  162. }
  163. if(publishedDataSetConfig->publishedDataSetType != UA_PUBSUB_DATASET_PUBLISHEDITEMS){
  164. UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER,
  165. "PublishedDataSet creation failed. Unsupported PublishedDataSet type.");
  166. return result;
  167. }
  168. //deep copy the given connection config
  169. UA_PublishedDataSetConfig tmpPublishedDataSetConfig;
  170. memset(&tmpPublishedDataSetConfig, 0, sizeof(UA_PublishedDataSetConfig));
  171. if(UA_PublishedDataSetConfig_copy(publishedDataSetConfig, &tmpPublishedDataSetConfig) != UA_STATUSCODE_GOOD){
  172. UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER,
  173. "PublishedDataSet creation failed. Configuration copy failed.");
  174. result.addResult = UA_STATUSCODE_BADINTERNALERROR;
  175. return result;
  176. }
  177. //create new PDS and add to UA_PubSubManager
  178. UA_PublishedDataSet *newPubSubDataSetField = (UA_PublishedDataSet *)
  179. UA_realloc(server->pubSubManager.publishedDataSets,
  180. sizeof(UA_PublishedDataSet) * (server->pubSubManager.publishedDataSetsSize + 1));
  181. if(!newPubSubDataSetField) {
  182. UA_PublishedDataSetConfig_clear(&tmpPublishedDataSetConfig);
  183. UA_LOG_ERROR(&server->config.logger, UA_LOGCATEGORY_SERVER,
  184. "PublishedDataSet creation failed. Out of Memory.");
  185. result.addResult = UA_STATUSCODE_BADOUTOFMEMORY;
  186. return result;
  187. }
  188. server->pubSubManager.publishedDataSets = newPubSubDataSetField;
  189. UA_PublishedDataSet *newPubSubDataSet = &server->pubSubManager.publishedDataSets[(server->pubSubManager.publishedDataSetsSize)];
  190. memset(newPubSubDataSet, 0, sizeof(UA_PublishedDataSet));
  191. TAILQ_INIT(&newPubSubDataSet->fields);
  192. //workaround - fixing issue with queue.h and realloc.
  193. for(size_t n = 0; n < server->pubSubManager.publishedDataSetsSize; n++){
  194. if(server->pubSubManager.publishedDataSets[n].fields.tqh_first){
  195. server->pubSubManager.publishedDataSets[n].fields.tqh_first->listEntry.tqe_prev = &server->pubSubManager.publishedDataSets[n].fields.tqh_first;
  196. }
  197. }
  198. newPubSubDataSet->config = tmpPublishedDataSetConfig;
  199. if(tmpPublishedDataSetConfig.publishedDataSetType == UA_PUBSUB_DATASET_PUBLISHEDITEMS_TEMPLATE){
  200. //parse template config and add fields (later PubSub batch)
  201. }
  202. //generate unique nodeId
  203. UA_PubSubManager_generateUniqueNodeId(server, &newPubSubDataSet->identifier);
  204. if(pdsIdentifier != NULL){
  205. UA_NodeId_copy(&newPubSubDataSet->identifier, pdsIdentifier);
  206. }
  207. result.addResult = UA_STATUSCODE_GOOD;
  208. result.fieldAddResults = NULL;
  209. result.fieldAddResultsSize = 0;
  210. //fill the DataSetMetaData
  211. switch(tmpPublishedDataSetConfig.publishedDataSetType){
  212. case UA_PUBSUB_DATASET_PUBLISHEDITEMS_TEMPLATE:
  213. if(UA_DataSetMetaDataType_copy(&tmpPublishedDataSetConfig.config.itemsTemplate.metaData,
  214. &newPubSubDataSet->dataSetMetaData) != UA_STATUSCODE_GOOD){
  215. UA_Server_removeDataSetField(server, newPubSubDataSet->identifier);
  216. result.addResult = UA_STATUSCODE_BADINTERNALERROR;
  217. }
  218. break;
  219. case UA_PUBSUB_DATASET_PUBLISHEDEVENTS_TEMPLATE:
  220. if(UA_DataSetMetaDataType_copy(&tmpPublishedDataSetConfig.config.eventTemplate.metaData,
  221. &newPubSubDataSet->dataSetMetaData) != UA_STATUSCODE_GOOD){
  222. UA_Server_removeDataSetField(server, newPubSubDataSet->identifier);
  223. result.addResult = UA_STATUSCODE_BADINTERNALERROR;
  224. }
  225. break;
  226. case UA_PUBSUB_DATASET_PUBLISHEDEVENTS:
  227. newPubSubDataSet->dataSetMetaData.configurationVersion.majorVersion = UA_PubSubConfigurationVersionTimeDifference();
  228. newPubSubDataSet->dataSetMetaData.configurationVersion.minorVersion = UA_PubSubConfigurationVersionTimeDifference();
  229. newPubSubDataSet->dataSetMetaData.dataSetClassId = UA_GUID_NULL;
  230. if(UA_String_copy(&tmpPublishedDataSetConfig.name, &newPubSubDataSet->dataSetMetaData.name) != UA_STATUSCODE_GOOD){
  231. UA_Server_removeDataSetField(server, newPubSubDataSet->identifier);
  232. result.addResult = UA_STATUSCODE_BADINTERNALERROR;
  233. }
  234. newPubSubDataSet->dataSetMetaData.description = UA_LOCALIZEDTEXT_ALLOC("", "");
  235. break;
  236. case UA_PUBSUB_DATASET_PUBLISHEDITEMS:
  237. newPubSubDataSet->dataSetMetaData.configurationVersion.majorVersion = UA_PubSubConfigurationVersionTimeDifference();
  238. newPubSubDataSet->dataSetMetaData.configurationVersion.minorVersion = UA_PubSubConfigurationVersionTimeDifference();
  239. if(UA_String_copy(&tmpPublishedDataSetConfig.name, &newPubSubDataSet->dataSetMetaData.name) != UA_STATUSCODE_GOOD){
  240. UA_Server_removeDataSetField(server, newPubSubDataSet->identifier);
  241. result.addResult = UA_STATUSCODE_BADINTERNALERROR;
  242. }
  243. newPubSubDataSet->dataSetMetaData.description = UA_LOCALIZEDTEXT_ALLOC("", "");
  244. newPubSubDataSet->dataSetMetaData.dataSetClassId = UA_GUID_NULL;
  245. break;
  246. }
  247. server->pubSubManager.publishedDataSetsSize++;
  248. result.configurationVersion.majorVersion = UA_PubSubConfigurationVersionTimeDifference();
  249. result.configurationVersion.minorVersion = UA_PubSubConfigurationVersionTimeDifference();
  250. #ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL
  251. addPublishedDataItemsRepresentation(server, newPubSubDataSet);
  252. #endif
  253. return result;
  254. }
  255. UA_StatusCode
  256. UA_Server_removePublishedDataSet(UA_Server *server, const UA_NodeId pds) {
  257. //search the identified PublishedDataSet and store the PDS index
  258. UA_PublishedDataSet *publishedDataSet = NULL;
  259. size_t publishedDataSetIndex;
  260. for(publishedDataSetIndex = 0; publishedDataSetIndex < server->pubSubManager.publishedDataSetsSize; publishedDataSetIndex++){
  261. if(UA_NodeId_equal(&server->pubSubManager.publishedDataSets[publishedDataSetIndex].identifier, &pds)){
  262. publishedDataSet = &server->pubSubManager.publishedDataSets[publishedDataSetIndex];
  263. break;
  264. }
  265. }
  266. if(!publishedDataSet){
  267. return UA_STATUSCODE_BADNOTFOUND;
  268. }
  269. if(publishedDataSet->config.configurationFrozen){
  270. UA_LOG_WARNING(&server->config.logger, UA_LOGCATEGORY_SERVER,
  271. "Remove PublishedDataSet failed. PublishedDataSet is frozen.");
  272. return UA_STATUSCODE_BADCONFIGURATIONERROR;
  273. }
  274. //search for referenced writers -> delete this writers. (Standard: writer must be connected with PDS)
  275. for(size_t i = 0; i < server->pubSubManager.connectionsSize; i++){
  276. UA_WriterGroup *writerGroup;
  277. LIST_FOREACH(writerGroup, &server->pubSubManager.connections[i].writerGroups, listEntry){
  278. UA_DataSetWriter *currentWriter, *tmpWriterGroup;
  279. LIST_FOREACH_SAFE(currentWriter, &writerGroup->writers, listEntry, tmpWriterGroup){
  280. if(UA_NodeId_equal(&currentWriter->connectedDataSet, &publishedDataSet->identifier)){
  281. UA_Server_removeDataSetWriter(server, currentWriter->identifier);
  282. }
  283. }
  284. }
  285. }
  286. #ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL
  287. removePublishedDataSetRepresentation(server, publishedDataSet);
  288. #endif
  289. UA_PublishedDataSet_clear(server, publishedDataSet);
  290. server->pubSubManager.publishedDataSetsSize--;
  291. //copy the last PDS to the removed PDS inside the allocated memory block
  292. if(server->pubSubManager.publishedDataSetsSize != publishedDataSetIndex){
  293. memcpy(&server->pubSubManager.publishedDataSets[publishedDataSetIndex],
  294. &server->pubSubManager.publishedDataSets[server->pubSubManager.publishedDataSetsSize],
  295. sizeof(UA_PublishedDataSet));
  296. }
  297. if(server->pubSubManager.publishedDataSetsSize <= 0){
  298. UA_free(server->pubSubManager.publishedDataSets);
  299. server->pubSubManager.publishedDataSets = NULL;
  300. } else {
  301. server->pubSubManager.publishedDataSets = (UA_PublishedDataSet *)
  302. UA_realloc(server->pubSubManager.publishedDataSets, sizeof(UA_PublishedDataSet) * server->pubSubManager.publishedDataSetsSize);
  303. if(!server->pubSubManager.publishedDataSets){
  304. return UA_STATUSCODE_BADINTERNALERROR;
  305. }
  306. //workaround - fixing issue with queue.h and realloc.
  307. for(size_t n = 0; n < server->pubSubManager.publishedDataSetsSize; n++){
  308. if(server->pubSubManager.publishedDataSets[n].fields.tqh_first){
  309. server->pubSubManager.publishedDataSets[n].fields.tqh_first->listEntry.tqe_prev = &server->pubSubManager.publishedDataSets[n].fields.tqh_first;
  310. }
  311. }
  312. }
  313. return UA_STATUSCODE_GOOD;
  314. }
  315. /* Calculate the time difference between current time and UTC (00:00) on January
  316. * 1, 2000. */
  317. UA_UInt32
  318. UA_PubSubConfigurationVersionTimeDifference() {
  319. UA_UInt32 timeDiffSince2000 = (UA_UInt32) (UA_DateTime_now() - UA_DATETIMESTAMP_2000);
  320. return timeDiffSince2000;
  321. }
  322. /* Generate a new unique NodeId. This NodeId will be used for the information
  323. * model representation of PubSub entities. */
  324. void
  325. UA_PubSubManager_generateUniqueNodeId(UA_Server *server, UA_NodeId *nodeId) {
  326. UA_NodeId newNodeId = UA_NODEID_NUMERIC(0, 0);
  327. UA_Node *newNode = UA_NODESTORE_NEW(server, UA_NODECLASS_OBJECT);
  328. UA_NODESTORE_INSERT(server, newNode, &newNodeId);
  329. UA_NodeId_copy(&newNodeId, nodeId);
  330. }
  331. /* Delete the current PubSub configuration including all nested members. This
  332. * action also delete the configured PubSub transport Layers. */
  333. void
  334. UA_PubSubManager_delete(UA_Server *server, UA_PubSubManager *pubSubManager) {
  335. UA_LOG_INFO(&server->config.logger, UA_LOGCATEGORY_SERVER, "PubSub cleanup was called.");
  336. /* Stop and unfreeze all WriterGroups */
  337. for(size_t i = 0; i < pubSubManager->connectionsSize; i++) {
  338. UA_WriterGroup *writerGroup;
  339. LIST_FOREACH(writerGroup, &pubSubManager->connections[i].writerGroups, listEntry) {
  340. UA_WriterGroup_setPubSubState(server, UA_PUBSUBSTATE_DISABLED, writerGroup);
  341. UA_Server_unfreezeWriterGroupConfiguration(server, writerGroup->identifier);
  342. }
  343. }
  344. //free the currently configured transport layers
  345. UA_free(server->config.pubsubTransportLayers);
  346. server->config.pubsubTransportLayersSize = 0;
  347. //remove Connections and WriterGroups
  348. while(pubSubManager->connectionsSize > 0){
  349. UA_Server_removePubSubConnection(server, pubSubManager->connections[pubSubManager->connectionsSize-1].identifier);
  350. }
  351. while(pubSubManager->publishedDataSetsSize > 0){
  352. UA_Server_removePublishedDataSet(server, pubSubManager->publishedDataSets[pubSubManager->publishedDataSetsSize-1].identifier);
  353. }
  354. }
  355. /***********************************/
  356. /* PubSub Jobs abstraction */
  357. /***********************************/
  358. #ifndef UA_ENABLE_PUBSUB_CUSTOM_PUBLISH_HANDLING
  359. /* If UA_ENABLE_PUBSUB_CUSTOM_PUBLISH_INTERRUPT is enabled, a custom callback
  360. * management must be linked to the application */
  361. UA_StatusCode
  362. UA_PubSubManager_addRepeatedCallback(UA_Server *server, UA_ServerCallback callback,
  363. void *data, UA_Double interval_ms, UA_UInt64 *callbackId) {
  364. return UA_Timer_addRepeatedCallback(&server->timer, (UA_ApplicationCallback)callback,
  365. server, data, interval_ms, callbackId);
  366. }
  367. UA_StatusCode
  368. UA_PubSubManager_changeRepeatedCallbackInterval(UA_Server *server, UA_UInt64 callbackId,
  369. UA_Double interval_ms) {
  370. return UA_Timer_changeRepeatedCallbackInterval(&server->timer, callbackId, interval_ms);
  371. }
  372. void
  373. UA_PubSubManager_removeRepeatedPubSubCallback(UA_Server *server, UA_UInt64 callbackId) {
  374. UA_Timer_removeCallback(&server->timer, callbackId);
  375. }
  376. #endif /* UA_ENABLE_PUBSUB_CUSTOM_PUBLISH_HANDLING */
  377. #endif /* UA_ENABLE_PUBSUB */