diff -ur libgtop-2.22.1-orig/ChangeLog libgtop-2.22.1/ChangeLog
--- libgtop-2.22.1-orig/ChangeLog	2007-05-19 12:14:56.000000000 -0700
+++ libgtop-2.22.1/ChangeLog	2008-04-14 20:40:13.527858349 -0700
@@ -1,3 +1,10 @@
+2008-04-14  Mark McClelland <mark@ovcam.org>
+	* examples/openfiles.c:
+	* include/glibtop/procopenfiles.h
+	* sysdeps/linux/procopenfiles.c
+
+	Implement ipv6 support for Linux
+
 2007-05-19  Benoît Dejean  <benoit@placenet.org>
 
 	* features.def:
Only in libgtop-2.22.1: ChangeLog~
Only in libgtop-2.22.1-orig/doc/reference: version.xml
Only in libgtop-2.22.1-orig/doc/reference: xml
diff -ur libgtop-2.22.1-orig/examples/openfiles.c libgtop-2.22.1/examples/openfiles.c
--- libgtop-2.22.1-orig/examples/openfiles.c	2007-04-26 15:27:41.000000000 -0700
+++ libgtop-2.22.1/examples/openfiles.c	2008-04-14 19:51:48.086029889 -0700
@@ -37,9 +37,16 @@
 		  printf("socket %s:%d\n", files[i].info.sock.dest_host, files[i].info.sock.dest_port);
 		  break;
 
+	  case GLIBTOP_FILE_TYPE_INET6SOCKET:
+		  printf("socket [%s]:%d\n", files[i].info.sock.dest_host, files[i].info.sock.dest_port);
+		  break;
+
 	  case GLIBTOP_FILE_TYPE_LOCALSOCKET:
 		  printf("localsocket %s\n", files[i].info.localsock.name);
 		  break;
+
+	  default:
+		  printf("unknown type\n");
 	  }
   }
 
Only in libgtop-2.22.1/examples: openfiles.c~
diff -ur libgtop-2.22.1-orig/include/glibtop/procopenfiles.h libgtop-2.22.1/include/glibtop/procopenfiles.h
--- libgtop-2.22.1-orig/include/glibtop/procopenfiles.h	2007-04-26 15:27:30.000000000 -0700
+++ libgtop-2.22.1/include/glibtop/procopenfiles.h	2008-04-14 18:50:09.700026263 -0700
@@ -53,7 +53,8 @@
 	GLIBTOP_FILE_TYPE_FILE		= 1,
 	GLIBTOP_FILE_TYPE_PIPE		= 2,
 	GLIBTOP_FILE_TYPE_INETSOCKET	= 4,
-	GLIBTOP_FILE_TYPE_LOCALSOCKET	= 8
+	GLIBTOP_FILE_TYPE_LOCALSOCKET	= 8,
+	GLIBTOP_FILE_TYPE_INET6SOCKET	= 16
 };
 
 typedef struct _glibtop_open_files_entry glibtop_open_files_entry;
@@ -65,7 +66,8 @@
 	int fd;
 	guint16 type; /* An "enum glibtop_file_type" value. */
 	union {
-		/* When type == GLIBTOP_FILE_TYPE_INETSOCKET */
+		/* When type == GLIBTOP_FILE_TYPE_INETSOCKET or
+		 * when type == GLIBTOP_FILE_TYPE_INET6SOCKET */
 		struct {
 			char dest_host[GLIBTOP_OPEN_DEST_HOST_LEN+1];
 			int dest_port;
Only in libgtop-2.22.1/include/glibtop: procopenfiles.h~
Only in libgtop-2.22.1-orig/lib: lib.c
Only in libgtop-2.22.1-orig/: libgtopconfig.h
Only in libgtop-2.22.1-orig/: libgtop.spec
diff -ur libgtop-2.22.1-orig/sysdeps/linux/procopenfiles.c libgtop-2.22.1/sysdeps/linux/procopenfiles.c
--- libgtop-2.22.1-orig/sysdeps/linux/procopenfiles.c	2007-06-03 13:06:05.000000000 -0700
+++ libgtop-2.22.1/sysdeps/linux/procopenfiles.c	2008-04-14 19:32:40.670025677 -0700
@@ -97,6 +97,48 @@
 
 
 
+struct Inet6SocketEntry
+{
+	char host[GLIBTOP_OPEN_DEST_HOST_LEN + 1];
+	int port;
+};
+
+
+static void
+inet6_socket_parser(GHashTable *dict, const char* line)
+{
+	struct Inet6SocketEntry *se;
+	int sock;
+	struct in6_addr addr;
+
+	se = g_malloc0(sizeof *se);
+
+	if(sscanf(line, "%*d: %*s %8x%8x%8x%8x:%4x %*x %*x:%*x %*x:%*x %*d %*d %*d %d",
+		  &addr.s6_addr32[0], &addr.s6_addr32[1], &addr.s6_addr32[2],
+		  &addr.s6_addr32[3], &se->port, &sock) != 6)
+		goto error;
+
+	if(!inet_ntop(AF_INET6, &addr, se->host, sizeof se->host))
+		goto error;
+
+	g_hash_table_insert(dict, GINT_TO_POINTER(sock), se);
+	return;
+
+ error:
+	g_free(se);
+}
+
+
+static inline GHashTable *
+get_all_inet6_sockets()
+{
+	return get_all("/proc/net/tcp6", inet6_socket_parser);
+}
+
+
+
+
+
 struct InetSocketEntry
 {
 	char host[GLIBTOP_OPEN_DEST_HOST_LEN + 1];
@@ -178,7 +220,7 @@
 {
 	char fn [BUFSIZ];
 	GArray *entries;
-	GHashTable *inet_sockets = NULL, *local_sockets = NULL;
+	GHashTable *inet6_sockets = NULL, *inet_sockets = NULL, *local_sockets = NULL;
 	struct dirent *direntry;
 	DIR *dir;
 
@@ -209,14 +251,27 @@
 		if(g_str_has_prefix(tgt, "socket:["))
 		{
 			int sockfd;
+			struct Inet6SocketEntry *i6se;
 			struct InetSocketEntry *ise;
 			struct LocalSocketEntry *lse;
 
+			if(!inet6_sockets) inet6_sockets = get_all_inet6_sockets();
 			if(!inet_sockets) inet_sockets = get_all_inet_sockets();
 			if(!local_sockets) local_sockets = get_all_local_sockets();
 
 			sockfd = atoi(tgt + 8);
 
+			i6se = g_hash_table_lookup(inet6_sockets,
+						 GINT_TO_POINTER(sockfd));
+
+			if(i6se) {
+				entry.type = GLIBTOP_FILE_TYPE_INET6SOCKET;
+				entry.info.sock.dest_port = i6se->port;
+				g_strlcpy(entry.info.sock.dest_host, i6se->host,
+					  sizeof entry.info.sock.dest_host);
+				goto found;
+			}
+
 			ise = g_hash_table_lookup(inet_sockets,
 						 GINT_TO_POINTER(sockfd));
 
Only in libgtop-2.22.1/sysdeps/linux: procopenfiles.c~
