1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2022 Felix Fietkau <nbd@nbd.name>
9 struct vlist_node node
;
10 uint8_t key
[CURVE25519_KEY_SIZE
];
11 union network_addr local_addr
;
13 struct blob_attr
*ipaddr
;
14 struct blob_attr
*subnet
;
21 bool has_local_ep_addr
;
22 union network_addr local_ep_addr
;
23 union network_endpoint endpoint
;
25 union network_endpoint next_endpoint
;
26 uint64_t last_ep_update
;
29 uint64_t last_handshake
;
30 uint64_t last_request
;
38 struct network_peer peer
;
41 struct network_group
{
46 struct network_host
**members
;
49 static inline const char *network_host_name(struct network_host
*host
)
51 return host
->node
.key
;
54 static inline const char *network_peer_name(struct network_peer
*peer
)
56 struct network_host
*host
= container_of(peer
, struct network_host
, peer
);
58 return network_host_name(host
);
61 void network_hosts_update_start(struct network
*net
);
62 void network_hosts_update_done(struct network
*net
);
63 void network_hosts_add(struct network
*net
, struct blob_attr
*hosts
);
65 void network_hosts_init(struct network
*net
);
66 void network_hosts_free(struct network
*net
);