evs.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  1. /*
  2. * vi: set autoindent tabstop=4 shiftwidth=4 :
  3. *
  4. * Copyright (c) 2004-2006 MontaVista Software, Inc.
  5. *
  6. * All rights reserved.
  7. *
  8. * Author: Steven Dake (sdake@mvista.com)
  9. *
  10. * This software licensed under BSD license, the text of which follows:
  11. *
  12. * Redistribution and use in source and binary forms, with or without
  13. * modification, are permitted provided that the following conditions are met:
  14. *
  15. * - Redistributions of source code must retain the above copyright notice,
  16. * this list of conditions and the following disclaimer.
  17. * - Redistributions in binary form must reproduce the above copyright notice,
  18. * this list of conditions and the following disclaimer in the documentation
  19. * and/or other materials provided with the distribution.
  20. * - Neither the name of the MontaVista Software, Inc. nor the names of its
  21. * contributors may be used to endorse or promote products derived from this
  22. * software without specific prior written permission.
  23. *
  24. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  25. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  26. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  27. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  28. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  29. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  30. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  31. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  32. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  33. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  34. * THE POSSIBILITY OF SUCH DAMAGE.
  35. */
  36. #include <sys/types.h>
  37. #include <sys/socket.h>
  38. #include <sys/un.h>
  39. #include <sys/sysinfo.h>
  40. #include <sys/ioctl.h>
  41. #include <netinet/in.h>
  42. #include <sys/uio.h>
  43. #include <unistd.h>
  44. #include <fcntl.h>
  45. #include <stdlib.h>
  46. #include <stdio.h>
  47. #include <errno.h>
  48. #include <signal.h>
  49. #include <time.h>
  50. #include <netinet/in.h>
  51. #include <arpa/inet.h>
  52. #include "../include/saAis.h"
  53. #include "../include/ipc_gen.h"
  54. #include "../include/ipc_evs.h"
  55. #include "../include/list.h"
  56. #include "../include/queue.h"
  57. #include "../lcr/lcr_comp.h"
  58. #include "aispoll.h"
  59. #include "totempg.h"
  60. #include "totemip.h"
  61. #include "main.h"
  62. #include "mempool.h"
  63. #include "handlers.h"
  64. #define LOG_SERVICE LOG_SERVICE_EVS
  65. #include "print.h"
  66. enum evs_exec_message_req_types {
  67. MESSAGE_REQ_EXEC_EVS_MCAST = 0
  68. };
  69. /*
  70. * Service Interfaces required by service_message_handler struct
  71. */
  72. static void evs_confchg_fn (
  73. enum totem_configuration_type configuration_type,
  74. struct totem_ip_address *member_list, int member_list_entries,
  75. struct totem_ip_address *left_list, int left_list_entries,
  76. struct totem_ip_address *joined_list, int joined_list_entries,
  77. struct memb_ring_id *ring_id);
  78. static void message_handler_req_exec_mcast (void *message, struct totem_ip_address *source_addr);
  79. static void req_exec_mcast_endian_convert (void *msg);
  80. static void message_handler_req_evs_join (struct conn_info *conn_info, void *message);
  81. static void message_handler_req_evs_leave (struct conn_info *conn_info, void *message);
  82. static void message_handler_req_evs_mcast_joined (struct conn_info *conn_info, void *message);
  83. static void message_handler_req_evs_mcast_groups (struct conn_info *conn_info, void *message);
  84. static void message_handler_req_evs_membership_get (struct conn_info *conn_info, void *message);
  85. static int evs_lib_init_fn (struct conn_info *conn_info);
  86. static int evs_lib_exit_fn (struct conn_info *conn_info);
  87. static struct openais_lib_handler evs_lib_handlers[] =
  88. {
  89. { /* 0 */
  90. .lib_handler_fn = message_handler_req_evs_join,
  91. .response_size = sizeof (struct res_lib_evs_join),
  92. .response_id = MESSAGE_RES_EVS_JOIN,
  93. .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED
  94. },
  95. { /* 1 */
  96. .lib_handler_fn = message_handler_req_evs_leave,
  97. .response_size = sizeof (struct res_lib_evs_leave),
  98. .response_id = MESSAGE_RES_EVS_LEAVE,
  99. .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED
  100. },
  101. { /* 2 */
  102. .lib_handler_fn = message_handler_req_evs_mcast_joined,
  103. .response_size = sizeof (struct res_lib_evs_mcast_joined),
  104. .response_id = MESSAGE_RES_EVS_MCAST_JOINED,
  105. .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED
  106. },
  107. { /* 3 */
  108. .lib_handler_fn = message_handler_req_evs_mcast_groups,
  109. .response_size = sizeof (struct res_lib_evs_mcast_groups),
  110. .response_id = MESSAGE_RES_EVS_MCAST_GROUPS,
  111. .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED
  112. },
  113. { /* 4 */
  114. .lib_handler_fn = message_handler_req_evs_membership_get,
  115. .response_size = sizeof (struct res_lib_evs_membership_get),
  116. .response_id = MESSAGE_RES_EVS_MEMBERSHIP_GET,
  117. .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED
  118. }
  119. };
  120. static struct openais_exec_handler evs_exec_handlers[] =
  121. {
  122. {
  123. .exec_handler_fn = message_handler_req_exec_mcast,
  124. .exec_endian_convert_fn = req_exec_mcast_endian_convert
  125. }
  126. };
  127. struct openais_service_handler evs_service_handler = {
  128. .name = (unsigned char*)"openais extended virtual synchrony service",
  129. .id = EVS_SERVICE,
  130. .lib_init_fn = evs_lib_init_fn,
  131. .lib_exit_fn = evs_lib_exit_fn,
  132. .lib_handlers = evs_lib_handlers,
  133. .lib_handlers_count = sizeof (evs_lib_handlers) / sizeof (struct openais_lib_handler),
  134. .exec_handlers = evs_exec_handlers,
  135. .exec_handlers_count = sizeof (evs_exec_handlers) / sizeof (struct openais_exec_handler),
  136. .confchg_fn = evs_confchg_fn,
  137. .exec_init_fn = NULL,
  138. .exec_dump_fn = NULL
  139. };
  140. static DECLARE_LIST_INIT (confchg_notify);
  141. /*
  142. * Dynamic loading descriptor
  143. */
  144. #ifdef BUILD_DYNAMIC
  145. struct openais_service_handler *evs_get_service_handler_ver0 (void);
  146. struct openais_service_handler_iface_ver0 evs_service_handler_iface = {
  147. .openais_get_service_handler_ver0 = evs_get_service_handler_ver0
  148. };
  149. struct lcr_iface openais_evs_ver0[1] = {
  150. {
  151. .name = "openais_evs",
  152. .version = 0,
  153. .versions_replace = 0,
  154. .versions_replace_count = 0,
  155. .dependencies = 0,
  156. .dependency_count = 0,
  157. .constructor = NULL,
  158. .destructor = NULL,
  159. .interfaces = (void **)&evs_service_handler_iface,
  160. }
  161. };
  162. struct lcr_comp evs_comp_ver0 = {
  163. .iface_count = 1,
  164. .ifaces = openais_evs_ver0
  165. };
  166. int lcr_comp_get (struct lcr_comp **component)
  167. {
  168. *component = &evs_comp_ver0;
  169. return (0);
  170. }
  171. struct openais_service_handler *evs_get_service_handler_ver0 (void)
  172. {
  173. return (&evs_service_handler);
  174. }
  175. #endif /* BUILD_DYNAMIC */
  176. struct res_evs_confchg_callback res_evs_confchg_callback;
  177. static void evs_confchg_fn (
  178. enum totem_configuration_type configuration_type,
  179. struct totem_ip_address *member_list, int member_list_entries,
  180. struct totem_ip_address *left_list, int left_list_entries,
  181. struct totem_ip_address *joined_list, int joined_list_entries,
  182. struct memb_ring_id *ring_id)
  183. {
  184. int i;
  185. struct list_head *list;
  186. struct conn_info *conn_info;
  187. /*
  188. * Build configuration change message
  189. */
  190. res_evs_confchg_callback.header.size = sizeof (struct res_evs_confchg_callback);
  191. res_evs_confchg_callback.header.id = MESSAGE_RES_EVS_CONFCHG_CALLBACK;
  192. res_evs_confchg_callback.header.error = SA_AIS_OK;
  193. for (i = 0; i < member_list_entries; i++) {
  194. totemip_copy((struct totem_ip_address *)&res_evs_confchg_callback.member_list[i],
  195. &member_list[i]);
  196. }
  197. res_evs_confchg_callback.member_list_entries = member_list_entries;
  198. for (i = 0; i < left_list_entries; i++) {
  199. totemip_copy((struct totem_ip_address *)&res_evs_confchg_callback.left_list[i],
  200. &left_list[i]);
  201. }
  202. res_evs_confchg_callback.left_list_entries = left_list_entries;
  203. for (i = 0; i < joined_list_entries; i++) {
  204. totemip_copy((struct totem_ip_address *)&res_evs_confchg_callback.joined_list[i],
  205. &joined_list[i]);
  206. }
  207. res_evs_confchg_callback.joined_list_entries = joined_list_entries;
  208. /*
  209. * Send configuration change message to every EVS library user
  210. */
  211. for (list = confchg_notify.next; list != &confchg_notify; list = list->next) {
  212. conn_info = list_entry (list, struct conn_info, conn_list);
  213. libais_send_response (conn_info, &res_evs_confchg_callback,
  214. sizeof (res_evs_confchg_callback));
  215. }
  216. }
  217. static int evs_lib_init_fn (struct conn_info *conn_info)
  218. {
  219. log_printf (LOG_LEVEL_DEBUG, "Got request to initalize evs service.\n");
  220. list_init (&conn_info->conn_list);
  221. list_add (&conn_info->conn_list, &confchg_notify);
  222. libais_send_response (conn_info, &res_evs_confchg_callback,
  223. sizeof (res_evs_confchg_callback));
  224. return (0);
  225. }
  226. static int evs_lib_exit_fn (struct conn_info *conn_info)
  227. {
  228. list_del (&conn_info->conn_list);
  229. return (0);
  230. }
  231. static void message_handler_req_evs_join (struct conn_info *conn_info, void *message)
  232. {
  233. evs_error_t error = EVS_OK;
  234. struct req_lib_evs_join *req_lib_evs_join = (struct req_lib_evs_join *)message;
  235. struct res_lib_evs_join res_lib_evs_join;
  236. void *addr;
  237. if (req_lib_evs_join->group_entries > 50) {
  238. error = EVS_ERR_TOO_MANY_GROUPS;
  239. goto exit_error;
  240. }
  241. #ifdef DEBUG
  242. { int i;
  243. for (i = 0; i < req_lib_evs_join->group_entries; i++) {
  244. printf ("Joining group %s\n", req_lib_evs_join->groups[i].key);
  245. }
  246. }
  247. #endif
  248. addr = realloc (conn_info->conn_info_partner->ais_ci.u.libevs_ci.groups,
  249. sizeof (struct evs_group) *
  250. (conn_info->conn_info_partner->ais_ci.u.libevs_ci.group_entries +
  251. req_lib_evs_join->group_entries));
  252. if (addr == 0) {
  253. error = SA_AIS_ERR_NO_MEMORY;
  254. goto exit_error;
  255. }
  256. conn_info->conn_info_partner->ais_ci.u.libevs_ci.groups = addr;
  257. memcpy (&conn_info->conn_info_partner->ais_ci.u.libevs_ci.groups[conn_info->conn_info_partner->ais_ci.u.libevs_ci.group_entries],
  258. req_lib_evs_join->groups,
  259. sizeof (struct evs_group) * req_lib_evs_join->group_entries);
  260. conn_info->conn_info_partner->ais_ci.u.libevs_ci.group_entries += req_lib_evs_join->group_entries;
  261. exit_error:
  262. res_lib_evs_join.header.size = sizeof (struct res_lib_evs_join);
  263. res_lib_evs_join.header.id = MESSAGE_RES_EVS_JOIN;
  264. res_lib_evs_join.header.error = error;
  265. libais_send_response (conn_info, &res_lib_evs_join,
  266. sizeof (struct res_lib_evs_join));
  267. }
  268. static void message_handler_req_evs_leave (struct conn_info *conn_info, void *message)
  269. {
  270. struct req_lib_evs_leave *req_lib_evs_leave = (struct req_lib_evs_leave *)message;
  271. struct res_lib_evs_leave res_lib_evs_leave;
  272. evs_error_t error = EVS_OK;
  273. int error_index;
  274. int i, j;
  275. int found;
  276. for (i = 0; i < req_lib_evs_leave->group_entries; i++) {
  277. found = 0;
  278. for (j = 0; j < conn_info->conn_info_partner->ais_ci.u.libevs_ci.group_entries;) {
  279. if (memcmp (&req_lib_evs_leave->groups[i],
  280. &conn_info->conn_info_partner->ais_ci.u.libevs_ci.groups[j],
  281. sizeof (struct evs_group)) == 0) {
  282. /*
  283. * Delete entry
  284. */
  285. memmove (&conn_info->conn_info_partner->ais_ci.u.libevs_ci.groups[j],
  286. &conn_info->conn_info_partner->ais_ci.u.libevs_ci.groups[j + 1],
  287. (conn_info->conn_info_partner->ais_ci.u.libevs_ci.group_entries - j - 1) *
  288. sizeof (struct evs_group));
  289. conn_info->conn_info_partner->ais_ci.u.libevs_ci.group_entries -= 1;
  290. found = 1;
  291. break;
  292. } else {
  293. j++;
  294. }
  295. }
  296. if (found == 0) {
  297. error = EVS_ERR_NOT_EXIST;
  298. error_index = i;
  299. break;
  300. }
  301. }
  302. #ifdef DEBUG
  303. for (i = 0; i < conn_info->conn_info_partner->ais_ci.u.libevs_ci.group_entries; i++) {
  304. printf ("Groups Left %s\n",
  305. &conn_info->conn_info_partner->ais_ci.u.libevs_ci.groups[i].key);
  306. }
  307. #endif
  308. res_lib_evs_leave.header.size = sizeof (struct res_lib_evs_leave);
  309. res_lib_evs_leave.header.id = MESSAGE_RES_EVS_LEAVE;
  310. res_lib_evs_leave.header.error = error;
  311. libais_send_response (conn_info, &res_lib_evs_leave,
  312. sizeof (struct res_lib_evs_leave));
  313. }
  314. static void message_handler_req_evs_mcast_joined (struct conn_info *conn_info, void *message)
  315. {
  316. evs_error_t error = EVS_ERR_TRY_AGAIN;
  317. struct req_lib_evs_mcast_joined *req_lib_evs_mcast_joined = (struct req_lib_evs_mcast_joined *)message;
  318. struct res_lib_evs_mcast_joined res_lib_evs_mcast_joined;
  319. struct iovec req_exec_evs_mcast_iovec[3];
  320. struct req_exec_evs_mcast req_exec_evs_mcast;
  321. int send_ok = 0;
  322. int res;
  323. req_exec_evs_mcast.header.size = sizeof (struct req_exec_evs_mcast) +
  324. conn_info->conn_info_partner->ais_ci.u.libevs_ci.group_entries *
  325. sizeof (struct evs_group) +
  326. req_lib_evs_mcast_joined->msg_len;
  327. req_exec_evs_mcast.header.id =
  328. SERVICE_ID_MAKE (EVS_SERVICE, MESSAGE_REQ_EXEC_EVS_MCAST);
  329. req_exec_evs_mcast.msg_len = req_lib_evs_mcast_joined->msg_len;
  330. req_exec_evs_mcast.group_entries = conn_info->conn_info_partner->ais_ci.u.libevs_ci.group_entries;
  331. req_exec_evs_mcast_iovec[0].iov_base = &req_exec_evs_mcast;
  332. req_exec_evs_mcast_iovec[0].iov_len = sizeof (req_exec_evs_mcast);
  333. req_exec_evs_mcast_iovec[1].iov_base = conn_info->conn_info_partner->ais_ci.u.libevs_ci.groups;
  334. req_exec_evs_mcast_iovec[1].iov_len = conn_info->conn_info_partner->ais_ci.u.libevs_ci.group_entries * sizeof (struct evs_group);
  335. req_exec_evs_mcast_iovec[2].iov_base = &req_lib_evs_mcast_joined->msg;
  336. req_exec_evs_mcast_iovec[2].iov_len = req_lib_evs_mcast_joined->msg_len;
  337. // TODO this doesn't seem to work for some reason
  338. send_ok = totempg_groups_send_ok_joined (openais_group_handle, req_exec_evs_mcast_iovec, 3);
  339. res = totempg_groups_mcast_joined (openais_group_handle, req_exec_evs_mcast_iovec, 3, TOTEMPG_AGREED);
  340. // TODO
  341. if (res == 0) {
  342. error = EVS_OK;
  343. }
  344. res_lib_evs_mcast_joined.header.size = sizeof (struct res_lib_evs_mcast_joined);
  345. res_lib_evs_mcast_joined.header.id = MESSAGE_RES_EVS_MCAST_JOINED;
  346. res_lib_evs_mcast_joined.header.error = error;
  347. libais_send_response (conn_info, &res_lib_evs_mcast_joined,
  348. sizeof (struct res_lib_evs_mcast_joined));
  349. }
  350. static void message_handler_req_evs_mcast_groups (struct conn_info *conn_info, void *message)
  351. {
  352. evs_error_t error = EVS_ERR_TRY_AGAIN;
  353. struct req_lib_evs_mcast_groups *req_lib_evs_mcast_groups = (struct req_lib_evs_mcast_groups *)message;
  354. struct res_lib_evs_mcast_groups res_lib_evs_mcast_groups;
  355. struct iovec req_exec_evs_mcast_iovec[3];
  356. struct req_exec_evs_mcast req_exec_evs_mcast;
  357. char *msg_addr;
  358. int send_ok = 0;
  359. int res;
  360. req_exec_evs_mcast.header.size = sizeof (struct req_exec_evs_mcast) +
  361. sizeof (struct evs_group) * req_lib_evs_mcast_groups->group_entries +
  362. req_lib_evs_mcast_groups->msg_len;
  363. req_exec_evs_mcast.header.id =
  364. SERVICE_ID_MAKE (EVS_SERVICE, MESSAGE_REQ_EXEC_EVS_MCAST);
  365. req_exec_evs_mcast.msg_len = req_lib_evs_mcast_groups->msg_len;
  366. req_exec_evs_mcast.group_entries = req_lib_evs_mcast_groups->group_entries;
  367. msg_addr = (char *)req_lib_evs_mcast_groups +
  368. sizeof (struct req_lib_evs_mcast_groups) +
  369. (sizeof (struct evs_group) * req_lib_evs_mcast_groups->group_entries);
  370. req_exec_evs_mcast_iovec[0].iov_base = &req_exec_evs_mcast;
  371. req_exec_evs_mcast_iovec[0].iov_len = sizeof (req_exec_evs_mcast);
  372. req_exec_evs_mcast_iovec[1].iov_base = &req_lib_evs_mcast_groups->groups;
  373. req_exec_evs_mcast_iovec[1].iov_len = sizeof (struct evs_group) * req_lib_evs_mcast_groups->group_entries;
  374. req_exec_evs_mcast_iovec[2].iov_base = msg_addr;
  375. req_exec_evs_mcast_iovec[2].iov_len = req_lib_evs_mcast_groups->msg_len;
  376. // TODO this is wacky
  377. send_ok = totempg_groups_send_ok_joined (openais_group_handle, req_exec_evs_mcast_iovec, 3);
  378. res = totempg_groups_mcast_joined (openais_group_handle, req_exec_evs_mcast_iovec, 3, TOTEMPG_AGREED);
  379. if (res == 0) {
  380. error = EVS_OK;
  381. }
  382. res_lib_evs_mcast_groups.header.size = sizeof (struct res_lib_evs_mcast_groups);
  383. res_lib_evs_mcast_groups.header.id = MESSAGE_RES_EVS_MCAST_GROUPS;
  384. res_lib_evs_mcast_groups.header.error = error;
  385. libais_send_response (conn_info, &res_lib_evs_mcast_groups,
  386. sizeof (struct res_lib_evs_mcast_groups));
  387. }
  388. static void message_handler_req_evs_membership_get (struct conn_info *conn_info, void *message)
  389. {
  390. struct res_lib_evs_membership_get res_lib_evs_membership_get;
  391. res_lib_evs_membership_get.header.size = sizeof (struct res_lib_evs_membership_get);
  392. res_lib_evs_membership_get.header.id = MESSAGE_RES_EVS_MEMBERSHIP_GET;
  393. res_lib_evs_membership_get.header.error = EVS_OK;
  394. totemip_copy((struct totem_ip_address *)&res_lib_evs_membership_get.local_addr,
  395. this_ip);
  396. memcpy (&res_lib_evs_membership_get.member_list,
  397. &res_evs_confchg_callback.member_list,
  398. sizeof (res_lib_evs_membership_get.member_list));
  399. res_lib_evs_membership_get.member_list_entries =
  400. res_evs_confchg_callback.member_list_entries;
  401. libais_send_response (conn_info, &res_lib_evs_membership_get,
  402. sizeof (struct res_lib_evs_membership_get));
  403. }
  404. static void req_exec_mcast_endian_convert (void *msg)
  405. {
  406. }
  407. static void message_handler_req_exec_mcast (void *message, struct totem_ip_address *source_addr)
  408. {
  409. struct req_exec_evs_mcast *req_exec_evs_mcast = (struct req_exec_evs_mcast *)message;
  410. struct res_evs_deliver_callback res_evs_deliver_callback;
  411. char *msg_addr;
  412. struct conn_info *conn_info;
  413. struct list_head *list;
  414. int found = 0;
  415. int i, j;
  416. res_evs_deliver_callback.header.size = sizeof (struct res_evs_deliver_callback) +
  417. req_exec_evs_mcast->msg_len;
  418. res_evs_deliver_callback.header.id = MESSAGE_RES_EVS_DELIVER_CALLBACK;
  419. res_evs_deliver_callback.header.error = SA_AIS_OK;
  420. res_evs_deliver_callback.msglen = req_exec_evs_mcast->msg_len;
  421. msg_addr = (char *)req_exec_evs_mcast + sizeof (struct req_exec_evs_mcast) +
  422. (sizeof (struct evs_group) * req_exec_evs_mcast->group_entries);
  423. for (list = confchg_notify.next; list != &confchg_notify; list = list->next) {
  424. found = 0;
  425. conn_info = list_entry (list, struct conn_info, conn_list);
  426. for (i = 0; i < conn_info->ais_ci.u.libevs_ci.group_entries; i++) {
  427. for (j = 0; j < req_exec_evs_mcast->group_entries; j++) {
  428. if (memcmp (&conn_info->ais_ci.u.libevs_ci.groups[i],
  429. &req_exec_evs_mcast->groups[j],
  430. sizeof (struct evs_group)) == 0) {
  431. found = 1;
  432. break;
  433. }
  434. }
  435. if (found) {
  436. break;
  437. }
  438. }
  439. if (found) {
  440. totemip_copy((struct totem_ip_address *)&res_evs_deliver_callback.evs_address,
  441. source_addr);
  442. libais_send_response (conn_info, &res_evs_deliver_callback,
  443. sizeof (struct res_evs_deliver_callback));
  444. libais_send_response (conn_info, msg_addr,
  445. req_exec_evs_mcast->msg_len);
  446. }
  447. }
  448. }