Libecoli 0.11.1
Extensible COmmand LIne library
Loading...
Searching...
No Matches
ip_pool.h
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright 2025, Olivier MATZ <zer0@droids-corp.org>
3 */
4
5/* A very simple IP pool. */
6
7#include <stdint.h>
8
9struct ec_strvec;
10struct ip_pool;
11struct ip_address;
12
13/* create htable of ip pools */
14int ip_pool_init(void);
15
16/* free ip pools */
17void ip_pool_exit(void);
18
19/* create an ip pool */
20struct ip_pool *ip_pool(const char *name);
21
22/* lookup for an ip pool, by name */
23struct ip_pool *ip_pool_lookup(const char *name);
24
25/* list ip pool names */
26struct ec_strvec *ip_pool_list(void);
27
28/* destroy the ip pool */
29void ip_pool_free(const char *name);
30
31/* add an IP */
32int ip_pool_addr_add(struct ip_pool *pool, const char *addr);
33
34/* del an IP */
35int ip_pool_addr_del(struct ip_pool *pool, const char *addr);
36
37/* list pool IP addresses */
38struct ec_strvec *ip_pool_addr_list(const struct ip_pool *pool);
struct ec_strvec * ec_strvec(void)