diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-06-21 03:10:57 +0000 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-06-29 17:31:28 +0000 |
| commit | 96ade3ed7716c89b8047a1c0ab3377985d461cf8 (patch) | |
| tree | 1c3061738c2c0027612b6cdb3e5d5eccb08587bf /bgpd/bgp_filter.c | |
| parent | 4d5f445750e01467898eee47796e80d808500d56 (diff) | |
*: use vty_outln
Saves 400 lines
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'bgpd/bgp_filter.c')
| -rw-r--r-- | bgpd/bgp_filter.c | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/bgpd/bgp_filter.c b/bgpd/bgp_filter.c index 31fc39fd23..ac0a382496 100644 --- a/bgpd/bgp_filter.c +++ b/bgpd/bgp_filter.c @@ -457,7 +457,7 @@ DEFUN (ip_as_path, regex = bgp_regcomp (regstr); if (!regex) { - vty_out (vty, "can't compile regexp %s%s", regstr, VTY_NEWLINE); + vty_outln (vty, "can't compile regexp %s", regstr); XFREE (MTYPE_TMP, regstr); return CMD_WARNING; } @@ -503,8 +503,7 @@ DEFUN (no_ip_as_path, aslist = as_list_lookup (aslistname); if (aslist == NULL) { - vty_out (vty, "ip as-path access-list %s doesn't exist%s", aslistname, - VTY_NEWLINE); + vty_outln (vty, "ip as-path access-list %s doesn't exist",aslistname); return CMD_WARNING; } @@ -515,7 +514,7 @@ DEFUN (no_ip_as_path, type = AS_FILTER_DENY; else { - vty_out (vty, "filter type must be [permit|deny]%s", VTY_NEWLINE); + vty_outln (vty, "filter type must be [permit|deny]"); return CMD_WARNING; } @@ -526,7 +525,7 @@ DEFUN (no_ip_as_path, regex = bgp_regcomp (regstr); if (!regex) { - vty_out (vty, "can't compile regexp %s%s", regstr, VTY_NEWLINE); + vty_outln (vty, "can't compile regexp %s", regstr); XFREE (MTYPE_TMP, regstr); return CMD_WARNING; } @@ -539,7 +538,7 @@ DEFUN (no_ip_as_path, if (asfilter == NULL) { - vty_out (vty, "%s", VTY_NEWLINE); + vty_outln (vty, ""); return CMD_WARNING; } @@ -563,8 +562,8 @@ DEFUN (no_ip_as_path_all, aslist = as_list_lookup (argv[idx_word]->arg); if (aslist == NULL) { - vty_out (vty, "ip as-path access-list %s doesn't exist%s", argv[idx_word]->arg, - VTY_NEWLINE); + vty_outln (vty, "ip as-path access-list %s doesn't exist", + argv[idx_word]->arg); return CMD_WARNING; } @@ -582,12 +581,12 @@ as_list_show (struct vty *vty, struct as_list *aslist) { struct as_filter *asfilter; - vty_out (vty, "AS path access list %s%s", aslist->name, VTY_NEWLINE); + vty_outln (vty, "AS path access list %s", aslist->name); for (asfilter = aslist->head; asfilter; asfilter = asfilter->next) { - vty_out (vty, " %s %s%s", filter_type_str (asfilter->type), - asfilter->reg_str, VTY_NEWLINE); + vty_outln (vty, " %s %s", filter_type_str (asfilter->type), + asfilter->reg_str); } } @@ -599,23 +598,23 @@ as_list_show_all (struct vty *vty) for (aslist = as_list_master.num.head; aslist; aslist = aslist->next) { - vty_out (vty, "AS path access list %s%s", aslist->name, VTY_NEWLINE); + vty_outln (vty, "AS path access list %s", aslist->name); for (asfilter = aslist->head; asfilter; asfilter = asfilter->next) { - vty_out (vty, " %s %s%s", filter_type_str (asfilter->type), - asfilter->reg_str, VTY_NEWLINE); + vty_outln (vty, " %s %s", filter_type_str (asfilter->type), + asfilter->reg_str); } } for (aslist = as_list_master.str.head; aslist; aslist = aslist->next) { - vty_out (vty, "AS path access list %s%s", aslist->name, VTY_NEWLINE); + vty_outln (vty, "AS path access list %s", aslist->name); for (asfilter = aslist->head; asfilter; asfilter = asfilter->next) { - vty_out (vty, " %s %s%s", filter_type_str (asfilter->type), - asfilter->reg_str, VTY_NEWLINE); + vty_outln (vty, " %s %s", filter_type_str (asfilter->type), + asfilter->reg_str); } } } @@ -659,20 +658,18 @@ config_write_as_list (struct vty *vty) for (aslist = as_list_master.num.head; aslist; aslist = aslist->next) for (asfilter = aslist->head; asfilter; asfilter = asfilter->next) { - vty_out (vty, "ip as-path access-list %s %s %s%s", + vty_outln (vty, "ip as-path access-list %s %s %s", aslist->name, filter_type_str (asfilter->type), - asfilter->reg_str, - VTY_NEWLINE); + asfilter->reg_str); write++; } for (aslist = as_list_master.str.head; aslist; aslist = aslist->next) for (asfilter = aslist->head; asfilter; asfilter = asfilter->next) { - vty_out (vty, "ip as-path access-list %s %s %s%s", + vty_outln (vty, "ip as-path access-list %s %s %s", aslist->name, filter_type_str (asfilter->type), - asfilter->reg_str, - VTY_NEWLINE); + asfilter->reg_str); write++; } return write; |
