Esempio n. 1
0
def link (entity1, entity2, latency=None):
  """ Connects the two nodes on a free port """
  #return topoOf(entity1).linkTo(entity2)

  # Add latency if there is - Kaifei Chen([email protected])
  if latency is None:
      return topoOf(entity1).linkTo(entity2)
  else:
      return topoOf(entity1).linkTo(entity2, latency=latency)
Esempio n. 2
0
def show_ports (entity):
  ports = topoOf(entity).get_ports()
  print "Ports for %s:" % (entity,)
  for p in ports:
    p1 = "%s:%i" % (p[0],p[1])
    p2 = "%s:%i" % (p[2],p[3])
    print "%14s <-> %-14s" % (p1,p2)
Esempio n. 3
0
def show_ports(entity):
    ports = topoOf(entity).get_ports()
    print "Ports for %s:" % (entity, )
    for p in ports:
        p1 = "%s:%i" % (p[0], p[1])
        p2 = "%s:%i" % (p[2], p[3])
        print "%14s <-> %-14s" % (p1, p2)
Esempio n. 4
0
def link (entity1, entity2):
  """ Connects the two nodes on a free port """
  return topoOf(entity1).linkTo(entity2)
Esempio n. 5
0
def disconnect (entity):
  """ Disconnects this entity from everything """
  return topoOf(entity).disconnect()
Esempio n. 6
0
def unlink (entity1, entity2):
  """ Disconnects two connected nodes """
  return topoOf(entity1).unlinkTo(entity2)
Esempio n. 7
0
def link(entity1, entity2):
    """ Connects the two nodes on a free port """
    return topoOf(entity1).linkTo(entity2)
Esempio n. 8
0
def disconnect(entity):
    """ Disconnects this entity from everything """
    return topoOf(entity).disconnect()
Esempio n. 9
0
def unlink(entity1, entity2):
    """ Disconnects two connected nodes """
    return topoOf(entity1).unlinkTo(entity2)
Esempio n. 10
0
def unlink_later(entity1, entity2, sec_later):
  return topoOf(entity1).unlinkTo(entity2, sec_later)