Split project over multiple files

This commit is contained in:
2025-10-28 17:24:25 +01:00
parent 017c2c3428
commit c5a21608d7
24 changed files with 5145 additions and 5113 deletions
+54
View File
@@ -0,0 +1,54 @@
#ifndef METADATA_SERVER_INCLUDED
#define METADATA_SERVER_INCLUDED
#include "tcp.h"
#include "file_tree.h"
#define CONNECTION_TAG_CLIENT -1
#define CONNECTION_TAG_UNKNOWN -2
typedef struct {
int count;
int capacity;
SHA256 *items;
} HashList;
typedef struct {
bool auth;
int num_addrs;
Address addrs[MAX_SERVER_ADDRS];
// Chunks held by the chunk server during
// the last update
HashList old_list;
// Chunks added to the chunk server since
// the last update
HashList add_list;
// Chunks removed from the chunk server
// since the last update
HashList rem_list;
} ChunkServerPeer;
typedef struct {
TCP tcp;
FileTree file_tree;
int replication_factor;
int num_chunk_servers;
ChunkServerPeer chunk_servers[MAX_CHUNK_SERVERS];
} MetadataServer;
int metadata_server_init(MetadataServer *state, int argc, char **argv);
int metadata_server_free(MetadataServer *state);
int metadata_server_step(MetadataServer *state);
#endif // METADATA_SERVER_INCLUDED