-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add igmp proxy support #16861
Merged
Merged
Add igmp proxy support #16861
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
26b6799
pimd, yang: add cli for igmp proxy
9b68853
pimd: add igmp proxy cli and yang configuration
f4d3222
pimd: add proxy join/prune functionality
cec07a1
pimd: add show commands for igmp proxy joins
bb4620d
doc: add documentation for ip igmp proxy cli
1425d4a
tests: add topotest for igmp proxy
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -567,7 +567,7 @@ static void igmp_show_interfaces_single(struct pim_instance *pim, | |
} | ||
|
||
static void igmp_show_interface_join(struct pim_instance *pim, struct vty *vty, | ||
bool uj) | ||
bool uj, enum gm_join_type join_type) | ||
{ | ||
struct interface *ifp; | ||
time_t now; | ||
|
@@ -612,6 +612,10 @@ static void igmp_show_interface_join(struct pim_instance *pim, struct vty *vty, | |
char source_str[INET_ADDRSTRLEN]; | ||
char uptime[10]; | ||
|
||
if (ij->join_type != join_type && | ||
ij->join_type != GM_JOIN_BOTH) | ||
continue; | ||
|
||
pim_time_uptime(uptime, sizeof(uptime), | ||
now - ij->sock_creation); | ||
pim_inet4_dump("<grp?>", ij->group_addr, group_str, | ||
|
@@ -1784,7 +1788,7 @@ DEFUN (show_ip_igmp_join, | |
if (!vrf) | ||
return CMD_WARNING; | ||
|
||
igmp_show_interface_join(vrf->info, vty, uj); | ||
igmp_show_interface_join(vrf->info, vty, uj, GM_JOIN_STATIC); | ||
|
||
return CMD_SUCCESS; | ||
} | ||
|
@@ -1822,7 +1826,61 @@ DEFUN (show_ip_igmp_join_vrf_all, | |
first = false; | ||
} else | ||
vty_out(vty, "VRF: %s\n", vrf->name); | ||
igmp_show_interface_join(vrf->info, vty, uj); | ||
igmp_show_interface_join(vrf->info, vty, uj, GM_JOIN_STATIC); | ||
} | ||
if (uj) | ||
vty_out(vty, "}\n"); | ||
|
||
return CMD_SUCCESS; | ||
} | ||
|
||
DEFUN (show_ip_igmp_proxy, | ||
show_ip_igmp_proxy_cmd, | ||
"show ip igmp [vrf NAME] proxy [json]", | ||
SHOW_STR | ||
IP_STR | ||
IGMP_STR | ||
VRF_CMD_HELP_STR | ||
"IGMP proxy join information\n" | ||
JSON_STR) | ||
{ | ||
int idx = 2; | ||
bool uj = use_json(argc, argv); | ||
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx, uj); | ||
|
||
if (!vrf) | ||
return CMD_WARNING; | ||
|
||
igmp_show_interface_join(vrf->info, vty, uj, GM_JOIN_PROXY); | ||
|
||
return CMD_SUCCESS; | ||
} | ||
|
||
DEFUN (show_ip_igmp_proxy_vrf_all, | ||
show_ip_igmp_proxy_vrf_all_cmd, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same, merge with the other show that does basically the same thing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above |
||
"show ip igmp vrf all proxy [json]", | ||
SHOW_STR | ||
IP_STR | ||
IGMP_STR | ||
VRF_CMD_HELP_STR | ||
"IGMP proxy join information\n" | ||
JSON_STR) | ||
{ | ||
bool uj = use_json(argc, argv); | ||
struct vrf *vrf; | ||
bool first = true; | ||
|
||
if (uj) | ||
vty_out(vty, "{ "); | ||
RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) { | ||
if (uj) { | ||
if (!first) | ||
vty_out(vty, ", "); | ||
vty_out(vty, " \"%s\": ", vrf->name); | ||
first = false; | ||
} else | ||
vty_out(vty, "VRF: %s\n", vrf->name); | ||
igmp_show_interface_join(vrf->info, vty, uj, GM_JOIN_PROXY); | ||
} | ||
if (uj) | ||
vty_out(vty, "}\n"); | ||
|
@@ -5756,6 +5814,18 @@ DEFUN (interface_no_ip_pim_hello, | |
return pim_process_no_ip_pim_hello_cmd(vty); | ||
} | ||
|
||
DEFPY (interface_ip_igmp_proxy, | ||
interface_ip_igmp_proxy_cmd, | ||
"[no] ip igmp proxy", | ||
NO_STR | ||
IP_STR | ||
IGMP_STR | ||
"Proxy IGMP join/prune operations\n") | ||
{ | ||
return pim_process_ip_gmp_proxy_cmd(vty, !no); | ||
} | ||
|
||
|
||
DEFUN (debug_igmp, | ||
debug_igmp_cmd, | ||
"debug igmp", | ||
|
@@ -8718,6 +8788,7 @@ void pim_cmd_init(void) | |
&interface_ip_igmp_last_member_query_interval_cmd); | ||
install_element(INTERFACE_NODE, | ||
&interface_no_ip_igmp_last_member_query_interval_cmd); | ||
install_element(INTERFACE_NODE, &interface_ip_igmp_proxy_cmd); | ||
install_element(INTERFACE_NODE, &interface_ip_pim_activeactive_cmd); | ||
install_element(INTERFACE_NODE, &interface_ip_pim_ssm_cmd); | ||
install_element(INTERFACE_NODE, &interface_no_ip_pim_ssm_cmd); | ||
|
@@ -8761,6 +8832,8 @@ void pim_cmd_init(void) | |
install_element(VIEW_NODE, &show_ip_igmp_join_group_vrf_all_cmd); | ||
install_element(VIEW_NODE, &show_ip_igmp_static_group_cmd); | ||
install_element(VIEW_NODE, &show_ip_igmp_static_group_vrf_all_cmd); | ||
install_element(VIEW_NODE, &show_ip_igmp_proxy_cmd); | ||
install_element(VIEW_NODE, &show_ip_igmp_proxy_vrf_all_cmd); | ||
install_element(VIEW_NODE, &show_ip_igmp_groups_cmd); | ||
install_element(VIEW_NODE, &show_ip_igmp_groups_vrf_all_cmd); | ||
install_element(VIEW_NODE, &show_ip_igmp_groups_retransmissions_cmd); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could easily be combined with show_ip_igmp_join_cmd since they both do the same thing, just passing a different type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I talked to Jafar about this and he prefers to leave them separate, both for clarity and also because the proxy command may expand in the future. If it does, we'll just have to pull them apart again.