def handle_HELLO (self, con, msg): #S # Send features and switch desc requests if not self._features_request_sent: self._features_request_sent = True fr = of.ofp_features_request() if self.request_description: ss = of.ofp_stats_request() ss.body = of.ofp_desc_stats_request() con.send(fr.pack() + ss.pack()) else: con.send(fr)
def handle_HELLO(self, con, msg): #S # Send features and switch desc requests if not self._features_request_sent: self._features_request_sent = True fr = of.ofp_features_request() if self.request_description: ss = of.ofp_stats_request() ss.body = of.ofp_desc_stats_request() con.send(fr.pack() + ss.pack()) else: con.send(fr)
def _timer_func (): if len(core.openflow._connections.values())==0: # since no switch is connected, clean everything. del switches[:] hosts.clear() switch_desc.clear() adjacency.clear() link_bw.clear() link_bw_total.clear() byte.clear() byte_r.clear() clock.clear() flow_stats.clear() aggr_stats.clear() port_stats.clear() for connection in core.openflow._connections.values(): connection.send(of.ofp_stats_request(body=of.ofp_port_stats_request())) connection.send(of.ofp_stats_request(body=of.ofp_aggregate_stats_request())) connection.send(of.ofp_stats_request(body=of.ofp_flow_stats_request())) connection.send(of.ofp_stats_request(body=of.ofp_desc_stats_request()))
def _handle_ConnectionUp(event): msg = of.ofp_stats_request(body=of.ofp_desc_stats_request()) msg.type = 0 # For betta bug, can be removed event.connection.send(msg)
def _handle_ConnectionUp (event): msg = of.ofp_stats_request(body=of.ofp_desc_stats_request()) msg.type = 0 # For betta bug, can be removed event.connection.send(msg)
def _send_SwitchDescReq (self, dpid): body = of.ofp_desc_stats_request() body._type = 0 msg = of.ofp_stats_request(body=body) con = core.openflow.getConnection(dpid) con.send(msg.pack())
def _handle_ConnectionUp (self, event): log.debug("Switch %s has come up.", dpid_to_str(event.dpid)) #print event.ofp event.connection.send(of.ofp_stats_request(body=of.ofp_port_stats_request())) event.connection.send(of.ofp_stats_request(body=of.ofp_flow_stats_request())) event.connection.send(of.ofp_stats_request(body=of.ofp_desc_stats_request()))
def _send_SwitchDescReq(self, dpid): body = of.ofp_desc_stats_request() body._type = 0 msg = of.ofp_stats_request(body=body) con = core.openflow.getConnection(dpid) con.send(msg.pack())