gPTP Documentation
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
linux/src/platform.hpp File Reference
#include <stdint.h>
Include dependency graph for linux/src/platform.hpp:

Go to the source code of this file.

Macros

#define PLAT_strncpy(dest, src, max)   strncpy( dest, src, max+1 )
 
#define PLAT_snprintf(...)   snprintf( __VA_ARGS__ )
 

Functions

uint16_t PLAT_htons (uint16_t s)
 Converts the unsigned short integer hostshort from host byte order to network byte order. More...
 
uint32_t PLAT_htonl (uint32_t l)
 Converts the unsigned integer hostlong from host byte order to network byte order. More...
 
uint16_t PLAT_ntohs (uint16_t s)
 Converts the unsigned short integer netshort from network byte order to host byte order. More...
 
uint32_t PLAT_ntohl (uint32_t l)
 Converts the unsigned integer netlong from network byte order to host byte order. More...
 

Macro Definition Documentation

#define PLAT_snprintf (   ...)    snprintf( __VA_ARGS__ )

Provides snprintf

#define PLAT_strncpy (   dest,
  src,
  max 
)    strncpy( dest, src, max+1 )

Provides strncpy

Function Documentation

uint32_t PLAT_htonl ( uint32_t  l)

Converts the unsigned integer hostlong from host byte order to network byte order.

Parameters
lHost long byte order
Returns
value in network byte order
uint16_t PLAT_htons ( uint16_t  s)

Converts the unsigned short integer hostshort from host byte order to network byte order.

Parameters
sshort host byte order
Returns
short value in network order
uint32_t PLAT_ntohl ( uint32_t  l)

Converts the unsigned integer netlong from network byte order to host byte order.

Parameters
lLong value in network order
Returns
Long value on host byte order
uint16_t PLAT_ntohs ( uint16_t  s)

Converts the unsigned short integer netshort from network byte order to host byte order.

Parameters
sNetwork order short integer
Returns
host order value