소스 검색

totemrrp.h, totemsrp.h, totemnet.h: const+size_t

* exec/totemrrp.c (totemrrp_initialize):
* exec/totemrrp.h (totemrrp_initialize):
* exec/totemsrp.c (handler_functions, main_deliver_fn):
(main_iface_change_fn):
* exec/totemnet.c (totemnet_deliver_fn, totemnet_iface_change_fn):
(encrypt_and_sign_worker, ucast_sendmsg, mcast_sendmsg):
(totemnet_mcast_worker_fn, totemnet_initialize):
(totemnet_token_send, totemnet_mcast_flush_send):
(totemnet_mcast_noflush_send, totemnet_token_target_set):
* exec/totemnet.h (TOTEMNET_FLUSH):
* exec/totemrrp.c (totemrrp_deliver_fn, totemrrp_iface_change_fn):
(totemrrp_token_seqid_get, rrp_deliver_fn, rrp_iface_change_fn):
* exec/totemsrp.c (handler_functions, main_token_seqid_get):
(srp_addr_copy_endian_convert, message_handler_orf_token):
(message_handler_mcast, message_handler_memb_merge_detect):
(memb_join_endian_convert, memb_commit_token_endian_convert):
(orf_token_endian_convert, mcast_endian_convert):
(memb_merge_detect_endian_convert, message_handler_memb_join):
(message_handler_memb_commit_token):
(message_handler_token_hold_cancel, main_deliver_fn):

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2062 fd59a12c-fef9-0310-b244-a6a79926bd2f
Jim Meyering 17 년 전
부모
커밋
d45965ecae
15개의 변경된 파일188개의 추가작업 그리고 186개의 파일을 삭제
  1. 1 1
      exec/main.c
  2. 2 2
      exec/sync.c
  3. 4 4
      exec/totemmrp.c
  4. 2 2
      exec/totemmrp.h
  5. 27 29
      exec/totemnet.c
  6. 8 8
      exec/totemnet.h
  7. 5 5
      exec/totempg.c
  8. 67 67
      exec/totemrrp.c
  9. 9 9
      exec/totemrrp.h
  10. 51 49
      exec/totemsrp.c
  11. 1 1
      exec/totemsrp.h
  12. 1 1
      exec/vsf_ykd.c
  13. 1 1
      include/corosync/engine/coroapi.h
  14. 5 5
      include/corosync/totem/totempg.h
  15. 4 2
      services/votequorum.c

+ 1 - 1
exec/main.c

@@ -412,7 +412,7 @@ static void corosync_mlockall (void)
 
 static void deliver_fn (
 	unsigned int nodeid,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len,
 	int endian_conversion_required)
 {

+ 2 - 2
exec/sync.c

@@ -102,7 +102,7 @@ static int sync_service_process (enum totem_callback_token_type type,
 
 static void sync_deliver_fn (
 	unsigned int nodeid,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len,
 	int endian_conversion_required);
 
@@ -327,7 +327,7 @@ static void sync_endian_convert (struct req_exec_sync_barrier_start
 
 static void sync_deliver_fn (
 	unsigned int nodeid,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len,
 	int endian_conversion_required)
 {

+ 4 - 4
exec/totemmrp.c

@@ -68,7 +68,7 @@ hdb_handle_t totemsrp_handle_in;
 
 void totemmrp_deliver_fn (
 	unsigned int nodeid,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len,
 	int endian_conversion_required);
 
@@ -81,7 +81,7 @@ void totemmrp_confchg_fn (
 
 void (*pg_deliver_fn) (
 	unsigned int nodeid,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len,
 	int endian_conversion_required) = 0;
 
@@ -94,7 +94,7 @@ void (*pg_confchg_fn) (
 
 void totemmrp_deliver_fn (
 	unsigned int nodeid,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len,
 	int endian_conversion_required)
 {
@@ -124,7 +124,7 @@ int totemmrp_initialize (
 
 	void (*deliver_fn) (
 		unsigned int nodeid,
-		struct iovec *iovec,
+		const struct iovec *iovec,
 		unsigned int iov_len,
 		int endian_conversion_required),
 	void (*confchg_fn) (

+ 2 - 2
exec/totemmrp.h

@@ -7,7 +7,7 @@
  * Author: Steven Dake (sdake@redhat.com)
  *
  * This software licensed under BSD license, the text of which follows:
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
  *
@@ -61,7 +61,7 @@ extern int totemmrp_initialize (
 
 	void (*deliver_fn) (
 		unsigned int nodeid,
-		struct iovec *iovec,
+		const struct iovec *iovec,
 		unsigned int iov_len,
 		int endian_conversion_required),
 	void (*confchg_fn) (

+ 27 - 29
exec/totemnet.c

@@ -1,13 +1,13 @@
 /*
  * Copyright (c) 2005 MontaVista Software, Inc.
- * Copyright (c) 2006-2008 Red Hat, Inc.
+ * Copyright (c) 2006-2009 Red Hat, Inc.
  *
  * All rights reserved.
  *
  * Author: Steven Dake (sdake@redhat.com)
 
  * This software licensed under BSD license, the text of which follows:
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
  *
@@ -119,12 +119,12 @@ struct totemnet_instance {
 
 	void (*totemnet_deliver_fn) (
 		void *context,
-		void *msg,
-		int msg_len);
+		const void *msg,
+		size_t msg_len);
 
 	void (*totemnet_iface_change_fn) (
 		void *context,
-		struct totem_ip_address *iface_address);
+		const struct totem_ip_address *iface_address);
 
 	/*
 	 * Function and data used to log messages
@@ -297,9 +297,9 @@ static int authenticate_and_decrypt (
 static void encrypt_and_sign_worker (
 	struct totemnet_instance *instance,
 	unsigned char *buf,
-	int *buf_len,
-	struct iovec *iovec,
-	unsigned int iov_len,
+	size_t *buf_len,
+	const struct iovec *iovec,
+	size_t iov_len,
 	prng_state *prng_state_in)
 {
 	int i;
@@ -310,7 +310,7 @@ static void encrypt_and_sign_worker (
 	unsigned char *cipher_key = &keys[16];
 	unsigned char *initial_vector = &keys[0];
 	unsigned long len;
-	int outlen = 0;
+	size_t outlen = 0;
 	hmac_state hmac_state;
 	prng_state keygen_prng_state;
 	prng_state stream_prng_state;
@@ -379,16 +379,16 @@ static void encrypt_and_sign_worker (
 static inline void ucast_sendmsg (
 	struct totemnet_instance *instance,
 	struct totem_ip_address *system_to,
-	struct iovec *iovec_in,
-	unsigned int iov_len_in)
+	const struct iovec *iovec_in,
+	size_t iov_len_in)
 {
 	struct msghdr msg_ucast;
 	int res = 0;
-	int buf_len;
+	size_t buf_len;
 	unsigned char sheader[sizeof (struct security_header)];
 	unsigned char encrypt_data[FRAME_SIZE_MAX];
 	struct iovec iovec_encrypt[20];
-	struct iovec *iovec_sendmsg;
+	const struct iovec *iovec_sendmsg;
 	struct sockaddr_storage sockaddr;
 	unsigned int iov_len;
 	int addrlen;
@@ -427,7 +427,7 @@ static inline void ucast_sendmsg (
 		instance->totem_interface->ip_port, &sockaddr, &addrlen);
 	msg_ucast.msg_name = &sockaddr;
 	msg_ucast.msg_namelen = addrlen;
-	msg_ucast.msg_iov = iovec_sendmsg;
+	msg_ucast.msg_iov = (void *) iovec_sendmsg;
 	msg_ucast.msg_iovlen = iov_len;
 	msg_ucast.msg_control = 0;
 	msg_ucast.msg_controllen = 0;
@@ -443,16 +443,16 @@ static inline void ucast_sendmsg (
 
 static inline void mcast_sendmsg (
 	struct totemnet_instance *instance,
-	struct iovec *iovec_in,
-	unsigned int iov_len_in)
+	const struct iovec *iovec_in,
+	size_t iov_len_in)
 {
 	struct msghdr msg_mcast;
 	int res = 0;
-	int buf_len;
+	size_t buf_len;
 	unsigned char sheader[sizeof (struct security_header)];
 	unsigned char encrypt_data[FRAME_SIZE_MAX];
 	struct iovec iovec_encrypt[20];
-	struct iovec *iovec_sendmsg;
+	const struct iovec *iovec_sendmsg;
 	struct sockaddr_storage sockaddr;
 	unsigned int iov_len;
 	int addrlen;
@@ -491,7 +491,7 @@ static inline void mcast_sendmsg (
 		instance->totem_interface->ip_port, &sockaddr, &addrlen);
 	msg_mcast.msg_name = &sockaddr;
 	msg_mcast.msg_namelen = addrlen;
-	msg_mcast.msg_iov = iovec_sendmsg;
+	msg_mcast.msg_iov = (void *) iovec_sendmsg;
 	msg_mcast.msg_iovlen = iov_len;
 	msg_mcast.msg_control = 0;
 	msg_mcast.msg_controllen = 0;
@@ -527,7 +527,7 @@ static void totemnet_mcast_worker_fn (void *thread_state, void *work_item_in)
 	struct msghdr msg_mcast;
 	unsigned char sheader[sizeof (struct security_header)];
 	int res = 0;
-	int buf_len;
+	size_t buf_len;
 	struct iovec iovec_encrypted;
 	struct iovec *iovec_sendmsg;
 	struct sockaddr_storage sockaddr;
@@ -1157,12 +1157,12 @@ int totemnet_initialize (
 
 	void (*deliver_fn) (
 		void *context,
-		void *msg,
-		int msg_len),
+		const void *msg,
+		size_t msg_len),
 
 	void (*iface_change_fn) (
 		void *context,
-		struct totem_ip_address *iface_address))
+		const struct totem_ip_address *iface_address))
 {
 	struct totemnet_instance *instance;
 	unsigned int res;
@@ -1334,7 +1334,7 @@ error_exit:
 
 int totemnet_token_send (
 	hdb_handle_t handle,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len)
 {
 	struct totemnet_instance *instance;
@@ -1356,7 +1356,7 @@ error_exit:
 }
 int totemnet_mcast_flush_send (
 	hdb_handle_t handle,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len)
 {
 	struct totemnet_instance *instance;
@@ -1379,7 +1379,7 @@ error_exit:
 
 int totemnet_mcast_noflush_send (
 	hdb_handle_t handle,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len)
 {
 	struct totemnet_instance *instance;
@@ -1481,7 +1481,7 @@ error_exit:
 
 int totemnet_token_target_set (
 	hdb_handle_t handle,
-	struct totem_ip_address *token_target)
+	const struct totem_ip_address *token_target)
 {
 	struct totemnet_instance *instance;
 	unsigned int res;
@@ -1500,5 +1500,3 @@ int totemnet_token_target_set (
 error_exit:
 	return (res);
 }
-
-

+ 8 - 8
exec/totemnet.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2005 MontaVista Software, Inc.
- * Copyright (c) 2006-2007 Red Hat, Inc.
+ * Copyright (c) 2006-2007, 2009 Red Hat, Inc.
  *
  * All rights reserved.
  *
@@ -59,12 +59,12 @@ extern int totemnet_initialize (
 
 	void (*deliver_fn) (
 		void *context,
-		void *msg,
-		int msg_len),
+		const void *msg,
+		size_t msg_len),
 
 	void (*iface_change_fn) (
 		void *context,
-		struct totem_ip_address *iface_address));
+		const struct totem_ip_address *iface_address));
 
 extern int totemnet_processor_count_set (
 	hdb_handle_t handle,
@@ -72,17 +72,17 @@ extern int totemnet_processor_count_set (
 
 extern int totemnet_token_send (
 	hdb_handle_t handle,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len);
 
 extern int totemnet_mcast_flush_send (
 	hdb_handle_t handle,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len);
 
 extern int totemnet_mcast_noflush_send (
 	hdb_handle_t handle,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len);
 
 extern int totemnet_recv_flush (hdb_handle_t handle);
@@ -103,6 +103,6 @@ extern int totemnet_iface_get (
 
 extern int totemnet_token_target_set (
 	hdb_handle_t handle,
-	struct totem_ip_address *token_target);
+	const struct totem_ip_address *token_target);
 
 #endif /* TOTEMNET_H_DEFINED */

+ 5 - 5
exec/totempg.c

@@ -66,7 +66,7 @@
 
 /*
  * ASSEMBLY AND UNPACKING ALGORITHM:
- * 
+ *
  * copy incoming packet into assembly data buffer indexed by current
  * location of end of fragment
  *
@@ -79,7 +79,7 @@
  * else
  * if msg_count = 1 and fragmented
  *	do nothing
- *	
+ *
  */
 
 #include <config.h>
@@ -211,7 +211,7 @@ static unsigned int totempg_max_handle = 0;
 struct totempg_group_instance {
 	void (*deliver_fn) (
 		unsigned int nodeid,
-		struct iovec *iovec,
+		const struct iovec *iovec,
 		unsigned int iov_len,
 		int endian_conversion_required);
 
@@ -497,7 +497,7 @@ static void totempg_confchg_fn (
 
 static void totempg_deliver_fn (
 	unsigned int nodeid,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len,
 	int endian_conversion_required)
 {
@@ -985,7 +985,7 @@ int totempg_groups_initialize (
 
 	void (*deliver_fn) (
 		unsigned int nodeid,
-		struct iovec *iovec,
+		const struct iovec *iovec,
 		unsigned int iov_len,
 		int endian_conversion_required),
 

+ 67 - 67
exec/totemrrp.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2005 MontaVista Software, Inc.
- * Copyright (c) 2006-2008 Red Hat, Inc.
+ * Copyright (c) 2006-2009 Red Hat, Inc.
  *
  * All rights reserved.
  *
@@ -70,12 +70,12 @@
 
 void rrp_deliver_fn (
 	void *context,
-	void *msg,
-	int msg_len);
+	const void *msg,
+	size_t msg_len);
 
 void rrp_iface_change_fn (
 	void *context,
-	struct totem_ip_address *iface_addr);
+	const struct totem_ip_address *iface_addr);
 
 struct totemrrp_instance;
 struct passive_instance {
@@ -116,30 +116,30 @@ struct rrp_algo {
 		struct totemrrp_instance *instance,
 		unsigned int iface_no,
 		void *context,
-		void *msg,
-		unsigned int msg_len);
+		const void *msg,
+		size_t msg_len);
 
 	void (*mcast_noflush_send) (
 		struct totemrrp_instance *instance,
-		struct iovec *iovec,
+		const struct iovec *iovec,
 		unsigned int iov_len);
 
 	void (*mcast_flush_send) (
 		struct totemrrp_instance *instance,
-		struct iovec *iovec,
+		const struct iovec *iovec,
 		unsigned int iov_len);
 
 	void (*token_recv) (
 		struct totemrrp_instance *instance,
 		unsigned int iface_no,
 		void *context,
-		void *msg,
-		unsigned int msg_len,
+		const void *msg,
+		size_t msg_len,
 		unsigned int token_seqid);
 
 	void (*token_send) (
 		struct totemrrp_instance *instance,
-		struct iovec *iovec,
+		const struct iovec *iovec,
 		unsigned int iov_len);	
 
 	void (*recv_flush) (
@@ -177,16 +177,16 @@ struct totemrrp_instance {
 
 	void (*totemrrp_deliver_fn) (
 		void *context,
-		void *msg,
-		int msg_len);
+		const void *msg,
+		size_t msg_len);
 
 	void (*totemrrp_iface_change_fn) (
 		void *context,
-		struct totem_ip_address *iface_addr,
+		const struct totem_ip_address *iface_addr,
 		unsigned int iface_no);
 
 	void (*totemrrp_token_seqid_get) (
-		void *msg,
+		const void *msg,
 		unsigned int *seqid,
 		unsigned int *token_is);
 
@@ -233,30 +233,30 @@ static void none_mcast_recv (
 	struct totemrrp_instance *instance,
 	unsigned int iface_no,
 	void *context,
-	void *msg,
-	unsigned int msg_len);
+	const void *msg,
+	size_t msg_len);
 
 static void none_mcast_noflush_send (
 	struct totemrrp_instance *instance,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len);
 
 static void none_mcast_flush_send (
 	struct totemrrp_instance *instance,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len);
 
 static void none_token_recv (
 	struct totemrrp_instance *instance,
 	unsigned int iface_no,
 	void *context,
-	void *msg,
-	unsigned int msg_len,
+	const void *msg,
+	size_t msg_len,
 	unsigned int token_seqid);
 
 static void none_token_send (
 	struct totemrrp_instance *instance,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len);	
 
 static void none_recv_flush (
@@ -291,30 +291,30 @@ static void passive_mcast_recv (
 	struct totemrrp_instance *instance,
 	unsigned int iface_no,
 	void *context,
-	void *msg,
-	unsigned int msg_len);
+	const void *msg,
+	size_t msg_len);
 
 static void passive_mcast_noflush_send (
 	struct totemrrp_instance *instance,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len);
 
 static void passive_mcast_flush_send (
 	struct totemrrp_instance *instance,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len);
 
 static void passive_token_recv (
 	struct totemrrp_instance *instance,
 	unsigned int iface_no,
 	void *context,
-	void *msg,
-	unsigned int msg_len,
+	const void *msg,
+	size_t msg_len,
 	unsigned int token_seqid);
 
 static void passive_token_send (
 	struct totemrrp_instance *instance,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len);	
 
 static void passive_recv_flush (
@@ -349,30 +349,30 @@ static void active_mcast_recv (
 	struct totemrrp_instance *instance,
 	unsigned int iface_no,
 	void *context,
-	void *msg,
-	unsigned int msg_len);
+	const void *msg,
+	size_t msg_len);
 
 static void active_mcast_noflush_send (
 	struct totemrrp_instance *instance,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len);
 
 static void active_mcast_flush_send (
 	struct totemrrp_instance *instance,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len);
 
 static void active_token_recv (
 	struct totemrrp_instance *instance,
 	unsigned int iface_no,
 	void *context,
-	void *msg,
-	unsigned int msg_len,
+	const void *msg,
+	size_t msg_len,
 	unsigned int token_seqid);
 
 static void active_token_send (
 	struct totemrrp_instance *instance,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len);	
 
 static void active_recv_flush (
@@ -485,8 +485,8 @@ static void none_mcast_recv (
 	struct totemrrp_instance *rrp_instance,
 	unsigned int iface_no,
 	void *context,
-	void *msg,
-	unsigned int msg_len)
+	const void *msg,
+	size_t msg_len)
 {
 	rrp_instance->totemrrp_deliver_fn (
 		context,
@@ -496,7 +496,7 @@ static void none_mcast_recv (
 
 static void none_mcast_flush_send (
 	struct totemrrp_instance *instance,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len)
 {
 	totemnet_mcast_flush_send (instance->net_handles[0], iovec, iov_len);
@@ -504,7 +504,7 @@ static void none_mcast_flush_send (
 
 static void none_mcast_noflush_send (
 	struct totemrrp_instance *instance,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len)
 {
 	totemnet_mcast_noflush_send (instance->net_handles[0], iovec, iov_len);
@@ -514,8 +514,8 @@ static void none_token_recv (
 	struct totemrrp_instance *rrp_instance,
 	unsigned int iface_no,
 	void *context,
-	void *msg,
-	unsigned int msg_len,
+	const void *msg,
+	size_t msg_len,
 	unsigned int token_seq)
 {
 	rrp_instance->totemrrp_deliver_fn (
@@ -526,7 +526,7 @@ static void none_token_recv (
 
 static void none_token_send (
 	struct totemrrp_instance *instance,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len)
 {
 	totemnet_token_send (
@@ -685,8 +685,8 @@ static void passive_mcast_recv (
 	struct totemrrp_instance *rrp_instance,
 	unsigned int iface_no,
 	void *context,
-	void *msg,
-	unsigned int msg_len)
+	const void *msg,
+	size_t msg_len)
 {
 	struct passive_instance *passive_instance = (struct passive_instance *)rrp_instance->rrp_algo_instance;
 	unsigned int max;
@@ -740,7 +740,7 @@ static void passive_mcast_recv (
 
 static void passive_mcast_flush_send (
 	struct totemrrp_instance *instance,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len)
 {
 	struct passive_instance *passive_instance = (struct passive_instance *)instance->rrp_algo_instance;
@@ -754,7 +754,7 @@ static void passive_mcast_flush_send (
 
 static void passive_mcast_noflush_send (
 	struct totemrrp_instance *instance,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len)
 {
 	struct passive_instance *passive_instance = (struct passive_instance *)instance->rrp_algo_instance;
@@ -771,8 +771,8 @@ static void passive_token_recv (
 	struct totemrrp_instance *rrp_instance,
 	unsigned int iface_no,
 	void *context,
-	void *msg,
-	unsigned int msg_len,
+	const void *msg,
+	size_t msg_len,
 	unsigned int token_seq)
 {
 	struct passive_instance *passive_instance = (struct passive_instance *)rrp_instance->rrp_algo_instance;
@@ -824,7 +824,7 @@ static void passive_token_recv (
 
 static void passive_token_send (
 	struct totemrrp_instance *instance,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len)
 {
 	struct passive_instance *passive_instance = (struct passive_instance *)instance->rrp_algo_instance;
@@ -1094,8 +1094,8 @@ static void active_mcast_recv (
 	struct totemrrp_instance *instance,
 	unsigned int iface_no,
 	void *context,
-	void *msg,
-	unsigned int msg_len)
+	const void *msg,
+	size_t msg_len)
 {
 	instance->totemrrp_deliver_fn (
 		context,
@@ -1105,7 +1105,7 @@ static void active_mcast_recv (
 
 static void active_mcast_flush_send (
 	struct totemrrp_instance *instance,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len)
 {
 	int i;
@@ -1120,7 +1120,7 @@ static void active_mcast_flush_send (
 
 static void active_mcast_noflush_send (
 	struct totemrrp_instance *instance,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len)
 {
 	int i;
@@ -1137,8 +1137,8 @@ static void active_token_recv (
 	struct totemrrp_instance *instance,
 	unsigned int iface_no,
 	void *context,
-	void *msg,
-	unsigned int msg_len,
+	const void *msg,
+	size_t msg_len,
 	unsigned int token_seq)
 {
 	int i;
@@ -1177,7 +1177,7 @@ static void active_token_recv (
 
 static void active_token_send (
 	struct totemrrp_instance *instance,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len)
 {
 	struct active_instance *rrp_algo_instance = (struct active_instance *)instance->rrp_algo_instance;
@@ -1308,8 +1308,8 @@ static int totemrrp_algorithm_set (
 
 void rrp_deliver_fn (
 	void *context,
-	void *msg,
-	int msg_len)
+	const void *msg,
+	size_t msg_len)
 {
 	unsigned int token_seqid;
 	unsigned int token_is;
@@ -1347,7 +1347,7 @@ void rrp_deliver_fn (
 
 void rrp_iface_change_fn (
 	void *context,
-	struct totem_ip_address *iface_addr)
+	const struct totem_ip_address *iface_addr)
 {
 	struct deliver_fn_context *deliver_fn_context = (struct deliver_fn_context *)context;
 
@@ -1397,16 +1397,16 @@ int totemrrp_initialize (
 
 	void (*deliver_fn) (
 		void *context,
-		void *msg,
-		int msg_len),
+		const void *msg,
+		size_t msg_len),
 
 	void (*iface_change_fn) (
 		void *context,
-		struct totem_ip_address *iface_addr,
+		const struct totem_ip_address *iface_addr,
 		unsigned int iface_no),
 
 	void (*token_seqid_get) (
-		void *msg,
+		const void *msg,
 		unsigned int *seqid,
 		unsigned int *token_is),
 
@@ -1589,7 +1589,7 @@ error_exit:
 
 int totemrrp_token_send (
 	hdb_handle_t handle,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len)
 {
 	struct totemrrp_instance *instance;
@@ -1612,7 +1612,7 @@ error_exit:
 
 int totemrrp_mcast_flush_send (
 	hdb_handle_t handle,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len)
 {
 	struct totemrrp_instance *instance;
@@ -1635,7 +1635,7 @@ error_exit:
 
 int totemrrp_mcast_noflush_send (
 	hdb_handle_t handle,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len)
 {
 	struct totemrrp_instance *instance;

+ 9 - 9
exec/totemrrp.h

@@ -1,13 +1,13 @@
 /*
  * Copyright (c) 2005 MontaVista Software, Inc.
- * Copyright (c) 2006-2007 Red Hat, Inc.
+ * Copyright (c) 2006-2007, 2009 Red Hat, Inc.
  *
  * All rights reserved.
  *
  * Author: Steven Dake (sdake@redhat.com)
  *
  * This software licensed under BSD license, the text of which follows:
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
  *
@@ -59,16 +59,16 @@ extern int totemrrp_initialize (
 
 	void (*deliver_fn) (
 		void *context,
-		void *msg,
-		int msg_len),
+		const void *msg,
+		size_t msg_len),
 
 	void (*iface_change_fn) (
 		void *context,
-		struct totem_ip_address *iface_addr,
+		const struct totem_ip_address *iface_addr,
 		unsigned int iface_no),
 
 	void (*token_seqid_get) (
-		void *msg,
+		const void *msg,
 		unsigned int *seqid,
 		unsigned int *token_is),
 
@@ -81,17 +81,17 @@ extern int totemrrp_processor_count_set (
 
 extern int totemrrp_token_send (
 	hdb_handle_t handle,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len);
 
 extern int totemrrp_mcast_noflush_send (
 	hdb_handle_t handle,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len);
 
 extern int totemrrp_mcast_flush_send (
 	hdb_handle_t handle,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len);
 
 extern int totemrrp_recv_flush (hdb_handle_t handle);

+ 51 - 49
exec/totemsrp.c

@@ -457,7 +457,7 @@ struct totemsrp_instance {
 
 	void (*totemsrp_deliver_fn) (
 		unsigned int nodeid,
-		struct iovec *iovec,
+		const struct iovec *iovec,
 		unsigned int iov_len,
 		int endian_conversion_required);
 
@@ -507,8 +507,8 @@ struct message_handlers {
 	int count;
 	int (*handler_functions[6]) (
 		struct totemsrp_instance *instance,
-		void *msg,
-		int msg_len,
+		const void *msg,
+		size_t msg_len,
 		int endian_conversion_needed);
 };
 
@@ -517,38 +517,38 @@ struct message_handlers {
  */
 static int message_handler_orf_token (
 	struct totemsrp_instance *instance,
-	void *msg,
-	int msg_len,
+	const void *msg,
+	size_t msg_len,
 	int endian_conversion_needed);
 
 static int message_handler_mcast (
 	struct totemsrp_instance *instance,
-	void *msg,
-	int msg_len,
+	const void *msg,
+	size_t msg_len,
 	int endian_conversion_needed);
 
 static int message_handler_memb_merge_detect (
 	struct totemsrp_instance *instance,
-	void *msg,
-	int msg_len,
+	const void *msg,
+	size_t msg_len,
 	int endian_conversion_needed);
 
 static int message_handler_memb_join (
 	struct totemsrp_instance *instance,
-	void *msg,
-	int msg_len,
+	const void *msg,
+	size_t msg_len,
 	int endian_conversion_needed);
 
 static int message_handler_memb_commit_token (
 	struct totemsrp_instance *instance,
-	void *msg,
-	int msg_len,
+	const void *msg,
+	size_t msg_len,
 	int endian_conversion_needed);
 
 static int message_handler_token_hold_cancel (
 	struct totemsrp_instance *instance,
-	void *msg,
-	int msg_len,
+	const void *msg,
+	size_t msg_len,
 	int endian_conversion_needed);
 
 static void totemsrp_instance_initialize (struct totemsrp_instance *instance);
@@ -556,7 +556,7 @@ static void totemsrp_instance_initialize (struct totemsrp_instance *instance);
 static unsigned int main_msgs_missing (void);
 
 static void main_token_seqid_get (
-	void *msg,
+	const void *msg,
 	unsigned int *seqid,
 	unsigned int *token_is);
 
@@ -585,14 +585,14 @@ static void memb_state_commit_token_target_set (struct totemsrp_instance *instan
 static int memb_state_commit_token_send (struct totemsrp_instance *instance, struct memb_commit_token *memb_commit_token);
 static void memb_state_commit_token_create (struct totemsrp_instance *instance, struct memb_commit_token *commit_token);
 static int token_hold_cancel_send (struct totemsrp_instance *instance);
-static void orf_token_endian_convert (struct orf_token *in, struct orf_token *out);
-static void memb_commit_token_endian_convert (struct memb_commit_token *in, struct memb_commit_token *out);
-static void memb_join_endian_convert (struct memb_join *in, struct memb_join *out);
-static void mcast_endian_convert (struct mcast *in, struct mcast *out);
+static void orf_token_endian_convert (const struct orf_token *in, struct orf_token *out);
+static void memb_commit_token_endian_convert (const struct memb_commit_token *in, struct memb_commit_token *out);
+static void memb_join_endian_convert (const struct memb_join *in, struct memb_join *out);
+static void mcast_endian_convert (const struct mcast *in, struct mcast *out);
 static void memb_merge_detect_endian_convert (
-	struct memb_merge_detect *in,
+	const struct memb_merge_detect *in,
 	struct memb_merge_detect *out);
-static void srp_addr_copy_endian_convert (struct srp_addr *out, struct srp_addr *in);
+static void srp_addr_copy_endian_convert (struct srp_addr *out, const struct srp_addr *in);
 static void timer_function_orf_token_timeout (void *data);
 static void timer_function_heartbeat_timeout (void *data);
 static void timer_function_token_retransmit_timeout (void *data);
@@ -601,12 +601,12 @@ static void timer_function_merge_detect_timeout (void *data);
 
 void main_deliver_fn (
 	void *context,
-	void *msg,
-	int msg_len);
+	const void *msg,
+	size_t msg_len);
 
 void main_iface_change_fn (
 	void *context,
-	struct totem_ip_address *iface_address,
+	const struct totem_ip_address *iface_address,
 	unsigned int iface_no);
 
 /*
@@ -659,7 +659,7 @@ static void totemsrp_instance_initialize (struct totemsrp_instance *instance)
 }
 
 static void main_token_seqid_get (
-	void *msg,
+	const void *msg,
 	unsigned int *seqid,
 	unsigned int *token_is)
 {
@@ -689,7 +689,7 @@ int totemsrp_initialize (
 
 	void (*deliver_fn) (
 		unsigned int nodeid,
-		struct iovec *iovec,
+		const struct iovec *iovec,
 		unsigned int iov_len,
 		int endian_conversion_required),
 
@@ -1037,7 +1037,7 @@ static void srp_addr_to_nodeid (
 	}
 }
 
-static void srp_addr_copy_endian_convert (struct srp_addr *out, struct srp_addr *in)
+static void srp_addr_copy_endian_convert (struct srp_addr *out, const struct srp_addr *in)
 {
 	int i;
 
@@ -3188,8 +3188,8 @@ struct timeval tv_old;
  */
 static int message_handler_orf_token (
 	struct totemsrp_instance *instance,
-	void *msg,
-	int msg_len,
+	const void *msg,
+	size_t msg_len,
 	int endian_conversion_needed)
 {
 	char token_storage[1500];
@@ -3612,8 +3612,8 @@ static void messages_deliver_to_app (
  */
 static int message_handler_mcast (
 	struct totemsrp_instance *instance,
-	void *msg,
-	int msg_len,
+	const void *msg,
+	size_t msg_len,
 	int endian_conversion_needed)
 {
 	struct sort_queue_item sort_queue_item;
@@ -3734,8 +3734,8 @@ static int message_handler_mcast (
 
 static int message_handler_memb_merge_detect (
 	struct totemsrp_instance *instance,
-	void *msg,
-	int msg_len,
+	const void *msg,
+	size_t msg_len,
 	int endian_conversion_needed)
 {
 	struct memb_merge_detect *memb_merge_detect = (struct memb_merge_detect *)msg;
@@ -3862,7 +3862,7 @@ static int memb_join_process (
 	return (0); /* gather not entered */
 }
 
-static void memb_join_endian_convert (struct memb_join *in, struct memb_join *out)
+static void memb_join_endian_convert (const struct memb_join *in, struct memb_join *out)
 {
 	int i;
 	struct srp_addr *in_proc_list;
@@ -3891,7 +3891,7 @@ static void memb_join_endian_convert (struct memb_join *in, struct memb_join *ou
 	}
 }
 
-static void memb_commit_token_endian_convert (struct memb_commit_token *in, struct memb_commit_token *out)
+static void memb_commit_token_endian_convert (const struct memb_commit_token *in, struct memb_commit_token *out)
 {
 	int i;
 	struct srp_addr *in_addr = (struct srp_addr *)in->end_of_commit_token;
@@ -3930,7 +3930,7 @@ static void memb_commit_token_endian_convert (struct memb_commit_token *in, stru
 	}
 }
 
-static void orf_token_endian_convert (struct orf_token *in, struct orf_token *out)
+static void orf_token_endian_convert (const struct orf_token *in, struct orf_token *out)
 {
 	int i;
 
@@ -3954,7 +3954,7 @@ static void orf_token_endian_convert (struct orf_token *in, struct orf_token *ou
 	}
 }
 
-static void mcast_endian_convert (struct mcast *in, struct mcast *out)
+static void mcast_endian_convert (const struct mcast *in, struct mcast *out)
 {
 	out->header.type = in->header.type;
 	out->header.endian_detector = ENDIAN_LOCAL;
@@ -3971,7 +3971,7 @@ static void mcast_endian_convert (struct mcast *in, struct mcast *out)
 }
 
 static void memb_merge_detect_endian_convert (
-	struct memb_merge_detect *in,
+	const struct memb_merge_detect *in,
 	struct memb_merge_detect *out)
 {
 	out->header.type = in->header.type;
@@ -3984,8 +3984,8 @@ static void memb_merge_detect_endian_convert (
 
 static int message_handler_memb_join (
 	struct totemsrp_instance *instance,
-	void *msg,
-	int msg_len,
+	const void *msg,
+	size_t msg_len,
 	int endian_conversion_needed)
 {
 	struct memb_join *memb_join;
@@ -4049,8 +4049,8 @@ static int message_handler_memb_join (
 
 static int message_handler_memb_commit_token (
 	struct totemsrp_instance *instance,
-	void *msg,
-	int msg_len,
+	const void *msg,
+	size_t msg_len,
 	int endian_conversion_needed)
 {
 	struct memb_commit_token *memb_commit_token_convert = alloca (msg_len);
@@ -4130,8 +4130,8 @@ static int message_handler_memb_commit_token (
 
 static int message_handler_token_hold_cancel (
 	struct totemsrp_instance *instance,
-	void *msg,
-	int msg_len,
+	const void *msg,
+	size_t msg_len,
 	int endian_conversion_needed)
 {
 	struct token_hold_cancel *token_hold_cancel = (struct token_hold_cancel *)msg;
@@ -4149,14 +4149,16 @@ static int message_handler_token_hold_cancel (
 
 void main_deliver_fn (
 	void *context,
-	void *msg,
-	int msg_len)
+	const void *msg,
+	size_t msg_len)
 {
 	struct totemsrp_instance *instance = (struct totemsrp_instance *)context;
 	struct message_header *message_header = (struct message_header *)msg;
 
 	if (msg_len < sizeof (struct message_header)) {
-		log_printf (instance->totemsrp_log_level_security, "Received message is too short...  ignoring %d.\n", msg_len);
+		log_printf (instance->totemsrp_log_level_security,
+			    "Received message is too short...  ignoring %u.\n",
+			    (unsigned int)msg_len);
 		return;
 	}
 	
@@ -4177,7 +4179,7 @@ void main_deliver_fn (
 
 void main_iface_change_fn (
 	void *context,
-	struct totem_ip_address *iface_addr,
+	const struct totem_ip_address *iface_addr,
 	unsigned int iface_no)
 {
 	struct totemsrp_instance *instance = (struct totemsrp_instance *)context;

+ 1 - 1
exec/totemsrp.h

@@ -53,7 +53,7 @@ int totemsrp_initialize (
 
 	void (*deliver_fn) (
 		unsigned int nodeid,
-		struct iovec *iovec,
+		const struct iovec *iovec,
 		unsigned int iov_len,
 		int endian_conversion_required),
 	void (*confchg_fn) (

+ 1 - 1
exec/vsf_ykd.c

@@ -341,7 +341,7 @@ static void ykd_state_endian_convert (struct ykd_state *ykd_state)
 
 static void ykd_deliver_fn (
 	unsigned int nodeid,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len,
 	int endian_conversion_required)
 {

+ 1 - 1
include/corosync/engine/coroapi.h

@@ -446,7 +446,7 @@ struct corosync_api_v1 {
 
 		void (*deliver_fn) (
 			unsigned int nodeid,
-			struct iovec *iovec,
+			const struct iovec *iovec,
 			unsigned int iov_len,
 			int endian_conversion_required),
 

+ 5 - 5
include/corosync/totem/totempg.h

@@ -7,7 +7,7 @@
  * Author: Steven Dake (sdake@redhat.com)
  *
  * This software licensed under BSD license, the text of which follows:
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
  *
@@ -80,7 +80,7 @@ extern int totempg_groups_initialize (
 
 	void (*deliver_fn) (
 		unsigned int nodeid,
-		struct iovec *iovec,
+		const struct iovec *iovec,
 		unsigned int iov_len,
 		int endian_conversion_required),
 
@@ -117,7 +117,7 @@ extern int totempg_groups_joined_reserve (
 
 extern int totempg_groups_joined_release (
 	int msg_count);
-	
+
 extern int totempg_groups_mcast_groups (
 	hdb_handle_t handle,
 	int guarantee,
@@ -132,7 +132,7 @@ extern int totempg_groups_send_ok_groups (
 	size_t groups_cnt,
 	const struct iovec *iovec,
 	unsigned int iov_len);
-	
+
 extern int totempg_ifaces_get (
 	unsigned int nodeid,
         struct totem_ip_address *interfaces,
@@ -146,5 +146,5 @@ extern unsigned int totempg_my_nodeid_get (void);
 extern int totempg_my_family_get (void);
 
 extern int totempg_ring_reenable (void);
-	
+
 #endif /* TOTEMPG_H_DEFINED */

+ 4 - 2
services/votequorum.c

@@ -178,7 +178,8 @@ static void quorum_confchg_fn (
 	const unsigned int *joined_list, size_t joined_list_entries,
 	const struct memb_ring_id *ring_id);
 
-static void quorum_deliver_fn(unsigned int nodeid, struct iovec *iovec, unsigned int iov_len,
+static void quorum_deliver_fn(unsigned int nodeid,
+			      const struct iovec *iovec, unsigned int iov_len,
 			      int endian_conversion_required);
 
 static int votequorum_exec_init_fn (struct corosync_api_v1 *corosync_api);
@@ -988,7 +989,8 @@ static void exec_quorum_killnode_endian_convert (void *msg)
 	killnode->nodeid = swab32(killnode->nodeid);
 }
 
-static void quorum_deliver_fn(unsigned int nodeid, struct iovec *iovec, unsigned int iov_len,
+static void quorum_deliver_fn(unsigned int nodeid,
+			      const struct iovec *iovec, unsigned int iov_len,
 			      int endian_conversion_required)
 {
 	struct q_protheader *header = iovec->iov_base;