diff --git a/python-inet_diag/inet_diag.c b/python-inet_diag/inet_diag.c
index 33dd8a3..dba3fb7 100644
--- a/python-inet_diag/inet_diag.c
+++ b/python-inet_diag/inet_diag.c
@@ -26,6 +26,7 @@
 #include <arpa/inet.h>
 #include <netinet/tcp.h>
 #include <linux/inet_diag.h>
+#include <linux/sock_diag.h>
 
 #include <stdlib.h>
 #include <unistd.h>
@@ -114,6 +115,7 @@ struct inet_socket {
 	struct inet_diag_msg msg;
 	struct inet_diag_meminfo *ext_memory;
 	struct tcp_info *ext_protocol;
+	struct user_ent *proc;
 	char *ext_congestion;
 };
 
@@ -208,7 +210,7 @@ static void user_ent_hash_build(void)
 
     while ((d = readdir(dir)) != NULL) {
         struct dirent *d1;
-        char process[16];
+        char process[0];
         int pid, pos;
         DIR *dir1;
         char crap;
@@ -221,8 +223,6 @@ static void user_ent_hash_build(void)
         if ((dir1 = opendir(name)) == NULL)
             continue;
 
-        process[0] = '\0';
-
         while ((d1 = readdir(dir1)) != NULL) {
             const char *pattern = "socket:[";
             unsigned int ino;
@@ -245,17 +245,6 @@ static void user_ent_hash_build(void)
 
             sscanf(lnk, "socket:[%u]", &ino);
 
-            if (process[0] == '\0') {
-                char tmp[1024];
-                FILE *fp;
-
-                snprintf(tmp, sizeof(tmp), "%s/%d/stat", root, pid);
-                if ((fp = fopen(tmp, "r")) != NULL) {
-                    fscanf(fp, "%*d (%[^)])", process);
-                    fclose(fp);
-                }
-            }
-
             user_ent_add(ino, process, pid, fd);
         }
         closedir(dir1);
@@ -263,37 +252,36 @@ static void user_ent_hash_build(void)
     closedir(dir);
 }
 
-static int find_users(unsigned ino, char *buf, int buflen)
+static int find_users(unsigned ino, struct user_ent *found)
 {
     struct user_ent *p;
     int cnt = 0;
-    char *ptr;
 
     if (!ino)
         return 0;
 
     p = user_ent_hash[user_ent_hashfn(ino)];
-    ptr = buf;
     while (p) {
         if (p->ino != ino)
             goto next;
 
-        if (ptr - buf >= buflen - 1)
-            break;
+		found->ino = p->ino;
+		found->fd  = p->fd;
+		found->pid = p->pid;
 
-		/* TODO: return 'p' */
-        snprintf(ptr, buflen - (ptr - buf),
-             "(\"%s\",%d,%d),",
-             p->process, p->pid, p->fd);
-        ptr += strlen(ptr);
         cnt++;
-
     next:
         p = p->next;
     }
 
-    if (ptr != buf)
-        ptr[-1] = '\0';
+	//get the full process path
+	char tmp[1024];
+	// TODO: this should only be determined once in the whole file
+    const char *root = getenv("PROC_ROOT") ? : "/proc/";
+
+	snprintf(tmp, sizeof(tmp), "%s/%d/exe", root, found->pid);
+	char *bin_path = canonicalize_file_name(tmp);
+	strcpy(found->process, bin_path);
 
     return cnt;
 }
@@ -321,7 +309,7 @@ static PyObject *inet_socket__saddr(struct inet_socket *self,
 }
 
 static char inet_socket__sock_doc__[] =
-"saddr() -- get internet socket pointer";
+"sock() -- get internet socket pointer";
 static PyObject *inet_socket__sock(struct inet_socket *self,
 				   PyObject *args __unused)
 {
@@ -330,7 +318,7 @@ static PyObject *inet_socket__sock(struct inet_socket *self,
 }
 
 static char inet_socket__congestion_algorithm_doc__[] =
-"saddr() -- get internet socket congestion algorithm being used";
+"congestion_algorithm() -- get internet socket congestion algorithm being used";
 static PyObject *inet_socket__congestion_algorithm(struct inet_socket *self,
 						   PyObject *args __unused)
 {
@@ -342,6 +330,19 @@ static PyObject *inet_socket__congestion_algorithm(struct inet_socket *self,
 	return PyString_FromString(self->ext_congestion);
 }
 
+static char inet_socket__process_doc__[] =
+"process() -- get name of process";
+static PyObject *inet_socket__process(struct inet_socket *self,
+				    PyObject *args __unused)
+{
+	if (self->proc == NULL) {
+		PyErr_SetString(PyExc_OSError,			
+				"no process found or proc not specified");
+		return NULL;
+	}
+	return PyString_FromString(self->proc->process);
+}
+
 #define INET_SOCK__STR_METHOD(name, field, table, doc)		\
 static char inet_socket__##name##_doc__[] = #name "() -- " doc;	\
 static PyObject *inet_socket__##name(struct inet_socket *self,	\
@@ -372,7 +373,13 @@ static PyObject *inet_socket__##name(struct inet_socket *self,	\
 	}							\
 	return Py_BuildValue("l", self->ext_##ext->field); 	\
 }
-		
+
+#define INET_SOCK__PROC_INT_METHOD(name, field, doc)			\
+static char inet_socket__##name##_doc__[] = #name "() -- " doc;	\
+static PyObject *inet_socket__##name(struct inet_socket *self,	\
+				     PyObject *args __unused)	\
+{ return Py_BuildValue("i", self->proc->field); }
+
 INET_SOCK__NET_INT_METHOD(dport, id.idiag_dport,
 			  "get internet socket destination port");
 INET_SOCK__NET_INT_METHOD(sport, id.idiag_sport,
@@ -428,6 +435,10 @@ INET_SOCK__EXT_INT_METHOD(cwnd, protocol, tcpi_snd_cwnd,
 			  "get socket congestion window");
 INET_SOCK__EXT_INT_METHOD(ssthresh, protocol, tcpi_snd_ssthresh,
 			  "get socket slow start threshold");
+INET_SOCK__PROC_INT_METHOD(pid, pid,
+			  "get process id");
+INET_SOCK__PROC_INT_METHOD(fd, fd,
+			  "get file descriptor");
 
 #define INET_SOCK__METHOD(name)	{			\
 	.ml_name  = #name,				\
@@ -467,6 +478,9 @@ static struct PyMethodDef inet_socket__methods[] = {
 	INET_SOCK__METHOD(ato),
 	INET_SOCK__METHOD(cwnd),
 	INET_SOCK__METHOD(ssthresh),
+	INET_SOCK__METHOD(process),
+	INET_SOCK__METHOD(pid),
+	INET_SOCK__METHOD(fd),
 	{ .ml_name = NULL, }
 };
 
@@ -494,7 +508,7 @@ static PyTypeObject inet_socket__type = {
 };
 
 /* constructor */
-static PyObject *inet_socket__new(struct inet_diag_msg *r, int nlmsg_len)
+static PyObject *inet_socket__new(struct inet_diag_msg *r, int nlmsg_len, struct user_ent *proc)
 {
 	struct inet_socket *self;
 
@@ -511,6 +525,7 @@ static PyObject *inet_socket__new(struct inet_diag_msg *r, int nlmsg_len)
 	self->ext_memory = NULL;
 	self->ext_protocol = NULL;
 	self->ext_congestion = NULL;
+	self->proc = NULL;
 
 	if (nlmsg_len) {
 		struct rtattr *tb[INET_DIAG_MAX + 1];
@@ -549,6 +564,16 @@ static PyObject *inet_socket__new(struct inet_diag_msg *r, int nlmsg_len)
 			if (self->ext_congestion == NULL)
 				goto out_err;
 		}
+
+		if( proc != NULL) {
+			self->proc = malloc(sizeof(*self->proc));
+			if (self->proc == NULL)
+				goto out_err;
+			self->proc->ino = proc->ino;
+			self->proc->pid = proc->pid;
+			self->proc->fd = proc->fd;
+			strcpy(self->proc->process, proc->process);
+		}
 	}
 
 	return (PyObject *)self;
@@ -653,13 +678,13 @@ out_eof:
 	const int nlmsg_len = self->h->nlmsg_len - NLMSG_LENGTH(sizeof(*r));
 	self->h = NLMSG_NEXT(self->h, self->len);
 
+	struct user_ent *found;
+	if (!(found=malloc(sizeof(struct user_ent) + 4096))) abort();
 	if ( show_users > 0 ) {
-		char ubuf[4096];
-    	if (find_users(r->idiag_inode, ubuf, sizeof(ubuf)) > 0)
-    		printf(" users:(%s)", ubuf);
+    	find_users(r->idiag_inode, found);
 	}
 
-	return inet_socket__new(r, nlmsg_len);
+	return inet_socket__new(r, nlmsg_len, found);
 
 }
 
@@ -859,7 +884,7 @@ static PyObject *inet_diag__create(PyObject *mself __unused, PyObject *args,
 {
 	int states = default_states;
 	int extensions = INET_DIAG_NONE;
-	int socktype = TCPDIAG_GETSOCK;
+	int socktype = IPPROTO_TCP;
 	const char *src;
 	const char *dst;
 	int sport  = -1;
@@ -880,7 +905,7 @@ static PyObject *inet_diag__create(PyObject *mself __unused, PyObject *args,
 					 &states, &extensions, &socktype, &src, &dst, &sport, &dport, &le_spt, &le_dpt, &ge_spt, &ge_dpt, &join, &proc))
 		goto out_err;
 
-	/* TODO: THIS SHOULD BE OPTIONAL */
+	/* TODO: have different levels of process identification */
 	if ( proc > 0 ) {
 		show_users++;
 		user_ent_hash_build();
@@ -896,18 +921,19 @@ static PyObject *inet_diag__create(PyObject *mself __unused, PyObject *args,
 
 	struct {
 		struct nlmsghdr nlh;
-		struct inet_diag_req r;
+		struct inet_diag_req_v2 r;
 	} req = {
 		.nlh = {
 			.nlmsg_len   = sizeof(req),
-			.nlmsg_type  = socktype,
+			.nlmsg_type  = SOCK_DIAG_BY_FAMILY,
 			.nlmsg_flags = NLM_F_ROOT | NLM_F_MATCH | NLM_F_REQUEST,
 			.nlmsg_seq   = 123456,
 		},
 		.r = {
-			.idiag_family = AF_INET,
-			.idiag_states = states,
-			.idiag_ext    = extensions,
+			.sdiag_family    = AF_INET,
+			.sdiag_protocol  = socktype,
+			.idiag_states    = states,
+			.idiag_ext       = extensions,
 		},
 	};
 
@@ -1095,7 +1121,8 @@ PyMODINIT_FUNC initinet_diag(void)
 	PyObject *m;
 	m = Py_InitModule3("inet_diag", python_inet_diag__methods, "Example:\n\n\
 	> import inet_diag\n\
-	> idiag = inet_diag.create(states = inet_diag.default_states, extensions = inet_diag.EXT_MEMORY, socktype = inet_diag.TCPDIAG_GETSOCK, le_dpt = 500)\n\
+	> from socket import IPPROTO_TCP\n\
+	> idiag = inet_diag.create(states = inet_diag.default_states, extensions = inet_diag.EXT_MEMORY, socktype = IPPROTO_TCP, le_dpt = 500)\n\
 	> while True:\n\
 	>     try:\n\
 	>         s = idiag.get()\n\
