def block(self, ip):
        match = of.ofp_match()
        match.nw_src = IPAddr(ip)

        print self.colours["GREEN"] + "blocking ", ip + self.colours["END"]
        msg2 = of.ofp_flow_mod(command=of.OFPFC_ADD, actions=[], match=match)
        for connection in core.openflow.connections:
            connection.send(msg2)
Exemplo n.º 2
0
    def block(self, ip):
        match = of.ofp_match()
        match.nw_src = IPAddr(ip)

        print self.colours["GREEN"] + "blocking ", ip + self.colours["END"]
        msg2 = of.ofp_flow_mod(command=of.OFPFC_ADD, actions=[], match=match)
        for connection in core.openflow.connections:
            connection.send(msg2)
Exemplo n.º 3
0
 def sendMatch(self,match,connection):
     message = of.ofp_flow_mod()
     message.match = match
     
     connection.send(message)
Exemplo n.º 4
0
 def sendLatencyFlowMod(self,switch):
     msg = of.ofp_flow_mod()
     msg.match.dl_type = 0001
     print "sending flow..."
     msg.actions.append(of.ofp_action_output(port=of.OFPP_CONTROLLER))
     switch.send(msg)
 def sendLatencyFlowMod(self, switch):
     msg = of.ofp_flow_mod()
     msg.match.dl_type = 0001
     msg.actions.append(of.ofp_action_output(port=of.OFPP_CONTROLLER))
     switch.send(msg)