Statistics
| Branch: | Revision:

grapes / src / TopologyManager / topman_iface.h @ 6fd9945c

History | View | Annotate | Download (778 Bytes)

1
typedef int (*rankingFunction)(const void *target, const void *p1, const void *p2);        // FIXME!
2

    
3
struct topman_iface {
4
  int (*init)(struct nodeID *myID, void *metadata, int metadata_size, rankingFunction rfun, const char *config);
5
  int (*changeMetadata)(void *metadata, int metadata_size);
6
  int (*addNeighbour)(struct nodeID *neighbour, void *metadata, int metadata_size);
7
  int (*parseData)(const uint8_t *buff, int len, struct nodeID **peers, int size, const void *metadata, int metadata_size);
8
  int (*givePeers)(int n, struct nodeID **peers, void *metadata);
9
  const void *(*getMetadata)(int *metadata_size);
10
  int (*growNeighbourhood)(int n);
11
  int (*shrinkNeighbourhood)(int n);
12
  int (*removeNeighbour)(struct nodeID *neighbour);
13
  int (*getNeighbourhoodSize)(void);
14
};