diff options
Diffstat (limited to 'ospfd/ospf_ri.c')
| -rw-r--r-- | ospfd/ospf_ri.c | 140 |
1 files changed, 60 insertions, 80 deletions
diff --git a/ospfd/ospf_ri.c b/ospfd/ospf_ri.c index 6912bc156f..1fb52a94b5 100644 --- a/ospfd/ospf_ri.c +++ b/ospfd/ospf_ri.c @@ -906,10 +906,9 @@ show_vty_router_cap (struct vty *vty, struct ri_tlv_header *tlvh) struct ri_tlv_router_cap *top = (struct ri_tlv_router_cap *) tlvh; if (vty != NULL) - vty_out (vty, " Router Capabilities: 0x%x%s", ntohl (top->value), - VTY_NEWLINE); - else - zlog_debug (" Router Capabilities: 0x%x", ntohl (top->value)); + vty_outln (vty, " Router Capabilities: 0x%x",ntohl(top->value)); + else + zlog_debug (" Router Capabilities: 0x%x", ntohl (top->value)); return RI_TLV_SIZE (tlvh); } @@ -922,20 +921,19 @@ show_vty_pce_subtlv_address (struct vty *vty, struct ri_tlv_header *tlvh) if (ntohs (top->address.type) == PCE_ADDRESS_TYPE_IPV4) { if (vty != NULL) - vty_out (vty, " PCE Address: %s%s", inet_ntoa (top->address.value), - VTY_NEWLINE); - else - zlog_debug (" PCE Address: %s", inet_ntoa (top->address.value)); + vty_outln (vty, " PCE Address: %s",inet_ntoa(top->address.value)); + else + zlog_debug (" PCE Address: %s", inet_ntoa (top->address.value)); } else { /* TODO: Add support to IPv6 with inet_ntop() */ if (vty != NULL) - vty_out (vty, " PCE Address: 0x%x%s", - ntohl (top->address.value.s_addr), VTY_NEWLINE); - else - zlog_debug (" PCE Address: 0x%x", - ntohl (top->address.value.s_addr)); + vty_outln (vty, " PCE Address: 0x%x", + ntohl(top->address.value.s_addr)); + else + zlog_debug (" PCE Address: 0x%x", + ntohl (top->address.value.s_addr)); } return RI_TLV_SIZE (tlvh); @@ -948,10 +946,9 @@ show_vty_pce_subtlv_path_scope (struct vty *vty, struct ri_tlv_header *tlvh) (struct ri_pce_subtlv_path_scope *) tlvh; if (vty != NULL) - vty_out (vty, " PCE Path Scope: 0x%x%s", ntohl (top->value), - VTY_NEWLINE); - else - zlog_debug (" PCE Path Scope: 0x%x", ntohl (top->value)); + vty_outln (vty, " PCE Path Scope: 0x%x",ntohl(top->value)); + else + zlog_debug (" PCE Path Scope: 0x%x", ntohl (top->value)); return RI_TLV_SIZE (tlvh); } @@ -966,18 +963,16 @@ show_vty_pce_subtlv_domain (struct vty *vty, struct ri_tlv_header *tlvh) { tmp.s_addr = top->value; if (vty != NULL) - vty_out (vty, " PCE domain Area: %s%s", inet_ntoa (tmp), - VTY_NEWLINE); - else - zlog_debug (" PCE domain Area: %s", inet_ntoa (tmp)); + vty_outln (vty, " PCE domain Area: %s",inet_ntoa(tmp)); + else + zlog_debug (" PCE domain Area: %s", inet_ntoa (tmp)); } else { if (vty != NULL) - vty_out (vty, " PCE domain AS: %d%s", ntohl (top->value), - VTY_NEWLINE); - else - zlog_debug (" PCE domain AS: %d", ntohl (top->value)); + vty_outln (vty, " PCE domain AS: %d",ntohl(top->value)); + else + zlog_debug (" PCE domain AS: %d", ntohl (top->value)); } return RI_TLV_SIZE (tlvh); } @@ -993,18 +988,16 @@ show_vty_pce_subtlv_neighbor (struct vty *vty, struct ri_tlv_header *tlvh) { tmp.s_addr = top->value; if (vty != NULL) - vty_out (vty, " PCE neighbor Area: %s%s", inet_ntoa (tmp), - VTY_NEWLINE); - else - zlog_debug (" PCE neighbor Area: %s", inet_ntoa (tmp)); + vty_outln (vty, " PCE neighbor Area: %s",inet_ntoa(tmp)); + else + zlog_debug (" PCE neighbor Area: %s", inet_ntoa (tmp)); } else { if (vty != NULL) - vty_out (vty, " PCE neighbor AS: %d%s", ntohl (top->value), - VTY_NEWLINE); - else - zlog_debug (" PCE neighbor AS: %d", ntohl (top->value)); + vty_outln (vty, " PCE neighbor AS: %d",ntohl(top->value)); + else + zlog_debug (" PCE neighbor AS: %d", ntohl (top->value)); } return RI_TLV_SIZE (tlvh); } @@ -1015,10 +1008,9 @@ show_vty_pce_subtlv_cap_flag (struct vty *vty, struct ri_tlv_header *tlvh) struct ri_pce_subtlv_cap_flag *top = (struct ri_pce_subtlv_cap_flag *) tlvh; if (vty != NULL) - vty_out (vty, " PCE Capabilities Flag: 0x%x%s", ntohl (top->value), - VTY_NEWLINE); - else - zlog_debug (" PCE Capabilities Flag: 0x%x", ntohl (top->value)); + vty_outln (vty, " PCE Capabilities Flag: 0x%x",ntohl(top->value)); + else + zlog_debug (" PCE Capabilities Flag: 0x%x", ntohl (top->value)); return RI_TLV_SIZE (tlvh); } @@ -1027,11 +1019,11 @@ static u_int16_t show_vty_unknown_tlv (struct vty *vty, struct ri_tlv_header *tlvh) { if (vty != NULL) - vty_out (vty, " Unknown TLV: [type(0x%x), length(0x%x)]%s", - ntohs (tlvh->type), ntohs (tlvh->length), VTY_NEWLINE); - else - zlog_debug (" Unknown TLV: [type(0x%x), length(0x%x)]", - ntohs (tlvh->type), ntohs (tlvh->length)); + vty_outln (vty, " Unknown TLV: [type(0x%x), length(0x%x)]", + ntohs (tlvh->type), ntohs(tlvh->length)); + else + zlog_debug (" Unknown TLV: [type(0x%x), length(0x%x)]", + ntohs (tlvh->type), ntohs (tlvh->length)); return RI_TLV_SIZE (tlvh); } @@ -1113,18 +1105,16 @@ ospf_router_info_config_write_router (struct vty *vty) if (OspfRI.status == enabled) { if (OspfRI.scope == OSPF_OPAQUE_AS_LSA) - vty_out (vty, " router-info as%s", VTY_NEWLINE); + vty_outln (vty, " router-info as"); else - vty_out (vty, " router-info area %s%s", inet_ntoa (OspfRI.area_id), - VTY_NEWLINE); + vty_outln (vty, " router-info area %s",inet_ntoa(OspfRI.area_id)); if (pce->pce_address.header.type != 0) - vty_out (vty, " pce address %s%s", - inet_ntoa (pce->pce_address.address.value), VTY_NEWLINE); + vty_outln (vty, " pce address %s", + inet_ntoa(pce->pce_address.address.value)); if (pce->pce_cap_flag.header.type != 0) - vty_out (vty, " pce flag 0x%x%s", ntohl (pce->pce_cap_flag.value), - VTY_NEWLINE); + vty_outln (vty, " pce flag 0x%x",ntohl(pce->pce_cap_flag.value)); for (ALL_LIST_ELEMENTS_RO (pce->pce_domain, node, domain)) { @@ -1133,13 +1123,11 @@ ospf_router_info_config_write_router (struct vty *vty) if (domain->type == PCE_DOMAIN_TYPE_AREA) { tmp.s_addr = domain->value; - vty_out (vty, " pce domain area %s%s", inet_ntoa (tmp), - VTY_NEWLINE); + vty_outln (vty, " pce domain area %s",inet_ntoa(tmp)); } else { - vty_out (vty, " pce domain as %d%s", ntohl (domain->value), - VTY_NEWLINE); + vty_outln (vty, " pce domain as %d",ntohl(domain->value)); } } } @@ -1151,20 +1139,19 @@ ospf_router_info_config_write_router (struct vty *vty) if (neighbor->type == PCE_DOMAIN_TYPE_AREA) { tmp.s_addr = neighbor->value; - vty_out (vty, " pce neighbor area %s%s", inet_ntoa (tmp), - VTY_NEWLINE); + vty_outln (vty, " pce neighbor area %s",inet_ntoa(tmp)); } else { - vty_out (vty, " pce neighbor as %d%s", - ntohl (neighbor->value), VTY_NEWLINE); + vty_outln (vty, " pce neighbor as %d", + ntohl(neighbor->value)); } } } if (pce->pce_scope.header.type != 0) - vty_out (vty, " pce scope 0x%x%s", - ntohl (OspfRI.pce_info.pce_scope.value), VTY_NEWLINE); + vty_outln (vty, " pce scope 0x%x", + ntohl(OspfRI.pce_info.pce_scope.value)); } return; } @@ -1194,8 +1181,8 @@ DEFUN (router_info, { if (!inet_aton (area, &OspfRI.area_id)) { - vty_out (vty, "%% specified Area ID %s is invalid%s", - area, VTY_NEWLINE); + vty_outln (vty, "%% specified Area ID %s is invalid", + area); return CMD_WARNING; } scope = OSPF_OPAQUE_AREA_LSA; @@ -1270,7 +1257,7 @@ ospf_ri_enabled (struct vty *vty) return 1; if (vty) - vty_out (vty, "%% OSPF RI is not turned on%s", VTY_NEWLINE); + vty_outln (vty, "%% OSPF RI is not turned on"); return 0; } @@ -1291,7 +1278,7 @@ DEFUN (pce_address, if (!inet_aton (argv[idx_ipv4]->arg, &value)) { - vty_out (vty, "Please specify PCE Address by A.B.C.D%s", VTY_NEWLINE); + vty_outln (vty, "Please specify PCE Address by A.B.C.D"); return CMD_WARNING; } @@ -1343,8 +1330,7 @@ DEFUN (pce_path_scope, if (sscanf (argv[idx_bitpattern]->arg, "0x%x", &scope) != 1) { - vty_out (vty, "pce_path_scope: fscanf: %s%s", safe_strerror (errno), - VTY_NEWLINE); + vty_outln (vty, "pce_path_scope: fscanf: %s",safe_strerror(errno)); return CMD_WARNING; } @@ -1398,8 +1384,7 @@ DEFUN (pce_domain, if (sscanf (argv[idx_number]->arg, "%d", &as) != 1) { - vty_out (vty, "pce_domain: fscanf: %s%s", safe_strerror (errno), - VTY_NEWLINE); + vty_outln (vty, "pce_domain: fscanf: %s",safe_strerror(errno)); return CMD_WARNING; } @@ -1436,8 +1421,7 @@ DEFUN (no_pce_domain, if (sscanf (argv[idx_number]->arg, "%d", &as) != 1) { - vty_out (vty, "no_pce_domain: fscanf: %s%s", safe_strerror (errno), - VTY_NEWLINE); + vty_outln (vty, "no_pce_domain: fscanf: %s",safe_strerror(errno)); return CMD_WARNING; } @@ -1471,8 +1455,7 @@ DEFUN (pce_neigbhor, if (sscanf (argv[idx_number]->arg, "%d", &as) != 1) { - vty_out (vty, "pce_neighbor: fscanf: %s%s", safe_strerror (errno), - VTY_NEWLINE); + vty_outln (vty, "pce_neighbor: fscanf: %s",safe_strerror(errno)); return CMD_WARNING; } @@ -1509,8 +1492,7 @@ DEFUN (no_pce_neighbor, if (sscanf (argv[idx_number]->arg, "%d", &as) != 1) { - vty_out (vty, "no_pce_neighbor: fscanf: %s%s", safe_strerror (errno), - VTY_NEWLINE); + vty_outln (vty, "no_pce_neighbor: fscanf: %s",safe_strerror(errno)); return CMD_WARNING; } @@ -1541,8 +1523,7 @@ DEFUN (pce_cap_flag, if (sscanf (argv[idx_bitpattern]->arg, "0x%x", &cap) != 1) { - vty_out (vty, "pce_cap_flag: fscanf: %s%s", safe_strerror (errno), - VTY_NEWLINE); + vty_outln (vty, "pce_cap_flag: fscanf: %s",safe_strerror(errno)); return CMD_WARNING; } @@ -1587,13 +1568,13 @@ DEFUN (show_ip_ospf_router_info, if (OspfRI.status == enabled) { - vty_out (vty, "--- Router Information parameters ---%s", VTY_NEWLINE); + vty_outln (vty, "--- Router Information parameters ---"); show_vty_router_cap (vty, &OspfRI.router_cap.header); } else { if (vty != NULL) - vty_out (vty, " Router Information is disabled on this router%s", VTY_NEWLINE); + vty_outln (vty, " Router Information is disabled on this router"); } return CMD_SUCCESS; } @@ -1615,7 +1596,7 @@ DEFUN (show_ip_opsf_router_info_pce, if (OspfRI.status == enabled) { - vty_out (vty, "--- PCE parameters ---%s", VTY_NEWLINE); + vty_outln (vty, "--- PCE parameters ---"); if (pce->pce_address.header.type != 0) show_vty_pce_subtlv_address (vty, &pce->pce_address.header); @@ -1641,8 +1622,7 @@ DEFUN (show_ip_opsf_router_info_pce, } else { - vty_out (vty, " Router Information is disabled on this router%s", - VTY_NEWLINE); + vty_outln (vty," Router Information is disabled on this router"); } return CMD_SUCCESS; |
