Просмотр исходного кода

Add source_addr to exec message handler for event service.

(Logical change 1.45)


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@131 fd59a12c-fef9-0310-b244-a6a79926bd2f
Steven Dake 21 лет назад
Родитель
Сommit
9783e8d172
5 измененных файлов с 45 добавлено и 45 удалено
  1. 13 13
      exec/amf.c
  2. 25 25
      exec/ckpt.c
  3. 4 4
      exec/clm.c
  4. 1 1
      exec/handlers.h
  5. 2 2
      exec/main.c

+ 13 - 13
exec/amf.c

@@ -223,17 +223,17 @@ static int amf_exit_fn (struct conn_info *conn_info);
 
 static int amfExecutiveInitialize (void);
 
-static int message_handler_req_exec_amf_componentregister (void *message);
+static int message_handler_req_exec_amf_componentregister (void *message, struct in_addr source_addr);
 
-static int message_handler_req_exec_amf_componentunregister (void *message);
+static int message_handler_req_exec_amf_componentunregister (void *message, struct in_addr source_addr);
 
-static int message_handler_req_exec_amf_errorreport (void *message);
+static int message_handler_req_exec_amf_errorreport (void *message, struct in_addr source_addr);
 
-static int message_handler_req_exec_amf_errorcancelall (void *message);
+static int message_handler_req_exec_amf_errorcancelall (void *message, struct in_addr source_addr);
 
-static int message_handler_req_exec_amf_readinessstateset (void *message);
+static int message_handler_req_exec_amf_readinessstateset (void *message, struct in_addr source_addr);
 
-static int message_handler_req_exec_amf_hastateset (void *message);
+static int message_handler_req_exec_amf_hastateset (void *message, struct in_addr source_addr);
 
 static int message_handler_req_amf_init (struct conn_info *conn_info, void *message);
 
@@ -276,7 +276,7 @@ int (*amf_libais_handler_fns[]) (struct conn_info *conn_info, void *) = {
 	message_handler_req_amf_componentcapabilitymodelget
 };
 
-int (*amf_aisexec_handler_fns[]) (void *) = {
+int (*amf_aisexec_handler_fns[]) (void *, struct in_addr source_addr) = {
 	message_handler_req_exec_amf_componentregister,
 	message_handler_req_exec_amf_componentunregister,
 	message_handler_req_exec_amf_errorreport,
@@ -1568,7 +1568,7 @@ int amf_exit_fn (struct conn_info *conn_info)
 }
 
 
-static int message_handler_req_exec_amf_componentregister (void *message)
+static int message_handler_req_exec_amf_componentregister (void *message, struct in_addr source_addr)
 {
 	struct req_exec_amf_componentregister *req_exec_amf_componentregister = (struct req_exec_amf_componentregister *)message;
 	struct res_lib_amf_componentregister res_lib_amf_componentregister;
@@ -1666,7 +1666,7 @@ static int message_handler_req_exec_amf_componentregister (void *message)
 	return (0);
 }
 
-static int message_handler_req_exec_amf_componentunregister (void *message)
+static int message_handler_req_exec_amf_componentunregister (void *message, struct in_addr source_addr)
 {
 	struct req_exec_amf_componentunregister *req_exec_amf_componentunregister = (struct req_exec_amf_componentunregister *)message;
 	struct res_lib_amf_componentunregister res_lib_amf_componentunregister;
@@ -1735,7 +1735,7 @@ static int message_handler_req_exec_amf_componentunregister (void *message)
 	return (0);
 }
 
-static int message_handler_req_exec_amf_errorreport (void *message)
+static int message_handler_req_exec_amf_errorreport (void *message, struct in_addr source_addr)
 {
 	struct req_exec_amf_errorreport *req_exec_amf_errorreport = (struct req_exec_amf_errorreport *)message;
 	struct res_lib_amf_errorreport res_lib_amf_errorreport;
@@ -1777,7 +1777,7 @@ static int message_handler_req_exec_amf_errorreport (void *message)
 	return (0);
 }
 
-static int message_handler_req_exec_amf_errorcancelall (void *message)
+static int message_handler_req_exec_amf_errorcancelall (void *message, struct in_addr source_addr)
 {
 	struct req_exec_amf_errorcancelall *req_exec_amf_errorcancelall = (struct req_exec_amf_errorcancelall *)message;
 	struct res_lib_amf_errorcancelall res_lib_amf_errorcancelall;
@@ -1827,7 +1827,7 @@ static int message_handler_req_exec_amf_errorcancelall (void *message)
  * node.  That cluster node API has verified the readiness state, so its time to let
  * the rest of the cluster nodes know about the readiness state change.
  */
-static int message_handler_req_exec_amf_readinessstateset (void *message)
+static int message_handler_req_exec_amf_readinessstateset (void *message, struct in_addr source_addr)
 {
 	struct req_exec_amf_readinessstateset *req_exec_amf_readinessstateset = (struct req_exec_amf_readinessstateset *)message;
 	struct saAmfComponent *component;
@@ -1851,7 +1851,7 @@ static int message_handler_req_exec_amf_readinessstateset (void *message)
  * node.  That cluster node API has verified the ha state, so its time to let
  * the rest of the cluster nodes know about the HA state change.
  */
-static int message_handler_req_exec_amf_hastateset (void *message)
+static int message_handler_req_exec_amf_hastateset (void *message, struct in_addr source_addr)
 {
 	struct req_exec_amf_hastateset *req_exec_amf_hastateset = (struct req_exec_amf_hastateset *)message;
 	struct saAmfComponent *component;

+ 25 - 25
exec/ckpt.c

@@ -63,25 +63,25 @@ static int ckptSectionIteratorApiFinalize (struct conn_info *conn_info);
 
 static int message_handler_req_lib_activatepoll (struct conn_info *, void *message);
 
-static int message_handler_req_exec_ckpt_checkpointopen (void *message);
+static int message_handler_req_exec_ckpt_checkpointopen (void *message, struct in_addr source_addr);
 
-static int message_handler_req_exec_ckpt_checkpointclose (void *message);
+static int message_handler_req_exec_ckpt_checkpointclose (void *message, struct in_addr source_addr);
 
-static int message_handler_req_exec_ckpt_checkpointunlink (void *message);
+static int message_handler_req_exec_ckpt_checkpointunlink (void *message, struct in_addr source_addr);
 
-static int message_handler_req_exec_ckpt_checkpointretentiondurationset (void *message);
+static int message_handler_req_exec_ckpt_checkpointretentiondurationset (void *message, struct in_addr source_addr);
 
-static int message_handler_req_exec_ckpt_sectioncreate (void *message);
+static int message_handler_req_exec_ckpt_sectioncreate (void *message, struct in_addr source_addr);
 
-static int message_handler_req_exec_ckpt_sectiondelete (void *message);
+static int message_handler_req_exec_ckpt_sectiondelete (void *message, struct in_addr source_addr);
 
-static int message_handler_req_exec_ckpt_sectionexpirationtimeset (void *message);
+static int message_handler_req_exec_ckpt_sectionexpirationtimeset (void *message, struct in_addr source_addr);
 
-static int message_handler_req_exec_ckpt_sectionwrite (void *message);
+static int message_handler_req_exec_ckpt_sectionwrite (void *message, struct in_addr source_addr);
 
-static int message_handler_req_exec_ckpt_sectionoverwrite (void *message);
+static int message_handler_req_exec_ckpt_sectionoverwrite (void *message, struct in_addr source_addr);
 
-static int message_handler_req_exec_ckpt_sectionread (void *message);
+static int message_handler_req_exec_ckpt_sectionread (void *message, struct in_addr source_addr);
 
 static int message_handler_req_lib_ckpt_init (struct conn_info *conn_info, void *message);
 
@@ -135,7 +135,7 @@ int (*ckpt_libais_handler_fns[]) (struct conn_info *conn_info, void *) = {
 /*
  * TODO
  */
-int (*ckpt_aisexec_handler_fns[]) (void *) = {
+int (*ckpt_aisexec_handler_fns[]) (void *, struct in_addr source_addr) = {
 };
 
 /*
@@ -144,7 +144,7 @@ int (*ckpt_aisexec_handler_fns[]) (void *) = {
 struct service_handler ckpt_service_handler = {
 	.libais_handler_fns			= ckpt_libais_handler_fns,
 	.libais_handler_fns_count	= sizeof (ckpt_libais_handler_fns) / sizeof (int (*)),
-	.aisexec_handler_fns		= ckpt_aisexec_handler_fns ,
+	.aisexec_handler_fns		= ckpt_aisexec_handler_fns,
 	.aisexec_handler_fns_count	= sizeof (ckpt_aisexec_handler_fns) / sizeof (int (*)),
 	.confchg_fn					= 0, /* ckpt service handler is not distributed */
 	.libais_init_fn				= message_handler_req_lib_ckpt_init,
@@ -170,7 +170,7 @@ static int (*ckpt_checkpoint_libais_handler_fns[]) (struct conn_info *conn_info,
 	message_handler_req_lib_ckpt_checkpointsyncronizeasync
 };
  
-static int (*ckpt_checkpoint_aisexec_handler_fns[]) (void *msg) = {
+static int (*ckpt_checkpoint_aisexec_handler_fns[]) (void *msg, struct in_addr source_addr) = {
 	message_handler_req_exec_ckpt_checkpointopen,
 	message_handler_req_exec_ckpt_checkpointclose,
 	message_handler_req_exec_ckpt_checkpointunlink,
@@ -186,7 +186,7 @@ static int (*ckpt_checkpoint_aisexec_handler_fns[]) (void *msg) = {
 struct service_handler ckpt_checkpoint_service_handler = {
 	.libais_handler_fns			= ckpt_checkpoint_libais_handler_fns,
 	.libais_handler_fns_count	= sizeof (ckpt_checkpoint_libais_handler_fns) / sizeof (int (*)),
-	.aisexec_handler_fns		= ckpt_checkpoint_aisexec_handler_fns ,
+	.aisexec_handler_fns		= ckpt_checkpoint_aisexec_handler_fns,
 	.aisexec_handler_fns_count	= sizeof (ckpt_checkpoint_aisexec_handler_fns) / sizeof (int (*)),
 	.confchg_fn					= ckptConfChg,
 	.libais_init_fn				= message_handler_req_lib_ckpt_checkpoint_init,
@@ -200,7 +200,7 @@ static int (*ckpt_sectioniterator_libais_handler_fns[]) (struct conn_info *conn_
     message_handler_req_lib_ckpt_sectioniteratornext
 };
 
-static int (*ckpt_sectioniterator_aisexec_handler_fns[]) (void *msg) = {
+static int (*ckpt_sectioniterator_aisexec_handler_fns[]) (void *msg, struct in_addr source_addr) = {
 };
 
 struct service_handler ckpt_sectioniterator_service_handler = {
@@ -326,7 +326,7 @@ static int message_handler_req_lib_activatepoll (struct conn_info *conn_info, vo
 	return (0);
 }
 
-static int message_handler_req_exec_ckpt_checkpointopen (void *message)
+static int message_handler_req_exec_ckpt_checkpointopen (void *message, struct in_addr source_addr)
 {
 	struct req_exec_ckpt_checkpointopen *req_exec_ckpt_checkpointopen = (struct req_exec_ckpt_checkpointopen *)message;
 	struct req_lib_ckpt_checkpointopen *req_lib_ckpt_checkpointopen = (struct req_lib_ckpt_checkpointopen *)&req_exec_ckpt_checkpointopen->req_lib_ckpt_checkpointopen;
@@ -425,7 +425,7 @@ error_exit:
 	return (0);
 }
 
-extern int message_handler_req_exec_ckpt_checkpointclose (void *message)
+extern int message_handler_req_exec_ckpt_checkpointclose (void *message, struct in_addr source_addr)
 {
 	struct req_exec_ckpt_checkpointclose *req_exec_ckpt_checkpointclose = (struct req_exec_ckpt_checkpointclose *)message;
 	struct saCkptCheckpoint *checkpoint = 0;
@@ -457,7 +457,7 @@ extern int message_handler_req_exec_ckpt_checkpointclose (void *message)
 	return (0);
 }
 
-static int message_handler_req_exec_ckpt_checkpointunlink (void *message)
+static int message_handler_req_exec_ckpt_checkpointunlink (void *message, struct in_addr source_addr)
 {
 	struct req_exec_ckpt_checkpointunlink *req_exec_ckpt_checkpointunlink = (struct req_exec_ckpt_checkpointunlink *)message;
 
@@ -501,7 +501,7 @@ error_exit:
 	return (0);
 }
 
-static int message_handler_req_exec_ckpt_checkpointretentiondurationset (void *message)
+static int message_handler_req_exec_ckpt_checkpointretentiondurationset (void *message, struct in_addr source_addr)
 {
 	struct req_exec_ckpt_checkpointretentiondurationset *req_exec_ckpt_checkpointretentiondurationset = (struct req_exec_ckpt_checkpointretentiondurationset *)message;
 	struct saCkptCheckpoint *checkpoint;
@@ -517,7 +517,7 @@ static int message_handler_req_exec_ckpt_checkpointretentiondurationset (void *m
 	return (0);
 }
 
-static int message_handler_req_exec_ckpt_sectioncreate (void *message) {
+static int message_handler_req_exec_ckpt_sectioncreate (void *message, struct in_addr source_addr) {
 	struct req_exec_ckpt_sectioncreate *req_exec_ckpt_sectioncreate = (struct req_exec_ckpt_sectioncreate *)message;
 	struct req_lib_ckpt_sectioncreate *req_lib_ckpt_sectioncreate = (struct req_lib_ckpt_sectioncreate *)&req_exec_ckpt_sectioncreate->req_lib_ckpt_sectioncreate;
 	struct res_lib_ckpt_sectioncreate res_lib_ckpt_sectioncreate;
@@ -616,7 +616,7 @@ error_exit:
 	return (0);
 }
 
-static int message_handler_req_exec_ckpt_sectiondelete (void *message) {
+static int message_handler_req_exec_ckpt_sectiondelete (void *message, struct in_addr source_addr) {
 	struct req_exec_ckpt_sectiondelete *req_exec_ckpt_sectiondelete = (struct req_exec_ckpt_sectiondelete *)message;
 	struct req_lib_ckpt_sectiondelete *req_lib_ckpt_sectiondelete = (struct req_lib_ckpt_sectiondelete *)&req_exec_ckpt_sectiondelete->req_lib_ckpt_sectiondelete;
 	struct res_lib_ckpt_sectiondelete res_lib_ckpt_sectiondelete;
@@ -675,7 +675,7 @@ error_exit:
 	return (0);
 }
 
-static int message_handler_req_exec_ckpt_sectionexpirationtimeset (void *message) {
+static int message_handler_req_exec_ckpt_sectionexpirationtimeset (void *message, struct in_addr source_addr) {
 	struct req_exec_ckpt_sectionexpirationtimeset *req_exec_ckpt_sectionexpirationtimeset = (struct req_exec_ckpt_sectionexpirationtimeset *)message;
 	struct req_lib_ckpt_sectionexpirationtimeset *req_lib_ckpt_sectionexpirationtimeset = (struct req_lib_ckpt_sectionexpirationtimeset *)&req_exec_ckpt_sectionexpirationtimeset->req_lib_ckpt_sectionexpirationtimeset;
 	struct res_lib_ckpt_sectionexpirationtimeset res_lib_ckpt_sectionexpirationtimeset;
@@ -727,7 +727,7 @@ error_exit:
 	return (0);
 }
 
-static int message_handler_req_exec_ckpt_sectionwrite (void *message) {
+static int message_handler_req_exec_ckpt_sectionwrite (void *message, struct in_addr source_addr) {
 	struct req_exec_ckpt_sectionwrite *req_exec_ckpt_sectionwrite = (struct req_exec_ckpt_sectionwrite *)message;
 	struct req_lib_ckpt_sectionwrite *req_lib_ckpt_sectionwrite = (struct req_lib_ckpt_sectionwrite *)&req_exec_ckpt_sectionwrite->req_lib_ckpt_sectionwrite;
 	struct res_lib_ckpt_sectionwrite res_lib_ckpt_sectionwrite;
@@ -809,7 +809,7 @@ error_exit:
 	return (0);
 }
 
-static int message_handler_req_exec_ckpt_sectionoverwrite (void *message) {
+static int message_handler_req_exec_ckpt_sectionoverwrite (void *message, struct in_addr source_addr) {
 	struct req_exec_ckpt_sectionoverwrite *req_exec_ckpt_sectionoverwrite = (struct req_exec_ckpt_sectionoverwrite *)message;
 	struct req_lib_ckpt_sectionoverwrite *req_lib_ckpt_sectionoverwrite = (struct req_lib_ckpt_sectionoverwrite *)&req_exec_ckpt_sectionoverwrite->req_lib_ckpt_sectionoverwrite;
 	struct res_lib_ckpt_sectionoverwrite res_lib_ckpt_sectionoverwrite;
@@ -881,7 +881,7 @@ error_exit:
 	}
 	return (0);
 }
-static int message_handler_req_exec_ckpt_sectionread (void *message) {
+static int message_handler_req_exec_ckpt_sectionread (void *message, struct in_addr source_addr) {
 	struct req_exec_ckpt_sectionread *req_exec_ckpt_sectionread = (struct req_exec_ckpt_sectionread *)message;
 	struct req_lib_ckpt_sectionread *req_lib_ckpt_sectionread = (struct req_lib_ckpt_sectionread *)&req_exec_ckpt_sectionread->req_lib_ckpt_sectionread;
 	struct res_lib_ckpt_sectionread res_lib_ckpt_sectionread;

+ 4 - 4
exec/clm.c

@@ -81,7 +81,7 @@ static int clmConfChg (
     struct sockaddr_in *left_list, int left_list_entries,
     struct sockaddr_in *joined_list, int joined_list_entries);
 
-static int message_handler_req_exec_clm_nodejoin (void *message);
+static int message_handler_req_exec_clm_nodejoin (void *message, struct in_addr source_addr);
 
 static int message_handler_req_clm_init (struct conn_info *conn_info,
 	void *message);
@@ -107,14 +107,14 @@ static int (*clm_libais_handler_fns[]) (struct conn_info *conn_info, void *) = {
 	message_handler_req_clm_nodeget
 };
 
-static int (*clm_aisexec_handler_fns[]) (void *) = {
+static int (*clm_aisexec_handler_fns[]) (void *, struct in_addr source_addr) = {
 	message_handler_req_exec_clm_nodejoin
 };
 	
 struct service_handler clm_service_handler = {
 	.libais_handler_fns			= clm_libais_handler_fns,
 	.libais_handler_fns_count	= sizeof (clm_libais_handler_fns) / sizeof (int (*)),
-	.aisexec_handler_fns		= clm_aisexec_handler_fns ,
+	.aisexec_handler_fns		= clm_aisexec_handler_fns,
 	.aisexec_handler_fns_count	= sizeof (clm_aisexec_handler_fns) / sizeof (int (*)),
 	.confchg_fn					= clmConfChg,
 	.libais_init_fn				= message_handler_req_clm_init,
@@ -363,7 +363,7 @@ static int clmConfChg (
 	return (0);
 }
 
-static int message_handler_req_exec_clm_nodejoin (void *message)
+static int message_handler_req_exec_clm_nodejoin (void *message, struct in_addr source_addr)
 {
 	struct req_exec_clm_nodejoin *req_exec_clm_nodejoin = (struct req_exec_clm_nodejoin *)message;
 	int found;

+ 1 - 1
exec/handlers.h

@@ -40,7 +40,7 @@
 struct service_handler {
 	int (**libais_handler_fns) (struct conn_info *conn_info, void *msg);
 	int libais_handler_fns_count;
-	int (**aisexec_handler_fns) (void *msg);
+	int (**aisexec_handler_fns) (void *msg, struct in_addr source_addr);
 	int aisexec_handler_fns_count;
 	int (*confchg_fn) (
 		struct sockaddr_in *member_list, int member_list_entries,

+ 2 - 2
exec/main.c

@@ -445,7 +445,7 @@ static int pool_sizes[] = { 0, 0, 0, 0, 0, 4096, 0, 1, 0, /* 256 */
 					1024, 0, 1, 4096, 0, 0, 0, 0, /* 65536 */
 					1, 1, 1, 1, 1, 1, 1, 1, 1 };
 
-static int (*aisexec_handler_fns[AIS_SERVICE_HANDLER_AISEXEC_FUNCTIONS_MAX]) (void *msg);
+static int (*aisexec_handler_fns[AIS_SERVICE_HANDLER_AISEXEC_FUNCTIONS_MAX]) (void *msg, struct in_addr source_addr);
 static int aisexec_handler_fns_count = 0;
 
 /*
@@ -492,7 +492,7 @@ static void deliver_fn (
 	} else {
 		header = (struct message_header *)iovec[0].iov_base;
 	}
-	res = aisexec_handler_fns[header->id](header);
+	res = aisexec_handler_fns[header->id](header, source_addr);
 }
 
 static void confchg_fn (