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 /lib/plist.c | |
| parent | 4d5f445750e01467898eee47796e80d808500d56 (diff) | |
*: use vty_outln
Saves 400 lines
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/plist.c')
| -rw-r--r-- | lib/plist.c | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/lib/plist.c b/lib/plist.c index 7be56d4320..9b4bda7edc 100644 --- a/lib/plist.c +++ b/lib/plist.c @@ -882,8 +882,8 @@ prefix_entry_dup_check (struct prefix_list *plist, static int vty_invalid_prefix_range (struct vty *vty, const char *prefix) { - vty_out (vty, "%% Invalid prefix range for %s, make sure: len < ge-value <= le-value%s", - prefix, VTY_NEWLINE); + vty_outln (vty, "%% Invalid prefix range for %s, make sure: len < ge-value <= le-value", + prefix); return CMD_WARNING; } @@ -920,7 +920,7 @@ vty_prefix_list_install (struct vty *vty, afi_t afi, const char *name, type = PREFIX_DENY; else { - vty_out (vty, "%% prefix type must be permit or deny%s", VTY_NEWLINE); + vty_outln (vty, "%% prefix type must be permit or deny"); return CMD_WARNING; } @@ -940,7 +940,7 @@ vty_prefix_list_install (struct vty *vty, afi_t afi, const char *name, if (ret <= 0) { - vty_out (vty, "%% Malformed IPv4 prefix%s", VTY_NEWLINE); + vty_outln (vty, "%% Malformed IPv4 prefix"); return CMD_WARNING; } @@ -962,7 +962,7 @@ vty_prefix_list_install (struct vty *vty, afi_t afi, const char *name, if (ret <= 0) { - vty_out (vty, "%% Malformed IPv6 prefix%s", VTY_NEWLINE); + vty_outln (vty, "%% Malformed IPv6 prefix"); return CMD_WARNING; } @@ -973,7 +973,7 @@ vty_prefix_list_install (struct vty *vty, afi_t afi, const char *name, break; case AFI_L2VPN: default: - vty_out (vty, "%% Unrecognized AFI (%d)%s", afi, VTY_NEWLINE); + vty_outln (vty, "%% Unrecognized AFI (%d)", afi); return CMD_WARNING; break; } @@ -1042,7 +1042,7 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name, plist = prefix_list_lookup (afi, name); if (! plist) { - vty_out (vty, "%% Can't find specified prefix-list%s", VTY_NEWLINE); + vty_outln (vty, "%% Can't find specified prefix-list"); return CMD_WARNING; } @@ -1057,7 +1057,7 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name, /* We must have, at a minimum, both the type and prefix here */ if ((typestr == NULL) || (prefix == NULL)) { - vty_out (vty, "%% Both prefix and type required%s", VTY_NEWLINE); + vty_outln (vty, "%% Both prefix and type required"); return CMD_WARNING; } @@ -1078,7 +1078,7 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name, type = PREFIX_DENY; else { - vty_out (vty, "%% prefix type must be permit or deny%s", VTY_NEWLINE); + vty_outln (vty, "%% prefix type must be permit or deny"); return CMD_WARNING; } @@ -1096,7 +1096,7 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name, if (ret <= 0) { - vty_out (vty, "%% Malformed IPv4 prefix%s", VTY_NEWLINE); + vty_outln (vty, "%% Malformed IPv4 prefix"); return CMD_WARNING; } } @@ -1113,7 +1113,7 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name, if (ret <= 0) { - vty_out (vty, "%% Malformed IPv6 prefix%s", VTY_NEWLINE); + vty_outln (vty, "%% Malformed IPv6 prefix"); return CMD_WARNING; } } @@ -1123,7 +1123,7 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name, if (pentry == NULL) { - vty_out (vty, "%% Can't find specified prefix-list%s", VTY_NEWLINE); + vty_outln (vty, "%% Can't find specified prefix-list"); return CMD_WARNING; } @@ -1141,7 +1141,7 @@ vty_prefix_list_desc_unset (struct vty *vty, afi_t afi, const char *name) plist = prefix_list_lookup (afi, name); if (! plist) { - vty_out (vty, "%% Can't find specified prefix-list%s", VTY_NEWLINE); + vty_outln (vty, "%% Can't find specified prefix-list"); return CMD_WARNING; } @@ -1179,25 +1179,24 @@ vty_show_prefix_entry (struct vty *vty, afi_t afi, struct prefix_list *plist, if (dtype == normal_display) { - vty_out (vty, "ip%s prefix-list %s: %d entries%s", + vty_outln (vty, "ip%s prefix-list %s: %d entries", afi == AFI_IP ? "" : "v6", - plist->name, plist->count, VTY_NEWLINE); + plist->name, plist->count); if (plist->desc) - vty_out (vty, " Description: %s%s", plist->desc, VTY_NEWLINE); + vty_outln (vty, " Description: %s", plist->desc); } else if (dtype == summary_display || dtype == detail_display) { - vty_out (vty, "ip%s prefix-list %s:%s", - afi == AFI_IP ? "" : "v6", plist->name, VTY_NEWLINE); + vty_outln (vty, "ip%s prefix-list %s:", + afi == AFI_IP ? "" : "v6", plist->name); if (plist->desc) - vty_out (vty, " Description: %s%s", plist->desc, VTY_NEWLINE); + vty_outln (vty, " Description: %s", plist->desc); - vty_out (vty, " count: %d, range entries: %d, sequences: %u - %u%s", + vty_outln (vty, " count: %d, range entries: %d, sequences: %u - %u", plist->count, plist->rangecount, plist->head ? plist->head->seq : 0, - plist->tail ? plist->tail->seq : 0, - VTY_NEWLINE); + plist->tail ? plist->tail->seq : 0); } if (dtype != summary_display) @@ -1235,7 +1234,7 @@ vty_show_prefix_entry (struct vty *vty, afi_t afi, struct prefix_list *plist, vty_out (vty, " (hit count: %ld, refcount: %ld)", pentry->hitcnt, pentry->refcnt); - vty_out (vty, "%s", VTY_NEWLINE); + vty_outln (vty, ""); } } } @@ -1260,7 +1259,7 @@ vty_show_prefix_list (struct vty *vty, afi_t afi, const char *name, plist = prefix_list_lookup (afi, name); if (! plist) { - vty_out (vty, "%% Can't find specified prefix-list%s", VTY_NEWLINE); + vty_outln (vty, "%% Can't find specified prefix-list"); return CMD_WARNING; } vty_show_prefix_entry (vty, afi, plist, master, dtype, seqnum); @@ -1270,8 +1269,8 @@ vty_show_prefix_list (struct vty *vty, afi_t afi, const char *name, if (dtype == detail_display || dtype == summary_display) { if (master->recent) - vty_out (vty, "Prefix-list with the last deletion/insertion: %s%s", - master->recent->name, VTY_NEWLINE); + vty_outln (vty, "Prefix-list with the last deletion/insertion: %s", + master->recent->name); } for (plist = master->num.head; plist; plist = plist->next) @@ -1297,14 +1296,14 @@ vty_show_prefix_list_prefix (struct vty *vty, afi_t afi, const char *name, plist = prefix_list_lookup (afi, name); if (! plist) { - vty_out (vty, "%% Can't find specified prefix-list%s", VTY_NEWLINE); + vty_outln (vty, "%% Can't find specified prefix-list"); return CMD_WARNING; } ret = str2prefix (prefix, &p); if (ret <= 0) { - vty_out (vty, "%% prefix is malformed%s", VTY_NEWLINE); + vty_outln (vty, "%% prefix is malformed"); return CMD_WARNING; } @@ -1347,7 +1346,7 @@ vty_show_prefix_list_prefix (struct vty *vty, afi_t afi, const char *name, vty_out (vty, " (hit count: %ld, refcount: %ld)", pentry->hitcnt, pentry->refcnt); - vty_out (vty, "%s", VTY_NEWLINE); + vty_outln (vty, ""); if (type == first_match_display) return CMD_SUCCESS; @@ -1385,7 +1384,7 @@ vty_clear_prefix_list (struct vty *vty, afi_t afi, const char *name, plist = prefix_list_lookup (afi, name); if (! plist) { - vty_out (vty, "%% Can't find specified prefix-list%s", VTY_NEWLINE); + vty_outln (vty, "%% Can't find specified prefix-list"); return CMD_WARNING; } @@ -1394,7 +1393,7 @@ vty_clear_prefix_list (struct vty *vty, afi_t afi, const char *name, ret = str2prefix (prefix, &p); if (ret <= 0) { - vty_out (vty, "%% prefix is malformed%s", VTY_NEWLINE); + vty_outln (vty, "%% prefix is malformed"); return CMD_WARNING; } } @@ -1819,18 +1818,18 @@ config_write_prefix_afi (afi_t afi, struct vty *vty) if (! master->seqnum) { - vty_out (vty, "no ip%s prefix-list sequence-number%s", - afi == AFI_IP ? "" : "v6", VTY_NEWLINE); - vty_out (vty, "!%s", VTY_NEWLINE); + vty_outln (vty, "no ip%s prefix-list sequence-number", + afi == AFI_IP ? "" : "v6"); + vty_outln (vty, "!"); } for (plist = master->num.head; plist; plist = plist->next) { if (plist->desc) { - vty_out (vty, "ip%s prefix-list %s description %s%s", + vty_outln (vty, "ip%s prefix-list %s description %s", afi == AFI_IP ? "" : "v6", - plist->name, plist->desc, VTY_NEWLINE); + plist->name, plist->desc); write++; } @@ -1861,7 +1860,7 @@ config_write_prefix_afi (afi_t afi, struct vty *vty) if (pentry->le) vty_out (vty, " le %d", pentry->le); } - vty_out (vty, "%s", VTY_NEWLINE); + vty_outln (vty, ""); write++; } /* vty_out (vty, "!%s", VTY_NEWLINE); */ @@ -1871,9 +1870,9 @@ config_write_prefix_afi (afi_t afi, struct vty *vty) { if (plist->desc) { - vty_out (vty, "ip%s prefix-list %s description %s%s", + vty_outln (vty, "ip%s prefix-list %s description %s", afi == AFI_IP ? "" : "v6", - plist->name, plist->desc, VTY_NEWLINE); + plist->name, plist->desc); write++; } @@ -1904,7 +1903,7 @@ config_write_prefix_afi (afi_t afi, struct vty *vty) if (pentry->le) vty_out (vty, " le %d", pentry->le); } - vty_out (vty, "%s", VTY_NEWLINE); + vty_outln (vty, ""); write++; } } @@ -2049,14 +2048,15 @@ prefix_bgp_show_prefix_list (struct vty *vty, afi_t afi, char *name, u_char use_ else json_object_object_add(json, "ipv6PrefixList", json_prefix); - vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTY_NEWLINE); + vty_outln (vty, "%s", + json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else { - vty_out (vty, "ip%s prefix-list %s: %d entries%s", + vty_outln (vty, "ip%s prefix-list %s: %d entries", afi == AFI_IP ? "" : "v6", - plist->name, plist->count, VTY_NEWLINE); + plist->name, plist->count); for (pentry = plist->head; pentry; pentry = pentry->next) { @@ -2073,7 +2073,7 @@ prefix_bgp_show_prefix_list (struct vty *vty, afi_t afi, char *name, u_char use_ if (pentry->le) vty_out (vty, " le %d", pentry->le); - vty_out (vty, "%s", VTY_NEWLINE); + vty_outln (vty, ""); } } return plist->count; |
