Revision 4d9b08d1

View differences:

include/topmanager.h
31 31
          in case of error, or if the neighbourhood is empty.
32 32
*/
33 33
const struct nodeID **topGetNeighbourhood(int *n);
34

  
35
/**
36
  @brief Get the peer's metadata.
37

  
38
  Each peer in the neighbourhood can have some opaque metadata attached to
39
  it, and such metadata is gossiped together with the nodeIDs.
40
  This function returns the metadata currently associated to the
41
  neighbours of a peer, and the size of each object composing the metadata
42
  (metadata have the same structure for all the peers, so such size is
43
  constant). The neighbourhood size can be known by calling
44
  topGetNeighbourhood().
45

  
46
  @param metadata_size pointer to an integer where the size of the metadata
47
         associated to each peer is returned.
48
         Is set to -1 in case of error, or 0 if the neighbourhood is empty.
49
  @return a pointer to an array of metadata (ordered as the peers returned
50
          by topGetNeighbourhood()).
51
          NULL in case of error, or if the neighbourhood is empty.
52
*/
34 53
const void *topGetMetadata(int *metadata_size);
35 54

  
36 55
/**
......
70 89
  @brief Initialise the Topology Manager.
71 90

  
72 91
  @param myID the ID of this peer.
92
  @param metadata pointer to the metadata associated to this peer (will be
93
         gossiped).
94
  @param metadata_size size of the metadata associated to this peer.
73 95
  @return 0 in case of success; -1 in case of error.
74 96
*/
75 97
int topInit(struct nodeID *myID, void *metadata, int metadata_size);
......
81 103
  neighbourhood. It is useful in the bootstrap phase.
82 104
  @param neighbour the id of the peer to be added to the
83 105
         neighbourhood.
106
  @param metadata pointer to the metadata associated to the new peer (will be
107
         gossiped).
108
  @param metadata_size size of the metadata associated to the new peer (must
109
         be the same as for the other peers).
84 110
  @return 0 in case of success; -1 in case of error.
85 111
*/
86 112
int topAddNeighbour(struct nodeID *neighbour, void *metadata, int metadata_size);

Also available in: Unified diff