]> git.proxmox.com Git - mirror_frr.git/commitdiff
2004-10-10 Paul Jakma <paul@dishone.st>
authorpaul <paul>
Sun, 10 Oct 2004 12:54:58 +0000 (12:54 +0000)
committerpaul <paul>
Sun, 10 Oct 2004 12:54:58 +0000 (12:54 +0000)
* ospf6_route.c: Add const qualifier to various char arrays of
          constants. signed/unsigned fixes.
          (ospf6_linkstate_table_show) argv is const
        * ospf6_snmp.c: listnode typedef is dead.
          (ospf6_snmp_init) Take struct thread_master arg, needed for
          smux_init.
        * ospf6_snmp.h: update ospf6_snmp_init declaration.
        * ospf6d.c: (ospf6_init) add const qualifier to sargv, pass master
          to ospf_snmp6_init.
* ospf6_asbr.c: const char update.
* ospf6_interface.c: ditto, plus signed/unsigned fixes.
  (ipv6_ospf6_cost) Check whether cost fits in u_int32_t and use
          strtoul.
* ospf6_intra.c: const char update. Parenthesise expression.
* ospf6_lsa.c: signed/unsigned and const char updates.
* ospf6_proto.c: ditto.
* ospf6_message.c: ditto.
* ospf6_lsdb.c: signed/unsigned update.
* ospf6_main.c: const char update.
* ospf6_neighbor.c: ditto.
* ospf6_spf.c: ditto.
* ospf6_top.c: ditto.

22 files changed:
ospf6d/ChangeLog
ospf6d/ospf6_asbr.c
ospf6d/ospf6_interface.c
ospf6d/ospf6_interface.h
ospf6d/ospf6_intra.c
ospf6d/ospf6_lsa.c
ospf6d/ospf6_lsa.h
ospf6d/ospf6_lsdb.c
ospf6d/ospf6_main.c
ospf6d/ospf6_message.c
ospf6d/ospf6_message.h
ospf6d/ospf6_neighbor.c
ospf6d/ospf6_neighbor.h
ospf6d/ospf6_proto.c
ospf6d/ospf6_route.c
ospf6d/ospf6_route.h
ospf6d/ospf6_snmp.c
ospf6d/ospf6_snmp.h
ospf6d/ospf6_spf.c
ospf6d/ospf6_spf.h
ospf6d/ospf6_top.c
ospf6d/ospf6d.c

index 2628fecd4e65a7748782d8c2b606e14dc6acce25..3142bea6c78625b0f4a38e4298a18b90781c53f8 100644 (file)
@@ -1,7 +1,29 @@
 2004-10-10 Paul Jakma <paul@dishone.st>
 
        * Makefile.am: fix listing of ospf_snmp.c in noinst_HEADERS
-
+       * ospf6_route.c: Add const qualifier to various char arrays of
+          constants. signed/unsigned fixes.
+          (ospf6_linkstate_table_show) argv is const
+        * ospf6_snmp.c: listnode typedef is dead.
+          (ospf6_snmp_init) Take struct thread_master arg, needed for
+          smux_init.
+        * ospf6_snmp.h: update ospf6_snmp_init declaration.
+        * ospf6d.c: (ospf6_init) add const qualifier to sargv, pass master
+          to ospf_snmp6_init.
+       * ospf6_asbr.c: const char update.
+       * ospf6_interface.c: ditto, plus signed/unsigned fixes.
+         (ipv6_ospf6_cost) Check whether cost fits in u_int32_t and use
+          strtoul.
+       * ospf6_intra.c: const char update. Parenthesise expression.
+       * ospf6_lsa.c: signed/unsigned and const char updates.
+       * ospf6_proto.c: ditto.
+       * ospf6_message.c: ditto.
+       * ospf6_lsdb.c: signed/unsigned update.
+       * ospf6_main.c: const char update.
+       * ospf6_neighbor.c: ditto.
+       * ospf6_spf.c: ditto.
+       * ospf6_top.c: ditto.
+       
 2004-10-06  Yasuhiro Ohara  <yasu@sfc.wide.ad.jp>
 
        * ospf6_snmp.[ch], OSPFV3-MIB.txt: start supporting SNMP.
index 310508161e7b37f698b085ade37f5aefaaf71983..41da5e7e094a95f5ee08a3e3d2867ab044e329bc 100644 (file)
 
 unsigned char conf_debug_ospf6_asbr = 0;
 
-char *zroute_name[] =
+const char *zroute_name[] =
 { "system", "kernel", "connected", "static",
   "rip", "ripng", "ospf", "ospf6", "isis", "bgp", "unknown" };
 
-char *zroute_abname[] =
+const char *zroute_abname[] =
 { "X", "K", "C", "S", "R", "R", "O", "O", "I", "B", "?" };
 
 #define ZROUTE_NAME(x)                                     \
@@ -365,7 +365,7 @@ ospf6_asbr_lsentry_remove (struct ospf6_route *asbr_entry)
 /* redistribute function */
 
 void
-ospf6_asbr_routemap_set (int type, char *mapname)
+ospf6_asbr_routemap_set (int type, const char *mapname)
 {
   if (ospf6->rmap[type].name)
     free (ospf6->rmap[type].name);
@@ -383,7 +383,7 @@ ospf6_asbr_routemap_unset (int type)
 }
 
 void
-ospf6_asbr_routemap_update (char *mapname)
+ospf6_asbr_routemap_update (const char *mapname)
 {
   int type;
 
@@ -828,7 +828,7 @@ ospf6_routemap_rule_match_address_prefixlist (void *rule,
 }
 
 void *
-ospf6_routemap_rule_match_address_prefixlist_compile (char *arg)
+ospf6_routemap_rule_match_address_prefixlist_compile (const char *arg)
 {
   return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
 }
@@ -867,7 +867,7 @@ ospf6_routemap_rule_set_metric_type (void *rule, struct prefix *prefix,
 }
 
 void *
-ospf6_routemap_rule_set_metric_type_compile (char *arg)
+ospf6_routemap_rule_set_metric_type_compile (const char *arg)
 {
   if (strcmp (arg, "type-2") && strcmp (arg, "type-1"))
     return NULL;
@@ -904,7 +904,7 @@ ospf6_routemap_rule_set_metric (void *rule, struct prefix *prefix,
 }
 
 void *
-ospf6_routemap_rule_set_metric_compile (char *arg)
+ospf6_routemap_rule_set_metric_compile (const char *arg)
 {
   u_int32_t metric;
   char *endp;
@@ -950,7 +950,7 @@ ospf6_routemap_rule_set_forwarding (void *rule, struct prefix *prefix,
 }
 
 void *
-ospf6_routemap_rule_set_forwarding_compile (char *arg)
+ospf6_routemap_rule_set_forwarding_compile (const char *arg)
 {
   struct in6_addr a;
   if (inet_pton (AF_INET6, arg, &a) != 1)
index 85f908ed02bd0a1b176c3de571a627678f35f4ce..99d5acbc0009f394655293d41c74fb4fc3abd71e 100644 (file)
@@ -44,7 +44,7 @@
 
 unsigned char conf_debug_ospf6_interface = 0;
 
-char *ospf6_interface_state_str[] =
+const char *ospf6_interface_state_str[] =
 {
   "None",
   "Down",
@@ -107,7 +107,7 @@ struct ospf6_interface *
 ospf6_interface_create (struct interface *ifp)
 {
   struct ospf6_interface *oi;
-  int iobuflen;
+  unsigned int iobuflen;
 
   oi = (struct ospf6_interface *)
     XMALLOC (MTYPE_OSPF6_IF, sizeof (struct ospf6_interface));
@@ -261,7 +261,7 @@ void
 ospf6_interface_if_add (struct interface *ifp)
 {
   struct ospf6_interface *oi;
-  int iobuflen;
+  unsigned int iobuflen;
 
   oi = (struct ospf6_interface *) ifp->info;
   if (oi == NULL)
@@ -774,8 +774,8 @@ ospf6_interface_show (struct vty *vty, struct interface *ifp)
   struct prefix *p;
   struct listnode *i;
   char strbuf[64], drouter[32], bdrouter[32];
-  char *updown[3] = {"down", "up", NULL};
-  char *type;
+  const char *updown[3] = {"down", "up", NULL};
+  const char *type;
   struct timeval res, now;
   char duration[32];
   struct ospf6_lsa *lsa;
@@ -1058,7 +1058,7 @@ DEFUN (ipv6_ospf6_ifmtu,
 {
   struct ospf6_interface *oi;
   struct interface *ifp;
-  int ifmtu, iobuflen;
+  unsigned int ifmtu, iobuflen;
   struct listnode *node;
   struct ospf6_neighbor *on;
 
@@ -1119,7 +1119,7 @@ DEFUN (no_ipv6_ospf6_ifmtu,
 {
   struct ospf6_interface *oi;
   struct interface *ifp;
-  int iobuflen;
+  unsigned int iobuflen;
   struct listnode *node;
   struct ospf6_neighbor *on;
 
@@ -1168,6 +1168,7 @@ DEFUN (ipv6_ospf6_cost,
 {
   struct ospf6_interface *oi;
   struct interface *ifp;
+  unsigned long int lcost;
 
   ifp = (struct interface *) vty->index;
   assert (ifp);
@@ -1177,11 +1178,19 @@ DEFUN (ipv6_ospf6_cost,
     oi = ospf6_interface_create (ifp);
   assert (oi);
 
-  if (oi->cost == strtol (argv[0], NULL, 10))
-    return CMD_SUCCESS;
-
-  oi->cost = strtol (argv[0], NULL, 10);
+  lcost = strtol (argv[0], NULL, 10);
 
+  if (lcost > UINT32_MAX)
+    {
+      vty_out (vty, "Cost %ld is out of range%s", lcost, VNL);
+      return CMD_WARNING;
+    }
+  
+  if (oi->cost == lcost)
+    return CMD_SUCCESS;
+  
+  oi->cost = lcost;
+  
   /* update cost held in route_connected list in ospf6_interface */
   ospf6_interface_connected_route_update (oi->interface);
 
index d28b3105a41f25f0e0b73193f2e2b2609f14984b..c6615d8c7740183b0cdccbf57218f22cf13412ca 100644 (file)
@@ -115,7 +115,7 @@ struct ospf6_interface
 #define OSPF6_INTERFACE_DR               7
 #define OSPF6_INTERFACE_MAX              8
 
-extern char *ospf6_interface_state_str[];
+extern const char *ospf6_interface_state_str[];
 
 /* flags */
 #define OSPF6_INTERFACE_DISABLE      0x01
index fd208fd01a4b899286d16e6288f1c68606be2d97..365b98d155860b6bcce65e28310c89aae32845ec 100644 (file)
@@ -172,9 +172,9 @@ ospf6_router_lsa_originate (struct thread *thread)
         continue;
 
       /* Multiple Router-LSA instance according to size limit setting */
-      if (oa->router_lsa_size_limit != 0 &&
-          (caddr_t) lsdesc + sizeof (struct ospf6_router_lsdesc) -
-          (caddr_t) buffer > oa->router_lsa_size_limit)
+      if ( (oa->router_lsa_size_limit != 0)
+          && ((caddr_t) lsdesc + sizeof (struct ospf6_router_lsdesc) -
+              (caddr_t) buffer > oa->router_lsa_size_limit))
         {
           if ((caddr_t) lsdesc == (caddr_t) router_lsa +
                                   sizeof (struct ospf6_router_lsa))
@@ -471,7 +471,7 @@ ospf6_link_lsa_show (struct vty *vty, struct ospf6_lsa *lsa)
   int prefixnum;
   char buf[128], options[32];
   struct ospf6_prefix *prefix;
-  char *p, *mc, *la, *nu;
+  const char *p, *mc, *la, *nu;
   struct in6_addr in6;
 
   link_lsa = (struct ospf6_link_lsa *)
@@ -625,7 +625,7 @@ ospf6_intra_prefix_lsa_show (struct vty *vty, struct ospf6_lsa *lsa)
   char buf[128];
   struct ospf6_prefix *prefix;
   char id[16], adv_router[16];
-  char *p, *mc, *la, *nu;
+  const char *p, *mc, *la, *nu;
   struct in6_addr in6;
 
   intra_prefix_lsa = (struct ospf6_intra_prefix_lsa *)
index da732798283633e707ceb5c332f773d254a218ab..d6356c7279afd618a831b2a448dbf9860fb538a8 100644 (file)
@@ -90,7 +90,7 @@ struct ospf6_lsa_handler *
 ospf6_get_lsa_handler (u_int16_t type)
 {
   struct ospf6_lsa_handler *handler = NULL;
-  int index = ntohs (type) & OSPF6_LSTYPE_FCODE_MASK;
+  unsigned int index = ntohs (type) & OSPF6_LSTYPE_FCODE_MASK;
 
   if (index >= vector_max (ospf6_lsa_handler_vector))
     handler = &unknown_handler;
@@ -100,7 +100,7 @@ ospf6_get_lsa_handler (u_int16_t type)
   return handler;
 }
 
-char *
+const char *
 ospf6_lstype_name (u_int16_t type)
 {
   static char buf[8];
@@ -711,7 +711,8 @@ char *
 ospf6_lsa_handler_name (struct ospf6_lsa_handler *h)
 {
   static char buf[64];
-  int i, size = strlen (h->name);
+  unsigned int i; 
+  unsigned int size = strlen (h->name);
 
   if (h->name == "Unknown" &&
       h->type != OSPF6_LSTYPE_UNKNOWN)
@@ -740,7 +741,7 @@ DEFUN (debug_ospf6_lsa_type,
        "Specify LS type as Hexadecimal\n"
       )
 {
-  int i;
+  unsigned int i;
   struct ospf6_lsa_handler *handler = NULL;
   unsigned long val;
   char *endptr = NULL;
@@ -808,7 +809,7 @@ DEFUN (no_debug_ospf6_lsa_type,
        "Specify LS type as Hexadecimal\n"
       )
 {
-  int i;
+  u_int i;
   struct ospf6_lsa_handler *handler = NULL;
   unsigned long val;
   char *endptr = NULL;
@@ -868,7 +869,7 @@ struct cmd_element no_debug_ospf6_lsa_type_detail_cmd;
 void
 install_element_ospf6_debug_lsa ()
 {
-  int i;
+  u_int i;
   struct ospf6_lsa_handler *handler;
 #define STRSIZE  256
 #define DOCSIZE  1024
@@ -969,7 +970,7 @@ install_element_ospf6_debug_lsa ()
 int
 config_write_ospf6_debug_lsa (struct vty *vty)
 {
-  int i;
+  u_int i;
   struct ospf6_lsa_handler *handler;
 
   for (i = 0; i < vector_max (ospf6_lsa_handler_vector); i++)
index 0f81b6adc8173c70c37318a9e6bd197122063fd7..c23d6f71640a43da71b4db6562557a09e7d05530 100644 (file)
@@ -143,7 +143,7 @@ struct ospf6_lsa
 struct ospf6_lsa_handler
 {
   u_int16_t type; /* host byte order */
-  char *name;
+  const char *name;
   int (*show) (struct vty *, struct ospf6_lsa *);
   u_char debug;
 };
@@ -202,7 +202,7 @@ struct ospf6_lsa_handler
 
 \f
 /* Function Prototypes */
-char *ospf6_lstype_name (u_int16_t type);
+const char *ospf6_lstype_name (u_int16_t type);
 u_char ospf6_lstype_debug (u_int16_t type);
 int ospf6_lsa_is_differ (struct ospf6_lsa *lsa1, struct ospf6_lsa *lsa2);
 int ospf6_lsa_is_changed (struct ospf6_lsa *lsa1, struct ospf6_lsa *lsa2);
index 6cd633f554299922bb83bdc7f409b1e8a6cd1cd9..d20e9a1ff5df9ace88aa474d2c3e20519cdef8cd 100644 (file)
@@ -75,7 +75,7 @@ static void
 _lsdb_count_assert (struct ospf6_lsdb *lsdb)
 {
   struct ospf6_lsa *debug;
-  int num = 0;
+  unsigned int num = 0;
   for (debug = ospf6_lsdb_head (lsdb); debug;
        debug = ospf6_lsdb_next (debug))
     num++;
index b5e640335066ae28242a881cc3fb53d7b9cfa0b6..95086f2fba29951b4c3c4cf4b8d5ccd42f7d6b02 100644 (file)
@@ -92,7 +92,7 @@ int daemon_mode = 0;
 struct thread_master *master;
 
 /* Process ID saved for use by init system */
-char *pid_file = PATH_OSPF6D_PID;
+const char *pid_file = PATH_OSPF6D_PID;
 
 /* Help information display. */
 static void
index d4a60dd9f5a5e2483a080019acb25f9b1138bc40..e436867e7cda81a5b35391874b4c75a3d1aa5b79 100644 (file)
@@ -43,7 +43,7 @@
 #include "ospf6d.h"
 
 unsigned char conf_debug_ospf6_message[6] = {0x03, 0, 0, 0, 0, 0};
-char *ospf6_message_type_str[] =
+const char *ospf6_message_type_str[] =
   { "Unknown", "Hello", "DbDesc", "LSReq", "LSUpdate", "LSAck" };
 
 /* print functions */
@@ -1160,12 +1160,12 @@ ospf6_lsack_recv (struct in6_addr *src, struct in6_addr *dst,
     }
 }
 
-char *recvbuf = NULL;
-char *sendbuf = NULL;
-int iobuflen = 0;
+u_char *recvbuf = NULL;
+u_char *sendbuf = NULL;
+unsigned int iobuflen = 0;
 
 int
-ospf6_iobuf_size (int size)
+ospf6_iobuf_size (unsigned int size)
 {
   char *recvnew, *sendnew;
 
@@ -1198,7 +1198,8 @@ ospf6_iobuf_size (int size)
 int
 ospf6_receive (struct thread *thread)
 {
-  int sockfd, len;
+  int sockfd;
+  unsigned int len;
   char srcname[64], dstname[64];
   struct in6_addr src, dst;
   unsigned int ifindex;
@@ -1386,7 +1387,7 @@ ospf6_hello_send (struct thread *thread)
   struct ospf6_interface *oi;
   struct ospf6_header *oh;
   struct ospf6_hello *hello;
-  char *p;
+  u_char *p;
   struct listnode *node;
   struct ospf6_neighbor *on;
 
@@ -1452,7 +1453,7 @@ ospf6_dbdesc_send (struct thread *thread)
   struct ospf6_neighbor *on;
   struct ospf6_header *oh;
   struct ospf6_dbdesc *dbdesc;
-  char *p;
+  u_char *p;
   struct ospf6_lsa *lsa;
 
   on = (struct ospf6_neighbor *) THREAD_ARG (thread);
@@ -1568,7 +1569,7 @@ ospf6_lsreq_send (struct thread *thread)
   struct ospf6_neighbor *on;
   struct ospf6_header *oh;
   struct ospf6_lsreq_entry *e;
-  char *p;
+  u_char *p;
   struct ospf6_lsa *lsa;
 
   on = (struct ospf6_neighbor *) THREAD_ARG (thread);
@@ -1632,7 +1633,7 @@ ospf6_lsupdate_send_neighbor (struct thread *thread)
   struct ospf6_neighbor *on;
   struct ospf6_header *oh;
   struct ospf6_lsupdate *lsupdate;
-  char *p;
+  u_char *p;
   int num;
   struct ospf6_lsa *lsa;
 
@@ -1673,7 +1674,8 @@ ospf6_lsupdate_send_neighbor (struct thread *thread)
        lsa = ospf6_lsdb_next (lsa))
     {
       /* MTU check */
-      if (p - sendbuf + OSPF6_LSA_SIZE (lsa->header) > on->ospf6_if->ifmtu)
+      if ( (p - sendbuf + (unsigned int)OSPF6_LSA_SIZE (lsa->header))
+          > on->ospf6_if->ifmtu)
         {
           ospf6_lsa_unlock (lsa);
           break;
@@ -1692,7 +1694,8 @@ ospf6_lsupdate_send_neighbor (struct thread *thread)
        lsa = ospf6_lsdb_next (lsa))
     {
       /* MTU check */
-      if (p - sendbuf + OSPF6_LSA_SIZE (lsa->header) > on->ospf6_if->ifmtu)
+      if ( (p - sendbuf + (unsigned int)OSPF6_LSA_SIZE (lsa->header))
+          > on->ospf6_if->ifmtu)
         {
           ospf6_lsa_unlock (lsa);
           break;
@@ -1733,7 +1736,7 @@ ospf6_lsupdate_send_interface (struct thread *thread)
   struct ospf6_interface *oi;
   struct ospf6_header *oh;
   struct ospf6_lsupdate *lsupdate;
-  char *p;
+  u_char *p;
   int num;
   struct ospf6_lsa *lsa;
 
@@ -1764,7 +1767,8 @@ ospf6_lsupdate_send_interface (struct thread *thread)
        lsa = ospf6_lsdb_next (lsa))
     {
       /* MTU check */
-      if (p - sendbuf + OSPF6_LSA_SIZE (lsa->header) > oi->ifmtu)
+      if ( (p - sendbuf + ((unsigned int)OSPF6_LSA_SIZE (lsa->header)))
+          > oi->ifmtu)
         {
           ospf6_lsa_unlock (lsa);
           break;
@@ -1804,7 +1808,7 @@ ospf6_lsack_send_neighbor (struct thread *thread)
 {
   struct ospf6_neighbor *on;
   struct ospf6_header *oh;
-  char *p;
+  u_char *p;
   struct ospf6_lsa *lsa;
 
   on = (struct ospf6_neighbor *) THREAD_ARG (thread);
@@ -1864,7 +1868,7 @@ ospf6_lsack_send_interface (struct thread *thread)
 {
   struct ospf6_interface *oi;
   struct ospf6_header *oh;
-  char *p;
+  u_char *p;
   struct ospf6_lsa *lsa;
 
   oi = (struct ospf6_interface *) THREAD_ARG (thread);
@@ -2082,7 +2086,7 @@ ALIAS (no_debug_ospf6_message,
 int
 config_write_ospf6_debug_message (struct vty *vty)
 {
-  char *type_str[] = {"unknown", "hello", "dbdesc",
+  const char *type_str[] = {"unknown", "hello", "dbdesc",
                       "lsreq", "lsupdate", "lsack"};
   unsigned char s = 0, r = 0;
   int i;
index 186fc74bc1ced49c1b70fd0cec5373cbba8e78f6..95b07ced5e907ed5159d322ecdade828ba52c75b 100644 (file)
@@ -47,7 +47,7 @@ extern unsigned char conf_debug_ospf6_message[];
 #define OSPF6_MESSAGE_TYPE_CANONICAL(T) \
   ((T) > OSPF6_MESSAGE_TYPE_LSACK ? OSPF6_MESSAGE_TYPE_UNKNOWN : (T))
 
-extern char *ospf6_message_type_str[];
+extern const char *ospf6_message_type_str[];
 #define OSPF6_MESSAGE_TYPE_NAME(T) \
   (ospf6_message_type_str[ OSPF6_MESSAGE_TYPE_CANONICAL (T) ])
 
@@ -122,7 +122,7 @@ void ospf6_lsreq_print (struct ospf6_header *);
 void ospf6_lsupdate_print (struct ospf6_header *);
 void ospf6_lsack_print (struct ospf6_header *);
 
-int ospf6_iobuf_size (int size);
+int ospf6_iobuf_size (unsigned int size);
 int ospf6_receive (struct thread *thread);
 
 int ospf6_hello_send (struct thread *thread);
index 752b3fc66fbb09dc7fb9d8a18581b2a749ed1c51..7b91c17d2eaca65c297059bf98fe53a7bbbb53c6 100644 (file)
@@ -42,7 +42,7 @@
 
 unsigned char conf_debug_ospf6_neighbor = 0;
 
-char *ospf6_neighbor_state_str[] =
+const char *ospf6_neighbor_state_str[] =
 { "None", "Down", "Attempt", "Init", "Twoway", "ExStart", "ExChange",
   "Loading", "Full", NULL };
 
index 441ab81c7d0f0a33809339984d73df5c519968b8..8f94790d71193799b48f3de21a279e9d2f40e2ef 100644 (file)
@@ -105,7 +105,7 @@ struct ospf6_neighbor
 #define OSPF6_NEIGHBOR_LOADING  7
 #define OSPF6_NEIGHBOR_FULL     8
 
-extern char *ospf6_neighbor_state_str[];
+const extern char *ospf6_neighbor_state_str[];
 
 \f
 /* Function Prototypes */
index 584382ae5239a2fe1b4ff6f98967c45548f64727..c792aa4526136b8e79d5460cae5d785159a18465 100644 (file)
@@ -72,7 +72,7 @@ ospf6_capability_printbuf (char capability, char *buf, int size)
 void
 ospf6_options_printbuf (u_char *options, char *buf, int size)
 {
-  char *dc, *r, *n, *mc, *e, *v6;
+  const char *dc, *r, *n, *mc, *e, *v6;
   dc = (OSPF6_OPT_ISSET (options, OSPF6_OPT_DC) ? "DC" : "--");
   r  = (OSPF6_OPT_ISSET (options, OSPF6_OPT_R)  ? "R"  : "-" );
   n  = (OSPF6_OPT_ISSET (options, OSPF6_OPT_N)  ? "N"  : "-" );
index 7a5a394139035fd2cc9e4536c48059d35be20d29..c1c6d359cdc0abf873068cf641afb664e5958f5a 100644 (file)
@@ -63,16 +63,16 @@ ospf6_linkstate_prefix2str (struct prefix *prefix, char *buf, int size)
 }
 
 /* Global strings for logging */
-char *ospf6_dest_type_str[OSPF6_DEST_TYPE_MAX] =
+const char *ospf6_dest_type_str[OSPF6_DEST_TYPE_MAX] =
 { "Unknown", "Router", "Network", "Discard", "Linkstate", "AddressRange", };
 
-char *ospf6_dest_type_substr[OSPF6_DEST_TYPE_MAX] =
+const char *ospf6_dest_type_substr[OSPF6_DEST_TYPE_MAX] =
 { "?", "R", "N", "D", "L", "A", };
 
-char *ospf6_path_type_str[OSPF6_PATH_TYPE_MAX] =
+const char *ospf6_path_type_str[OSPF6_PATH_TYPE_MAX] =
 { "Unknown", "Intra-Area", "Inter-Area", "External-1", "External-2", };
 
-char *ospf6_path_type_substr[OSPF6_PATH_TYPE_MAX] =
+const char *ospf6_path_type_substr[OSPF6_PATH_TYPE_MAX] =
 { "??", "IA", "IE", "E1", "E2", };
 
 
@@ -206,7 +206,7 @@ _route_count_assert (struct ospf6_route_table *table)
 {
   struct ospf6_route *debug;
   char buf[64];
-  int num = 0;
+  unsigned int num = 0;
   for (debug = ospf6_route_head (table); debug;
        debug = ospf6_route_next (debug))
     num++;
@@ -769,7 +769,7 @@ ospf6_route_show_table_summary (struct vty *vty,
 {
   struct ospf6_route *route, *prev = NULL;
   int i, pathtype[OSPF6_PATH_TYPE_MAX];
-  int number = 0;
+  unsigned int number = 0;
   int nhinval = 0, ecmp = 0;
   int alternative = 0, destination = 0;
 
@@ -908,7 +908,7 @@ ospf6_route_show_table (struct vty *vty, int detail,
 }
 
 int
-ospf6_route_table_show (struct vty *vty, int argc, char **argv,
+ospf6_route_table_show (struct vty *vty, int argc, const char *argv[],
                         struct ospf6_route_table *table)
 {
   int summary = 0;
@@ -1083,7 +1083,7 @@ ospf6_linkstate_show_table (struct vty *vty, int detail,
 }
 
 int
-ospf6_linkstate_table_show (struct vty *vty, int argc, char **argv,
+ospf6_linkstate_table_show (struct vty *vty, int argc, const char *argv[],
                             struct ospf6_route_table *table)
 {
   int detail = 0;
index d9456a1435d0f091797df85140a5e72ad738a670..d91cd7b7623e18500bb93410da4b435b338d620d 100644 (file)
@@ -173,8 +173,8 @@ struct ospf6_route_table
   void (*hook_remove) (struct ospf6_route *);
 };
 
-extern char *ospf6_dest_type_str[OSPF6_DEST_TYPE_MAX];
-extern char *ospf6_dest_type_substr[OSPF6_DEST_TYPE_MAX];
+extern const char *ospf6_dest_type_str[OSPF6_DEST_TYPE_MAX];
+extern const char *ospf6_dest_type_substr[OSPF6_DEST_TYPE_MAX];
 #define OSPF6_DEST_TYPE_NAME(x)                       \
   (0 < (x) && (x) < OSPF6_DEST_TYPE_MAX ?             \
    ospf6_dest_type_str[(x)] : ospf6_dest_type_str[0])
@@ -182,8 +182,8 @@ extern char *ospf6_dest_type_substr[OSPF6_DEST_TYPE_MAX];
   (0 < (x) && (x) < OSPF6_DEST_TYPE_MAX ?                   \
    ospf6_dest_type_substr[(x)] : ospf6_dest_type_substr[0])
 
-extern char *ospf6_path_type_str[OSPF6_PATH_TYPE_MAX];
-extern char *ospf6_path_type_substr[OSPF6_PATH_TYPE_MAX];
+extern const char *ospf6_path_type_str[OSPF6_PATH_TYPE_MAX];
+extern const char *ospf6_path_type_substr[OSPF6_PATH_TYPE_MAX];
 #define OSPF6_PATH_TYPE_NAME(x)                       \
   (0 < (x) && (x) < OSPF6_PATH_TYPE_MAX ?             \
    ospf6_path_type_str[(x)] : ospf6_path_type_str[0])
@@ -266,9 +266,9 @@ void ospf6_route_dump (struct ospf6_route_table *table);
 void ospf6_route_show (struct vty *vty, struct ospf6_route *route);
 void ospf6_route_show_detail (struct vty *vty, struct ospf6_route *route);
 
-int ospf6_route_table_show (struct vty *, int, char **,
+int ospf6_route_table_show (struct vty *, int, const char *[],
                             struct ospf6_route_table *);
-int ospf6_linkstate_table_show (struct vty *vty, int argc, char **argv,
+int ospf6_linkstate_table_show (struct vty *vty, int argc, const char *argv[],
                             struct ospf6_route_table *table);
 
 void ospf6_brouter_show_header (struct vty *vty);
index 186c8e2fc4f483d7a23be046dbfbe0b17feea48c..98a7f5a97b1964d0145b1a181412c492d9afcd73 100644 (file)
@@ -234,8 +234,8 @@ ospfv3AreaEntry (struct variable *v, oid *name, size_t *length,
 {
   struct ospf6_area *oa, *area = NULL;
   u_int32_t area_id = 0;
-  listnode node;
-  int len;
+  struct listnode *node;
+  unsigned int len;
 
   if (ospf6 == NULL)
     return NULL;
@@ -293,9 +293,9 @@ ospfv3AreaEntry (struct variable *v, oid *name, size_t *length,
 
 /* Register OSPFv3-MIB. */
 void
-ospf6_snmp_init ()
+ospf6_snmp_init (struct thread_master *master)
 {
-  smux_init (ospf6d_oid, sizeof (ospf6d_oid) / sizeof (oid));
+  smux_init (master, ospf6d_oid, sizeof (ospf6d_oid) / sizeof (oid));
   REGISTER_MIB ("OSPFv3MIB", ospfv3_variables, variable, ospfv3_oid);
   smux_start ();
 }
index 89c8c4783333612e7cd97c3d553369a9c3b275bf..7ef784c91cf2d7afc4091710087a6b8eac2d642c 100644 (file)
@@ -22,7 +22,7 @@
 #ifndef OSPF6_SNMP_H
 #define OSPF6_SNMP_H
 
-void ospf6_snmp_init ();
+void ospf6_snmp_init (struct thread_master *);
 
 #endif /*OSPF6_SNMP_H*/
 
index 79539b2fb64d807950045814f0179b19497266e0..4f3af7cd66fd9c3be0985d7be973e5494812d369 100644 (file)
@@ -527,7 +527,7 @@ ospf6_spf_schedule (struct ospf6_area *oa)
 }
 
 void
-ospf6_spf_display_subtree (struct vty *vty, char *prefix, int rest,
+ospf6_spf_display_subtree (struct vty *vty, const char *prefix, int rest,
                            struct ospf6_vertex *v)
 {
   struct listnode *node;
index 6a6424eafb8f29c3aa653fb49a6627fe2bafbb23..c9e031bfe177b53324f8fcb0ea400913315d6c30 100644 (file)
@@ -82,7 +82,7 @@ void ospf6_spf_calculation (u_int32_t router_id,
                             struct ospf6_area *oa);
 void ospf6_spf_schedule (struct ospf6_area *oa);
 
-void ospf6_spf_display_subtree (struct vty *vty, char *prefix,
+void ospf6_spf_display_subtree (struct vty *vty, const char *prefix,
                                 int rest, struct ospf6_vertex *v);
 
 int config_write_ospf6_debug_spf (struct vty *vty);
index 712b337ed0beb9b10af5314425517b360f541f27..9fd3264148cf200da63d095a189d8524df1707fb 100644 (file)
@@ -521,7 +521,7 @@ DEFUN (show_ipv6_ospf6_route_match,
        "Display routes which match the specified route\n"
        )
 {
-  char *sargv[CMD_ARGC_MAX];
+  const char *sargv[CMD_ARGC_MAX];
   int i, sargc;
 
   /* copy argv to sargv and then append "match" */
@@ -547,7 +547,7 @@ DEFUN (show_ipv6_ospf6_route_match_detail,
        "Detailed information\n"
        )
 {
-  char *sargv[CMD_ARGC_MAX];
+  const char *sargv[CMD_ARGC_MAX];
   int i, sargc;
 
   /* copy argv to sargv and then append "match" and "detail" */
@@ -589,7 +589,7 @@ DEFUN (show_ipv6_ospf6_route_type_detail,
        "Detailed information\n"
        )
 {
-  char *sargv[CMD_ARGC_MAX];
+  const char *sargv[CMD_ARGC_MAX];
   int i, sargc;
 
   /* copy argv to sargv and then append "detail" */
index 695e8eca34fee69af9e5937c4097cba0b5263553..d10d1df670d0808229ace540346a900d3e5a9c9d 100644 (file)
@@ -129,7 +129,7 @@ config_write_ospf6_debug (struct vty *vty)
   "%s        AS Scoped Link State Database%s%s"
 
 static int
-parse_show_level (int argc, char **argv)
+parse_show_level (int argc, const char *argv[])
 {
   int level = 0;
   if (argc)
@@ -147,7 +147,7 @@ parse_show_level (int argc, char **argv)
 }
 
 static u_int16_t
-parse_type_spec (int argc, char **argv)
+parse_type_spec (int argc, const char *argv[])
 {
   u_int16_t type = 0;
   assert (argc);
@@ -1775,7 +1775,7 @@ DEFUN (show_ipv6_ospf6_linkstate_detail,
        "Display linkstate routing table\n"
       )
 {
-  char *sargv[CMD_ARGC_MAX];
+  const char *sargv[CMD_ARGC_MAX];
   int i, sargc;
   struct listnode *node;
   struct ospf6_area *oa;
@@ -1817,7 +1817,7 @@ ospf6_init ()
   ospf6_abr_init ();
 
 #ifdef HAVE_SNMP
-  ospf6_snmp_init ();
+  ospf6_snmp_init (master);
 #endif /*HAVE_SNMP*/
 
   install_node (&debug_node, config_write_ospf6_debug);