]> git.puffer.fish Git - mirror/frr.git/commitdiff
Compiler warnings fixes.
authorhasso <hasso>
Sun, 26 Sep 2004 16:24:14 +0000 (16:24 +0000)
committerhasso <hasso>
Sun, 26 Sep 2004 16:24:14 +0000 (16:24 +0000)
16 files changed:
isisd/ChangeLog
isisd/isis_adjacency.c
isisd/isis_circuit.c
isisd/isis_events.c
isisd/isis_events.h
isisd/isis_lsp.c
isisd/isis_misc.c
isisd/isis_network.c
isisd/isis_pdu.c
isisd/isis_route.c
isisd/isis_routemap.c
isisd/isis_spf.c
isisd/isis_tlv.c
isisd/isis_tlv.h
isisd/isis_zebra.c
isisd/isisd.c

index 4b0659a0ed61a4b3a40d9bb02d991f03f2fd3e34..35296fb49362c5c385792fd0b142e01e4042bee0 100644 (file)
@@ -1,3 +1,10 @@
+2004-09-26 Hasso Tepper <hasso at quagga.net>
+
+       * *.[c|h]: Fix a lot of compiler warnings.
+       * isis_events.c: Remove isis_event_int_reach_change() function, as it
+         doesn't make sense for now. Call lsp_regenerate_schedule() directly
+         where needed.
+
 2004-09-26 Hasso Tepper <hasso at quagga.net>
 
        * isis_lsp.h: Cast-as-lvalue extension is deprecated and is not
index 3770ebded84476a8036c137a655c81569e90a04c..beba0d95260c53284916cbef5ca7965c24314751 100644 (file)
@@ -263,7 +263,7 @@ isis_adj_print (struct isis_adjacency *adj)
       for (node = listhead (adj->ipv6_addrs); node; nextnode (node))
        {
          ipv6_addr = getdata (node);
-         inet_ntop (AF_INET6, ipv6_addr, ip6, INET6_ADDRSTRLEN);
+         inet_ntop (AF_INET6, ipv6_addr, (char *)ip6, INET6_ADDRSTRLEN);
          zlog_info ("%s", ip6);
        }
     }
@@ -413,7 +413,7 @@ isis_adj_print_vty2 (struct isis_adjacency *adj, struct vty *vty, char detail)
          for (node = listhead (adj->ipv6_addrs); node; nextnode (node))
            {
              ipv6_addr = getdata (node);
-             inet_ntop (AF_INET6, ipv6_addr, ip6, INET6_ADDRSTRLEN);
+             inet_ntop (AF_INET6, ipv6_addr, (char *)ip6, INET6_ADDRSTRLEN);
              vty_out (vty, "      %s%s", ip6, VTY_NEWLINE);
            }
        }
index 21aa59e4bd5efddcbf0a0623cb9b1125f874e6b8..2dbdba3ebf41af95acd29d3b93b2a456df16073e 100644 (file)
@@ -241,7 +241,7 @@ isis_circuit_add_addr (struct isis_circuit *circuit,
       ipv4->prefixlen = connected->address->prefixlen;
       ipv4->prefix = connected->address->u.prefix4;
       listnode_add (circuit->ip_addrs, ipv4);
-      isis_event_int_reach_change (circuit);
+      lsp_regenerate_schedule (circuit->area);
 
 #ifdef EXTREME_DEBUG
       prefix2str (connected->address, buf, BUFSIZ);
@@ -261,7 +261,7 @@ isis_circuit_add_addr (struct isis_circuit *circuit,
       else
        listnode_add (circuit->ipv6_non_link, ipv6);
 
-      isis_event_int_reach_change(circuit);
+      lsp_regenerate_schedule (circuit->area);
 
 #ifdef EXTREME_DEBUG
       prefix2str (connected->address, buf, BUFSIZ);
@@ -302,11 +302,11 @@ isis_circuit_del_addr (struct isis_circuit *circuit,
       if (ip)
        {
          listnode_delete (circuit->ip_addrs, ip);
-         isis_event_int_reach_change (circuit);
+         lsp_regenerate_schedule (circuit->area);
        }
       else
        {
-         prefix2str (connected->address, buf, BUFSIZ);
+         prefix2str (connected->address, (char *)buf, BUFSIZ);
          zlog_warn("Nonexitant ip address %s removal attempt from circuit \
                     %d", buf, circuit->circuit_id);
        }
@@ -349,12 +349,12 @@ isis_circuit_del_addr (struct isis_circuit *circuit,
 
       if (!found)
        {
-         prefix2str (connected->address, buf, BUFSIZ);
+         prefix2str (connected->address, (char *)buf, BUFSIZ);
          zlog_warn("Nonexitant ip address %s removal attempt from \
                     circuit %d", buf, circuit->circuit_id);
        }
       else
-       isis_event_int_reach_change (circuit);
+       lsp_regenerate_schedule (circuit->area);
     }
 #endif /* HAVE_IPV6 */
   return;
@@ -960,7 +960,7 @@ DEFUN (isis_circuit_type,
 
   assert (circuit);
 
-  circuit_t = string2circuit_t (argv[0]);
+  circuit_t = string2circuit_t ((u_char *)argv[0]);
 
   if (!circuit_t)
     {
@@ -1036,7 +1036,7 @@ DEFUN (isis_passwd,
     }
   circuit->passwd.len = len;
   circuit->passwd.type = ISIS_PASSWD_TYPE_CLEARTXT;
-  strncpy (circuit->passwd.passwd, argv[0], 255);
+  strncpy ((char *)circuit->passwd.passwd, argv[0], 255);
 
   return CMD_SUCCESS;
 }
index 4f84388732826bd1f5ebc9478a487ea6115610e6..353c29ba1e91dcdf3dfcc58bbdddca570f229572 100644 (file)
@@ -295,20 +295,6 @@ isis_event_adjacency_state_change (struct isis_adjacency *adj, int newstate)
   return;
 }
 
-void
-isis_event_int_reach_change (struct isis_circuit *circuit)
-{
-  if (!circuit || !circuit->area)
-    return;
-
-  zlog_info ("ISIS-Evt (%s) Internal reachability change",
-            circuit->area->area_tag);
-
-  lsp_regenerate_schedule (circuit->area);
-
-  return;
-}
-
 /* events supporting code */
 
 int
@@ -331,7 +317,7 @@ isis_event_dis_status_change (struct thread *thread)
 }
 
 void
-isis_event_auth_failure (char *area_tag, char *error_string, char *sysid)
+isis_event_auth_failure (char *area_tag, char *error_string, u_char *sysid)
 {
   zlog_info ("ISIS-Evt (%s) Authentication failure %s from %s",
             area_tag, error_string, sysid_print (sysid));
index a6ec2e8cf81f204d6e15095e4eedab919c2281a2..c4bd8ab7bb0e6195d99ccb9c393aeadf509ff6b0 100644 (file)
@@ -50,6 +50,6 @@ int isis_event_dis_status_change (struct thread *thread);
 #define AUTH_ERROR_TYPE_SNP   2
 #define AUTH_ERROR_TYPE_HELLO 1
 void isis_event_auth_failure (char *area_tag, char *error_string,
-                             char *sysid);
+                             u_char *sysid);
 
 #endif /* _ZEBRA_ISIS_EVENTS_H */
index 5467b48345133f88152133199b4ffb5e20f88c1a..2f1854374cee36c6132c8a7bc09ff2230b42e601 100644 (file)
@@ -653,18 +653,18 @@ lspid_print (u_char * lsp_id, u_char * trg, char dynhost, char frag)
     dyn = NULL;
 
   if (dyn)
-    sprintf (id, "%.14s", dyn->name.name);
+    sprintf ((char *)id, "%.14s", dyn->name.name);
   else if (!memcmp (isis->sysid, lsp_id, ISIS_SYS_ID_LEN) & dynhost)
-    sprintf (id, "%.14s", unix_hostname ());
+    sprintf ((char *)id, "%.14s", unix_hostname ());
   else
     {
       memcpy (id, sysid_print (lsp_id), 15);
     }
   if (frag)
-    sprintf (trg, "%s.%02x-%02x", id, LSP_PSEUDO_ID (lsp_id),
+    sprintf ((char *)trg, "%s.%02x-%02x", id, LSP_PSEUDO_ID (lsp_id),
             LSP_FRAGMENT (lsp_id));
   else
-    sprintf (trg, "%s.%02x", id, LSP_PSEUDO_ID (lsp_id));
+    sprintf ((char *)trg, "%s.%02x", id, LSP_PSEUDO_ID (lsp_id));
 }
 
 /* Convert the lsp attribute bits to attribute string */
@@ -832,7 +832,7 @@ lsp_print_detail (dnode_t * node, struct vty *vty, char dynhost)
       memset (&in6, 0, sizeof (in6));
       memcpy (in6.s6_addr, ipv6_reach->prefix,
              PSIZE (ipv6_reach->prefix_len));
-      inet_ntop (AF_INET6, &in6, buff, BUFSIZ);
+      inet_ntop (AF_INET6, &in6, (char *)buff, BUFSIZ);
       if ((ipv6_reach->control_info &&
           CTRL_INFO_DISTRIBUTION) == DISTRIBUTION_INTERNAL)
        vty_out (vty, "  Metric: %d IPv6-Intern %s/%d%s",
index 51c4d92992469c98ba8f9e8cc0200b7db2ef7295..53a2a85decc92a104885f7ea8ff5d3195079cf39 100644 (file)
@@ -112,7 +112,7 @@ dotformat2buff (u_char * buff, u_char * dotted)
   int nextdotpos = 2;
 
   number[2] = '\0';
-  dotlen = strlen (dotted);
+  dotlen = strlen ((char *)dotted);
   if (dotlen > 50)
     {
       /* this can't be an iso net, its too long */
@@ -151,7 +151,7 @@ dotformat2buff (u_char * buff, u_char * dotted)
          break;
        }
 
-      *(buff + len) = (char) strtol (number, NULL, 16);
+      *(buff + len) = (char) strtol ((char *)number, NULL, 16);
       len++;
     }
 
@@ -170,7 +170,7 @@ sysid2buff (u_char * buff, u_char * dotted)
 
   number[2] = '\0';
   // surely not a sysid_string if not 14 length
-  if (strlen (dotted) != 14)
+  if (strlen ((char *)dotted) != 14)
     {
       return 0;
     }
@@ -199,7 +199,7 @@ sysid2buff (u_char * buff, u_char * dotted)
          break;
        }
 
-      *(buff + len) = (char) strtol (number, NULL, 16);
+      *(buff + len) = (char) strtol ((char *)number, NULL, 16);
       len++;
     }
 
@@ -282,13 +282,13 @@ string2circuit_t (u_char * str)
   if (!str)
     return 0;
 
-  if (!strcmp (str, "level-1"))
+  if (!strcmp ((char *)str, "level-1"))
     return IS_LEVEL_1;
 
-  if (!strcmp (str, "level-2-only") || !strcmp (str, "level-2"))
+  if (!strcmp ((char *)str, "level-2-only") || !strcmp ((char *)str, "level-2"))
     return IS_LEVEL_2;
 
-  if (!strcmp (str, "level-1-2"))
+  if (!strcmp ((char *)str, "level-1-2"))
     return IS_LEVEL_1_AND_2;
 
   return 0;
@@ -339,7 +339,7 @@ char *
 snpa_print (u_char * from)
 {
   int i = 0;
-  u_char *pos = snpa;
+  u_char *pos = (u_char *)snpa;
 
   if (!from)
     return "unknown";
@@ -348,19 +348,19 @@ snpa_print (u_char * from)
     {
       if (i & 1)
        {
-         sprintf (pos, "%02x.", *(from + i));
+         sprintf ((char *)pos, "%02x.", *(from + i));
          pos += 3;
        }
       else
        {
-         sprintf (pos, "%02x", *(from + i));
+         sprintf ((char *)pos, "%02x", *(from + i));
          pos += 2;
 
        }
       i++;
     }
 
-  sprintf (pos, "%02x", *(from + (ISIS_SYS_ID_LEN - 1)));
+  sprintf ((char *)pos, "%02x", *(from + (ISIS_SYS_ID_LEN - 1)));
   pos += 2;
   *(pos) = '\0';
 
index 080863bda5c8732d14562107a223ff402752078a..4fbf16ff3b7d38a79391a1fbd902e5ba7a439c4c 100644 (file)
@@ -390,7 +390,7 @@ isis_recv_pdu_bcast (struct isis_circuit *circuit, u_char * ssnpa)
 
   bytesread = recvfrom (circuit->fd, (void *) &llc,
                        LLC_LEN, MSG_PEEK,
-                       (struct sockaddr *) &s_addr, &addr_len);
+                       (struct sockaddr *) &s_addr, (socklen_t *) &addr_len);
 
   if (bytesread < 0)
     {
@@ -417,7 +417,7 @@ isis_recv_pdu_bcast (struct isis_circuit *circuit, u_char * ssnpa)
 
   /* on lan we have to read to the static buff first */
   bytesread = recvfrom (circuit->fd, sock_buff, circuit->interface->mtu, 0,
-                       (struct sockaddr *) &s_addr, &addr_len);
+                       (struct sockaddr *) &s_addr, (socklen_t *) &addr_len);
 
   /* then we lose the LLC */
   memcpy (STREAM_DATA (circuit->rcv_stream),
@@ -442,7 +442,7 @@ isis_recv_pdu_p2p (struct isis_circuit *circuit, u_char * ssnpa)
   /* we can read directly to the stream */
   bytesread = recvfrom (circuit->fd, STREAM_DATA (circuit->rcv_stream),
                        circuit->interface->mtu, 0,
-                       (struct sockaddr *) &s_addr, &addr_len);
+                       (struct sockaddr *) &s_addr, (socklen_t *) &addr_len);
 
   if (s_addr.sll_pkttype == PACKET_OUTGOING)
     {
index bf8c14f78b99c4453b47931fa74ea3b476132c6a..436240efad906c764a1d9b503f3a63c02b28c777 100644 (file)
@@ -334,7 +334,7 @@ process_p2p_hello (struct isis_circuit *circuit)
   adj = circuit->u.p2p.neighbor;
   if (!adj)
     {
-      adj = isis_new_adj (hdr->source_id, "      ", 0, circuit);
+      adj = isis_new_adj (hdr->source_id, (u_char *) "      ", 0, circuit);
       if (adj == NULL)
        return ISIS_ERROR;
       circuit->u.p2p.neighbor = adj;
@@ -1587,7 +1587,7 @@ process_is_hello (struct isis_circuit *circuit)
   if (!adj)
     {
       /* 8.2.2 */
-      adj = isis_new_adj (sysid, "      ", 0, circuit);
+      adj = isis_new_adj (sysid, (u_char *) "      ", 0, circuit);
       if (adj == NULL)
        return ISIS_ERROR;
 
@@ -1603,7 +1603,7 @@ process_is_hello (struct isis_circuit *circuit)
       /* 8.2.2 a) 2) delete the adj */
       XFREE (MTYPE_ISIS_ADJACENCY, adj);
       /* 8.2.2 a) 3) create a new adj */
-      adj = isis_new_adj (sysid, "      ", 0, circuit);
+      adj = isis_new_adj (sysid, (u_char *) "      ", 0, circuit);
       if (adj == NULL)
        return ISIS_ERROR;
 
index 90808681c41371705f9d2c8e1a5c1116f15864ce..c6151f9accd86a2c08c0083920f310dbbcb6cc8e 100644 (file)
@@ -122,7 +122,7 @@ nexthop_print (struct isis_nexthop *nh)
 {
   u_char buf[BUFSIZ];
 
-  inet_ntop (AF_INET, &nh->ip, buf, BUFSIZ);
+  inet_ntop (AF_INET, &nh->ip, (char *) buf, BUFSIZ);
 
   zlog_info ("      %s %u", buf, nh->ifindex);
 }
@@ -218,7 +218,7 @@ nexthop6_print (struct isis_nexthop6 *nh6)
 {
   u_char buf[BUFSIZ];
 
-  inet_ntop (AF_INET6, &nh6->ip6, buf, BUFSIZ);
+  inet_ntop (AF_INET6, &nh6->ip6, (char *) buf, BUFSIZ);
 
   zlog_info ("      %s %u", buf, nh6->ifindex);
 }
@@ -331,14 +331,14 @@ isis_route_info_delete (struct isis_route_info *route_info)
 {
   if (route_info->nexthops)
     {
-      route_info->nexthops->del = (void *) isis_nexthop_delete;
+      route_info->nexthops->del = (void (*)(void *)) isis_nexthop_delete;
       list_delete (route_info->nexthops);
     }
 
 #ifdef HAVE_IPV6
   if (route_info->nexthops6)
     {
-      route_info->nexthops6->del = (void *) isis_nexthop6_delete;
+      route_info->nexthops6->del = (void (*)(void *)) isis_nexthop6_delete;
       list_delete (route_info->nexthops6);
     }
 #endif /* HAVE_IPV6 */
@@ -484,7 +484,7 @@ isis_route_create (struct prefix *prefix, u_int32_t cost, u_int32_t depth,
 
   family = prefix->family;
   /* for debugs */
-  prefix2str (prefix, buff, BUFSIZ);
+  prefix2str (prefix, (char *) buff, BUFSIZ);
 
   rinfo_new = isis_route_info_new (cost, depth, family, adjacencies);
   if (!rinfo_new)
@@ -623,7 +623,7 @@ again:
 
       if (isis->debugs & DEBUG_RTE_EVENTS)
        {
-         prefix2str (&rode->p, buff, BUFSIZ);
+         prefix2str (&rode->p, (char *) buff, BUFSIZ);
          zlog_info ("ISIS-Rte (%s): route validate: %s %s %s",
                     area->area_tag,
                     (CHECK_FLAG (rinfo->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNC) ?
index 56e44b888e50f657d845d196978e68fbf449c63f..688ca58bf2531be4c4a0bb265c11fa7b77814cae 100644 (file)
@@ -52,7 +52,7 @@
 extern struct isis *isis;
 
 void
-isis_route_map_upd ()
+isis_route_map_upd (char *name)
 {
   int i = 0;
 
index b2845ae1c62ea70768956678c6338cfcdaa529ce..1c32f8fce30fdfa5c3a352e2ebea19fb73dbf4b8 100644 (file)
@@ -192,13 +192,13 @@ vid2string (struct isis_vertex *vertex, u_char * buff)
     case VTYPE_IP6REACH_INTERNAL:
     case VTYPE_IP6REACH_EXTERNAL:
 #endif /* HAVE_IPV6 */
-      prefix2str ((struct prefix *) &vertex->N.prefix, buff, BUFSIZ);
+      prefix2str ((struct prefix *) &vertex->N.prefix, (char *) buff, BUFSIZ);
       break;
     default:
       return "UNKNOWN";
     }
 
-  return buff;
+  return (char *) buff;
 }
 
 struct isis_spftree *
@@ -232,10 +232,10 @@ isis_vertex_del (struct isis_vertex *vertex)
 void
 isis_spftree_del (struct isis_spftree *spftree)
 {
-  spftree->tents->del = (void *) isis_vertex_del;
+  spftree->tents->del = (void (*)(void *)) isis_vertex_del;
   list_delete (spftree->tents);
 
-  spftree->paths->del = (void *) isis_vertex_del;
+  spftree->paths->del = (void (*)(void *)) isis_vertex_del;
   list_delete (spftree->paths);
 
   XFREE (MTYPE_ISIS_SPFTREE, spftree);
@@ -935,7 +935,7 @@ add_to_paths (struct isis_spftree *spftree, struct isis_vertex *vertex,
 void
 init_spt (struct isis_spftree *spftree)
 {
-  spftree->tents->del = spftree->paths->del = (void *) isis_vertex_del;
+  spftree->tents->del = spftree->paths->del = (void (*)(void *)) isis_vertex_del;
   list_delete_all_node (spftree->tents);
   list_delete_all_node (spftree->paths);
   spftree->tents->del = spftree->paths->del = NULL;
index 70b3c1770e1d41d1ad5215904ee645a9e7e8da95..c859ef0e866546720e76c2c0f18838027b4024f1 100644 (file)
@@ -881,7 +881,7 @@ tlv_add_nlpid (struct nlpids *nlpids, struct stream *stream)
 }
 
 int
-tlv_add_authinfo (char auth_type, char auth_len, char *auth_value,
+tlv_add_authinfo (char auth_type, char auth_len, u_char *auth_value,
                  struct stream *stream)
 {
   u_char value[255];
index 0883547d131a9ba850dd280c1e1bf0adfe1de0f2..72f883dbbeb5f7b8e830996a0180c1507ff907be 100644 (file)
@@ -265,7 +265,7 @@ int tlv_add_is_neighs (struct list *is_neighs, struct stream *stream);
 int tlv_add_lan_neighs (struct list *lan_neighs, struct stream *stream);
 int tlv_add_nlpid (struct nlpids *nlpids, struct stream *stream);
 int tlv_add_checksum (struct checksum *checksum, struct stream *stream);
-int tlv_add_authinfo (char auth_type, char authlen, char *auth_value,
+int tlv_add_authinfo (char auth_type, char authlen, u_char *auth_value,
                      struct stream *stream);
 int tlv_add_ip_addrs (struct list *ip_addrs, struct stream *stream);
 int tlv_add_dynamic_hostname (struct hostname *hostname,
index e2f1dc590e8710e514384c38684379c4b46ec4f3..8e122082a5351c8c70277eedc9399205589e3d8c 100644 (file)
@@ -97,7 +97,7 @@ zebra_interface_if_lookup (struct stream *s)
   stream_get (ifname_tmp, s, INTERFACE_NAMSIZ);
 
   /* Lookup this by interface index. */
-  ifp = if_lookup_by_name (ifname_tmp);
+  ifp = if_lookup_by_name ((char *) ifname_tmp);
 
   /* If such interface does not exist, indicate an error */
   if (!ifp)
@@ -169,7 +169,7 @@ isis_zebra_if_address_add (int command, struct zclient *zclient,
 {
   struct connected *c;
   struct prefix *p;
-  u_char buf[BUFSIZ];
+  char buf[BUFSIZ];
 
   c = zebra_interface_address_read (ZEBRA_INTERFACE_ADDRESS_ADD,
                                    zclient->ibuf);
index af05cd152f6f4d9f8607d6c27cdbce2343c3b8d6..8656d22b090d7d8a768afc3d43b728e62952373c 100644 (file)
@@ -220,7 +220,7 @@ isis_area_destroy (struct vty *vty, char *area_tag)
 }
 
 int
-area_net_title (struct vty *vty, char *net_title)
+area_net_title (struct vty *vty, u_char *net_title)
 {
   struct isis_area *area;
   struct area_addr *addr;
@@ -314,7 +314,7 @@ area_net_title (struct vty *vty, char *net_title)
 }
 
 int
-area_clear_net_title (struct vty *vty, char *net_title)
+area_clear_net_title (struct vty *vty, u_char *net_title)
 {
   struct isis_area *area;
   struct area_addr addr, *addrp = NULL;
@@ -1006,7 +1006,7 @@ DEFUN (net,
        "A Network Entity Title for this process (OSI only)\n"
        "XX.XXXX. ... .XXX.XX  Network entity title (NET)\n")
 {
-  return area_net_title (vty, argv[0]);
+  return area_net_title (vty, (u_char *)argv[0]);
 }
 
 /*
@@ -1019,7 +1019,7 @@ DEFUN (no_net,
        "A Network Entity Title for this process (OSI only)\n"
        "XX.XXXX. ... .XXX.XX  Network entity title (NET)\n")
 {
-  return area_clear_net_title (vty, argv[0]);
+  return area_clear_net_title (vty, (u_char *)argv[0]);
 }
 
 DEFUN (area_passwd,
@@ -1047,7 +1047,7 @@ DEFUN (area_passwd,
     }
   area->area_passwd.len = (u_char) len;
   area->area_passwd.type = ISIS_PASSWD_TYPE_CLEARTXT;
-  strncpy (area->area_passwd.passwd, argv[0], 255);
+  strncpy ((char *)area->area_passwd.passwd, argv[0], 255);
 
   return CMD_SUCCESS;
 }
@@ -1098,7 +1098,7 @@ DEFUN (domain_passwd,
     }
   area->domain_passwd.len = (u_char) len;
   area->domain_passwd.type = ISIS_PASSWD_TYPE_CLEARTXT;
-  strncpy (area->domain_passwd.passwd, argv[0], 255);
+  strncpy ((char *)area->domain_passwd.passwd, argv[0], 255);
 
   return CMD_SUCCESS;
 }
@@ -1143,7 +1143,7 @@ DEFUN (is_type,
       return CMD_WARNING;
     }
 
-  type = string2circuit_t (argv[0]);
+  type = string2circuit_t ((u_char *)argv[0]);
   if (!type)
     {
       vty_out (vty, "Unknown IS level %s", VTY_NEWLINE);