Explorar el Código

move nodeid from interface section to totem section

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@979 fd59a12c-fef9-0310-b244-a6a79926bd2f
Steven Dake hace 20 años
padre
commit
701b56e551
Se han modificado 5 ficheros con 34 adiciones y 33 borrados
  1. 2 4
      exec/main.c
  2. 1 1
      exec/totem.h
  3. 7 9
      exec/totemconfig.c
  4. 1 1
      exec/totemnet.c
  5. 23 18
      man/openais.conf.5

+ 2 - 4
exec/main.c

@@ -1180,7 +1180,7 @@ int main (int argc, char **argv)
 		&objdb_handle,
 		&objdb_handle,
 		"objdb",
 		"objdb",
 		0,
 		0,
-		(void **)&objdb,
+		(void **)(void *)&objdb,
 		0);
 		0);
 
 
 	objdb->objdb_init ();
 	objdb->objdb_init ();
@@ -1195,7 +1195,7 @@ int main (int argc, char **argv)
 		&config_handle,
 		&config_handle,
 		config_iface,
 		config_iface,
 		config_version,
 		config_version,
-		(void **)&config,
+		(void **)(void *)&config,
 		0);
 		0);
 
 
 	if (res == -1) {
 	if (res == -1) {
@@ -1217,7 +1217,6 @@ int main (int argc, char **argv)
 
 
 	openais_service_link_all (objdb);
 	openais_service_link_all (objdb);
 
 
-printf ("main config read\n");
 	res = openais_main_config_read (objdb, &error_string, &main_config);
 	res = openais_main_config_read (objdb, &error_string, &main_config);
 	if (res == -1) {
 	if (res == -1) {
 		log_printf (LOG_LEVEL_NOTICE, "AIS Executive Service: Copyright (C) 2002-2006 MontaVista Software, Inc and contributors.\n");
 		log_printf (LOG_LEVEL_NOTICE, "AIS Executive Service: Copyright (C) 2002-2006 MontaVista Software, Inc and contributors.\n");
@@ -1226,7 +1225,6 @@ printf ("main config read\n");
 		openais_exit_error (AIS_DONE_MAINCONFIGREAD);
 		openais_exit_error (AIS_DONE_MAINCONFIGREAD);
 	}
 	}
 
 
-  printf ("totem config read\n");
 	res = totem_config_read (objdb, &totem_config, &error_string, 3);
 	res = totem_config_read (objdb, &totem_config, &error_string, 3);
 	if (res == -1) {
 	if (res == -1) {
 		log_printf (LOG_LEVEL_NOTICE, "AIS Executive Service: Copyright (C) 2002-2006 MontaVista Software, Inc and contributors.\n");
 		log_printf (LOG_LEVEL_NOTICE, "AIS Executive Service: Copyright (C) 2002-2006 MontaVista Software, Inc and contributors.\n");

+ 1 - 1
exec/totem.h

@@ -66,7 +66,6 @@ struct totem_interface {
 	struct totem_ip_address boundto;
 	struct totem_ip_address boundto;
 	struct totem_ip_address mcast_addr;
 	struct totem_ip_address mcast_addr;
 	uint16_t ip_port;
 	uint16_t ip_port;
-	int node_id;
 };
 };
 
 
 struct totem_logging_configuration {
 struct totem_logging_configuration {
@@ -86,6 +85,7 @@ struct totem_config {
 	 */
 	 */
 	struct totem_interface *interfaces;
 	struct totem_interface *interfaces;
 	int interface_count;
 	int interface_count;
+	int node_id;
 
 
 	/*
 	/*
 	 * key information
 	 * key information

+ 7 - 9
exec/totemconfig.c

@@ -166,6 +166,12 @@ extern int totem_config_read (
 				totem_config->secauth = 0;
 				totem_config->secauth = 0;
 			}
 			}
 		}
 		}
+
+		/*
+		 * Get interface node id
+		 */
+		objdb_get_int (objdb, object_totem_handle, "nodeid", &totem_config->node_id);
+
 		objdb_get_int (objdb,object_totem_handle, "threads", &totem_config->threads);
 		objdb_get_int (objdb,object_totem_handle, "threads", &totem_config->threads);
 
 
 
 
@@ -214,11 +220,6 @@ extern int totem_config_read (
 
 
 		objdb_get_int (objdb, object_interface_handle, "ringnumber", &ringnumber);
 		objdb_get_int (objdb, object_interface_handle, "ringnumber", &ringnumber);
 
 
-		/*
-		 * Get interface node id
-		 */
-		objdb_get_int (objdb, object_interface_handle, "nodeid", &totem_config->interfaces[ringnumber].node_id);
-
 		/*
 		/*
 		 * Get interface multicast address
 		 * Get interface multicast address
 		 */
 		 */
@@ -270,7 +271,6 @@ int totem_config_validate (
 	}
 	}
 
 
 	for (i = 0; i < totem_config->interface_count; i++) {
 	for (i = 0; i < totem_config->interface_count; i++) {
-printf ("validing interface %d of %d\n", i, totem_config->interfaces);
 		/*
 		/*
 		 * Some error checking of parsed data to make sure its valid
 		 * Some error checking of parsed data to make sure its valid
 		 */
 		 */
@@ -285,7 +285,7 @@ printf ("validing interface %d of %d\n", i, totem_config->interfaces);
 		}
 		}
 
 
 		if (totem_config->interfaces[i].mcast_addr.family == AF_INET6 &&
 		if (totem_config->interfaces[i].mcast_addr.family == AF_INET6 &&
-			totem_config->interfaces[i].node_id == 0) {
+			totem_config->node_id == 0) {
 	
 	
 			error_reason = "An IPV6 network requires that a node ID be specified.";
 			error_reason = "An IPV6 network requires that a node ID be specified.";
 			goto parse_error;
 			goto parse_error;
@@ -507,7 +507,6 @@ int totem_config_keyread (
 	char *key_location = NULL;
 	char *key_location = NULL;
 	unsigned int object_service_handle;
 	unsigned int object_service_handle;
 	int res;
 	int res;
-	int i;
 
 
 	if (totem_config->secauth == 0) {
 	if (totem_config->secauth == 0) {
 		return (0);
 		return (0);
@@ -558,7 +557,6 @@ int totem_config_keyread (
 
 
 	return (0);
 	return (0);
 
 
-parse_error:
 	*error_string = error_string_response;
 	*error_string = error_string_response;
 key_error:
 key_error:
 	return (-1);
 	return (-1);

+ 1 - 1
exec/totemnet.c

@@ -1231,7 +1231,7 @@ int totemnet_initialize (
 
 
 	instance->totemnet_poll_handle = poll_handle;
 	instance->totemnet_poll_handle = poll_handle;
 
 
-	instance->totem_interface->bindnet.nodeid = instance->totem_interface->node_id;
+	instance->totem_interface->bindnet.nodeid = instance->totem_config->node_id;
 
 
 	instance->context = context;
 	instance->context = context;
 	instance->totemnet_deliver_fn = deliver_fn;
 	instance->totemnet_deliver_fn = deliver_fn;

+ 23 - 18
man/openais.conf.5

@@ -65,19 +65,12 @@ Within the
 .B totem
 .B totem
 directive, an interface directive is required.  There is also one configuration
 directive, an interface directive is required.  There is also one configuration
 option which is required:
 option which is required:
-.PP
-.PP
-.TP
-version
-This specifies the version of the configuration file.  Currently the only
-valid version for this directive is 2.
-
 .PP
 .PP
 .PP
 .PP
 Within the 
 Within the 
 .B interface
 .B interface
-sub-directive of totem there are four parameters which are required unless IPV6
-is used, in which case 5 parameters are required:
+sub-directive of totem there are four parameters which are required:
+
 .TP
 .TP
 ringnumber
 ringnumber
 This specifies the ring number for the interface.  When using the redundant
 This specifies the ring number for the interface.  When using the redundant
@@ -113,21 +106,33 @@ This specifies the UDP port number.  It is possible to use the same multicast
 address on a network with the openais services configured for different
 address on a network with the openais services configured for different
 UDP ports.
 UDP ports.
 
 
+.PP
+.PP
+Within the 
+.B totem 
+directive, there are six configuration options of which 1 is required,
+4 are optional, and 1 is requierd when IPV6 is configured in the interface
+subdirective.  The required directive controls the version of the totem
+configuration.  The optional option unless using IPV6 directive controls
+identification of the processor.  The optional options control secrecy and
+authentication, the redundant ring mode of operation, maximum network MTU,
+and number of sending threads, and the nodeid field.
+
+.TP
+version
+This specifies the version of the configuration file.  Currently the only
+valid version for this directive is 2.
+
+.PP
+.PP
 .TP
 .TP
 nodeid
 nodeid
 This configuration option is optional when using IPv4 and required when using
 This configuration option is optional when using IPv4 and required when using
 IPv6.  This is a 32 bit value specifying the node identifier delivered to the
 IPv6.  This is a 32 bit value specifying the node identifier delivered to the
 cluster membership service.  If this is not specified with IPv4, the node id
 cluster membership service.  If this is not specified with IPv4, the node id
 will be determined from the 32 bit IP address the system to which the system
 will be determined from the 32 bit IP address the system to which the system
-is bound.  The node identifier value of zero is reserved and should not be used.
-
-.PP
-.PP
-Within the 
-.B totem 
-directive, there are four configuration options which are all optional.
-These control secrecy & authentication, the redundant ring mode of operation,
-and network MTU, and number of sending threads.
+is bound with ring identifier of 0.  The node identifier value of zero is
+reserved and should not be used.
 
 
 .TP
 .TP
 secauth
 secauth