]> git.puffer.fish Git - mirror/frr.git/commitdiff
Some compiler warnings fixes and fix for bugzilla #119.
authorhasso <hasso>
Tue, 12 Oct 2004 20:50:58 +0000 (20:50 +0000)
committerhasso <hasso>
Tue, 12 Oct 2004 20:50:58 +0000 (20:50 +0000)
zebra/ChangeLog
zebra/interface.c
zebra/irdp_interface.c
zebra/rib.h
zebra/zebra_rib.c
zebra/zebra_snmp.c
zebra/zebra_vty.c

index a40764950cb52f248ee1f539fe3c5565edff1d2f..fad80a143bf01cafcc9cef946550082db54a434b 100644 (file)
@@ -2,6 +2,10 @@
 
        * zebra_vty.c: Unbreak "show ip route" command help and make it work
          for isis routes.
+       * interface.c(if_dump_vty): Show IPv6 addresses in "show interface"
+         output. Fixes Bugzilla #119.
+       * *.c: Make some strings const and some (unsigned) casts to fix
+         compiler warnings.
 
 2004-10-07 Hasso Tepper <hasso at quagga.net>
 
index f95efa4e1de3b9534701e50373d82978e4d391f2..5664f41a41e4fbef0a3b37ecc7e5c7890040226b 100644 (file)
@@ -728,6 +728,14 @@ if_dump_vty (struct vty *vty, struct interface *ifp)
        }
     }
 
+  for (node = listhead (ifp->connected); node; nextnode (node))
+    {
+      connected = getdata (node);
+      if (CHECK_FLAG (connected->conf, ZEBRA_IFC_REAL) &&
+         (connected->address->family == AF_INET6))
+       connected_dump_vty (vty, connected);
+    }
+
 #ifdef RTADV
   nd_dump_vty (vty, ifp);
 #endif /* RTADV */
@@ -1092,8 +1100,9 @@ ALIAS (no_bandwidth_if,
        "Bandwidth in kilobits\n")
 \f
 int
-ip_address_install (struct vty *vty, struct interface *ifp, char *addr_str,
-                   char *peer_str, char *label)
+ip_address_install (struct vty *vty, struct interface *ifp,
+                   const char *addr_str, const char *peer_str,
+                   const char *label)
 {
   struct prefix_ipv4 cp;
   struct connected *ifc;
@@ -1178,8 +1187,9 @@ ip_address_install (struct vty *vty, struct interface *ifp, char *addr_str,
 }
 
 int
-ip_address_uninstall (struct vty *vty, struct interface *ifp, char *addr_str,
-                     char *peer_str, char *label)
+ip_address_uninstall (struct vty *vty, struct interface *ifp,
+                     const char *addr_str, const char *peer_str,
+                     const char *label)
 {
   struct prefix_ipv4 cp;
   struct connected *ifc;
@@ -1288,8 +1298,9 @@ DEFUN (no_ip_address_label,
 
 #ifdef HAVE_IPV6
 int
-ipv6_address_install (struct vty *vty, struct interface *ifp, char *addr_str,
-                     char *peer_str, char *label, int secondary)
+ipv6_address_install (struct vty *vty, struct interface *ifp,
+                     const char *addr_str, const char *peer_str,
+                     const char *label, int secondary)
 {
   struct prefix_ipv6 cp;
   struct connected *ifc;
@@ -1365,8 +1376,9 @@ ipv6_address_install (struct vty *vty, struct interface *ifp, char *addr_str,
 }
 
 int
-ipv6_address_uninstall (struct vty *vty, struct interface *ifp, char *addr_str,
-                       char *peer_str, char *label, int secondry)
+ipv6_address_uninstall (struct vty *vty, struct interface *ifp,
+                       const char *addr_str, const char *peer_str,
+                       const char *label, int secondry)
 {
   struct prefix_ipv6 cp;
   struct connected *ifc;
index 76654c47633c1e56b11f2018ff19fc53a481f709..e824abed75e3a4e7e619f3af5a636d28dbe8d39f 100644 (file)
@@ -155,7 +155,7 @@ int if_drop_group (struct interface *ifp)
   return 0;
 }
 
-struct interface *get_iflist_ifp(int idx)
+struct interface *get_iflist_ifp(unsigned int idx)
 {
   struct listnode *node;
   struct interface *ifp;
@@ -500,7 +500,7 @@ DEFUN (ip_irdp_minadvertinterval,
   zi=ifp->info;
   irdp=&zi->irdp;
 
-  if( atoi(argv[0]) <= irdp->MaxAdvertInterval) {
+  if( (unsigned) atoi(argv[0]) <= irdp->MaxAdvertInterval) {
       irdp->MinAdvertInterval = atoi(argv[0]);
 
       return CMD_SUCCESS;
@@ -534,7 +534,7 @@ DEFUN (ip_irdp_maxadvertinterval,
   irdp=&zi->irdp;
 
 
-  if( irdp->MinAdvertInterval <= atoi(argv[0]) ) {
+  if( irdp->MinAdvertInterval <= (unsigned) atoi(argv[0]) ) {
     irdp->MaxAdvertInterval = atoi(argv[0]);
 
       return CMD_SUCCESS;
index 1141db11822fe55b231d4ab0c5d1a07731f75c80..b21e087f24098e291256fe838801a3fb6be33205 100644 (file)
@@ -234,11 +234,11 @@ void rib_close ();
 void rib_init ();
 
 int
-static_add_ipv4 (struct prefix *p, struct in_addr *gate, char *ifname,
+static_add_ipv4 (struct prefix *p, struct in_addr *gate, const char *ifname,
        u_char flags, u_char distance, u_int32_t vrf_id);
 
 int
-static_delete_ipv4 (struct prefix *p, struct in_addr *gate, char *ifname,
+static_delete_ipv4 (struct prefix *p, struct in_addr *gate, const char *ifname,
                    u_char distance, u_int32_t vrf_id);
 
 #ifdef HAVE_IPV6
@@ -258,11 +258,12 @@ extern struct route_table *rib_table_ipv6;
 
 int
 static_add_ipv6 (struct prefix *p, u_char type, struct in6_addr *gate,
-                char *ifname, u_char flags, u_char distance, u_int32_t vrf_id);
+                const char *ifname, u_char flags, u_char distance,
+                u_int32_t vrf_id);
 
 int
 static_delete_ipv6 (struct prefix *p, u_char type, struct in6_addr *gate,
-                   char *ifname, u_char distance, u_int32_t vrf_id);
+                   const char *ifname, u_char distance, u_int32_t vrf_id);
 
 #endif /* HAVE_IPV6 */
 
index a06fd9095c637af382d955d7ad07759d6965a8db..dc27d1f9a665d6fd9c492f0962d977b47f798b06 100644 (file)
@@ -1437,7 +1437,7 @@ static_uninstall_ipv4 (struct prefix *p, struct static_ipv4 *si)
 
 /* Add static route into static route configuration. */
 int
-static_add_ipv4 (struct prefix *p, struct in_addr *gate, char *ifname,
+static_add_ipv4 (struct prefix *p, struct in_addr *gate, const char *ifname,
                 u_char flags, u_char distance, u_int32_t vrf_id)
 {
   u_char type = 0;
@@ -1533,7 +1533,7 @@ static_add_ipv4 (struct prefix *p, struct in_addr *gate, char *ifname,
 
 /* Delete static route from static route configuration. */
 int
-static_delete_ipv4 (struct prefix *p, struct in_addr *gate, char *ifname,
+static_delete_ipv4 (struct prefix *p, struct in_addr *gate, const char *ifname,
                    u_char distance, u_int32_t vrf_id)
 {
   u_char type = 0;
@@ -2002,7 +2002,8 @@ static_uninstall_ipv6 (struct prefix *p, struct static_ipv6 *si)
 /* Add static route into static route configuration. */
 int
 static_add_ipv6 (struct prefix *p, u_char type, struct in6_addr *gate,
-                char *ifname, u_char flags, u_char distance, u_int32_t vrf_id)
+                const char *ifname, u_char flags, u_char distance,
+                u_int32_t vrf_id)
 {
   struct route_node *rn;
   struct static_ipv6 *si;
@@ -2082,7 +2083,7 @@ static_add_ipv6 (struct prefix *p, u_char type, struct in6_addr *gate,
 /* Delete static route from static route configuration. */
 int
 static_delete_ipv6 (struct prefix *p, u_char type, struct in6_addr *gate,
-                   char *ifname, u_char distance, u_int32_t vrf_id)
+                   const char *ifname, u_char distance, u_int32_t vrf_id)
 {
   struct route_node *rn;
   struct static_ipv6 *si;
index 5095095c2103261d985bb8e499097378d73631f0..dece89eadb6a832d1963ee374b851f9539da8900 100644 (file)
@@ -328,7 +328,7 @@ get_fwtable_route_node(struct variable *v, oid objid[], size_t *objid_len,
 
   /* Short circuit exact matches of wrong length */
 
-  if (exact && (*objid_len != v->namelen + 10))
+  if (exact && (*objid_len != (unsigned) v->namelen + 10))
     return;
 
   table = vrf_table (AFI_IP, SAFI_UNICAST, 0);
@@ -342,19 +342,19 @@ get_fwtable_route_node(struct variable *v, oid objid[], size_t *objid_len,
   if (*objid_len > v->namelen)
     oid2in_addr (objid + v->namelen, MIN(4, *objid_len - v->namelen), &dest);
 
-  if (*objid_len > v->namelen + 4)
+  if (*objid_len > (unsigned) v->namelen + 4)
     proto = objid[v->namelen + 4];
 
-  if (*objid_len > v->namelen + 5)
+  if (*objid_len > (unsigned) v->namelen + 5)
     policy = objid[v->namelen + 5];
 
-  if (*objid_len > v->namelen + 6)
+  if (*objid_len > (unsigned) v->namelen + 6)
     oid2in_addr (objid + v->namelen + 6, MIN(4, *objid_len - v->namelen - 6),
                 &nexthop);
 
   /* Apply GETNEXT on not exact search */
 
-  if (!exact && (*objid_len >= v->namelen + 10))
+  if (!exact && (*objid_len >= (unsigned) v->namelen + 10))
     {
       if (! in_addr_add((u_char *) &nexthop, 1)) 
         return;
index 044448e13cd265eed5508b03cca90907caff741e..ae4083ed32a655352d80d75f4b5acb08799a3d4d 100644 (file)
@@ -91,16 +91,16 @@ route_type_char (u_char type)
 \f
 /* General fucntion for static route. */
 int
-zebra_static_ipv4 (struct vty *vty, int add_cmd,
-                  char *dest_str, char *mask_str, char *gate_str,
-                  char *flag_str, char *distance_str)
+zebra_static_ipv4 (struct vty *vty, int add_cmd, const char *dest_str,
+                  const char *mask_str, const char *gate_str,
+                  const char *flag_str, const char *distance_str)
 {
   int ret;
   u_char distance;
   struct prefix p;
   struct in_addr gate;
   struct in_addr mask;
-  char *ifname;
+  const char *ifname;
   u_char flag = 0;
   
   ret = str2prefix (dest_str, &p);
@@ -754,7 +754,9 @@ vty_show_ip_route (struct vty *vty, struct route_node *rn, struct rib *rib)
     }
 }
 
-#define SHOW_ROUTE_V4_HEADER "Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,%s       I - ISIS, B - BGP, > - selected route, * - FIB route%s%s"
+#define SHOW_ROUTE_V4_HEADER "Codes: K - kernel route, C - connected, " \
+  "S - static, R - RIP, O - OSPF,%s       I - ISIS, B - BGP, " \
+  "> - selected route, * - FIB route%s%s"
 
 DEFUN (show_ip_route,
        show_ip_route_cmd,
@@ -1114,8 +1116,9 @@ static_config_ipv4 (struct vty *vty)
 #ifdef HAVE_IPV6
 /* General fucntion for IPv6 static route. */
 int
-static_ipv6_func (struct vty *vty, int add_cmd, char *dest_str,
-                 char *gate_str, char *ifname, char *flag_str, char *distance_str)
+static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str,
+                 const char *gate_str, const char *ifname,
+                 const char *flag_str, const char *distance_str)
 {
   int ret;
   u_char distance;