static int config_write_segment_routing(struct vty *vty);
-static int config_write_traffic_eng(struct vty *vty);
-static int config_write_segment_lists(struct vty *vty);
-static int config_write_sr_policies(struct vty *vty);
static int segment_list_has_src_dst(
struct vty *vty, char *xpath, long index, const char *index_str,
struct in_addr adj_src_ipv4, struct in_addr adj_dst_ipv4,
DEFINE_MTYPE_STATIC(PATHD, PATH_CLI, "Client");
+DEFINE_HOOK(pathd_srte_config_write, (struct vty *vty), (vty));
+
/* Vty node structures. */
static struct cmd_node segment_routing_node = {
.name = "segment-routing",
.node = SR_TRAFFIC_ENG_NODE,
.parent_node = SEGMENT_ROUTING_NODE,
.prompt = "%s(config-sr-te)# ",
- .config_write = config_write_traffic_eng,
};
static struct cmd_node srte_segment_list_node = {
.node = SR_SEGMENT_LIST_NODE,
.parent_node = SR_TRAFFIC_ENG_NODE,
.prompt = "%s(config-sr-te-segment-list)# ",
- .config_write = config_write_segment_lists,
};
static struct cmd_node srte_policy_node = {
.node = SR_POLICY_NODE,
.parent_node = SR_TRAFFIC_ENG_NODE,
.prompt = "%s(config-sr-te-policy)# ",
- .config_write = config_write_sr_policies,
};
static struct cmd_node srte_candidate_dyn_node = {
int config_write_segment_routing(struct vty *vty)
{
vty_out(vty, "segment-routing\n");
- return 1;
-}
-
-int config_write_traffic_eng(struct vty *vty)
-{
vty_out(vty, " traffic-eng\n");
+
path_ted_config_write(vty);
- return 1;
-}
-int config_write_segment_lists(struct vty *vty)
-{
yang_dnode_iterate(config_write_dnode, vty, running_config->dnode,
"/frr-pathd:pathd/srte/segment-list");
-
- return 1;
-}
-
-int config_write_sr_policies(struct vty *vty)
-{
yang_dnode_iterate(config_write_dnode, vty, running_config->dnode,
"/frr-pathd:pathd/srte/policy");
+ hook_call(pathd_srte_config_write, vty);
+
return 1;
}
.name = "srte pcep",
.node = PCEP_NODE,
.parent_node = SR_TRAFFIC_ENG_NODE,
- .config_write = pcep_cli_pcep_config_write,
.prompt = "%s(config-sr-te-pcep)# "
};
.name = "srte pcep pcc",
.node = PCEP_PCC_NODE,
.parent_node = PCEP_NODE,
- .config_write = pcep_cli_pcc_config_write,
.prompt = "%s(config-sr-te-pcep-pcc)# "
};
.name = "srte pcep pce",
.node = PCEP_PCE_NODE,
.parent_node = PCEP_NODE,
- .config_write = pcep_cli_pce_config_write,
.prompt = "%s(config-sr-te-pcep-pce)# "
};
.name = "srte pcep pce-config",
.node = PCEP_PCE_CONFIG_NODE,
.parent_node = PCEP_NODE,
- .config_write = pcep_cli_pcep_pce_config_write,
.prompt = "%s(pce-sr-te-pcep-pce-config)# "
};
int pcep_cli_pcep_config_write(struct vty *vty)
{
vty_out(vty, " pcep\n");
+ pcep_cli_pcep_pce_config_write(vty);
+ pcep_cli_pce_config_write(vty);
+ pcep_cli_pcc_config_write(vty);
return 1;
}
void pcep_cli_init(void)
{
+ hook_register(pathd_srte_config_write, pcep_cli_pcep_config_write);
hook_register(nb_client_debug_config_write,
pcep_cli_debug_config_write);
hook_register(nb_client_debug_set_all, pcep_cli_debug_set_all);