ipif: set interface names
[hippotat] / hippotatlib / __init__.py
index 0c3577f..2a2a8ee 100644 (file)
@@ -136,15 +136,15 @@ max_batch_up = 4000
 http_retry = 5
 port = 80
 vroutes = ''
+ifname_client = hippo%%d
+ifname_server = shippo%%d
 
 #[server] or [<client>] overrides
-ipif = userv root ipif %(local)s,%(peer)s,%(mtu)s,slip %(rnets)s
+ipif = userv root ipif %(local)s,%(peer)s,%(mtu)s,slip,%(ifname)s %(rnets)s
 
 # relating to virtual network
 mtu = 1500
 
-[SERVER]
-server = SERVER
 # addrs = 127.0.0.1 ::1
 # url
 
@@ -525,6 +525,10 @@ def cfg_process_ipif(c, sections, varmap):
 
 #---------- startup ----------
 
+def log_debug_config(m):
+  if not DBG.CONFIG in debug_set: return
+  print('DBG.CONFIG:', m)
+
 def common_startup(process_cfg):
   # calls process_cfg(putative_clients, putative_servers)
 
@@ -536,7 +540,7 @@ def common_startup(process_cfg):
   def readconfig(pathname, mandatory=True):
     def log(m, p=pathname):
       if not DBG.CONFIG in debug_set: return
-      print('DBG.CONFIG: %s: %s' % (m, pathname))
+      log_debug_config('%s: %s' % (m, pathname))
 
     try:
       files = os.listdir(pathname)
@@ -695,3 +699,4 @@ def common_run():
   log_debug(DBG.INIT, 'entering reactor')
   if not _crashing: reactor.run()
   print('ENDED', file=sys.stderr)
+  sys.exit(16)