35 # define ROHC_EXPORT __declspec(dllexport) 40 #include <rohc/rohc_time.h> 131 #define rohc_buf_init_empty(__data, __max_len) \ 133 .time = { .sec = 0, .nsec = 0, }, \ 135 .max_len = (__max_len), \ 163 #define rohc_buf_init_full(__data, __len, __time) \ 167 .max_len = (__len), \ 182 #define rohc_buf_byte_at(__buf, __offset) \ 183 ((__buf).data)[(__buf).offset + (__offset)] 194 #define rohc_buf_byte(__buf) \ 195 rohc_buf_byte_at((__buf), 0) 200 __attribute__((warn_unused_result, pure));
203 __attribute__((warn_unused_result,
const));
206 __attribute__((nonnull(1)));
208 __attribute__((nonnull(1)));
211 __attribute__((warn_unused_result,
const));
215 __attribute__((warn_unused_result,
const));
217 __attribute__((warn_unused_result,
const));
220 const uint8_t *
const data,
222 __attribute__((nonnull(1, 2)));
224 const uint8_t *
const data,
226 __attribute__((nonnull(1, 2)));
229 __attribute__((nonnull(1)));
232 __attribute__((nonnull(1)));
245 return (buf.
data == NULL ||
263 return (buf.
len == 0);
281 #if defined(ROHC_EXTRA_ASSERT) && ROHC_EXTRA_ASSERT == 1 284 assert(buf->
len >= offset);
305 #if defined(ROHC_EXTRA_ASSERT) && ROHC_EXTRA_ASSERT == 1 307 assert(buf->
offset >= offset);
374 const uint8_t *
const data,
392 const uint8_t *
const data,
395 #if defined(ROHC_EXTRA_ASSERT) && ROHC_EXTRA_ASSERT == 1 415 #if defined(ROHC_EXTRA_ASSERT) && ROHC_EXTRA_ASSERT == 1 static uint8_t * rohc_buf_data(const struct rohc_buf buf)
Get the bytes in the given network buffer.
Definition: rohc_buf.h:342
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.
Definition: rohc_buf.h:391
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.
Definition: rohc_buf.h:373
size_t offset
Definition: rohc_buf.h:107
size_t len
Definition: rohc_buf.h:108
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.
Definition: rohc_buf.h:357
struct rohc_ts time
Definition: rohc_buf.h:104
uint8_t * data
Definition: rohc_buf.h:105
static void rohc_buf_reset(struct rohc_buf *const buf)
Reset the given network buffer.
Definition: rohc_buf.h:431
static bool rohc_buf_is_empty(const struct rohc_buf buf)
Is the given network buffer empty?
Definition: rohc_buf.h:261
static void rohc_buf_push(struct rohc_buf *const buf, const size_t offset)
Push the beginning of the given network buffer.
Definition: rohc_buf.h:303
static size_t rohc_buf_avail_len(const struct rohc_buf buf)
How many bytes the given network buffer may contain?
Definition: rohc_buf.h:323
A network buffer for the ROHC library.
Definition: rohc_buf.h:102
A timestamp for the ROHC library.
Definition: rohc_time.h:51
size_t max_len
Definition: rohc_buf.h:106
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.
Definition: rohc_buf.h:412
static void rohc_buf_pull(struct rohc_buf *const buf, const size_t offset)
Pull the beginning of the given network buffer.
Definition: rohc_buf.h:279
static bool rohc_buf_is_malformed(const struct rohc_buf buf)
Is the given network buffer malformed?
Definition: rohc_buf.h:243