From b2ad9348e3cf5bf54cea4181cf5dacce1487a75d Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Thu, 18 Feb 2010 16:50:40 -0500 Subject: Added tapset/inet.stp Signed-off-by: Steve Dickson --- tapset/inet.stp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tapset/inet.stp 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 +#include +#include +%} + +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(); +%} + -- cgit