ROHC compression/decompression library
Defines | Functions
rohc_traces_internal.h File Reference

Internal ROHC macros and functions for traces. More...

#include "rohc_traces.h"
#include <stdlib.h>
#include <assert.h>
#include "dllexport.h"
Include dependency graph for rohc_traces_internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define __rohc_print(trace_cb, level, entity, profile, format,...)
#define rohc_print(entity_struct, level, entity, profile, format,...)
#define rohc_debug(entity_struct, entity, profile, format,...)
#define rohc_info(entity_struct, entity, profile, format,...)
#define rohc_warning(entity_struct, entity, profile, format,...)
#define rohc_error(entity_struct, entity, profile, format,...)
#define rohc_assert(entity_struct, entity, profile, condition, label, format,...)
 Stop processing if the given condition is false.

Functions

void ROHC_EXPORT rohc_dump_packet (const rohc_trace_callback_t trace_cb, const rohc_trace_entity_t trace_entity, const rohc_trace_level_t trace_level, const char *const descr, const unsigned char *const packet, const size_t length) __attribute__((nonnull(4

Detailed Description

Internal ROHC macros and functions for traces.

Author:
Julien Bernard <julien.bernard@toulouse.viveris.com>
Audric Schiltknecht <audric.schiltknecht@toulouse.viveris.com>
Didier Barvaux <didier.barvaux@toulouse.viveris.com>
Didier Barvaux <didier@barvaux.org>

Define Documentation

#define __rohc_print (   trace_cb,
  level,
  entity,
  profile,
  format,
  ... 
)
Value:
do { \
                if(trace_cb != NULL) { \
                        trace_cb(level, entity, profile, "[%s:%d %s()] " format, \
                                 __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__); \
                } \
        } while(0)

Print information depending on the debug level (internal usage)

Referenced by c_init_header_info(), and rohc_dump_packet().

#define rohc_assert (   entity_struct,
  entity,
  profile,
  condition,
  label,
  format,
  ... 
)
Value:
do { \
                if(!(condition)) { \
                        rohc_error(entity_struct, entity, profile, \
                                   format, ##__VA_ARGS__); \
                        assert(condition); \
                        goto label; \
                } \
        } while(0)

Stop processing if the given condition is false.

In non-debug mode (ie. NDEBUG set): if the given condition fails, prints the given message then jump to the given label.

In debug mode (ie. NDEBUG not set): if the given condition fails, prints the given message then asserts.

Referenced by code_EXT0_packet(), code_EXT1_packet(), code_EXT2_packet(), code_EXT3_packet(), code_UO1_packet(), code_UO2_packet(), code_UOR2_ID_bytes(), code_UOR2_RTP_bytes(), code_UOR2_TS_bytes(), and decide_extension().

#define rohc_debug (   entity_struct,
  entity,
  profile,
  format,
  ... 
)
#define rohc_error (   entity_struct,
  entity,
  profile,
  format,
  ... 
)
#define rohc_info (   entity_struct,
  entity,
  profile,
  format,
  ... 
)
#define rohc_print (   entity_struct,
  level,
  entity,
  profile,
  format,
  ... 
)
Value:
do { \
                assert((entity_struct) != NULL); \
                __rohc_print((entity_struct)->trace_callback, \
                             level, entity, profile, \
                             format, ##__VA_ARGS__); \
        } while(0)

Print information depending on the debug level

#define rohc_warning (   entity_struct,
  entity,
  profile,
  format,
  ... 
)

Function Documentation

void ROHC_EXPORT rohc_dump_packet ( const rohc_trace_callback_t  trace_cb,
const rohc_trace_entity_t  trace_entity,
const rohc_trace_level_t  trace_level,
const char *const  descr,
const unsigned char *const  packet,
const size_t  length 
)