Skip to content

Commit

Permalink
Added log output of filter criteria for 'pftblctl expire/drop recap' …
Browse files Browse the repository at this point in the history
…commands.
  • Loading branch information
mpfr committed May 25, 2021
1 parent 6fac029 commit 4601b34
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/listener.c
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,8 @@ perform_ctrl_delete(struct statfd *sfd, char *arg, char *data, size_t datalen,
struct crangeq crq;
int recap;
unsigned int cnt;
struct ptr *tgt;
struct crange *cr;

if (arg == NULL)
return (1);
Expand Down Expand Up @@ -781,9 +783,16 @@ perform_ctrl_delete(struct statfd *sfd, char *arg, char *data, size_t datalen,
if (cnt == 0)
msg_send(sfd, "No client entries found.\n");
else {
if (recap)
print_ts_log("%d client entr%s %s.\n", cnt,
if (recap) {
print_ts_log("%d client entr%s %s from ", cnt,
cnt != 1 ? "ies" : "y", action);
STAILQ_FOREACH(tgt, &tpq, ptrs)
print_log("[%s]",
((struct target *)tgt->p)->name);
STAILQ_FOREACH(cr, &crq, cranges)
print_log("[%s]", cr->str);
print_log(".\n");
}
msg_send(sfd, "%d client entr%s %s.\n", cnt,
cnt != 1 ? "ies" : "y", action);
}
Expand Down

0 comments on commit 4601b34

Please sign in to comment.