Revision e2b6ad48 src/TopologyManager/peersampler.c

View differences:

src/TopologyManager/peersampler.c
7 7
#include "peersampler_iface.h"
8 8

  
9 9
extern struct peersampler_iface ncast;
10
extern struct peersampler_iface dummy;
11
static struct peersampler_iface *ps;
10 12

  
11 13
int topInit(struct nodeID *myID, void *metadata, int metadata_size, const char *config)
12 14
{
13
  return ncast.init(myID, metadata, metadata_size, config);
15
  ps = &ncast;
16
  return ps->init(myID, metadata, metadata_size, config);
14 17
}
15 18

  
16 19
int topChangeMetadata(void *metadata, int metadata_size)
17 20
{
18
  return ncast.change_metadata(metadata, metadata_size);
21
  return ps->change_metadata(metadata, metadata_size);
19 22
}
20 23

  
21 24
int topAddNeighbour(struct nodeID *neighbour, void *metadata, int metadata_size)
22 25
{
23
  return ncast.add_neighbour(neighbour, metadata, metadata_size);
26
  return ps->add_neighbour(neighbour, metadata, metadata_size);
24 27
}
25 28

  
26 29
int topParseData(const uint8_t *buff, int len)
27 30
{
28
  return ncast.parse_data(buff, len);
31
  return ps->parse_data(buff, len);
29 32
}
30 33

  
31 34
const struct nodeID **topGetNeighbourhood(int *n)
32 35
{
33
  return ncast.get_neighbourhood(n);
36
  return ps->get_neighbourhood(n);
34 37
}
35 38

  
36 39
const void *topGetMetadata(int *metadata_size)
37 40
{
38
  return ncast.get_metadata(metadata_size);
41
  return ps->get_metadata(metadata_size);
39 42
}
40 43

  
41 44
int topGrowNeighbourhood(int n)
42 45
{
43
  return ncast.grow_neighbourhood(n);
46
  return ps->grow_neighbourhood(n);
44 47
}
45 48

  
46 49
int topShrinkNeighbourhood(int n)
47 50
{
48
  return ncast.shrink_neighbourhood(n);
51
  return ps->shrink_neighbourhood(n);
49 52
}
50 53

  
51 54
int topRemoveNeighbour(struct nodeID *neighbour)
52 55
{
53
  return ncast.remove_neighbour(neighbour);
56
  return ps->remove_neighbour(neighbour);
54 57
}

Also available in: Unified diff