fgms 0.11.8
The
FlightGear MultiPlayer Server
project
tiny_xdr.hxx File Reference

Tiny XDR implementation for flightgear. More...

Go to the source code of this file.

Macros

#define FG_NDEBUG
 
#define SWAP16(arg)   sgIsLittleEndian() ? sg_bswap_16(arg) : arg
 
#define SWAP32(arg)   sgIsLittleEndian() ? sg_bswap_32(arg) : arg
 
#define SWAP64(arg)   sgIsLittleEndian() ? sg_bswap_64(arg) : arg
 
#define XDR_BYTES_PER_UNIT   4
 

Typedefs

typedef uint64_t xdr_data2_t
 8 Bytes More...
 
typedef uint32_t xdr_data_t
 4 Bytes More...
 

Functions

template<typename TYPE >
TYPE NET_decode16 (uint16_t Val)
 Decode 16-Bit values from network byte order. More...
 
template<typename TYPE >
TYPE NET_decode32 (uint32_t Val)
 Decode 32-Bit values from network byte order. More...
 
template<typename TYPE >
TYPE NET_decode64 (uint64_t Val)
 Decode 64-Bit values from network byte order. More...
 
template<typename TYPE >
TYPE NET_decode8 (uint8_t Val)
 Decode 8-Bit values from network byte order (actually decodes nothing, just to satisfy the templates) More...
 
template<typename TYPE >
uint16_t NET_encode16 (TYPE Val)
 Encode 16-Bit values to network byte order. More...
 
template<typename TYPE >
uint32_t NET_encode32 (TYPE Val)
 Encode 32-Bit values to network byte order. More...
 
template<typename TYPE >
uint64_t NET_encode64 (TYPE Val)
 Encode 64-Bit values to network byte order. More...
 
template<typename TYPE >
uint8_t NET_encode8 (TYPE Val)
 encode 8-Bit values to network byte order (actually encodes nothing, just to satisfy the templates) More...
 
template<typename TYPE >
TYPE XDR_decode (xdr_data_t Val)
 xdr decode 8, 16 and 32 Bit values More...
 
template<typename TYPE >
TYPE XDR_decode64 (xdr_data2_t Val)
 xdr decode 64 Bit values More...
 
template<typename TYPE >
xdr_data_t XDR_encode (TYPE Val)
 xdr encode 8, 16 and 32 Bit values More...
 
template<typename TYPE >
xdr_data2_t XDR_encode64 (TYPE Val)
 xdr encode 64 Bit values More...
 

Detailed Description

Tiny XDR implementation for flightgear.

Author
Oliver Schroeder

Definition in file tiny_xdr.hxx.

Macro Definition Documentation

#define FG_NDEBUG

Definition at line 47 of file tiny_xdr.hxx.

#define SWAP16 (   arg)    sgIsLittleEndian() ? sg_bswap_16(arg) : arg

Definition at line 32 of file tiny_xdr.hxx.

Referenced by NET_decode16(), and NET_encode16().

#define SWAP32 (   arg)    sgIsLittleEndian() ? sg_bswap_32(arg) : arg

Definition at line 33 of file tiny_xdr.hxx.

Referenced by NET_decode32(), NET_encode32(), XDR_decode(), and XDR_encode().

#define SWAP64 (   arg)    sgIsLittleEndian() ? sg_bswap_64(arg) : arg

Definition at line 34 of file tiny_xdr.hxx.

Referenced by NET_decode64(), NET_encode64(), XDR_decode64(), and XDR_encode64().

#define XDR_BYTES_PER_UNIT   4

Definition at line 35 of file tiny_xdr.hxx.

Typedef Documentation

typedef uint64_t xdr_data2_t

8 Bytes

Definition at line 41 of file tiny_xdr.hxx.

typedef uint32_t xdr_data_t

4 Bytes

Definition at line 38 of file tiny_xdr.hxx.

Function Documentation

template<typename TYPE >
TYPE NET_decode16 ( uint16_t  Val)

Decode 16-Bit values from network byte order.

Definition at line 181 of file tiny_xdr.hxx.

template<typename TYPE >
TYPE NET_decode32 ( uint32_t  Val)

Decode 32-Bit values from network byte order.

Definition at line 216 of file tiny_xdr.hxx.

template<typename TYPE >
TYPE NET_decode64 ( uint64_t  Val)

Decode 64-Bit values from network byte order.

Definition at line 251 of file tiny_xdr.hxx.

template<typename TYPE >
TYPE NET_decode8 ( uint8_t  Val)

Decode 8-Bit values from network byte order (actually decodes nothing, just to satisfy the templates)

Definition at line 146 of file tiny_xdr.hxx.

template<typename TYPE >
uint16_t NET_encode16 ( TYPE  Val)

Encode 16-Bit values to network byte order.

Definition at line 163 of file tiny_xdr.hxx.

template<typename TYPE >
uint32_t NET_encode32 ( TYPE  Val)

Encode 32-Bit values to network byte order.

Definition at line 198 of file tiny_xdr.hxx.

template<typename TYPE >
uint64_t NET_encode64 ( TYPE  Val)

Encode 64-Bit values to network byte order.

Definition at line 233 of file tiny_xdr.hxx.

template<typename TYPE >
uint8_t NET_encode8 ( TYPE  Val)

encode 8-Bit values to network byte order (actually encodes nothing, just to satisfy the templates)

Definition at line 128 of file tiny_xdr.hxx.

template<typename TYPE >
TYPE XDR_decode ( xdr_data_t  Val)

xdr decode 8, 16 and 32 Bit values

Definition at line 70 of file tiny_xdr.hxx.

template<typename TYPE >
TYPE XDR_decode64 ( xdr_data2_t  Val)

xdr decode 64 Bit values

Definition at line 103 of file tiny_xdr.hxx.

template<typename TYPE >
xdr_data_t XDR_encode ( TYPE  Val)

xdr encode 8, 16 and 32 Bit values

Definition at line 53 of file tiny_xdr.hxx.

template<typename TYPE >
xdr_data2_t XDR_encode64 ( TYPE  Val)

xdr encode 64 Bit values

Definition at line 86 of file tiny_xdr.hxx.