+def get_nodeid(myid, remoteid):
+ if myid < remoteid:
+ nodeid = 1
+ else:
+ nodeid = 2
+ return nodeid
+
+def get_virt_ip(myid, remoteid):
+ linkid = get_linkid(myid, remoteid)
+ nodeid = get_nodeid(myid, remoteid)
+ first = linkid >> 6
+ second = ((linkid & 0x3f)<<2) + nodeid
+ return "192.168.%d.%d" % (first, second)
+
+def get_virt_net(myid, remoteid):
+ linkid = get_linkid(myid, remoteid)
+ first = linkid >> 6
+ second = (linkid & 0x3f)<<2
+ return "192.168.%d.%d/30" % (first, second)