

def add_router_port(self, router, router_port, local_network_id):
    datapath = self.get_datapath()
    parser = datapath.ofproto_parser
    mac = router_port.get_mac()
    tunnel_key = router_port.get_tunnel_key()
    dst_ip = router_port.get_ip()
    if (netaddr.IPAddress(router_port.get_ip()).version == 4):
        ArpResponder(datapath, local_network_id, dst_ip, mac).add()
    if (netaddr.IPAddress(dst_ip).version == 4):
        match = parser.OFPMatch(eth_type=ether.ETH_TYPE_IP, metadata=local_network_id, ipv4_dst=dst_ip)
    else:
        match = parser.OFPMatch(eth_type=ether.ETH_TYPE_IPV6, metadata=local_network_id, ipv6_dst=dst_ip)
    goto_inst = parser.OFPInstructionGotoTable(const.EGRESS_TABLE)
    inst = [goto_inst]
    self.mod_flow(datapath, inst=inst, table_id=const.L3_LOOKUP_TABLE, priority=const.PRIORITY_HIGH, match=match)
    self._install_flow_send_to_output_table(local_network_id, dst_ip)
    for port in router.get_ports():
        if (port.get_name() != router_port.get_name()):
            port_net_id = self.db_store.get_network_id(port.get_lswitch_id())
            self._add_subnet_send_to_proactive_routing(local_network_id, port.get_cidr_network(), port.get_cidr_netmask(), port.get_tunnel_key(), port_net_id, port.get_mac())
            self._add_subnet_send_to_proactive_routing(port_net_id, router_port.get_cidr_network(), router_port.get_cidr_netmask(), tunnel_key, local_network_id, router_port.get_mac())

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