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)
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)
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")
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")
def test_basic(self): m = SyncMessage(**self.basic_hash)
def test_basic(self): # TODO(cs): test something m = SyncMessage(**self.basic_hash)