Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Implement a gras_os_myname. KISS and don't try a DNS resolver tonight. ie, don't...
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 29 Mar 2005 22:24:16 +0000 (22:24 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 29 Mar 2005 22:24:16 +0000 (22:24 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1184 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/Makefile.am
src/gras/Virtu/rl_dns.c [new file with mode: 0644]
src/gras/Virtu/sg_dns.c [new file with mode: 0644]

index 6662a0f..894a83d 100644 (file)
@@ -127,7 +127,8 @@ RL_SRC= \
   gras/Transport/rl_transport.c  gras/Transport/transport_plugin_tcp.c  gras/Transport/transport_plugin_file.c  \
   \
   gras/Virtu/rl_chrono.c \
-  gras/Virtu/rl_process.c        gras/Virtu/rl_time.c                   gras/Virtu/rl_conditional.c
+  gras/Virtu/rl_process.c        gras/Virtu/rl_time.c gras/Virtu/rl_conditional.c \
+  gras/Virtu/rl_dns.c
 
 SG_SRC=  \
   xbt/context.c                                                                \
@@ -147,7 +148,8 @@ SG_SRC=  \
   gras/Transport/sg_transport.c  gras/Transport/transport_plugin_sg.c             \
   \
   gras/Virtu/sg_chrono.c \
-  gras/Virtu/sg_process.c        gras/Virtu/sg_time.c                 gras/Virtu/sg_conditional.c 
+  gras/Virtu/sg_process.c        gras/Virtu/sg_time.c                 gras/Virtu/sg_conditional.c \
+  gras/Virtu/sg_dns.c
 
 gras/DataDesc/ddt_parse.yy.c: gras/DataDesc/ddt_parse.yy.l
        @LEX@ -o$@ -Pgras_ddt_parse_ $^
diff --git a/src/gras/Virtu/rl_dns.c b/src/gras/Virtu/rl_dns.c
new file mode 100644 (file)
index 0000000..75dd9b6
--- /dev/null
@@ -0,0 +1,24 @@
+/* $Id$ */
+
+/* rl_dns - name resolution (real life)                                     */
+
+/* Copyright (c) 2003, 2004 Martin Quinson. All rights reserved.            */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include "gras/Virtu/virtu_rl.h"
+
+/* A portable DNS resolver is a nightmare to do in a portable manner */
+
+/* the ADNS library is a good candidate for inclusion in the source tree, but
+ * it would be a bit too much. We need a stripped down version of it, and it's
+ * a bit too late for this tonight.
+ * 
+ * Next time maybe ;)
+ */
+const char *gras_os_myname(void) {
+
+   return "(unknown host)";
+}
+
diff --git a/src/gras/Virtu/sg_dns.c b/src/gras/Virtu/sg_dns.c
new file mode 100644 (file)
index 0000000..1d67ee4
--- /dev/null
@@ -0,0 +1,15 @@
+/* $Id$ */
+
+/* sg_dns - name resolution (simulator)                                     */
+
+/* Copyright (c) 2005 Martin Quinson. All rights reserved.                  */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+
+#include "gras/Virtu/virtu_sg.h"
+
+const char *gras_os_myname(void) {
+   return MSG_host_get_name(MSG_host_self());
+}