HEX
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.30
System: Linux iZj6c1151k3ad370bosnmsZ 3.10.0-1160.76.1.el7.x86_64 #1 SMP Wed Aug 10 16:21:17 UTC 2022 x86_64
User: root (0)
PHP: 7.4.30
Disabled: NONE
Upload Files
File: //usr/share/systemtap/tapset/dyninst/inet.stp
/* Some functions from libc <arpa/inet.h> */

/* NB: functionally equivalent to linux/inet.stp
 * ... but we have the advantage of using (mostly) direct equivalents!
 */

%{
#include <arpa/inet.h>
#include <endian.h>
%}

function htonll:long (x:long)
%{
	/* pure */ STAP_RETVALUE = htobe64 ((uint64_t) STAP_ARG_x);
%}

function htonl:long (x:long)
%{
	/* pure */ STAP_RETVALUE = htonl ((uint32_t) STAP_ARG_x);
%}

function htons:long (x:long)
%{
	/* pure */ STAP_RETVALUE = htons ((uint16_t) STAP_ARG_x);
%}

function ntohll:long (x:long)
%{
	/* pure */ STAP_RETVALUE = be64toh ((uint64_t) STAP_ARG_x);
%}

function ntohl:long (x:long)
%{
	/* pure */ STAP_RETVALUE = ntohl ((uint32_t) STAP_ARG_x);
%}

function ntohs:long (x:long)
%{
	/* pure */ STAP_RETVALUE = ntohs ((uint16_t) STAP_ARG_x);
%}