summaryrefslogtreecommitdiff
path: root/infra/packet_manager/packet_pool.h
blob: fd5424da3e775bfa1a4b9d632d1eeaf93c51943f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#pragma once

#ifdef __cplusplus
extern "C"
{
#endif

#include "stellar/packet.h"

struct packet_pool;
struct packet_pool *packet_pool_new(uint64_t capacity);
void packet_pool_free(struct packet_pool *pool);

struct packet *packet_pool_acquire_packet(struct packet_pool *pool);
void packet_pool_release_packet(struct packet_pool *pool, struct packet *pkt);

uint64_t packet_pool_get_used_num(const struct packet_pool *pool);
uint64_t packet_pool_get_free_num(const struct packet_pool *pool);

#ifdef __cplusplus
}
#endif