grapes / src / Cache / cloudcast_proto.h @ e910cf6c
History | View | Annotate | Download (1.36 KB)
1 |
#ifndef CLOUDCAST_PROTO
|
---|---|
2 |
#define CLOUDCAST_PROTO
|
3 |
|
4 |
#include <time.h> |
5 |
#include "cloud_helper.h" |
6 |
|
7 |
struct cloudcast_proto_context;
|
8 |
|
9 |
struct cloudcast_header {
|
10 |
uint64_t last_cloud_contact_sec; |
11 |
}; |
12 |
|
13 |
struct cloudcast_proto_context* cloudcast_proto_init(struct nodeID *s, const void *meta, int meta_size); |
14 |
|
15 |
int cloudcast_reply_peer(struct cloudcast_proto_context *context, const struct peer_cache *c, struct peer_cache *local_cache, uint64_t last_cloud_contact_sec); |
16 |
int cloudcast_query_peer(struct cloudcast_proto_context *context, struct peer_cache *local_cache, struct nodeID *dst, uint64_t last_cloud_contact_sec); |
17 |
|
18 |
int cloudcast_reply_cloud(struct cloudcast_proto_context *context, struct peer_cache *cloud_cache); |
19 |
|
20 |
struct peer_cache * cloudcast_cloud_default_reply(struct peer_cache *template, struct nodeID *cloud_entry); |
21 |
|
22 |
int cloudcast_query_cloud(struct cloudcast_proto_context *context); |
23 |
time_t cloudcast_timestamp_cloud(struct cloudcast_proto_context *context);
|
24 |
|
25 |
int cloudcast_proto_change_metadata(struct cloudcast_proto_context *context, const void *metadata, int metadata_size); |
26 |
|
27 |
struct nodeID** cloudcast_get_cloud_nodes(struct cloudcast_proto_context *context, uint8_t number); |
28 |
|
29 |
struct nodeID* cloudcast_get_cloud_node(struct cloudcast_proto_context *context); |
30 |
|
31 |
int cloudcast_is_cloud_node(struct cloudcast_proto_context *context, struct nodeID* node); |
32 |
#endif /* CLOUDCAST_PROTO */ |