? .cvsignore
? Makefile.am
? acinclude.m4
? config
? configure.ac
? debian
? support
? update.log
? JDIM/.cvsignore
? JDIM/Makefile.am
? Visual/pvss_dim_server.dsw
? Visual/pvss_dim_server.ncb
? dim/.cvsignore
? dim/Makefile.am
? src/.cvsignore
? src/Makefile.am
? src/BENCHMARK/.cvsignore
? src/BENCHMARK/Makefile
? src/did/.cvsignore
? src/did/Makefile
? src/examples/.cvsignore
? src/examples/Makefile
? src/examples/Markus.cxx
? src/examples/db_dim_client.c
? src/examples/db_dim_server.c
? src/examples/demo_serve.c
? src/examples/test_client_many.c
? src/examples/test_client_slac.c
? src/examples/test_server_many.c
? src/examples/test_server_priorities.c
? src/examples/test_server_slac.c
? src/util/.cvsignore
? src/util/Makefile
Index: src/dis.c
===================================================================
RCS file: /local/reps/lhcbonline/dim/src/dis.c,v
retrieving revision 1.37
diff -u -w -r1.37 dis.c
Index: src/BENCHMARK/bigClient.cxx
===================================================================
RCS file: /local/reps/lhcbonline/dim/src/BENCHMARK/bigClient.cxx,v
retrieving revision 1.1
diff -u -w -r1.1 bigClient.cxx
--- src/BENCHMARK/bigClient.cxx	15 Dec 2003 15:13:49 -0000	1.1
+++ src/BENCHMARK/bigClient.cxx	26 Jun 2008 12:22:26 -0000
@@ -1,4 +1,8 @@
 #include <dic.hxx>
+#include <cstdio>
+#include <iostream>
+using std::cout;
+using std::endl;
 
 class Service : public DimInfo
 {
Index: src/BENCHMARK/bigServer.cxx
===================================================================
RCS file: /local/reps/lhcbonline/dim/src/BENCHMARK/bigServer.cxx,v
retrieving revision 1.1
diff -u -w -r1.1 bigServer.cxx
--- src/BENCHMARK/bigServer.cxx	15 Dec 2003 15:13:49 -0000	1.1
+++ src/BENCHMARK/bigServer.cxx	26 Jun 2008 12:22:26 -0000
@@ -2,6 +2,10 @@
 #ifdef WIN32
 #include <process.h>
 #endif
+#include <cstdio>
+#include <iostream>
+using std::cout;
+using std::endl;
 
 int main(int argc, char *argv[])
 {
Index: src/did/did.c
===================================================================
RCS file: /local/reps/lhcbonline/dim/src/did/did.c,v
retrieving revision 1.19
diff -u -w -r1.19 did.c
--- src/did/did.c	11 Jul 2006 08:39:34 -0000	1.19
+++ src/did/did.c	26 Jun 2008 12:22:26 -0000
@@ -791,7 +791,7 @@
     unsigned int argc;                  /* Command line argument count. */
     char *argv[];                       /* Pointers to command line args. */
 {
-    int i;
+    int i, j;
 	char opt_str[20], *ptr;
 	XtInputMask mask;
 	void do_got_service_list();
@@ -802,11 +802,11 @@
 	dic_disable_padding();
 	dis_disable_padding();
 	
-	if(argc > 1)
+	for (j = 1; j < argc; j++)
 	{
-		if(argv[1][0] == '-')
+		if(argv[j][0] == '-')
 		{
-			sprintf(opt_str,"%s",&argv[1][1]);
+			sprintf(opt_str,"%s",&argv[j][1]);
 			if((!strncmp(opt_str,"node",4)) || 
 			   (!strncmp(opt_str,"NODE",4)))
 				Curr_view_opt = 0;
@@ -819,10 +819,24 @@
 			else if((!strncmp(opt_str,"error",5)) ||
 					(!strncmp(opt_str,"ERROR",5)))
 				Curr_view_opt = 3;
+			else if((!strncmp(opt_str,"dns",3)) ||
+				(!strncmp(opt_str,"DNS",3))){
+			  	dim_set_dns_node(argv[j+1]);
+				j++;
+				continue;
+			}
+			else if((!strncmp(opt_str,"port",3)) ||
+				(!strncmp(opt_str,"PORT",3))){
+			  	dim_set_dns_port(atoi(argv[j+1]));
+				j++;
+				continue;
+			}
 			else if((!strncmp(opt_str,"help",4)) || 
 				(!strncmp(opt_str,"HELP",4)))
 			  {
     printf("Did - DIM Information Display\n");
+    printf("\t-dns <host>      Connect to DNS at <host>\n");
+    printf("\t-port <port>     Connect to DNS on port <port>");
     printf("\t-all             Show ALL Servers\n");
     printf("\t-service=<str>   Show Servers providing Service <str>\n");
     printf("\t-node=<nodename> Show Servers on Node <nodename>\n");
@@ -834,13 +848,15 @@
 				Curr_view_opt = -1;
 			if((Curr_view_opt == 0) || (Curr_view_opt == 2))
 			{
-  				if(!(ptr = strchr(argv[1],'=')))
+  				if(!(ptr = strchr(argv[j],'=')))
 				{
 					if( (ptr = strchr(argv[2],'=')) )
 					{
 						ptr++;
-						if(!(*ptr))
-							ptr = argv[3];
+						if(!(*ptr)){
+							j++; 
+							ptr = argv[j];
+						}
 					}
 					else
 						ptr++;
@@ -848,8 +864,10 @@
 				else
 				{			
 					ptr++;
-					if(!(*ptr))
-						ptr = argv[2];
+					if(!(*ptr)) {
+					  	j++;
+						ptr = argv[j];
+					}
 				}
 				for(i = 0;*ptr; ptr++, i++)
 					Curr_view_opt_par[i] = toupper(*ptr);
Index: src/examples/rshServer.cxx
===================================================================
RCS file: /local/reps/lhcbonline/dim/src/examples/rshServer.cxx,v
retrieving revision 1.1
diff -u -w -r1.1 rshServer.cxx
--- src/examples/rshServer.cxx	2 May 2002 13:00:42 -0000	1.1
+++ src/examples/rshServer.cxx	26 Jun 2008 12:22:26 -0000
@@ -8,6 +8,10 @@
 #include <process.h>
 #endif
 #include <ctype.h>
+#include <cstdio>
+#include <iostream>
+using std::cout;
+using std::endl;
 
 #ifndef WIN32
 char outfile[] = "/tmp/dim_rsh_server.dat";
@@ -152,7 +156,7 @@
 }
 #endif
 
-void main(int argc, char **argv)
+int main(int argc, char **argv)
 {
 	char host[64], cmd_name[128], result_name[128];
 	Cmd *cmd;
@@ -173,4 +177,5 @@
     {
 		pause();
     }
+	return 0;
 }
Index: src/util/check_dns.cxx
===================================================================
RCS file: /local/reps/lhcbonline/dim/src/util/check_dns.cxx,v
retrieving revision 1.3
diff -u -w -r1.3 check_dns.cxx
--- src/util/check_dns.cxx	15 Dec 2003 15:07:17 -0000	1.3
+++ src/util/check_dns.cxx	26 Jun 2008 12:22:26 -0000
@@ -1,9 +1,45 @@
 #include <iostream>
+#include <string>
+#include <sstream>
 #include <dic.hxx>
 using namespace std;
 
-int main()
+int main(int argc, char** argv)
 {
+  	string node;
+	int    port = -1;
+	for (int i = 1; i < argc; i++) {
+	  	if (argv[i][0] == '-') {
+		  	string arg(argv[i]);
+			if (arg == "-dns") {
+			  	node = argv[i+1];
+			  	i++;
+			}
+			else if (arg == "-port") {
+			  	stringstream s(argv[i+1]);
+			  	s >> port;
+			  	i++;
+			}
+			else if (arg == "-help") {
+			  	cout << "Check if DNS is running\n\n" 
+				     << "Usage: " << argv[0] << " [OPTIONS]\n\n"
+				     << "\t-dns  NODE\tNode where DNS should be running\n"
+				     << "\t-port PORT\tPort number DNS is listning to\n" 
+				     << "\t-help     \tThis help\n"
+				     << std::endl;
+				return 0;
+			}
+		}
+	}
+	
+	if (!node.empty()) {
+	  	if (port >= 0)
+		  	DimClient::setDnsNode(const_cast<char*>(node.c_str()), 
+					      port);
+		else 
+		  	DimClient::setDnsNode(const_cast<char*>(node.c_str()));
+	}
+	
 	int version = 0;
 	DimCurrentInfo dns("DIS_DNS/VERSION_NUMBER",10,-1);
 	
