|
ascii-chat 0.8.38
Real-time terminal-based video chat with ASCII art conversion
|
Ring topology implementation. More...
Go to the source code of this file.
Data Structures | |
| struct | consensus_topology |
| Ring topology for consensus participants. More... | |
Typedefs | |
| typedef struct consensus_topology | consensus_topology_t |
| Ring topology for consensus participants. | |
Functions | |
| 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) |
| void | consensus_topology_destroy (consensus_topology_t *topology) |
| int | consensus_topology_get_position (const consensus_topology_t *topology) |
| bool | consensus_topology_am_leader (const consensus_topology_t *topology) |
| asciichat_error_t | consensus_topology_get_next (const consensus_topology_t *topology, uint8_t out_id[16]) |
| asciichat_error_t | consensus_topology_get_prev (const consensus_topology_t *topology, uint8_t out_id[16]) |
| asciichat_error_t | consensus_topology_get_leader (const consensus_topology_t *topology, uint8_t out_id[16]) |
| asciichat_error_t | consensus_topology_get_all (const consensus_topology_t *topology, uint8_t out_ids[64][16], int *out_count) |
Ring topology implementation.
Definition in file topology.c.
| typedef struct consensus_topology consensus_topology_t |
Ring topology for consensus participants.
Maintains a sorted list of participant IDs for ring-based consensus algorithms and leader election.
| bool consensus_topology_am_leader | ( | const consensus_topology_t * | topology | ) |
Definition at line 76 of file topology.c.
References consensus_topology::my_position, and consensus_topology::num_participants.
Referenced by consensus_coordinator_process(), consensus_state_collection_complete(), and consensus_state_is_leader().
| 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 | ||
| ) |
Definition at line 38 of file topology.c.
References consensus_topology::my_position, consensus_topology::num_participants, and consensus_topology::participant_ids.
Referenced by session_consensus_create(), and session_consensus_set_topology().
| void consensus_topology_destroy | ( | consensus_topology_t * | topology | ) |
Definition at line 64 of file topology.c.
Referenced by session_consensus_create(), session_consensus_destroy(), and session_consensus_set_topology().
| asciichat_error_t consensus_topology_get_all | ( | const consensus_topology_t * | topology, |
| uint8_t | out_ids[64][16], | ||
| int * | out_count | ||
| ) |
Definition at line 111 of file topology.c.
References consensus_topology::num_participants, and consensus_topology::participant_ids.
| asciichat_error_t consensus_topology_get_leader | ( | const consensus_topology_t * | topology, |
| uint8_t | out_id[16] | ||
| ) |
Definition at line 102 of file topology.c.
References consensus_topology::num_participants, and consensus_topology::participant_ids.
| asciichat_error_t consensus_topology_get_next | ( | const consensus_topology_t * | topology, |
| uint8_t | out_id[16] | ||
| ) |
Definition at line 82 of file topology.c.
References consensus_topology::my_position, consensus_topology::num_participants, and consensus_topology::participant_ids.
| int consensus_topology_get_position | ( | const consensus_topology_t * | topology | ) |
Definition at line 70 of file topology.c.
References consensus_topology::my_position.
| asciichat_error_t consensus_topology_get_prev | ( | const consensus_topology_t * | topology, |
| uint8_t | out_id[16] | ||
| ) |
Definition at line 92 of file topology.c.
References consensus_topology::my_position, consensus_topology::num_participants, and consensus_topology::participant_ids.