summaryrefslogtreecommitdiff
path: root/ospfd/ospf_vty.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2019-11-20 17:26:59 +0100
committerDavid Lamparter <equinox@diac24.net>2019-12-02 15:01:29 +0100
commit2b64873d24730882af68bdf2881aa380a3a8d17f (patch)
tree7bb835e81d96fc17ec5d1bed8bb5f5857a9673ad /ospfd/ospf_vty.c
parent0d8c7a26a1e5dbbd36df79751b2468276bd7ec20 (diff)
*: generously apply const
const const const your boat, merrily down the stream... Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'ospfd/ospf_vty.c')
-rw-r--r--ospfd/ospf_vty.c50
1 files changed, 30 insertions, 20 deletions
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index d11c34f243..4c97615ed1 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -53,7 +53,7 @@
#include "ospfd/ospf_dump.h"
#include "ospfd/ospf_bfd.h"
-static const char *ospf_network_type_str[] = {
+static const char *const ospf_network_type_str[] = {
"Null", "POINTOPOINT", "BROADCAST", "NBMA", "POINTOMULTIPOINT",
"VIRTUALLINK", "LOOPBACK"};
@@ -2622,11 +2622,14 @@ ALIAS(no_ospf_write_multiplier, no_write_multiplier_cmd,
"Write multiplier\n"
"Maximum number of interface serviced per write\n")
-const char *ospf_abr_type_descr_str[] = {"Unknown", "Standard (RFC2328)",
- "Alternative IBM", "Alternative Cisco",
- "Alternative Shortcut"};
+static const char *const ospf_abr_type_descr_str[] = {
+ "Unknown", "Standard (RFC2328)", "Alternative IBM",
+ "Alternative Cisco", "Alternative Shortcut"
+};
-const char *ospf_shortcut_mode_descr_str[] = {"Default", "Enabled", "Disabled"};
+static const char *const ospf_shortcut_mode_descr_str[] = {
+ "Default", "Enabled", "Disabled"
+};
static void show_ip_ospf_area(struct vty *vty, struct ospf_area *area,
json_object *json_areas, bool use_json)
@@ -5767,7 +5770,7 @@ static int show_lsa_summary(struct vty *vty, struct ospf_lsa *lsa, int self)
return 0;
}
-static const char *show_database_desc[] = {
+static const char *const show_database_desc[] = {
"unknown",
"Router Link States",
"Net Link States",
@@ -5782,7 +5785,7 @@ static const char *show_database_desc[] = {
"AS-external Opaque-LSA",
};
-static const char *show_database_header[] = {
+static const char *const show_database_header[] = {
"",
"Link ID ADV Router Age Seq# CkSum Link count",
"Link ID ADV Router Age Seq# CkSum",
@@ -5834,7 +5837,7 @@ static void show_ip_ospf_database_header(struct vty *vty, struct ospf_lsa *lsa)
vty_out(vty, " Length: %d\n\n", ntohs(lsa->data->length));
}
-const char *link_type_desc[] = {
+static const char *const link_type_desc[] = {
"(null)",
"another Router (point-to-point)",
"a Transit Network",
@@ -5842,12 +5845,12 @@ const char *link_type_desc[] = {
"a Virtual Link",
};
-const char *link_id_desc[] = {
+static const char *const link_id_desc[] = {
"(null)", "Neighboring Router ID", "Designated Router address",
"Net", "Neighboring Router ID",
};
-const char *link_data_desc[] = {
+static const char *const link_data_desc[] = {
"(null)", "Router Interface address", "Router Interface address",
"Network Mask", "Router Interface address",
};
@@ -6047,7 +6050,7 @@ static int show_opaque_lsa_detail(struct vty *vty, struct ospf_lsa *lsa)
return 0;
}
-int (*show_function[])(struct vty *, struct ospf_lsa *) = {
+int (*const show_function[])(struct vty *, struct ospf_lsa *) = {
NULL,
show_router_lsa_detail,
show_network_lsa_detail,
@@ -9646,7 +9649,7 @@ DEFUN (show_ip_ospf_vrfs,
struct ospf *ospf = NULL;
struct listnode *node = NULL;
int count = 0;
- static char header[] = "Name Id RouterId ";
+ static const char header[] = "Name Id RouterId ";
if (uj) {
json = json_object_new_object();
@@ -9703,16 +9706,23 @@ DEFUN (show_ip_ospf_vrfs,
return CMD_SUCCESS;
}
-const char *ospf_abr_type_str[] = {"unknown", "standard", "ibm", "cisco",
- "shortcut"};
+static const char *const ospf_abr_type_str[] = {
+ "unknown", "standard", "ibm", "cisco", "shortcut"
+};
-const char *ospf_shortcut_mode_str[] = {"default", "enable", "disable"};
+static const char *const ospf_shortcut_mode_str[] = {
+ "default", "enable", "disable"
+};
-const char *ospf_int_type_str[] = {"unknown", /* should never be used. */
- "point-to-point", "broadcast",
- "non-broadcast", "point-to-multipoint",
- "virtual-link", /* should never be used. */
- "loopback"};
+static const char *const ospf_int_type_str[] = {
+ "unknown", /* should never be used. */
+ "point-to-point",
+ "broadcast",
+ "non-broadcast",
+ "point-to-multipoint",
+ "virtual-link", /* should never be used. */
+ "loopback"
+};
static int config_write_interface_one(struct vty *vty, struct vrf *vrf)
{