blob: fab7649ecc0f33fa751ad35aedad664bde0ca780 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#ifndef DGRAMBUF_H
#define DGRAMBUF_H
/*
* dgrambuf.c - C datagrams buffer.
*
* Copyright 2016 by Ludovic Pouzenc <ludovic@pouzenc.fr>
*/
#include <stdlib.h> /* size_t */
typedef struct dgrambuf_t *dgrambuf_t;
dgrambuf_t dgrambuf_new(size_t dgram_slots, size_t dgram_max_size, size_t dgram_header_size, size_t iovec_slots);
void dgrambuf_free(dgrambuf_t *dbuf);
size_t dgrambuf_free_count(const dgrambuf_t);
void dgrambuf_set_validate_func(dgrambuf_t dbuf, unsigned int (*func)(unsigned int, void *) );
int dgrambuf_have_data_ready_to_write(dgrambuf_t dbuf);
int dgrambuf_recvmmsg(dgrambuf_t dbuf, int sockfd);
ssize_t dgrambuf_write(dgrambuf_t dbuf, int fd);
#endif /* DGRAMBUF_H */
|