summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Dickson <steved@redhat.com>2010-02-18 16:50:40 -0500
committerSteve Dickson <steved@redhat.com>2010-02-18 16:50:40 -0500
commitb2ad9348e3cf5bf54cea4181cf5dacce1487a75d (patch)
treeed1fe274f0b8e8b503080fb209adbde243be685e
parent2549149b4588b19c2cbca5b38c7876febb3e0e57 (diff)
downloadsystemtap-b2ad9348e3cf5bf54cea4181cf5dacce1487a75d.tar.gz
systemtap-b2ad9348e3cf5bf54cea4181cf5dacce1487a75d.tar.xz
systemtap-b2ad9348e3cf5bf54cea4181cf5dacce1487a75d.zip
Added tapset/inet.stp
Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r--tapset/inet.stp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tapset/inet.stp b/tapset/inet.stp
new file mode 100644
index 0000000..9df5ea6
--- /dev/null
+++ b/tapset/inet.stp
@@ -0,0 +1,20 @@
+%{
+#include <net/sock.h>
+#include <net/inet_hashtables.h>
+#include <linux/in.h>
+%}
+
+function _inet_ntoa:string (_uaddr:long) %{
+ struct sockaddr_in *addr;
+ unsigned char *bytes;
+
+ addr = (struct sockaddr_in *)(long)kread(&THIS->_uaddr);
+ bytes = (unsigned char *)&addr->sin_addr.s_addr;
+
+ snprintf(THIS->__retvalue, MAXSTRINGLEN,
+ "%d.%d.%d.%d:%d", bytes[0], bytes[1], bytes[2], bytes[3],
+ addr->sin_port);
+
+ CATCH_DEREF_FAULT();
+%}
+