Revision ef4061e4

View differences:

include/net_helper.h
36 36
int nodeid_equal(const struct nodeID *s1, const struct nodeID *s2);
37 37

  
38 38
/**
39
* @brief Compare two nodes and give some consistent ordering.
40
* This ordering  should only be used for keeping lists ordered, it has no other meaning.
41
* @param[in] s1 The first nodeID to be compared.
42
* @param[in] s2 The second nodeID to be compared.
43
* @return -1, 0 or 1, depending on the relation between  s1 and s2.
44
*/
45
int nodeid_cmp(const struct nodeID *s1, const struct nodeID *s2);
46

  
47
/**
39 48
* @brief Create a new nodeID.
40 49
* Create a new nodeID from a given IP address and port number.
41 50
* @param[in] IPaddr The IP address in string form to be associated to the new nodeID.
src/net_helper-ml.c
671 671
	return (mlCompareSocketIDs(s1->addr,s2->addr) == 0);
672 672
}
673 673

  
674
int nodeid_cmp(const struct nodeID *s1, const struct nodeID *s2)
675
{
676
	return mlCompareSocketIDs(s1->addr,s2->addr);
677
}
678

  
674 679
int nodeid_dump(uint8_t *b, const struct nodeID *s, size_t max_write_size)
675 680
{
676 681
  if (max_write_size < SOCKETID_STRING_SIZE) return -1;
src/net_helper-win32.c
198 198
  return (memcmp(&s1->addr, &s2->addr, sizeof(struct sockaddr_in)) == 0);
199 199
}
200 200

  
201
int nodeid_cmp(const struct nodeID *s1, const struct nodeID *s2)
202
{
203
  return memcmp(&s1->addr, &s2->addr, sizeof(struct sockaddr_in));
204
}
205

  
201 206
int nodeid_dump(uint8_t *b, const struct nodeID *s, size_t max_write_size)
202 207
{
203 208
  if (max_write_size < sizeof(struct sockaddr_in)) return -1;
src/net_helper.c
210 210
  return (memcmp(&s1->addr, &s2->addr, sizeof(struct sockaddr_in)) == 0);
211 211
}
212 212

  
213
int nodeid_cmp(const struct nodeID *s1, const struct nodeID *s2)
214
{
215
  return memcmp(&s1->addr, &s2->addr, sizeof(struct sockaddr_in));
216
}
217

  
213 218
int nodeid_dump(uint8_t *b, const struct nodeID *s, size_t max_write_size)
214 219
{
215 220
  if (max_write_size < sizeof(struct sockaddr_in)) return -1;

Also available in: Unified diff