Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mgmtd: fix missing -n flag and help #15297

Merged
merged 2 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions lib/if.c
Original file line number Diff line number Diff line change
Expand Up @@ -1748,6 +1748,8 @@ lib_interface_state_phy_address_get_elem(struct nb_cb_get_elem_args *args)
}

/* clang-format off */

/* cli_show callbacks are kept here for daemons not yet converted to mgmtd */
const struct frr_yang_module_info frr_interface_info = {
.name = "frr-interface",
.nodes = {
Expand Down Expand Up @@ -1830,3 +1832,26 @@ const struct frr_yang_module_info frr_interface_info = {
},
}
};

const struct frr_yang_module_info frr_interface_cli_info = {
.name = "frr-interface",
.ignore_cfg_cbs = true,
.nodes = {
{
.xpath = "/frr-interface:lib/interface",
.cbs = {
.cli_show = cli_show_interface,
.cli_show_end = cli_show_interface_end,
},
},
{
.xpath = "/frr-interface:lib/interface/description",
.cbs = {
.cli_show = cli_show_interface_desc,
},
},
{
.xpath = NULL,
},
}
};
1 change: 1 addition & 0 deletions lib/if.h
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@ extern void if_down_via_zapi(struct interface *ifp);
extern void if_destroy_via_zapi(struct interface *ifp);

extern const struct frr_yang_module_info frr_interface_info;
extern const struct frr_yang_module_info frr_interface_cli_info;

#ifdef __cplusplus
}
Expand Down
10 changes: 10 additions & 0 deletions lib/routing_nb.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,13 @@ const struct frr_yang_module_info frr_routing_info = {
},
}
};

const struct frr_yang_module_info frr_routing_cli_info = {
.name = "frr-routing",
.ignore_cfg_cbs = true,
.nodes = {
{
.xpath = NULL,
},
}
};
1 change: 1 addition & 0 deletions lib/routing_nb.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ extern "C" {
#endif

extern const struct frr_yang_module_info frr_routing_info;
extern const struct frr_yang_module_info frr_routing_cli_info;

/* Mandatory callbacks. */
int routing_control_plane_protocols_control_plane_protocol_create(
Expand Down
18 changes: 18 additions & 0 deletions lib/vrf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,8 @@ lib_vrf_state_active_get_elem(struct nb_cb_get_elem_args *args)
}

/* clang-format off */

/* cli_show callbacks are kept here for daemons not yet converted to mgmtd */
const struct frr_yang_module_info frr_vrf_info = {
.name = "frr-vrf",
.nodes = {
Expand Down Expand Up @@ -1069,3 +1071,19 @@ const struct frr_yang_module_info frr_vrf_info = {
}
};

const struct frr_yang_module_info frr_vrf_cli_info = {
.name = "frr-vrf",
.ignore_cfg_cbs = true,
.nodes = {
{
.xpath = "/frr-vrf:lib/vrf",
.cbs = {
.cli_show = lib_vrf_cli_write,
.cli_show_end = lib_vrf_cli_write_end,
},
},
{
.xpath = NULL,
},
}
};
1 change: 1 addition & 0 deletions lib/vrf.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ extern int vrf_enable(struct vrf *vrf);
extern void vrf_delete(struct vrf *vrf);

extern const struct frr_yang_module_info frr_vrf_info;
extern const struct frr_yang_module_info frr_vrf_cli_info;

#ifdef __cplusplus
}
Expand Down
11 changes: 6 additions & 5 deletions mgmtd/mgmt_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,10 @@ const struct frr_yang_module_info zebra_route_map_info = {
*/
static const struct frr_yang_module_info *const mgmt_yang_modules[] = {
&frr_filter_cli_info,
&frr_interface_info,
&frr_interface_cli_info,
&frr_route_map_cli_info,
&frr_routing_info,
&frr_vrf_info,
&frr_routing_cli_info,
&frr_vrf_cli_info,
&frr_affinity_map_cli_info,

/* mgmtd-only modules */
Expand Down Expand Up @@ -230,8 +230,9 @@ int main(int argc, char **argv)

frr_preinit(&mgmtd_di, argc, argv);
frr_opt_add(
"s:" DEPRECATED_OPTIONS, longopts,
" -s, --socket_size Set MGMTD peer socket send buffer size\n");
"s:n" DEPRECATED_OPTIONS, longopts,
" -s, --socket_size Set MGMTD peer socket send buffer size\n"
" -n, --vrfwnetns Use NetNS as VRF backend\n");

/* Command line argument treatment. */
while (1) {
Expand Down
Loading