Ejemplo n.º 1
0
 def _remove_extra_flows(self, extra_flows):
     msg_list = []
     for tbl in extra_flows:
         for flow in extra_flows[tbl]:
             match = ovs_flow_match_to_magma_match(flow)
             self.logger.debug('Sending msg for deletion -> %s',
                               match.ryu_match)
             msg_list.append(
                 flows.get_delete_flow_msg(
                     self._datapath,
                     tbl,
                     match,
                     cookie=flow.cookie,
                     cookie_mask=flows.OVS_COOKIE_MATCH_ALL))
     if msg_list:
         chan = self._msg_hub.send(msg_list, self._datapath)
         self._wait_for_responses(chan, len(msg_list))
Ejemplo n.º 2
0
 def _remove_extra_flows(self, extra_flows):
     msg_list = []
     for flow in extra_flows:
         if DIRECTION_REG in flow.match:
             direction = Direction(flow.match.get(DIRECTION_REG, None))
         else:
             direction = None
         match = MagmaMatch(imsi=flow.match.get(IMSI_REG, None),
                            direction=direction)
         self.logger.debug('Sending msg for deletion -> %s',
                           flow.match.get('reg1', None))
         msg_list.append(
             flows.get_delete_flow_msg(
                 self._datapath,
                 self.tbl_num,
                 match,
                 cookie=flow.cookie,
                 cookie_mask=flows.OVS_COOKIE_MATCH_ALL))
     if msg_list:
         chan = self._msg_hub.send(msg_list, self._datapath)
         self._wait_for_responses(chan, len(msg_list))