Contiki 2.5
Files | Macros | Functions

Files

file  sdnv.c
 implementation of SDNV functions
 
file  sdnv.h
 Headerfile for sdnv functions.
 

Macros

#define MAX_LENGTH   8
 maximum sdnv length
 

Functions

int sdnv_encode (uint32_t val, uint8_t *bp, size_t len)
 encodes an uint32 value in sdnv More...
 
size_t sdnv_encoding_len (uint32_t val)
 calculates the length needed to encode an uint32 value in sdnv More...
 
int sdnv_decode (const uint8_t *bp, size_t len, uint32_t *val)
 decodes a sdnv to an uint32 value More...
 
size_t sdnv_len (const uint8_t *bp)
 calculates the length of a sdnv More...
 

Detailed Description

Function Documentation

int sdnv_decode ( const uint8_t *  bp,
size_t  len,
uint32_t *  val 
)

decodes a sdnv to an uint32 value

Parameters
bppointer to sdnv
lenlength of sdnv
valpointer to uint32 value
Returns
length of sndv

Definition at line 63 of file sdnv.c.

References MAX_LENGTH.

Referenced by bundle_recover_bundle(), eid_parse_full_length(), and eid_parse_host_length().

int sdnv_encode ( uint32_t  val,
uint8_t *  bp,
size_t  len 
)

encodes an uint32 value in sdnv

Parameters
valvalue to be encoded
bppointer to sdnv
lensize of sdnv
Returns
length of sndv

Definition at line 24 of file sdnv.c.

Referenced by bundle_encode_bundle(), discovery_ipnd_send(), eid_create_full_length(), eid_create_host_length(), and statusreport_encode().

size_t sdnv_encoding_len ( uint32_t  val)

calculates the length needed to encode an uint32 value in sdnv

Parameters
valvalue to be encoded
Returns
length of sndv

Definition at line 51 of file sdnv.c.

Referenced by bundle_encode_bundle().

size_t sdnv_len ( const uint8_t *  bp)

calculates the length of a sdnv

Parameters
bppointer to sdnv
Returns
length of sndv

Definition at line 99 of file sdnv.c.