| 1 |
/* Some functions from libc <arpa/inet.h> */ |
| 2 |
|
| 3 |
/* <tapsetdescription> |
| 4 |
* These functions convert between network (big-endian) and host byte |
| 5 |
* order, like their namesake C functions. |
| 6 |
* </tapsetdescription> |
| 7 |
*/ |
| 8 |
|
| 9 |
/** |
| 10 |
* sfunction htonll - Convert 64-bit long long from host to network order |
| 11 |
* @x: Value to convert |
| 12 |
*/ |
| 13 |
function htonll:long (x:long) %{ /* pure */ STAP_RETVALUE = (int64_t) cpu_to_be64 ((u64) STAP_ARG_x); %} |
| 14 |
|
| 15 |
/** |
| 16 |
* sfunction htonl - Convert 32-bit long from host to network order |
| 17 |
* @x: Value to convert |
| 18 |
*/ |
| 19 |
function htonl:long (x:long) %{ /* pure */ STAP_RETVALUE = (int64_t) cpu_to_be32 ((u32) STAP_ARG_x); %} |
| 20 |
|
| 21 |
/** |
| 22 |
* sfunction htons - Convert 16-bit short from host to network order |
| 23 |
* @x: Value to convert |
| 24 |
*/ |
| 25 |
function htons:long (x:long) %{ /* pure */ STAP_RETVALUE = (int64_t) cpu_to_be16 ((u16) STAP_ARG_x); %} |
| 26 |
|
| 27 |
/** |
| 28 |
* sfunction ntohll - Convert 64-bit long long from network to host order |
| 29 |
* @x: Value to convert |
| 30 |
*/ |
| 31 |
function ntohll:long (x:long) %{ /* pure */ STAP_RETVALUE = (int64_t) be64_to_cpu ((u64) STAP_ARG_x); %} |
| 32 |
|
| 33 |
/** |
| 34 |
* sfunction ntohl - Convert 32-bit long from network to host order |
| 35 |
* @x: Value to convert |
| 36 |
*/ |
| 37 |
function ntohl:long (x:long) %{ /* pure */ STAP_RETVALUE = (int64_t) be32_to_cpu ((u32) STAP_ARG_x); %} |
| 38 |
|
| 39 |
/** |
| 40 |
* sfunction ntohs - Convert 16-bit short from network to host order |
| 41 |
* @x: Value to convert |
| 42 |
*/ |
| 43 |
function ntohs:long (x:long) %{ /* pure */ STAP_RETVALUE = (int64_t) be16_to_cpu ((u16) STAP_ARG_x); %} |