Compiler warnings fixes.
diff --git a/isisd/ChangeLog b/isisd/ChangeLog
index 4b0659a..35296fb 100644
--- a/isisd/ChangeLog
+++ b/isisd/ChangeLog
@@ -1,5 +1,12 @@
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
accpted any more in gcc-4.0.
diff --git a/isisd/isis_adjacency.c b/isisd/isis_adjacency.c
index 3770ebd..beba0d9 100644
--- a/isisd/isis_adjacency.c
+++ b/isisd/isis_adjacency.c
@@ -263,7 +263,7 @@
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 @@
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);
}
}
diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c
index 21aa59e..2dbdba3 100644
--- a/isisd/isis_circuit.c
+++ b/isisd/isis_circuit.c
@@ -241,7 +241,7 @@
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 @@
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 @@
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 @@
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 @@
assert (circuit);
- circuit_t = string2circuit_t (argv[0]);
+ circuit_t = string2circuit_t ((u_char *)argv[0]);
if (!circuit_t)
{
@@ -1036,7 +1036,7 @@
}
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;
}
diff --git a/isisd/isis_events.c b/isisd/isis_events.c
index 4f84388..353c29b 100644
--- a/isisd/isis_events.c
+++ b/isisd/isis_events.c
@@ -295,20 +295,6 @@
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 @@
}
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));
diff --git a/isisd/isis_events.h b/isisd/isis_events.h
index a6ec2e8..c4bd8ab 100644
--- a/isisd/isis_events.h
+++ b/isisd/isis_events.h
@@ -50,6 +50,6 @@
#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 */
diff --git a/isisd/isis_lsp.c b/isisd/isis_lsp.c
index 5467b48..2f18543 100644
--- a/isisd/isis_lsp.c
+++ b/isisd/isis_lsp.c
@@ -653,18 +653,18 @@
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 @@
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",
diff --git a/isisd/isis_misc.c b/isisd/isis_misc.c
index 51c4d92..53a2a85 100644
--- a/isisd/isis_misc.c
+++ b/isisd/isis_misc.c
@@ -112,7 +112,7 @@
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 @@
break;
}
- *(buff + len) = (char) strtol (number, NULL, 16);
+ *(buff + len) = (char) strtol ((char *)number, NULL, 16);
len++;
}
@@ -170,7 +170,7 @@
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 @@
break;
}
- *(buff + len) = (char) strtol (number, NULL, 16);
+ *(buff + len) = (char) strtol ((char *)number, NULL, 16);
len++;
}
@@ -282,13 +282,13 @@
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 @@
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 @@
{
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';
diff --git a/isisd/isis_network.c b/isisd/isis_network.c
index 080863b..4fbf16f 100644
--- a/isisd/isis_network.c
+++ b/isisd/isis_network.c
@@ -390,7 +390,7 @@
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 @@
/* 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 @@
/* 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)
{
diff --git a/isisd/isis_pdu.c b/isisd/isis_pdu.c
index bf8c14f..436240e 100644
--- a/isisd/isis_pdu.c
+++ b/isisd/isis_pdu.c
@@ -334,7 +334,7 @@
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 @@
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 @@
/* 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;
diff --git a/isisd/isis_route.c b/isisd/isis_route.c
index 9080868..c6151f9 100644
--- a/isisd/isis_route.c
+++ b/isisd/isis_route.c
@@ -122,7 +122,7 @@
{
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 @@
{
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 @@
{
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 @@
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 @@
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) ?
diff --git a/isisd/isis_routemap.c b/isisd/isis_routemap.c
index 56e44b8..688ca58 100644
--- a/isisd/isis_routemap.c
+++ b/isisd/isis_routemap.c
@@ -52,7 +52,7 @@
extern struct isis *isis;
void
-isis_route_map_upd ()
+isis_route_map_upd (char *name)
{
int i = 0;
diff --git a/isisd/isis_spf.c b/isisd/isis_spf.c
index b2845ae..1c32f8f 100644
--- a/isisd/isis_spf.c
+++ b/isisd/isis_spf.c
@@ -192,13 +192,13 @@
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 @@
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 @@
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;
diff --git a/isisd/isis_tlv.c b/isisd/isis_tlv.c
index 70b3c17..c859ef0 100644
--- a/isisd/isis_tlv.c
+++ b/isisd/isis_tlv.c
@@ -881,7 +881,7 @@
}
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];
diff --git a/isisd/isis_tlv.h b/isisd/isis_tlv.h
index 0883547..72f883d 100644
--- a/isisd/isis_tlv.h
+++ b/isisd/isis_tlv.h
@@ -265,7 +265,7 @@
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,
diff --git a/isisd/isis_zebra.c b/isisd/isis_zebra.c
index e2f1dc5..8e12208 100644
--- a/isisd/isis_zebra.c
+++ b/isisd/isis_zebra.c
@@ -97,7 +97,7 @@
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 @@
{
struct connected *c;
struct prefix *p;
- u_char buf[BUFSIZ];
+ char buf[BUFSIZ];
c = zebra_interface_address_read (ZEBRA_INTERFACE_ADDRESS_ADD,
zclient->ibuf);
diff --git a/isisd/isisd.c b/isisd/isisd.c
index af05cd1..8656d22 100644
--- a/isisd/isisd.c
+++ b/isisd/isisd.c
@@ -220,7 +220,7 @@
}
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 @@
}
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 @@
"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 @@
"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 @@
}
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 @@
}
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 @@
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);