ROHC compression/decompression library
Data Structures | Macros | Functions
rohc_buf.h File Reference

Define a network buffer for the ROHC library. More...

#include <rohc/rohc_time.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
Include dependency graph for rohc_buf.h:

Go to the source code of this file.

Data Structures

struct  rohc_buf
 A network buffer for the ROHC library. More...
 

Macros

#define ROHC_EXPORT
 
#define rohc_buf_init_empty(__data, __max_len)
 Initialize the given network buffer with no data. More...
 
#define rohc_buf_init_full(__data, __len, __time)
 Initialize the given network buffer with all its data. More...
 
#define rohc_buf_byte_at(__buf, __offset)   ((__buf).data)[(__buf).offset + (__offset)]
 Get the byte at the given offset in the given network buffer. More...
 
#define rohc_buf_byte(__buf)   rohc_buf_byte_at((__buf), 0)
 Get the next byte in the given network buffer. More...
 

Functions

static bool rohc_buf_is_malformed (const struct rohc_buf buf)
 Is the given network buffer malformed? More...
 
static bool rohc_buf_is_empty (const struct rohc_buf buf)
 Is the given network buffer empty? More...
 
static void rohc_buf_pull (struct rohc_buf *const buf, const size_t offset)
 Pull the beginning of the given network buffer. More...
 
static void rohc_buf_push (struct rohc_buf *const buf, const size_t offset)
 Push the beginning of the given network buffer. More...
 
static size_t rohc_buf_avail_len (const struct rohc_buf buf)
 How many bytes the given network buffer may contain? More...
 
static uint8_t * rohc_buf_data_at (const struct rohc_buf buf, const size_t offset)
 Get the bytes at the given offset in the given network buffer. More...
 
static uint8_t * rohc_buf_data (const struct rohc_buf buf)
 Get the bytes in the given network buffer. More...
 
static void rohc_buf_prepend (struct rohc_buf *const buf, const uint8_t *const data, const size_t len)
 Add data at the beginning of the given network buffer. More...
 
static void rohc_buf_append (struct rohc_buf *const buf, const uint8_t *const data, const size_t len)
 Add data at the end of the given network buffer. More...
 
static void rohc_buf_append_buf (struct rohc_buf *const dst, const struct rohc_buf src)
 Add a network buffer at the end of the given network buffer. More...
 
static void rohc_buf_reset (struct rohc_buf *const buf)
 Reset the given network buffer. More...
 

Detailed Description

Define a network buffer for the ROHC library.

Author
Didier Barvaux didie.nosp@m.r@ba.nosp@m.rvaux.nosp@m..org

Macro Definition Documentation

#define ROHC_EXPORT

Macro that handles DLL export declarations gracefully