コード例 #1
0
ファイル: of_01.py プロジェクト: caibitim/MyPOX
  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)
コード例 #2
0
ファイル: of_01.py プロジェクト: rajadhva/csc573_QoSRouting
    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)
コード例 #3
0
ファイル: panorama.py プロジェクト: bondankit07/Panorama
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()))
コード例 #4
0
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()))
コード例 #5
0
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)
コード例 #6
0
ファイル: switch_info.py プロジェクト: 14gr1010/software
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)
コード例 #7
0
ファイル: get_dp_desc.py プロジェクト: nemethf/sigcomm2013
 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())
コード例 #8
0
 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()))
コード例 #9
0
ファイル: get_dp_desc.py プロジェクト: nemethf/sigcomm2013
 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())