Beispiel #1
0
 def _get_nom_snapshot(self, message):
     snapshot = self.snapshotter.get_snapshot()
     response = SyncMessage(type="RESPONSE",
                            messageClass="NOMSnapshot",
                            time=SyncTime.now(),
                            xid=message.xid,
                            value=snapshot)
     self.send(response)
Beispiel #2
0
 def _get_deterministic_value(self, message):
     value = self.state_master.get_deterministic_value(
         self.controller, message.name)
     response = SyncMessage(type="RESPONSE",
                            messageClass="DeterministicValue",
                            time=SyncTime.now(),
                            xid=message.xid,
                            value=value)
     self.send(response)
Beispiel #3
0
 def send_link_notification(self, link_attrs):
     # Link attrs must be a list of the form:
     # [dpid1, port1, dpid2, port2]
     if self.speaker:
         msg = SyncMessage(type="ASYNC",
                           messageClass="LinkDiscovery",
                           value=link_attrs)
         return self.speaker.send(msg)
     else:
         log.warn("STSSyncConnection: not connected. cannot send link")
Beispiel #4
0
 def send_deterministic_value(self, xid, value):
     if self.speaker:
         msg = SyncMessage(type="RESPONSE",
                           messageClass="DeterministicValue",
                           time=value,
                           xid=xid,
                           value=value)
         return self.speaker.send(msg)
     else:
         log.warn("STSSyncConnection: not connected. cannot ACK")
Beispiel #5
0
 def test_basic(self):
     m = SyncMessage(**self.basic_hash)
Beispiel #6
0
 def test_basic(self):
     # TODO(cs): test something
     m = SyncMessage(**self.basic_hash)