diff extensions/app_acct/acct_conf.y @ 528:1b3b9790e7cb

Add a new field in the app_acct.fdx database to receive the name of the local server. Update your existing tables with the following SQL command: ALTER TABLE "incoming" ADD "recorded_serv" bytea NOT NULL;
author Sebastien Decugis <sdecugis@nict.go.jp>
date Fri, 03 Sep 2010 16:46:16 +0900
parents 26aafbbc1640
children 4a9f08d6b6ba
line wrap: on
line diff
--- a/extensions/app_acct/acct_conf.y	Wed Sep 01 16:49:02 2010 +0900
+++ b/extensions/app_acct/acct_conf.y	Fri Sep 03 16:46:16 2010 +0900
@@ -101,6 +101,7 @@
 	fd_log_debug("   ConnInfo ...... : '%s'\n", acct_config->conninfo ?: "<null>");
 	fd_log_debug("   Table name .... : '%s'\n", acct_config->tablename ?: "<null>");
 	fd_log_debug("   Timestamp field : '%s'\n", acct_config->tsfield ?: "<null>");
+	fd_log_debug("   Server name fld : '%s'\n", acct_config->srvnfield ?: "<null>");
 	fd_log_debug(" AVPs that will be saved to the database:\n");
 	for (li = acct_config->avps.next; li != &acct_config->avps; li = li->next) {
 		struct acct_conf_avp * a = (struct acct_conf_avp *)li;
@@ -136,6 +137,7 @@
 	free(acct_config->conninfo);
 	free(acct_config->tablename);
 	free(acct_config->tsfield);
+	free(acct_config->srvnfield);
 	
 	/* Done */
 	free(acct_config);
@@ -204,6 +206,7 @@
 %token 		CONNINFO
 %token 		TABLE
 %token 		TSFIELD
+%token 		SRVNFIELD
 
 /* Tokens and types */
 /* A (de)quoted string (malloc'd in lex parser; it must be freed after use) */
@@ -223,6 +226,7 @@
 			| conffile conninfoline
 			| conffile tableline
 			| conffile tsfieldline
+			| conffile srvnfieldline
 			| conffile errors
 			{
 				yyerror(&yylloc, conffile, "An error occurred while parsing the configuration file.");
@@ -320,3 +324,13 @@
 				acct_config->tsfield = $3
 			}
 			;
+
+srvnfieldline:		SRVNFIELD '=' QSTRING ';'
+			{
+				if (acct_config->srvnfield) {
+					yyerror (&yylloc, conffile, "Duplicate entry");
+					YYERROR;
+				}
+				acct_config->srvnfield = $3
+			}
+			;
"Welcome to our mercurial repository"