chiark / gitweb /
wip, client does something
[hippotat] / client
diff --git a/client b/client
index b3556471e489642caeff34c8bcc91f85ec80aeba..7684cf33b682dad6212861880aa52df1bab245ac 100755 (executable)
--- a/client
+++ b/client
@@ -8,21 +8,24 @@ max_requests_outstanding = 4
 
 [virtual]
 mtu = 1500
-# [server]  } maybe computed from `network' (see server defaults)
+# [server]  # maybe computed from `network' (see server defaults)
+# [routes]  # default is none
 
 [server]
-# url     } maybe computed from `addrs' and `port' (see server defaults)
+# url     # maybe computed from `addrs' and `port' (see server defaults)
 
 # [<my ip address>]
 # password = <password>
 '''
 
-c.clientv = None
+client_cs = None
 
 def set_client(ci,cs,pw):
+  global client_cs
   global password
-  assert(c.clientv is None)
-  c.clientv = ci
+  assert(client_cs is None)
+  client_cs = cs
+  c.client = ci
   c.max_outstanding = cfg.getint(cs, 'max_requests_outstanding')
   password = pw
 
@@ -41,5 +44,21 @@ def process_cfg():
 
   process_cfg_clients(set_client)
 
+  try:
+    c.routes = cfg.get('virtual','routes')
+  except NoOptionError:
+    c.routes = ''
+
+  process_cfg_ipif(client_cs,
+                   (('local', 'client'),
+                    ('peer',  'server'),
+                    ('rnets', 'routes')))
+
+def outbound(packet, saddr, daddr):
+  print('OUT ', saddr, daddr, repr(packet))
+  pass
+
 common_startup(defcfg)
 process_cfg()
+start_ipif(c.ipif_command, outbound)
+common_run()