changeset 1006:766a12db7c5b

* src/ecos/support.c (_show_ifp): Display the IPv6 flag information. * src/ecos/support.c (cyg_net_malloc): Honour the flag M_ZERO, otherwise we end up with junk where we don't want it.
author asl
date Mon, 12 May 2003 10:09:04 +0000
parents 1f968b35cd30
children 16d247bb9c70
files packages/net/bsd_tcpip/current/ChangeLog packages/net/bsd_tcpip/current/include/netinet/in_var.h packages/net/bsd_tcpip/current/src/ecos/support.c
diffstat 3 files changed, 50 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/packages/net/bsd_tcpip/current/ChangeLog
+++ b/packages/net/bsd_tcpip/current/ChangeLog
@@ -1,3 +1,8 @@
+2003-05-12  Andrew Lunn  <andrew.lunn@ascom.ch>
+
+	* src/ecos/support.c (_show_ifp): Display the IPv6 flag
+	information.
+
 2003-05-04  Gary Thomas  <gary@mlbassoc.com>
 
 	* src/ecos/support.c: 
@@ -6,9 +11,15 @@ 2003-05-04  Gary Thomas  <gary@mlbassoc.
 	on some hardware as the init sequence can totally foul up a
 	network [debug] connection.
 
+2003-04-28  Andrew Lunn  <andrew.lunn@ascom.ch>
+
+	* src/ecos/support.c (cyg_net_malloc): Honour the flag M_ZERO,
+	otherwise we end up with junk where we don't want it.
+
 2003-04-11  Michael Checky  <Michael_Checky@Thermoking.com>
 
-	* cdl/freebsd_net.cdl: Deleted the 'CYGPKG_NET_FREEBSD_STACK_BUILD_TESTS'
+	* cdl/freebsd_net.cdl: Deleted the 
+	'CYGPKG_NET_FREEBSD_STACK_BUILD_TESTS'
 	component because these tests are in the net.cdl component
 	'CYGPKG_NET_BUILD_TESTS' and selecting this option in freebsd_net.cdl
 	causes build errors.
--- a/packages/net/bsd_tcpip/current/include/netinet/in_var.h
+++ b/packages/net/bsd_tcpip/current/include/netinet/in_var.h
@@ -242,3 +242,6 @@ void	ipflow_slowtimo __P((void));
 #include <netinet6/in6_var.h>
 
 #endif /* _NETINET_IN_VAR_H_ */
+
+
+
--- a/packages/net/bsd_tcpip/current/src/ecos/support.c
+++ b/packages/net/bsd_tcpip/current/src/ecos/support.c
@@ -72,6 +72,11 @@
 #include <cyg/hal/hal_if.h>
 #include <cyg/infra/cyg_ass.h>
 
+#ifdef CYGPKG_NET_INET6
+#include <netinet/in.h>
+#include <netinet6/in6_var.h>
+#endif
+
 #if !CYGPKG_NET_DRIVER_FRAMEWORK   // Interface
 #error At least one network driver framework must be defined!
 #else
@@ -202,6 +207,9 @@ cyg_net_malloc(u_long size, int type, in
     } else {
         res = cyg_mempool_var_alloc(net_mem, size);
     }
+    if ((flags & M_ZERO) && res) {
+      memset(res,0,size);
+    }
     FINISH_STATS(stats_malloc);
     log(LOG_MDEBUG, "%p\n", res);
     return (res);
@@ -945,17 +953,32 @@ static void
     TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) {
         if (ifa->ifa_addr->sa_family != AF_LINK) {
 	    (*pr)("%-8s", name);
-            getnameinfo (ifa->ifa_addr, ifa->ifa_addr->sa_len, addr, sizeof(addr), 0, 0, 0);
+            getnameinfo (ifa->ifa_addr, ifa->ifa_addr->sa_len, addr, 
+                         sizeof(addr), 0, 0, NI_NUMERICHOST);
 	    if (ifa->ifa_addr->sa_family == AF_INET) {
-	      getnameinfo (ifa->ifa_dstaddr, ifa->ifa_dstaddr->sa_len, broadcast, sizeof(broadcast), 0, 0, 0);
+	      getnameinfo (ifa->ifa_dstaddr, ifa->ifa_dstaddr->sa_len, 
+                           broadcast, sizeof(broadcast), 
+                           0, 0, NI_NUMERICHOST);
 	      _mask(ifa->ifa_netmask, netmask, 64);
-	      (*pr)("IP: %s, Broadcast: %s, Netmask: %s\n", addr, broadcast, netmask);
+	      (*pr)("IP: %s, Broadcast: %s, Netmask: %s\n", 
+                    addr, broadcast, netmask);
 	    }
-#ifdef CYGPKG_NET_INET6
-	    if (ifa->ifa_addr->sa_family == AF_INET6) {
-	      _mask6(ifa->ifa_netmask, netmask, 64);
-	      (*pr)("IP: %s/%s\n", addr,netmask);
-	    }
+#ifdef CYGPKG_NET_INET6 
+            if (ifa->ifa_addr->sa_family == AF_INET6) {
+              struct in6_ifaddr * ifa6 = (struct in6_ifaddr *) ifa;
+              _mask6(ifa->ifa_netmask, netmask, 64);
+              (*pr)("IP: %s/%s   ", addr,netmask);
+              if (ifa6->ia6_flags & IN6_IFF_ANYCAST) (*pr) ("Anycast ");
+              if (ifa6->ia6_flags & IN6_IFF_TENTATIVE) (*pr) ("Tentative ");
+              if (ifa6->ia6_flags & IN6_IFF_DUPLICATED) (*pr) ("Duplicate ");
+              if (ifa6->ia6_flags & IN6_IFF_DETACHED) (*pr) ("Detached ");
+              if (ifa6->ia6_flags & IN6_IFF_DEPRECATED) (*pr) ("Deprecated ");
+              if (ifa6->ia6_flags & IN6_IFF_NODAD) (*pr) ("NoDAD ");
+              if (ifa6->ia6_flags & IN6_IFF_AUTOCONF) (*pr) ("AutoConf ");
+              if (ifa6->ia6_flags & IN6_IFF_TEMPORARY) (*pr) ("Tempory ");
+              if (ifa6->ia6_flags & IN6_IFF_HOME) (*pr) ("Home ");
+              (*pr) ("\n");
+            }
 #endif
             (*pr)("        ");
             if ((ifp->if_flags & IFF_UP)) (*pr)("UP ");
@@ -966,8 +989,10 @@ static void
             if ((ifp->if_flags & IFF_MULTICAST)) (*pr)("MULTICAST ");
             if ((ifp->if_flags & IFF_ALLMULTI)) (*pr)("ALLMULTI ");
             (*pr)("MTU: %d, Metric: %d\n", ifp->if_mtu, ifp->if_metric);
-            (*pr)("        Rx - Packets: %d, Bytes: %d", ifa->if_data.ifi_ipackets, ifa->if_data.ifi_ibytes);
-            (*pr)(", Tx - Packets: %d, Bytes: %d\n", ifa->if_data.ifi_opackets, ifa->if_data.ifi_obytes);
+            (*pr)("        Rx - Packets: %d, Bytes: %d", 
+                  ifa->if_data.ifi_ipackets, ifa->if_data.ifi_ibytes);
+            (*pr)(", Tx - Packets: %d, Bytes: %d\n", 
+                  ifa->if_data.ifi_opackets, ifa->if_data.ifi_obytes);
         }
     }
 }