Revision 005954ae

View differences:

include/topmanager.h
1 1
#ifndef TOPMAN_H
2 2
#define TOPMAN_H
3 3
const struct nodeID **topGetNeighbourhood(int *n);
4
const void **topGetMetadata(int *metadata_size);
4 5
int topGrowNeighbourhood(int n);
5 6
int topShrinkNeighbourhood(int n);
6 7
int topRemoveNeighbour(struct nodeID *neighbour);
7 8

  
8 9

  
9
int topInit(struct nodeID *myID);
10
int topAddNeighbour(struct nodeID *neighbour);
10
int topInit(struct nodeID *myID, void *metadata, int metadata_size);
11
int topAddNeighbour(struct nodeID *neighbour, void *metadata, int metadata_size);
11 12
int topParseData(const uint8_t *buff, int len);
12 13

  
13 14
/*
som/TopologyManager/ncast.c
48 48
/*
49 49
 * Public Functions!
50 50
 */
51
int topInit(struct nodeID *myID)
51
int topInit(struct nodeID *myID, void *metadata, int metadata_size)
52 52
{
53
  if (metadata_size) {
54
    fprintf(stderr, "Metadata are not implemented yet!\n");
55

  
56
    return -1;
57
  }
58

  
53 59
  local_cache = cache_init(cache_size);
54 60
  if (local_cache == NULL) {
55 61
    return -1;
......
60 66
  return 1;
61 67
}
62 68

  
63
int topAddNeighbour(struct nodeID *neighbour)
69
int topAddNeighbour(struct nodeID *neighbour, void *metadata, int metadata_size)
64 70
{
71
  if (metadata_size) {
72
    fprintf(stderr, "Metadata are not implemented yet!\n");
73

  
74
    return -1;
75
  }
76

  
65 77
  if (cache_add(local_cache, neighbour) < 0) {
66 78
    return -1;
67 79
  }
......
111 123
  return (const struct nodeID **)r;
112 124
}
113 125

  
126
const void **topGetMetadata(int *metadata_size)
127
{
128
  fprintf(stderr, "MetaData are not implemented yet!!!\n");
129

  
130
  return NULL;
131
}
132

  
114 133
int topGrowNeighbourhood(int n)
115 134
{
116 135
  cache_size += n;

Also available in: Unified diff