diff options
author | OpenGnSys Support Team <soporte-og@soleta.eu> | 2024-08-21 20:19:23 +0200 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2024-08-21 21:58:48 +0200 |
commit | 5eba9f4e1b44fb0d4b4962c2241fe9391e202d7b (patch) | |
tree | 1940f98fcf9d24b1046e425b77eddc5bab624ee4 /src/repo.h | |
parent | 4e0f9aac9e2883a992469f5b2b231ecb14b30183 (diff) |
rest: allow repository to have more than one IP address
Repository can have more than one single IP address.
* Add alias field to database to represent the extra IPs that are attached to
the repository, update schema and add version 9.
* Use og_dbi_get_repository_ip() to infer the repository IP address.
* Add helper functions (src/repo.c) to build a list of repositories and update
rest API to use it.
Diffstat (limited to 'src/repo.h')
-rw-r--r-- | src/repo.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/repo.h b/src/repo.h new file mode 100644 index 0000000..08b6260 --- /dev/null +++ b/src/repo.h @@ -0,0 +1,20 @@ +#ifndef _OG_REPO_H_ +#define _OG_REPO_H_ + +#include <stdint.h> +#include "list.h" + +#define OG_ADDR_REPO_MAX 16 + +struct og_repo { + struct list_head list; + const char *name; + uint32_t id; + struct in_addr addr[OG_ADDR_REPO_MAX]; + int num_ips; +}; + +int og_repo_list(struct list_head *repo_list); +void og_repo_free_list(struct list_head *repo_list); + +#endif |