

def _add_subnet_send_to_proactive_routing(self, network_id, dst_network, dst_netmask, dst_router_tunnel_key, dst_network_id, dst_router_port_mac):
    parser = self.get_datapath().ofproto_parser
    ofproto = self.get_datapath().ofproto
    if (netaddr.IPAddress(dst_network).version == 4):
        match = parser.OFPMatch(eth_type=ether.ETH_TYPE_IP, metadata=network_id, ipv4_dst=(dst_network, dst_netmask))
    else:
        match = parser.OFPMatch(eth_type=ether.ETH_TYPE_IPV6, metadata=network_id, ipv6_dst=(dst_network, dst_netmask))
    actions = []
    actions.append(parser.OFPActionDecNwTtl())
    actions.append(parser.OFPActionSetField(metadata=dst_network_id))
    actions.append(parser.OFPActionSetField(eth_src=dst_router_port_mac))
    action_inst = self.get_datapath().ofproto_parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS, actions)
    goto_inst = parser.OFPInstructionGotoTable(const.L3_PROACTIVE_LOOKUP_TABLE)
    inst = [action_inst, goto_inst]
    self.mod_flow(self.get_datapath(), cookie=dst_router_tunnel_key, inst=inst, table_id=const.L3_LOOKUP_TABLE, priority=const.PRIORITY_MEDIUM, match=match)

dataset/ETHPy150Open openstack/dragonflow/dragonflow/controller/l3_proactive_app.py L3ProactiveApp._add_subnet_send_to_proactive_routing/original