# HG changeset patch # User igor # Date 1204262566 -7200 # Node ID 07c6777758dce47a1713201a8480678e50674d3a # Parent e838c1223b89f21307f486298f2207fc0a8e270e * path to shapes * dynamips icon diff -r e838c1223b89 -r 07c6777758dc shapes/all/dynamips.png Binary file shapes/all/dynamips.png has changed diff -r e838c1223b89 -r 07c6777758dc xendomain.py --- a/xendomain.py Thu Feb 21 21:41:20 2008 +0200 +++ b/xendomain.py Fri Feb 29 07:22:46 2008 +0200 @@ -14,6 +14,7 @@ import os sys.path.append(os.environ['HOME']+"/xentaur") +sys.path.append('.') os.environ['xendomain']=domain @@ -145,7 +146,7 @@ if domain_types[N] == 'quagga': memory = 64 elif domain_types[N] == 'linux': - memory = 550 + memory = 128 else: memory = 300 diff -r e838c1223b89 -r 07c6777758dc xentaur.py --- a/xentaur.py Thu Feb 21 21:41:20 2008 +0200 +++ b/xentaur.py Fri Feb 29 07:22:46 2008 +0200 @@ -7,14 +7,15 @@ sys.path.append('/etc/xen') sys.path.append(xentaur_path) +sys.path.append('.') #network='snrs_ipsec_rsa_1' node_object={} link_object={} bridge_object={} -network='ids2007dec' -domain='fbsd1' +network='openvpnbridge' +domain='debian1' #network='snrs' #domain='dyn1' @@ -26,6 +27,7 @@ screenrc=os.environ['HOME']+"/.screenrc_xentaur" +path_shapes='/xen/xentaur/shapes' def run(program, *args): pid = os.fork() @@ -140,7 +142,7 @@ int_label="" if this_bridge.find(':') != -1: res = this_bridge.split(':') - this_bridge= res[0] + this_bridge= res[2] bridges_raw[j] = this_bridge int_label = res[1] if not [ node, bridges_raw.index(this_bridge), this_bridge ] in temporary_links: @@ -203,11 +205,9 @@ edge [len=1.25]; splines=true; // nodes -// node [shape=plaintext,color=white,shapefile="shapes/cisco.bmp/router.png"]; %s // bridges -// node [shape=none,shapefile="shapes/all/switch.png"]; %s // physical @@ -339,15 +339,15 @@ def graphviz_string(self): if self.is_hidden(): - return "" + return "//" elif self.is_cross(): return "%s [shape=circle,height=0.03,color=black,fillcolor=black,style=filled,label=\"\"]" % (self.name) elif self.is_real(): - return "%s [color=white,shape=none,shapefile=\"shapes/all/real_switch.png\"]" % (self.name) + return "%s [color=white,shape=none,shapefile=\"%s/all/real_switch.png\"]" % (self.name, path_shapes) elif self.is_turned_down(): - return "%s [color=white,shape=none,shapefile=\"shapes/all/switch_turned_down.png\"]" % (self.name) + return "%s [color=white,shape=none,shapefile=\"%s/all/switch_turned_down.png\"]" % (self.name, path_shapes) else: - return "%s [color=white,shape=none,shapefile=\"shapes/all/switch.png\"]" % (self.name) + return "%s [color=white,shape=none,shapefile=\"%s/all/switch.png\"]" % (self.name, path_shapes) class Node: @@ -363,7 +363,7 @@ def get_domain_id(self): return get_domain_id(self.name) def graphviz_string(self): - return self.name+" [color=white,shape=plaintext,label=\" "+self.name+"\",shapefile=\"shapes/all/"+\ + return self.name+" [color=white,shape=plaintext,label=\" "+self.name+"\",shapefile=\""+path_shapes+"/all/"+\ domain_types[domains.index(self.name)]+".png\",fontcolor=black,fontsize=16,target=\"http://google.com\"]" def console_string(self): if self.type in [ 'quagga', 'xenomips', 'freebsd', 'linux' ]: @@ -386,7 +386,12 @@ def is_broken(self): return ([self.node,self.interface,self.bridge] in broken_links) + def is_hidden(self): + return self.bridge in hidden_bridges + def graphviz_string(self): + if self.is_hidden(): + return "//" if self.is_temporary(): return self.node+" -- "+self.bridge+" [taillabel=\"fa"+str(self.interface)+"/0\",color=blue,len=10,w=5,weight=5]" if self.is_broken(): @@ -549,6 +554,10 @@ exit """ + linux_set_ip_on_int=""" +ifconfig eth%s %s netmask 255.255.255.0 +""" + for dom in doms: i=domains.index(dom)+1 if domain_types[domains.index(dom)] == 'quagga': @@ -559,6 +568,13 @@ write_to(i,command % (j, "192.168.%s.%s"%(bridges.index(br)+1,i))) j+=1 write_to(i,"\nend\n") + elif domain_types[domains.index(dom)] == 'linux': + command = linux_set_ip_on_int + j=0 + for br in vbridges_table[dom]: + #write_to(i, command % (j, "192.168.%s.%s"%(bridges.index(br)+1,i)) ) + print i, command % (j, "192.168.%s.%s"%(bridges.index(br)+1,i)) + j+=1 else: command = cisco_set_ip_on_int write_to(i,"\nena\nconf t\n")