Statistics
| Branch: | Revision:

grapes / src / PeerSampler / peersampler_iface.h @ 1583fd78

History | View | Annotate | Download (1013 Bytes)

1 60fa723d Luca Abeni
#ifndef PEERSAMPLER_IFACE
2
#define PEERSAMPLER_IFACE
3
4 06113eb4 Andrea Zito
struct peersampler_context;
5
6 a515fd33 Luca
struct peersampler_iface {
7 15d5934d Luca Abeni
  struct peersampler_context* (*init)(struct nodeID *myID, const void *metadata, int metadata_size, const char *config);
8
  int (*change_metadata)(struct peersampler_context *context, const void *metadata, int metadata_size);
9
  int (*add_neighbour)(struct peersampler_context *context, struct nodeID *neighbour, const void *metadata, int metadata_size);
10 06113eb4 Andrea Zito
  int (*parse_data)(struct peersampler_context *context, const uint8_t *buff, int len);
11 92358b75 Luca Abeni
  const struct nodeID *const*(*get_neighbourhood)(struct peersampler_context *context, int *n);
12 06113eb4 Andrea Zito
  const void *(*get_metadata)(struct peersampler_context *context, int *metadata_size);
13
  int (*grow_neighbourhood)(struct peersampler_context *context, int n);
14
  int (*shrink_neighbourhood)(struct peersampler_context *context, int n);
15 15d5934d Luca Abeni
  int (*remove_neighbour)(struct peersampler_context *context, const struct nodeID *neighbour);
16 a515fd33 Luca
};
17
18 60fa723d Luca Abeni
#endif        /* PEERSAMPLER_IFACE */