changeset 515:b9167b4de7dc

Added documentation for rt_un_number
author Sebastien Decugis <sdecugis@nict.go.jp>
date Thu, 26 Aug 2010 14:10:03 +0900
parents 179ef7de53de
children 1c2f5ee38039
files doc/rt_un_number.conf.sample extensions/rt_un_number/rtun.c
diffstat 2 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/rt_un_number.conf.sample	Thu Aug 26 14:10:03 2010 +0900
@@ -0,0 +1,11 @@
+# This file contains information for configuring the rt_un_number extension.
+# To find how to have freeDiameter load this extension, please refer to the freeDiameter documentation.
+#
+# The rt_un_number extension is a simple showcase of load-balancing routing with
+# freeDiameter. It routes the messages to different servers based on a numerical
+# value contained in the User-Name.
+
+# The format of this configuration file is very simple, just declare
+# the list of all servers you whish to load-balance between.
+# serv = "server1.identity" ;
+# serv = "server2.identity" ;
--- a/extensions/rt_un_number/rtun.c	Wed Aug 25 19:00:25 2010 +0900
+++ b/extensions/rt_un_number/rtun.c	Thu Aug 26 14:10:03 2010 +0900
@@ -136,6 +136,13 @@
 	/* Parse the configuration file */
 	CHECK_FCT( rtun_conf_handle(conffile) );
 	
+	/* Check the configuration */
+	CHECK_PARAMS_DO( rtun_conf.serv_nb > 1,
+		{
+			fd_log_debug("[rt_un_number] Invalid configuration: you need at least 2 servers to perform load-balancing.\n");
+			return EINVAL;
+		} );
+	
 	/* Register the callback */
 	CHECK_FCT( fd_rt_out_register( rtun_out, NULL, 1, &rtun_hdl ) );
 	
"Welcome to our mercurial repository"