dtn::data::SDNV Class Reference

#include <SDNV.h>

List of all members.

Static Public Member Functions

static size_t encoding_len (u_int16_t val)
static size_t encoding_len (u_int32_t val)
static int encode (u_int16_t val, char *bp, size_t len)
static int encode (u_int32_t val, char *bp, size_t len)
static int encode (u_int64_t val, char *bp, size_t len)
static int encode (float val, char *bp, size_t len)
static int decode (char *bp, size_t len, u_int64_t *val)
static int decode (char *bp, size_t len, u_int32_t *val)
static size_t encoding_len (u_int64_t val)
static size_t encoding_len (float val_f)
static int encode (u_int64_t val, u_char *bp, size_t len)
static int encode (float val_f, u_char *bp, size_t len)
static int decode (const u_char *bp, size_t len, float *val_f)
static int decode (const u_char *bp, size_t len, u_int64_t *val)
static int decode (const u_char *bp, size_t len, u_int32_t *val)
static int decode (const u_char *bp, size_t len, u_int16_t *val)
static size_t len (const u_char *bp)

Static Public Attributes

static const size_t MAX_LENGTH = 10


Member Function Documentation

static size_t dtn::data::SDNV::encoding_len ( u_int16_t  val  )  [inline, static]

static size_t dtn::data::SDNV::encoding_len ( u_int32_t  val  )  [inline, static]

References encoding_len().

static int dtn::data::SDNV::encode ( u_int16_t  val,
char *  bp,
size_t  len 
) [inline, static]

static int dtn::data::SDNV::encode ( u_int32_t  val,
char *  bp,
size_t  len 
) [inline, static]

References encode().

static int dtn::data::SDNV::encode ( u_int64_t  val,
char *  bp,
size_t  len 
) [inline, static]

References encode().

static int dtn::data::SDNV::encode ( float  val,
char *  bp,
size_t  len 
) [inline, static]

References encode().

static int dtn::data::SDNV::decode ( char *  bp,
size_t  len,
u_int64_t *  val 
) [inline, static]

static int dtn::data::SDNV::decode ( char *  bp,
size_t  len,
u_int32_t *  val 
) [inline, static]

References decode().

size_t dtn::data::SDNV::encoding_len ( u_int64_t  val  )  [static]

Return the number of bytes needed to encode the given value.

References encode().

size_t dtn::data::SDNV::encoding_len ( float  val_f  )  [static]

Return the number of bytes needed to encode the given float value.

References encoding_len().

int dtn::data::SDNV::encode ( u_int64_t  val,
u_char *  bp,
size_t  len 
) [static]

Convert the given 64-bit integer into an SDNV.

Returns:
The number of bytes used, or -1 on ERROR(SDNV).

References MAX_LENGTH.

int dtn::data::SDNV::encode ( float  val_f,
u_char *  bp,
size_t  len 
) [static]

Convert the given float into an SDNV.

Returns:
The number of bytes used, or -1 on ERROR(SDNV).

References encode().

int dtn::data::SDNV::decode ( const u_char *  bp,
size_t  len,
float *  val 
) [static]

Convert an SDNV pointed to by bp into a float Checks for overflow in the SDNV.

Returns:
The number of bytes of bp consumed, or -1 on ERROR(SDNV).

References decode().

int dtn::data::SDNV::decode ( const u_char *  bp,
size_t  len,
u_int64_t *  val 
) [static]

Convert an SDNV pointed to by bp into a unsigned 64-bit integer.

Returns:
The number of bytes of bp consumed, or -1 on ERROR(SDNV).

References MAX_LENGTH.

int dtn::data::SDNV::decode ( const u_char *  bp,
size_t  len,
u_int32_t *  val 
) [static]

Convert an SDNV pointed to by bp into a unsigned 32-bit integer. Checks for overflow in the SDNV.

Returns:
The number of bytes of bp consumed, or -1 on ERROR(SDNV).

References decode().

int dtn::data::SDNV::decode ( const u_char *  bp,
size_t  len,
u_int16_t *  val 
) [static]

Convert an SDNV pointed to by bp into a unsigned 16-bit integer. Checks for overflow in the SDNV.

Returns:
The number of bytes of bp consumed, or -1 on ERROR(SDNV).

References decode().

size_t dtn::data::SDNV::len ( const u_char *  bp  )  [static]


Member Data Documentation

const size_t dtn::data::SDNV::MAX_LENGTH = 10 [static]

The maximum length for this SDNV implementation is 10 bytes, since the maximum value is 64 bits wide.

Referenced by decode(), and encode().


The documentation for this class was generated from the following files:

Generated on Wed Mar 25 12:41:44 2009 for IBR-DTN by  doxygen 1.5.6