router_route_del
2017-02-10 10:57:28 0 举报
AI智能生成
`router_route_del` 是一个用于删除路由器路由表项的函数或命令。它的作用是从路由器的路由表中移除指定的路由条目,以便重新配置网络连接或优化网络性能。通过指定路由的目标地址、子网掩码和下一跳地址等参数,可以精确地删除特定的路由信息。该函数通常在网络管理员或系统管理员使用网络设备进行配置和管理时使用,以确保网络中的数据能够按照预期的路径传输。使用 `router_route_del` 可以提高网络的稳定性和安全性,同时简化网络配置和维护的过程。
作者其他创作
大纲/内容
class
UnexpectedRouterRpcException
RouterRpcInfoErrorException
UnExpectedRouterException
VrouterPluginApi
继承了 proxy.RpcProxy
sync_routers (rpc_consume)
update_floatingip_statuses (rpc_consume)
VrouterAction
__init__
__call__
只要定义类型的时候,实现__call__函数,这个类型就成为可调用的
__repr__
compare
相同 resource,越新的 action 优先级越高
post_action
设置 action 处理完成的时间
if result_dispatcher,判断结果
check_fresh
判断是否需要 check fresh?
PortAction
__init__
继承 VrouterAction
FdbAction
__init__
继承 VrouterAction
RouterAction
__init__
继承 VrouterAction
DvrRoutesAction
继承 p_runner.ResourceActionWithRetry
这个是我改的,是否可以和上面保持一致,都继承 VrouterAction
__repr__
_call__
post_action
timestamp
compare
timestamp (set)
check_fresh
DvrRoutesInfo
cache 结构
VrouterPortsCache
只用于 qr port
__init__
进入目录,如果没有该目录则创建
打开bvrouter_vif_ports文件
reload 配置,恢复 vrouter_vif_ports
better_to_sync
master_bvrouter 挂掉并且没有选出新的 master_bvrouter 的场景
RouterInfo
__init__
__repr__
VrouterL2population
继承了 l2population_rpc.L2populationRpcCallBackMixin
这个类定义了一些抽象函数
重写了上面类的抽象函数
fdb_add
fdb_remove
fdb_update
fdb_action_dispatch
fdb 一些真正的处理过程
VrouterAgent
__init__
check_parameter
bvrouter_warpper
priority_runner
vpc_firewall
fw_agent_rpc_callback
FWaaSVPCAgentRpcCallback
firewall 的一些 action
register_extend_agent
dedicated_interface
dedicated_interface_rpc_callback
register_extend_agent
l2_pop
l2_pop_callback
vrouter_rpc
sync_routers
update_floatingip_statuses
_setup_extend_rpc
设置 consumers
port update
l2population update
设置 callback
self.l2_pop_callback
VrouterL2population (fdb 相关)
port_action
add
_port_add
get_device_details
port_id in details?
yes
details['admin_state_up'] ?
True
update_device_up
False
update_device_down
self.ports_cache.add_vrouter_vif_port
no
self.ports_cache.del_vrouter_vif_port
update
_port_update
get_device_details
port_id in details?
yes
details['admin_state_up'] ?
True
better_to_resync ?
yes
new_port = True
no
new_port = False
update_device_up (new_port, init_flag)
False
update_device_down
no
self.ports_cache.del_vrouter_vif_port
delete
_port_delete
self.ports_cache.del_vrouter_vif_port
get_device_details
port_id in details?
return
update_device_down
router_action
_process_router_sync
_process_router_add
_process_router_internal_ports
add_ports
router_if_del
PORT DEL
del_ports
router_if_add
PORT ADD
_process_router_external_port
qg
_process_router_floatingips
_process_router_floating_ip_nat_rules
根据当前的nat 规则生成 floatingip 和 fixed_ip 对
current
remove
处理 cache 中的 floatingips
如果在 current 中,跳过
否则,添加到 list
在current 中
是
从 removes 中删除该对
否
添加到 list -> 添加到 nf-rules
处理 removes
_process_router_floating_ip_addresses
获取到 qg 接口
将 floatingips 添加到 qg 接口的 floatingips
更新 floatingip 的状态
dvr_process_router_add
fetch_dvr_routes
add_dvr_routes
_dvr_process_rules_add
_process_router_update
和 add 的逻辑基本一致
_process_router_delete
bvr-agent bvrouter-delete
如果需要,清理 cache
VrouterAgentWithStateReport
继承了 VrouterAgent
0 条评论
下一页