35 # define ROHC_EXPORT __declspec(dllexport)
40 #include <rohc/rohc_time.h>
133 #define rohc_buf_init_empty(__data, __max_len) \
135 .time = { .sec = 0, .nsec = 0, }, \
137 .max_len = (__max_len), \
165 #define rohc_buf_init_full(__data, __len, __time) \
169 .max_len = (__len), \
184 #define rohc_buf_byte_at(__buf, __offset) \
185 ((__buf).data)[(__buf).offset + (__offset)]
196 #define rohc_buf_byte(__buf) \
197 rohc_buf_byte_at((__buf), 0)
202 __attribute__((warn_unused_result, pure));
205 __attribute__((warn_unused_result,
const));
208 __attribute__((nonnull(1)));
210 __attribute__((nonnull(1)));
213 __attribute__((warn_unused_result,
const));
217 __attribute__((warn_unused_result,
const));
219 __attribute__((warn_unused_result,
const));
222 const uint8_t *
const data,
224 __attribute__((nonnull(1, 2)));
226 const uint8_t *
const data,
228 __attribute__((nonnull(1, 2)));
231 __attribute__((nonnull(1)));
234 __attribute__((nonnull(1)));
247 return (buf.
data == NULL ||
265 return (buf.
len == 0);
283 #if defined(ROHC_EXTRA_ASSERT) && ROHC_EXTRA_ASSERT == 1
286 assert(buf->
len >= offset);
307 #if defined(ROHC_EXTRA_ASSERT) && ROHC_EXTRA_ASSERT == 1
309 assert(buf->
offset >= offset);
376 const uint8_t *
const data,
394 const uint8_t *
const data,
397 #if defined(ROHC_EXTRA_ASSERT) && ROHC_EXTRA_ASSERT == 1
417 #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:344
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:393
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:375
size_t offset
Definition: rohc_buf.h:109
size_t len
Definition: rohc_buf.h:110
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:359
struct rohc_ts time
Definition: rohc_buf.h:106
uint8_t * data
Definition: rohc_buf.h:107
static void rohc_buf_reset(struct rohc_buf *const buf)
Reset the given network buffer.
Definition: rohc_buf.h:433
static bool rohc_buf_is_empty(const struct rohc_buf buf)
Is the given network buffer empty?
Definition: rohc_buf.h:263
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:305
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:325
A network buffer for the ROHC library.
Definition: rohc_buf.h:104
A timestamp for the ROHC library.
Definition: rohc_time.h:51
size_t max_len
Definition: rohc_buf.h:108
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:414
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:281
static bool rohc_buf_is_malformed(const struct rohc_buf buf)
Is the given network buffer malformed?
Definition: rohc_buf.h:245