gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r3534 - in GNUnet: . contrib src/setup src/setup/lib src/tr


From: grothoff
Subject: [GNUnet-SVN] r3534 - in GNUnet: . contrib src/setup src/setup/lib src/transports src/util/boot src/util/config_impl
Date: Sat, 21 Oct 2006 17:53:06 -0700 (PDT)

Author: grothoff
Date: 2006-10-21 17:52:59 -0700 (Sat, 21 Oct 2006)
New Revision: 3534

Modified:
   GNUnet/contrib/config-client.scm
   GNUnet/contrib/config-daemon.in
   GNUnet/contrib/config-daemon.scm
   GNUnet/src/setup/gnunet-setup.c
   GNUnet/src/setup/lib/tree.c
   GNUnet/src/transports/udp6.c
   GNUnet/src/util/boot/startup.c
   GNUnet/src/util/config_impl/impl.c
   GNUnet/todo
Log:
towards setup

Modified: GNUnet/contrib/config-client.scm
===================================================================
--- GNUnet/contrib/config-client.scm    2006-10-21 22:42:14 UTC (rev 3533)
+++ GNUnet/contrib/config-client.scm    2006-10-22 00:52:59 UTC (rev 3534)
@@ -110,8 +110,119 @@
    'always) )
 
 
+;; logging options
 
+(define (log-conf-user-urgency-severity-logger description user urgency 
severity logger builder def opt)
+ (builder
+   "LOGGING"
+   (string-append user "-" urgency "-" severity "-" logger)
+   description
+   ""
+   '()
+   #t
+   def
+   opt
+   (if (string=? urgency "STDOUT") 'rare 'always)))
 
+
+;; FIXME: set default to /dev/null for DEVELOPER, INFO, STATUS and REQUEST 
file-logs
+(define (log-conf-user-urgency-severity description user urgency severity 
builder)
+ (builder
+   "LOGGING"
+   (string-append user "-" urgency "-" severity)
+   description
+   ""
+   (list
+     (log-conf-user-urgency-severity-logger (_"Log using standard error 
(YES/NO)") user urgency severity "STDERR" builder #f #f)
+     (log-conf-user-urgency-severity-logger (_"Log using standard output 
(YES/NO)") user urgency severity "STDOUT" builder #f #f)
+     (log-conf-user-urgency-severity-logger (_"Log this event type to a file 
(specify filename)") user urgency severity "FILE" builder "~/.gnunet/logs" '())
+   )
+   #t
+   #f
+   #f
+   (if (string=? severity "DEBUG") 'rare 
+     (if (string=? severity "STATUS") 'advanced
+        (if (string=? severity "INFO") 'advanced 'always )))))
+
+(define (log-conf-user-urgency description user urgency builder)
+ (builder
+   "LOGGING"
+   (string-append user "-" urgency)
+   description
+   ""
+   (list
+     (log-conf-user-urgency-severity (_"Logging of events that are fatal to 
some operation") user urgency "FATAL" builder)
+     (log-conf-user-urgency-severity (_"Logging of non-fatal errors") user 
urgency "ERROR" builder)
+     (log-conf-user-urgency-severity (_"Logging of warnings") user urgency 
"WARNING" builder)
+     (log-conf-user-urgency-severity (_"Logging of information messages") user 
urgency "INFO" builder)
+     (log-conf-user-urgency-severity (_"Logging of status messages") user 
urgency "STATUS" builder)
+     (log-conf-user-urgency-severity (_"Logging of debug messages") user 
urgency "DEBUG" builder)
+   )
+   #t
+   #f
+   #f
+   (if (string=? urgency "REQUEST") 'rare 'always)))
+
+(define (log-conf-user description user builder)
+ (builder
+   "LOGGING"
+   user
+   description
+   ""
+   (list
+     (log-conf-user-urgency (_"Logging of events that usually require 
immediate attention") user "IMMEDIATE" builder)
+     (log-conf-user-urgency (_"Logging of events that can be processed in 
bulk") user "BULK" builder)
+     (log-conf-user-urgency (_"Logging of events that are to be shown only on 
request") user "REQUEST" builder)
+   )
+   #t
+   #f
+   #f
+   (if (string=? user "DEVELOPER") 'advanced 'always)))
+
+(define (log-conf-date builder)
+ (builder
+   "LOGGING"
+   "DATE"
+   (_ "Log the date of the event")
+   (nohelp)
+   '()
+   #t
+   #t
+   #t
+   'advanced))
+
+(define (log-keeplog builder)
+ (builder
+  "GNUNETD"
+  "KEEPLOG"
+  (_ "How long should logs be kept?")
+  (_ 
+"How long should logs be kept? If you specify a value greater than zero, a log 
is created each day with the date appended to its filename. These logs are 
deleted after $KEEPLOG days. To keep logs forever, set this value to 0." )
+  '()
+  #t
+  3
+  (cons 0 36500)
+  'advanced) )
+
+(define (logging builder)
+ (builder
+   "LOGGING"
+   "" 
+   (_ "Configuration of the logging system") 
+   (_ "Specify which system messages should be logged how")
+   (list 
+     (log-conf-date builder)
+     (log-keeplog builder)
+     (log-conf-user (_ "Logging of events for users") "USER" builder) 
+     (log-conf-user (_ "Logging of events for the system administrator") 
"ADMIN" builder) 
+     (log-conf-user (_ "Logging of events for developers") "DEVELOPER" 
builder) 
+   )
+   #t
+   #f
+   #f
+   'always) )
+
+
 ;; main-menu
 
 (define (main builder)
@@ -122,6 +233,7 @@
   (nohelp)
   (list 
     (meta builder)
+    (logging builder)
   )
   #t 
   #f 

Modified: GNUnet/contrib/config-daemon.in
===================================================================
--- GNUnet/contrib/config-daemon.in     2006-10-21 22:42:14 UTC (rev 3533)
+++ GNUnet/contrib/config-daemon.in     2006-10-22 00:52:59 UTC (rev 3534)
@@ -16,37 +16,6 @@
                populated by gnunetd with an initial set of nodes.
                Default: HOSTS          = $GNUNETD_HOME/data/hosts/
 
-       config HOSTLISTURL
-       string "Where can GNUnet find an initial list of peers"
-       depends on Meta::ADVANCED
-       default "http://gnunet.org/hostlist http://gnunet.mine.nu:8081/hostlist 
http://de.gnunet.org/cgi-bin/hostlist.cgi http://uk.gnunet.org/hostlist";
-       help
-               GNUnet can automatically update the hostlist from the web. While
-               GNUnet internally communicates which hosts are online, it is
-               typically a good idea to get a fresh hostlist whenever gnunetd
-               starts from the WEB. By setting this option, you can specify 
from
-               which server gnunetd should try to download the hostlist. The
-               default should be fine for now.
-               
-               The general format is a list of space-separated URLs.  Each URL 
must
-               have the format http://HOSTNAME/FILENAME
-               
-               If you want to setup an alternate hostlist server, you must run 
a
-               permanent node and "cat data/hosts/* > hostlist" every few 
minutes
-               to keep the list up-to-date.
-               
-               If you do not specify a HOSTLISTURL, you must copy valid 
hostkeys to
-               data/hosts manually.
-               Default: HOSTLISTURL = "http://gnunet.org/hostlist 
http://gnunet.mine.nu:8081/hostlist http://de.gnunet.org/cgi-bin/hostlist.cgi 
http://uk.gnunet.org/hostlist";
-    
-       config HTTP-PROXY
-       string "HTTP Proxy Server"
-       default ""
-       depends on Meta::ADVANCED
-       help
-               If you have to use a proxy for outbound HTTP connections,
-               specify the proxy configuration here.  Default is no proxy.
-  
 
        config TRANSPORTS
        string "Which transport mechanisms are available?"
@@ -84,15 +53,6 @@
                 (a numeric value between -20 and 19, keep in mind that values 
smaller 
                 than 0 require root privileges).  Default is "NORMAL".
 
-       config USER
-       string "GNUnet user"
-       default ""
-       depends on Meta::ADVANCED
-       help
-               As which user account should gnunetd run?
-               Empty means "current user". On computer startup, it is 
root/SYSTEM.
-               Under Windows, this setting affects the creation of a new
-               system service only.
 
        config GROUP
        string "GNUnet group"
@@ -114,19 +74,6 @@
 
 
 menu "Network" "NETWORK"
-       config PORT
-       int "Client/Server Port"
-       range 1 65535
-       default "2087"
-       depends on Meta::ADVANCED
-       help
-               Which is the client-server port that is used between gnunetd 
and the
-               clients (TCP only).  You may firewall this port for non-local
-               machines (but you do not have to since GNUnet will perform 
access
-               control and only allow connections from machines that are listed
-               under TRUSTED).
-               Default: PORT = 2087
-
        config INTERFACE
        string "Interface to probe for external IP"
        help
@@ -168,22 +115,6 @@
 
                 If in doubt, use YES.  Default is YES.
   
-       config TRUSTED
-       string "IPs allowed to use gnunetd server"
-       default "127.0.0.0/8;"
-       depends on Meta::ADVANCED
-       help
-               This option specifies which hosts are trusted enough
-               to connect as clients (to the TCP port).  This is useful if you 
run
-               gnunetd on one host of your network and want to allow all other
-               hosts to use this node as their server.  By default, this is 
set to
-               'loopback only'.  The format is IP/NETMASK where the IP is 
specified in
-               dotted-decimal and the netmask either in CIDR notation (/16) or 
in
-               dotted decimal (255.255.0.0). Several entries must be separated 
by a
-               semicolon, spaces are not allowed. 
-
-               Default is "127.0.0.0/8;".
-
 endmenu
 
 

Modified: GNUnet/contrib/config-daemon.scm
===================================================================
--- GNUnet/contrib/config-daemon.scm    2006-10-21 22:42:14 UTC (rev 3533)
+++ GNUnet/contrib/config-daemon.scm    2006-10-22 00:52:59 UTC (rev 3534)
@@ -136,33 +136,124 @@
   (cons 1 14400)
   'advanced) )
 
-(define (general-loglevel builder)
+(define (general-hostlisturl builder)
  (builder
   "GNUNETD"
-  "LOGLEVEL"
-  (_ "Log level")
-  (_ "How verbose should the logging of errors be?")
+  "HOSTLISTURL"
+  (_ "Where can GNUnet find an initial list of peers?")
+  (_ 
+"GNUnet can automatically update the hostlist from the web. While GNUnet 
internally communicates which hosts are online, it is typically a good idea to 
get a fresh hostlist whenever gnunetd starts from the WEB. By setting this 
option, you can specify from which server gnunetd should try to download the 
hostlist. The default should be fine for now.
+               
+The general format is a list of space-separated URLs.  Each URL must have the 
format http://HOSTNAME/FILENAME
+               
+If you want to setup an alternate hostlist server, you must run a permanent 
node and \"cat data/hosts/* > hostlist\" every few minutes to keep the list 
up-to-date.
+               
+If you do not specify a HOSTLISTURL, you must copy valid hostkeys to 
data/hosts manually.")
   '()
   #t
-  "WARNING"
-  (list "NOTHING" "DEBUG" "STATUS" "INFO" "WARNING" "ERROR" "FATAL")
+  "http://gnunet.org/hostlist http://gnunet.mine.nu:8081/hostlist 
http://de.gnunet.org/cgi-bin/hostlist.cgi http://uk.gnunet.org/hostlist";
+  '()
   'always) )
 
-(define (general-logfile builder)
+(define (general-http-proxy builder)
  (builder
   "GNUNETD"
-  "LOGFILE"
-  (_ "Where should logs go?")
+  "HTTP-PROXY"
+  (_ "HTTP Proxy Server")
   (_ 
-"In which file should gnunetd write the logs?  If you specify nothing, logs 
are written to stderr (and note that if gnunetd runs in the background, stderr 
is closed and all logs are discarded)." )
+"If you have to use a proxy for outbound HTTP connections, specify the proxy 
configuration here.  Default is no proxy." )
   '()
   #t
-  "$GNUNETD_HOME/logs"
+  ""
   '()
   'advanced) )
 
-(define (general-keeplog builder)
+
+
+
+;; logging options
+
+(define (log-conf-user-urgency-severity-logger description user urgency 
severity logger builder def opt)
  (builder
+   "LOGGING"
+   (string-append user "-" urgency "-" severity "-" logger)
+   description
+   ""
+   '()
+   #t
+   def
+   opt
+   (if (string=? urgency "STDOUT") 'rare 'always)))
+
+
+;; FIXME: set default to /dev/null for DEVELOPER, INFO, STATUS and REQUEST 
file-logs
+(define (log-conf-user-urgency-severity description user urgency severity 
builder)
+ (builder
+   "LOGGING"
+   (string-append user "-" urgency "-" severity)
+   description
+   ""
+   (list
+     (log-conf-user-urgency-severity-logger (_"Log using standard error 
(YES/NO)") user urgency severity "STDERR" builder #f #f)
+     (log-conf-user-urgency-severity-logger (_"Log using standard output 
(YES/NO)") user urgency severity "STDOUT" builder #f #f)
+     (log-conf-user-urgency-severity-logger (_"Log this event type to a file 
(specify filename)") user urgency severity "FILE" builder "~/.gnunet/logs" '())
+   )
+   #t
+   #f
+   #f
+   (if (string=? severity "DEBUG") 'rare 
+     (if (string=? severity "STATUS") 'advanced
+        (if (string=? severity "INFO") 'advanced 'always )))))
+
+(define (log-conf-user-urgency description user urgency builder)
+ (builder
+   "LOGGING"
+   (string-append user "-" urgency)
+   description
+   ""
+   (list
+     (log-conf-user-urgency-severity (_"Logging of events that are fatal to 
some operation") user urgency "FATAL" builder)
+     (log-conf-user-urgency-severity (_"Logging of non-fatal errors") user 
urgency "ERROR" builder)
+     (log-conf-user-urgency-severity (_"Logging of warnings") user urgency 
"WARNING" builder)
+     (log-conf-user-urgency-severity (_"Logging of information messages") user 
urgency "INFO" builder)
+     (log-conf-user-urgency-severity (_"Logging of status messages") user 
urgency "STATUS" builder)
+     (log-conf-user-urgency-severity (_"Logging of debug messages") user 
urgency "DEBUG" builder)
+   )
+   #t
+   #f
+   #f
+   (if (string=? urgency "REQUEST") 'rare 'always)))
+
+(define (log-conf-user description user builder)
+ (builder
+   "LOGGING"
+   user
+   description
+   ""
+   (list
+     (log-conf-user-urgency (_"Logging of events that usually require 
immediate attention") user "IMMEDIATE" builder)
+     (log-conf-user-urgency (_"Logging of events that can be processed in 
bulk") user "BULK" builder)
+     (log-conf-user-urgency (_"Logging of events that are to be shown only on 
request") user "REQUEST" builder)
+   )
+   #t
+   #f
+   #f
+   (if (string=? user "DEVELOPER") 'advanced 'always)))
+
+(define (log-conf-date builder)
+ (builder
+   "LOGGING"
+   "DATE"
+   (_ "Log the date of the event")
+   (nohelp)
+   '()
+   #t
+   #t
+   #t
+   'advanced))
+
+(define (log-keeplog builder)
+ (builder
   "GNUNETD"
   "KEEPLOG"
   (_ "How long should logs be kept?")
@@ -173,6 +264,25 @@
   3
   (cons 0 36500)
   'advanced) )
+
+(define (logging builder)
+ (builder
+   "LOGGING"
+   "" 
+   (_ "Configuration of the logging system") 
+   (_ "Specify which system messages should be logged how")
+   (list 
+     (log-conf-date builder)
+     (log-keeplog builder)
+     (log-conf-user (_ "Logging of events for users") "USER" builder) 
+     (log-conf-user (_ "Logging of events for the system administrator") 
"ADMIN" builder) 
+     (log-conf-user (_ "Logging of events for developers") "DEVELOPER" 
builder) 
+   )
+   #t
+   #f
+   #f
+   'always) )
+
  
 (define (general-pidfile builder)
  (builder
@@ -186,6 +296,20 @@
   "$GNUNET_HOME/gnunetd.pid"
   '()
   'rare) )
+
+
+(define (general-username builder)
+ (builder
+  "GNUNETD"
+  "USER"
+  (_ "As which user should gnunetd run?")
+  (_ 
+"Empty means \"current user\". On computer startup, it is root/SYSTEM.  Under 
Windows, this setting affects the creation of a new system service only.")
+  '()
+  #f
+  ""
+  '()
+  'advanced) )
  
 
 (define (general-transports builder)
@@ -235,8 +359,44 @@
  
 
 
+(define (tcpserver-disable builder)
+ (builder
+ "TCPSERVER"
+ "DISABLE"
+ (_ "Disable client-server connections")
+ (nohelp)
+ '()
+ #t
+ #f
+ #f
+ 'advanced) )
 
+(define (network-port builder)
+ (builder
+ "NETWORK"
+ "PORT"
+ (_ "Client/Server Port")
+ (_ "Which is the client-server port that is used between gnunetd and the 
clients (TCP only).  You may firewall this port for non-local machines (but you 
do not have to since GNUnet will perform access control and only allow 
connections from machines that are listed under TRUSTED).")
+ '()
+ #t
+ 2087
+ (cons 1 65535)
+ 'advanced) )
 
+(define (network-trusted builder)
+ (builder
+ "NETWORK"
+ "TRUSTED"
+ (_ "IPs allowed to use gnunetd server")
+ (_ "This option specifies which hosts are trusted enough to connect as 
clients (to the TCP port).  This is useful if you run gnunetd on one host of 
your network and want to allow all other hosts to use this node as their 
server.  By default, this is set to 'loopback only'.  The format is IP/NETMASK 
where the IP is specified in dotted-decimal and the netmask either in CIDR 
notation (/16) or in dotted decimal (255.255.0.0). Several entries must be 
separated by a semicolon, spaces are not allowed.")
+ '()
+ #t
+ "127.0.0.0/8;"
+ '()
+ 'advanced) )
+
+
+
 (define (general builder)
  (builder
   "GNUNETD"
@@ -245,11 +405,14 @@
   (_ "Settings that change the behavior of GNUnet in general")
   (list 
     (general-path builder) 
+    (general-hostlisturl builder)
+    (general-http-proxy builder)
     (general-helloexpires builder) 
-    (general-loglevel builder) 
-    (general-logfile builder) 
-    (general-keeplog builder) 
+    (tcpserver-disable builder) 
+    (network-port builder) 
+    (network-trusted builder) 
     (general-pidfile builder) 
+    (general-username builder) 
     (general-transports builder) 
     (general-applications builder) 
   )
@@ -482,6 +645,30 @@
  (cons 0 65535)
  'advanced))
 
+(define (udp-mtu builder)
+ (builder
+ "UDP"
+ "MTU"
+ (_ "What is the maximum transfer unit for UDP?")
+ (nohelp)
+ '()
+ #t
+ 1472
+ (cons 1200 65500)
+ 'rare))
+
+(define (udp-blacklist builder)
+ (builder
+ "UDP"
+ "BLACKLIST"
+ (_ "Which IPs are not allowed to connect?")
+ (nohelp)
+ '()
+ #t
+ ""
+ '()
+ 'advanced))
+
 (define (udp builder)
  (builder
  "UDP"
@@ -490,6 +677,8 @@
  (nohelp)
  (list 
    (udp-port builder)
+   (udp-mtu builder)
+   (udp-blacklist builder)
  )
  #t
  #f
@@ -509,6 +698,18 @@
  (cons 0 65535)
  'nat-unlimited))
 
+(define (tcp6-blacklist builder)
+ (builder
+ "TCP6"
+ "BLACKLIST"
+ (_ "Which IPs are not allowed to connect?")
+ (nohelp)
+ '()
+ #t
+ ""
+ '()
+ 'advanced))
+
 (define (tcp6 builder)
  (builder
  "TCP6"
@@ -517,6 +718,7 @@
  (nohelp)
  (list 
    (tcp6-port builder)
+   (tcp6-blacklist builder)
  )
  #t
  #f
@@ -536,6 +738,30 @@
  (cons 0 65535)
  'advanced))
 
+(define (udp6-mtu builder)
+ (builder
+ "UDP6"
+ "MTU"
+ (_ "What is the maximum transfer unit for UDP 6?")
+ (nohelp)
+ '()
+ #t
+ 1452
+ (cons 1200 65500)
+ 'rare))
+
+(define (udp6-blacklist builder)
+ (builder
+ "UDP6"
+ "BLACKLIST"
+ (_ "Which IPs are not allowed to connect?")
+ (nohelp)
+ '()
+ #t
+ ""
+ '()
+ 'advanced))
+
 (define (udp6 builder)
  (builder
  "UDP6"
@@ -544,6 +770,8 @@
  (nohelp)
  (list 
    (udp6-port builder)
+   (udp6-mtu builder)
+   (udp6-blacklist builder)
  )
  #t
  #f
@@ -551,6 +779,30 @@
  'udp6-loaded) )
 
 
+(define (network-interface builder)
+ (builder
+ "NETWORK"
+ "INTERFACE"
+ (_ "Network interface")
+ (nohelp)
+ '()
+ #t
+ "eth0"
+ '()
+ 'nat-unlimited) )
+
+(define (network-ip builder)
+ (builder
+ "NETWORK"
+ "IP"
+ (_ "External IP address (leave empty to try auto-detection)")
+ (nohelp)
+ '()
+ #t
+ ""
+ '()
+ 'nat-unlimited) )
+
 (define (transports builder)
  (builder
   ""
@@ -559,6 +811,8 @@
   (nohelp)
   (list 
     (nat builder)
+    (network-interface builder)
+    (network-ip builder)
     (tcp builder)
     (tcp6 builder)
     (udp builder)
@@ -571,6 +825,60 @@
   'always) )
 
 
+
+(define (load-maxdown builder)
+ (builder
+ "LOAD"
+ "MAXNETDOWNBPS"
+ (_ "What is the maximum number of bytes per second that we may receive?")
+ (nohelp)
+ '()
+ #t
+ 50000
+ (cons 1 999999999)
+ 'always))
+
+(define (load-maxup builder)
+ (builder
+ "LOAD"
+ "MAXNETDOWNBPS"
+ (_ "What is the maximum number of bytes per second that we may send?")
+ (nohelp)
+ '()
+ #t
+ 50000
+ (cons 1 999999999)
+ 'always))
+
+(define (load-padding builder)
+ (builder
+ "GNUNETD-EXPERIMENTAL"
+ "PADDING"
+ (_ "Should we disable random padding (experimental option)?")
+ (nohelp)
+ '()
+ #t
+ #f
+ #f
+ 'experimental))
+
+(define (load builder)
+ (builder
+  ""
+  ""
+  (_ "Load management")
+  (nohelp)
+  (list 
+    (load-maxdown builder)
+    (load-maxup builder)
+    (load-padding builder)
+  )
+  #t
+  #f
+  #f
+  'always) )
+
+
 ;; main-menu
 
 (define (main builder)
@@ -582,6 +890,8 @@
   (list 
     (meta builder)
     (general builder) 
+    (logging builder)
+    (load builder)
     (modules builder) 
     (f2f builder) 
     (transports builder) 
@@ -652,6 +962,9 @@
             ((eq? i 'tcp6-loaded)  (change-visible ctx a b tcp6-loaded))
             (else 'nothing)
           )
-   ) ) ) )
+   ) ) ) 
+   (change-visible ctx "NETWORK" "PORT" (and advanced (not (get-option ctx 
"TCPSERVER" "DISABLE"))))
+   (change-visible ctx "NETWORK" "TRUSTED" (and advanced (not (get-option ctx 
"TCPSERVER" "DISABLE"))))
+  )
 ) )
 

Modified: GNUnet/src/setup/gnunet-setup.c
===================================================================
--- GNUnet/src/setup/gnunet-setup.c     2006-10-21 22:42:14 UTC (rev 3533)
+++ GNUnet/src/setup/gnunet-setup.c     2006-10-22 00:52:59 UTC (rev 3534)
@@ -172,6 +172,8 @@
       ? STRDUP(DEFAULT_DAEMON_CONFIG_FILE)
       : STRDUP(DEFAULT_CLIENT_CONFIG_FILE);
   dirname = string_expandFileName(ectx, cfgFilename);
+  FREE(cfgFilename);
+  cfgFilename = STRDUP(dirname);
   i = strlen(dirname) - 1;
   while (i > -1) {
     char ch = dirname[i];

Modified: GNUnet/src/setup/lib/tree.c
===================================================================
--- GNUnet/src/setup/lib/tree.c 2006-10-21 22:42:14 UTC (rev 3533)
+++ GNUnet/src/setup/lib/tree.c 2006-10-22 00:52:59 UTC (rev 3534)
@@ -206,7 +206,6 @@
   SCM_ASSERT(scm_string_p(option), option, SCM_ARG2, "set_option");
   SCM_ASSERT(scm_string_p(section), section, SCM_ARG3, "set_option");
   SCM_ASSERT(scm_string_p(value), value, SCM_ARG4, "set_option");
-
   tc    = (TC *) SCM_SMOB_DATA(smob);
   opt = scm_to_locale_string(option);
   sec = scm_to_locale_string(section);
@@ -364,10 +363,6 @@
   SCM smob_ctx;
   SCM proc;
 
-  /* I hope that loading of "specification" from
-     tree_parse is preserved by guile.
-     Otherwise we have to re-do this here */
-  scm_c_primitive_load("/home/grothoff/share/GNUnet/config-daemon.scm");
   proc = scm_variable_ref(scm_c_lookup("gnunet-config-change"));
   smob_ctx = box_tc(tc);
   scm_apply_1(proc, smob_ctx, SCM_EOL);
@@ -443,8 +438,7 @@
     len = strlen(oldpath);
   env = malloc(len + strlen(load) + 18);
   strcpy(env, "GUILE_LOAD_PATH=");
-  if (oldpath)
-  {
+  if (oldpath) {
     strcat(env, oldpath);
     strcat(env, ";");
   }

Modified: GNUnet/src/transports/udp6.c
===================================================================
--- GNUnet/src/transports/udp6.c        2006-10-21 22:42:14 UTC (rev 3533)
+++ GNUnet/src/transports/udp6.c        2006-10-22 00:52:59 UTC (rev 3534)
@@ -77,7 +77,7 @@
   unsigned long long port;
 
  if (-1 == GC_get_configuration_value_number(cfg,
-                                             "UDP",
+                                             "UDP6",
                                              "PORT",
                                              1,
                                              65535,
@@ -373,7 +373,7 @@
   MUTEX_LOCK(configLock);
   FREENONNULL(filteredNetworks_);
   if (0 != GC_get_configuration_value_string(cfg,
-                                            "UDP",
+                                            "UDP6",
                                             "BLACKLIST",
                                             NULL,
                                             &ch))
@@ -427,7 +427,7 @@
   configLock = MUTEX_CREATE(NO);
   reloadConfiguration();
   if (-1 == GC_get_configuration_value_number(cfg,
-                                             "UDP",
+                                             "UDP6",
                                              "MTU",
                                              sizeof(UDPMessage) + 
P2P_MESSAGE_OVERHEAD + sizeof(MESSAGE_HEADER) + 32,
                                              65500,

Modified: GNUnet/src/util/boot/startup.c
===================================================================
--- GNUnet/src/util/boot/startup.c      2006-10-21 22:42:14 UTC (rev 3533)
+++ GNUnet/src/util/boot/startup.c      2006-10-22 00:52:59 UTC (rev 3534)
@@ -30,6 +30,18 @@
 #include "platform.h"
 
 /**
+ * Configure logging mechanism as specified by
+ * user (and supported by system).  
+ * 
+ * @return 0 on success, 1 on error
+ */
+static int configure_logging(struct GE_Context ** ectx,
+                            struct GC_Configuration * cfg) {
+  
+  return 0;
+}
+
+/**
  * Run a standard GNUnet startup sequence
  * (initialize loggers and configuration,
  * parse options).
@@ -47,6 +59,8 @@
                struct GC_Configuration ** cfg) {
   int i;
 
+  /* during startup, log all warnings and higher
+     for anybody to stderr */
   *ectx = GE_create_context_stderr(NO,
                                   GE_WARNING | GE_ERROR | GE_FATAL |
                                   GE_USER | GE_ADMIN | GE_DEVELOPER |
@@ -66,6 +80,8 @@
   if (OK != GC_parse_configuration(*cfg,
                                   *cfgFileName)) 
     return -1;
+  if (configure_logging(ectx, *cfg) != 0)
+    return -1;
   return i;
 }
 

Modified: GNUnet/src/util/config_impl/impl.c
===================================================================
--- GNUnet/src/util/config_impl/impl.c  2006-10-21 22:42:14 UTC (rev 3533)
+++ GNUnet/src/util/config_impl/impl.c  2006-10-22 00:52:59 UTC (rev 3534)
@@ -293,15 +293,30 @@
   FILE *fp;
   int error;
   int ret;
+  char * dirname;
+  size_t pos;
+  char * fn;
 
+  fn = string_expandFileName(NULL, filename);
+  dirname = STRDUP(fn);
+  pos = strlen(dirname);
+  while ( (pos > 0) &&
+         (dirname[pos] != DIR_SEPARATOR) )
+    pos--;
+  dirname[pos] = '\0';
+  disk_directory_create(NULL, dirname);
+  FREE(dirname);
+  
   data = cfg->data;
-  if (NULL == (fp = FOPEN(filename, "w"))) {
+  if (NULL == (fp = FOPEN(fn, "w"))) {
     GE_LOG_STRERROR_FILE(data->ectx,
                         GE_ERROR | GE_USER | GE_IMMEDIATE,
                         "fopen",
-                        filename);
+                        fn);
+    FREE(fn);
     return -1;
   }
+  FREE(fn);
   error = 0;
   ret = 0;
   MUTEX_LOCK(data->lock);

Modified: GNUnet/todo
===================================================================
--- GNUnet/todo 2006-10-21 22:42:14 UTC (rev 3533)
+++ GNUnet/todo 2006-10-22 00:52:59 UTC (rev 3534)
@@ -14,7 +14,8 @@
 
 0.7.1 [10'06] (aka "stabilization")
 - finish util refactoring: [RC]
-  * logger configuration 
+  * logger configuration:
+    + util/boot code to parse configuration   
   * error handling: [RC]
     + tcpio
     + fs/module
@@ -23,7 +24,28 @@
     + fs/fsui
   * gnunet-setup: [RC]
     + Scheme (scm) specification of entire configuration
-      @ check for dead options!
+      - util/network_client
+      - util/os
+      - advertising
+      - state
+      - datastore
+      - identity
+      - topology_default
+      - gap
+      - connect
+      - fs/module
+      - fsui
+      - ecrs
+      - uritrack
+      - namespace
+      - sqlite
+      - mysql
+      - gnunet-stats
+      - gnunet-tracekit
+      - gnunet-insert/download/unindex
+      - DHT options
+      - topology_f2f
+      - kvstore
     + gtk wizard
     + ncurses wizard
 - fix critical known bugs (see Mantis for updates):





reply via email to

[Prev in Thread] Current Thread [Next in Thread]