libosmocore  1.5.1
Osmocom core library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
byteswap.h File Reference
#include <stdint.h>
#include <osmocom/core/endian.h>

Go to the source code of this file.

Macros

#define osmo_ntohl(x)   (x)
 
#define osmo_ntohs(x)   (x)
 
#define osmo_htonl(x)   (x)
 
#define osmo_htons(x)   (x)
 

Functions

static uint32_t osmo_swab32 (uint32_t in)
 byte-swap a 32bit word More...
 
static uint16_t osmo_swab16 (uint16_t in)
 byte-swap a 16bit word More...
 

Macro Definition Documentation

#define osmo_htonl (   x)    (x)
#define osmo_htons (   x)    (x)

Referenced by gsmtap_makemsg_ex().

#define osmo_ntohl (   x)    (x)
#define osmo_ntohs (   x)    (x)

Function Documentation

static uint16_t osmo_swab16 ( uint16_t  in)
inlinestatic

byte-swap a 16bit word

Parameters
[in]into be swapped 16bit word
Returns
byte-swapped 16bit word
static uint32_t osmo_swab32 ( uint32_t  in)
inlinestatic

byte-swap a 32bit word

Parameters
[in]into be swapped 32bit word
Returns
byte-swapped 32bit word