-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmember.h
More file actions
33 lines (25 loc) · 893 Bytes
/
member.h
File metadata and controls
33 lines (25 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// SPDX-License-Identifier: GPL-2.0-only
// Copyright (C) 2025-2026, Shu De Zheng <[email protected]>. All Rights Reserved.
#ifndef __UMEM_CACHE_RAFT_MEMBER_H
#define __UMEM_CACHE_RAFT_MEMBER_H
#include "raft_conn.h"
#define MEMBER_TYPE_OLD (1 << 0)
#define MEMBER_TYPE_NEW (1 << 1)
#define MEMBER_TYPE_ALL (MEMBER_TYPE_OLD + MEMBER_TYPE_NEW)
struct member {
uint32_t id;
char unstable_round;
unsigned char type;
in_port_t sin6_port;
struct in6_addr sin6_addr;
bool available;
bool available_since_last_timer_event;
struct raft_conn conn;
uint64_t append_entry_round;
uint64_t next_index;
uint64_t match_index;
};
const char *member_string_address(const struct member *m, char str[INET6_ADDRSTRLEN]);
struct member *members_search_id(struct member *members, uint32_t n, uint32_t id);
uint32_t members_init(struct member *members, struct log *log, uint32_t leader);
#endif