Skip to content

Commit

Permalink
Merge pull request #15237 from donaldsharp/sharp_watch_neighbors_more
Browse files Browse the repository at this point in the history
sharpd: Add ability to turn off watching of redistribution
  • Loading branch information
ton31337 authored Jan 26, 2024
2 parents d48b99a + 3d97d26 commit 5db3bb0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions sharpd/sharp_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ DEFPY(watch_neighbor, watch_neighbor_cmd,


DEFPY(watch_redistribute, watch_redistribute_cmd,
"sharp watch [vrf NAME$vrf_name] redistribute " FRR_REDIST_STR_SHARPD,
"[no] sharp watch [vrf NAME$vrf_name] redistribute " FRR_REDIST_STR_SHARPD,
NO_STR
"Sharp routing Protocol\n"
"Watch for changes\n"
"The vrf we would like to watch if non-default\n"
Expand All @@ -75,7 +76,7 @@ DEFPY(watch_redistribute, watch_redistribute_cmd,
}

source = proto_redistnum(AFI_IP, argv[argc-1]->text);
sharp_redistribute_vrf(vrf, source);
sharp_redistribute_vrf(vrf, source, !no);

return CMD_SUCCESS;
}
Expand Down
7 changes: 4 additions & 3 deletions sharpd/sharp_zebra.c
Original file line number Diff line number Diff line change
Expand Up @@ -704,10 +704,11 @@ static int sharp_redistribute_route(ZAPI_CALLBACK_ARGS)
return 0;
}

void sharp_redistribute_vrf(struct vrf *vrf, int type)
void sharp_redistribute_vrf(struct vrf *vrf, int type, bool turn_on)
{
zebra_redistribute_send(ZEBRA_REDISTRIBUTE_ADD, zclient, AFI_IP, type,
0, vrf->vrf_id);
zebra_redistribute_send(turn_on ? ZEBRA_REDISTRIBUTE_ADD
: ZEBRA_REDISTRIBUTE_DELETE,
zclient, AFI_IP, type, 0, vrf->vrf_id);
}

static zclient_handler *const sharp_opaque_handlers[] = {
Expand Down
2 changes: 1 addition & 1 deletion sharpd/sharp_zebra.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ extern void sharp_zebra_send_arp(const struct interface *ifp,
/* Register Link State Opaque messages */
extern void sharp_zebra_register_te(void);

extern void sharp_redistribute_vrf(struct vrf *vrf, int source);
extern void sharp_redistribute_vrf(struct vrf *vrf, int source, bool turn_on);

extern int sharp_zebra_srv6_manager_get_locator_chunk(const char *lname);
extern int sharp_zebra_srv6_manager_release_locator_chunk(const char *lname);
Expand Down

0 comments on commit 5db3bb0

Please sign in to comment.