ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
topology.h
Go to the documentation of this file.
1
7#pragma once
8
9#include "metrics.h"
11#include <stdbool.h>
12#include <stddef.h>
13
18
32 const uint8_t my_id[16], consensus_topology_t **out_topology);
33
40
48
56
67
78
87
97 int *out_count);
⚠️‼️ Comprehensive thread-local error context system for ascii-chat
unsigned char uint8_t
Definition common.h:56
asciichat_error_t
Error and exit codes - unified status values (0-255)
Definition error_codes.h:49
Ring consensus metrics collection and wire protocol.
ClangTool/LibTooling compatibility shim for stdbool.h.
Ring topology for consensus participants.
Definition topology.c:17
uint8_t participant_ids[64][16]
Participant UUIDs in sorted order.
Definition topology.c:18
int num_participants
Total number of participants.
Definition topology.c:19
int consensus_topology_get_position(const consensus_topology_t *topology)
Get my position in ring (0 = first)
Definition topology.c:70
asciichat_error_t consensus_topology_get_prev(const consensus_topology_t *topology, uint8_t out_id[16])
Get previous participant ID in ring.
Definition topology.c:92
void consensus_topology_destroy(consensus_topology_t *topology)
Destroy topology.
Definition topology.c:64
asciichat_error_t consensus_topology_get_leader(const consensus_topology_t *topology, uint8_t out_id[16])
Get ring leader ID (last participant)
Definition topology.c:102
bool consensus_topology_am_leader(const consensus_topology_t *topology)
Check if I am the ring leader (last position)
Definition topology.c:76
asciichat_error_t consensus_topology_get_all(const consensus_topology_t *topology, uint8_t out_ids[64][16], int *out_count)
Get all participant IDs in ring order.
Definition topology.c:111
asciichat_error_t consensus_topology_get_next(const consensus_topology_t *topology, uint8_t out_id[16])
Get next participant ID in ring.
Definition topology.c:82
asciichat_error_t consensus_topology_create(const uint8_t participant_ids[64][16], int num_participants, const uint8_t my_id[16], consensus_topology_t **out_topology)
Create new ring topology from participant list.
Definition topology.c:38