From bfb724429e55072f53e82f3d4037f2b7e80f1203 Mon Sep 17 00:00:00 2001 From: fche Date: Fri, 5 Oct 2007 02:19:35 +0000 Subject: rhbz 319611: htonl and friends in tapset 2007-10-04 Frank Ch. Eigler * stapfuncs.5.in: Document inet.stp tapset functions. * buildok/inet-embedded.stp: Test inet.stp functions. * inet.stp: New tapset for htonl and friends. --- tapset/inet.stp | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 tapset/inet.stp (limited to 'tapset/inet.stp') diff --git a/tapset/inet.stp b/tapset/inet.stp new file mode 100644 index 00000000..0fdd4bab --- /dev/null +++ b/tapset/inet.stp @@ -0,0 +1,8 @@ +/* Some functions from libc */ + +function htonll:long (x:long) %{ THIS->__retvalue = (int64_t) cpu_to_be64 ((u64) THIS->x); %} +function htonl:long (x:long) %{ THIS->__retvalue = (int64_t) cpu_to_be32 ((u32) THIS->x); %} +function htons:long (x:long) %{ THIS->__retvalue = (int64_t) cpu_to_be16 ((u16) THIS->x); %} +function ntohll:long (x:long) %{ THIS->__retvalue = (int64_t) be64_to_cpu ((u64) THIS->x); %} +function ntohl:long (x:long) %{ THIS->__retvalue = (int64_t) be32_to_cpu ((u32) THIS->x); %} +function ntohs:long (x:long) %{ THIS->__retvalue = (int64_t) be16_to_cpu ((u16) THIS->x); %} -- cgit