corosync  2.4.6
totemip.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2005-2011 Red Hat, Inc.
3  *
4  * All rights reserved.
5  *
6  * Author: Patrick Caulfield (pcaulfie@redhat.com)
7  *
8  * This software licensed under BSD license, the text of which follows:
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions are met:
12  *
13  * - Redistributions of source code must retain the above copyright notice,
14  * this list of conditions and the following disclaimer.
15  * - Redistributions in binary form must reproduce the above copyright notice,
16  * this list of conditions and the following disclaimer in the documentation
17  * and/or other materials provided with the distribution.
18  * - Neither the name of the MontaVista Software, Inc. nor the names of its
19  * contributors may be used to endorse or promote products derived from this
20  * software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
26  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
32  * THE POSSIBILITY OF SUCH DAMAGE.
33  */
34 
35 /* IPv4/6 abstraction */
36 
37 #include <config.h>
38 
39 #include <sys/ioctl.h>
40 #include <sys/types.h>
41 #include <sys/socket.h>
42 #include <netinet/in.h>
43 #include <arpa/inet.h>
44 #include <netdb.h>
45 #include <net/if.h>
46 #include <string.h>
47 #include <stdio.h>
48 #include <errno.h>
49 #include <assert.h>
50 #include <stdlib.h>
51 #include <unistd.h>
52 #include <ifaddrs.h>
53 #include <corosync/logsys.h>
54 
55 #include <corosync/totem/totemip.h>
56 #include <corosync/swab.h>
57 
58 #define LOCALHOST_IPV4 "127.0.0.1"
59 #define LOCALHOST_IPV6 "::1"
60 
61 #define NETLINK_BUFSIZE 16384
62 
63 #ifdef SO_NOSIGPIPE
64 void totemip_nosigpipe(int s)
65 {
66  int on = 1;
67  setsockopt(s, SOL_SOCKET, SO_NOSIGPIPE, (void *)&on, sizeof(on));
68 }
69 #endif
70 
71 /* Compare two addresses */
72 int totemip_equal(const struct totem_ip_address *addr1,
73  const struct totem_ip_address *addr2)
74 {
75  int addrlen = 0;
76 
77  if (addr1->family != addr2->family)
78  return 0;
79 
80  if (addr1->family == AF_INET) {
81  addrlen = sizeof(struct in_addr);
82  }
83  if (addr1->family == AF_INET6) {
84  addrlen = sizeof(struct in6_addr);
85  }
86  assert(addrlen);
87 
88  if (memcmp(addr1->addr, addr2->addr, addrlen) == 0)
89  return 1;
90  else
91  return 0;
92 
93 }
94 
95 int totemip_sa_equal(const struct totem_ip_address *totem_ip,
96  const struct sockaddr *sa)
97 {
98  int res;
99 
100  res = 0;
101 
102  if (totem_ip->family != sa->sa_family) {
103  return (res);
104  }
105 
106  switch (totem_ip->family) {
107  case AF_INET:
108  res = (memcmp(totem_ip->addr,
109  &((const struct sockaddr_in *)sa)->sin_addr, sizeof(struct in_addr)) == 0);
110  break;
111  case AF_INET6:
112  res = (memcmp(totem_ip->addr,
113  &((const struct sockaddr_in6 *)sa)->sin6_addr, sizeof(struct in6_addr)) == 0);
114  break;
115  default:
116  assert(0);
117  }
118 
119  return (res);
120 }
121 
122 /* Copy a totem_ip_address */
123 void totemip_copy(struct totem_ip_address *addr1,
124  const struct totem_ip_address *addr2)
125 {
126  memcpy(addr1, addr2, sizeof(struct totem_ip_address));
127 }
128 
130  const struct totem_ip_address *addr2)
131 {
132  addr1->nodeid = swab32(addr2->nodeid);
133  addr1->family = swab16(addr2->family);
134  memcpy(addr1->addr, addr2->addr, TOTEMIP_ADDRLEN);
135 }
136 
137 /*
138  * Multicast address range is 224.0.0.0 to 239.255.255.255 this
139  * translates to the first 4 bits == 1110 (0xE).
140  * http://en.wikipedia.org/wiki/Multicast_address
141  */
142 int32_t totemip_is_mcast(struct totem_ip_address *ip_addr)
143 {
144  uint32_t addr = 0;
145 
146  memcpy (&addr, ip_addr->addr, sizeof (uint32_t));
147 
148  if (ip_addr->family == AF_INET) {
149  addr = ntohl(addr);
150  if ((addr >> 28) != 0xE) {
151  return -1;
152  }
153  }
154  return 0;
155 }
156 
157 /* For sorting etc. params are void * for qsort's benefit */
158 int totemip_compare(const void *a, const void *b)
159 {
160  int i;
161  const struct totem_ip_address *totemip_a = (const struct totem_ip_address *)a;
162  const struct totem_ip_address *totemip_b = (const struct totem_ip_address *)b;
163  struct in_addr ipv4_a1;
164  struct in_addr ipv4_a2;
165  struct in6_addr ipv6_a1;
166  struct in6_addr ipv6_a2;
167  unsigned short family;
168 
169  /*
170  * Use memcpy to align since totem_ip_address is unaligned on various archs
171  */
172  memcpy (&family, &totemip_a->family, sizeof (unsigned short));
173 
174  if (family == AF_INET) {
175  memcpy (&ipv4_a1, totemip_a->addr, sizeof (struct in_addr));
176  memcpy (&ipv4_a2, totemip_b->addr, sizeof (struct in_addr));
177  if (ipv4_a1.s_addr == ipv4_a2.s_addr) {
178  return (0);
179  }
180  if (htonl(ipv4_a1.s_addr) < htonl(ipv4_a2.s_addr)) {
181  return -1;
182  } else {
183  return +1;
184  }
185  } else
186  if (family == AF_INET6) {
187  /*
188  * We can only compare 8 bits at time for portability reasons
189  */
190  memcpy (&ipv6_a1, totemip_a->addr, sizeof (struct in6_addr));
191  memcpy (&ipv6_a2, totemip_b->addr, sizeof (struct in6_addr));
192  for (i = 0; i < 16; i++) {
193  int res = ipv6_a1.s6_addr[i] -
194  ipv6_a2.s6_addr[i];
195  if (res) {
196  return res;
197  }
198  }
199  return 0;
200  } else {
201  /*
202  * Family not set, should be!
203  */
204  assert (0);
205  }
206  return 0;
207 }
208 
209 /* Build a localhost totem_ip_address */
210 int totemip_localhost(int family, struct totem_ip_address *localhost)
211 {
212  const char *addr_text;
213 
214  memset (localhost, 0, sizeof (struct totem_ip_address));
215 
216  if (family == AF_INET) {
217  addr_text = LOCALHOST_IPV4;
218  if (inet_pton(family, addr_text, (char *)&localhost->nodeid) <= 0) {
219  return -1;
220  }
221  } else {
222  addr_text = LOCALHOST_IPV6;
223  }
224 
225  if (inet_pton(family, addr_text, (char *)localhost->addr) <= 0)
226  return -1;
227 
228  localhost->family = family;
229 
230  return 0;
231 }
232 
234 {
235  struct totem_ip_address localhost;
236 
237  if (totemip_localhost(addr->family, &localhost))
238  return 0;
239  return totemip_equal(addr, &localhost);
240 }
241 
242 const char *totemip_sa_print(const struct sockaddr *sa)
243 {
244  static char buf[INET6_ADDRSTRLEN];
245 
246  buf[0] = 0;
247 
248  switch (sa->sa_family) {
249  case AF_INET:
250  inet_ntop(sa->sa_family, &((struct sockaddr_in *)(sa))->sin_addr, buf,
251  INET6_ADDRSTRLEN);
252  break;
253  case AF_INET6:
254  inet_ntop(sa->sa_family, &((struct sockaddr_in6 *)(sa))->sin6_addr, buf,
255  INET6_ADDRSTRLEN);
256  break;
257  default:
258  return (NULL);
259  }
260 
261  return (buf);
262 }
263 
264 const char *totemip_print(const struct totem_ip_address *addr)
265 {
266  static char buf[INET6_ADDRSTRLEN];
267 
268  return (inet_ntop(addr->family, addr->addr, buf, sizeof(buf)));
269 }
270 
271 static int totemip_getif_scopeid(const unsigned char *addr16, unsigned int *scopeid)
272 {
273  struct ifaddrs *ifa;
274  const struct sockaddr_in6 *sin6;
275  const socklen_t addr_len = sizeof(struct in6_addr);
276  int rc = -1; // 0 = found 1 match; -1 = found 0 matches; -2 = found >1 matches
277  struct ifaddrs *totemip_getif_scopeid_ifap;
278 
279  if (getifaddrs(&totemip_getif_scopeid_ifap) != 0) {
280  return (-1);
281  }
282 
283  for (ifa = totemip_getif_scopeid_ifap; ifa; ifa = ifa->ifa_next) {
284  if (ifa->ifa_addr == NULL || ifa->ifa_netmask == NULL)
285  continue ;
286 
287  if ((ifa->ifa_addr->sa_family != AF_INET6) ||
288  (ifa->ifa_netmask->sa_family != AF_INET6 &&
289  ifa->ifa_netmask->sa_family != 0))
290  continue ;
291 
292  sin6 = (const struct sockaddr_in6 *)ifa->ifa_addr;
293 
294  if (memcmp(&sin6->sin6_addr, addr16, addr_len) == 0) {
295  *scopeid = sin6->sin6_scope_id;
296 
297  if (rc == -1) {
298  rc = 0;
299  } else {
300  rc = -2;
301  }
302  }
303  }
304 
305  if (rc == -2) {
306  log_printf(LOGSYS_LEVEL_WARNING, "(%s) exists on several interfaces."
307  " Use 'ip a' to see details.",
308  totemip_sa_print(ifa->ifa_addr));
309  }
310 
311  freeifaddrs(totemip_getif_scopeid_ifap);
312 
313  return rc;
314 }
315 
316 
318  uint16_t port, struct sockaddr_storage *saddr, int *addrlen,
319  int fill_scopeid)
320 {
321  int ret = -1;
322  unsigned int scopeid;
323 
324  if (ip_addr->family == AF_INET) {
325  struct sockaddr_in *sin = (struct sockaddr_in *)saddr;
326 
327  memset(sin, 0, sizeof(struct sockaddr_in));
328 #ifdef HAVE_SOCK_SIN_LEN
329  sin->sin_len = sizeof(struct sockaddr_in);
330 #endif
331  sin->sin_family = ip_addr->family;
332  sin->sin_port = ntohs(port);
333  memcpy(&sin->sin_addr, ip_addr->addr, sizeof(struct in_addr));
334  *addrlen = sizeof(struct sockaddr_in);
335  ret = 0;
336  }
337 
338  if (ip_addr->family == AF_INET6) {
339  struct sockaddr_in6 *sin = (struct sockaddr_in6 *)saddr;
340 
341  memset(sin, 0, sizeof(struct sockaddr_in6));
342 #ifdef HAVE_SOCK_SIN6_LEN
343  sin->sin6_len = sizeof(struct sockaddr_in6);
344 #endif
345  sin->sin6_family = ip_addr->family;
346  sin->sin6_port = ntohs(port);
347  if (fill_scopeid) {
348  if (totemip_getif_scopeid(ip_addr->addr, &scopeid) == 0) {
349  sin->sin6_scope_id = scopeid;
350  }
351  }
352  memcpy(&sin->sin6_addr, ip_addr->addr, sizeof(struct in6_addr));
353 
354  *addrlen = sizeof(struct sockaddr_in6);
355  ret = 0;
356  }
357 
358  return ret;
359 }
360 
361 /* Make a totem_ip_address into a usable sockaddr_storage */
363  uint16_t port, struct sockaddr_storage *saddr, int *addrlen)
364 {
365 
366  return (totemip_totemip_to_sockaddr_convert_with_scopeid(ip_addr, port, saddr, addrlen, 0));
367 }
368 
369 
370 /* Converts an address string string into a totem_ip_address.
371  family can be AF_INET, AF_INET6 or 0 ("for "don't care")
372 */
373 int totemip_parse(struct totem_ip_address *totemip, const char *addr, int family)
374 {
375  struct addrinfo *ainfo;
376  struct addrinfo ahints;
377  struct sockaddr_in *sa;
378  struct sockaddr_in6 *sa6;
379  int ret;
380 
381  memset(&ahints, 0, sizeof(ahints));
382  ahints.ai_socktype = SOCK_DGRAM;
383  ahints.ai_protocol = IPPROTO_UDP;
384  ahints.ai_family = family;
385 
386  /* Lookup the nodename address */
387  ret = getaddrinfo(addr, NULL, &ahints, &ainfo);
388  if (ret)
389  return -1;
390 
391  sa = (struct sockaddr_in *)ainfo->ai_addr;
392  sa6 = (struct sockaddr_in6 *)ainfo->ai_addr;
393  totemip->family = ainfo->ai_family;
394 
395  if (ainfo->ai_family == AF_INET)
396  memcpy(totemip->addr, &sa->sin_addr, sizeof(struct in_addr));
397  else
398  memcpy(totemip->addr, &sa6->sin6_addr, sizeof(struct in6_addr));
399 
400  freeaddrinfo(ainfo);
401  return 0;
402 }
403 
404 /* Make a sockaddr_* into a totem_ip_address */
405 int totemip_sockaddr_to_totemip_convert(const struct sockaddr_storage *saddr,
406  struct totem_ip_address *ip_addr)
407 {
408  int ret = -1;
409 
410  ip_addr->family = saddr->ss_family;
411  ip_addr->nodeid = 0;
412 
413  if (saddr->ss_family == AF_INET) {
414  const struct sockaddr_in *sin = (const struct sockaddr_in *)saddr;
415 
416  memcpy(ip_addr->addr, &sin->sin_addr, sizeof(struct in_addr));
417  ret = 0;
418  }
419 
420  if (saddr->ss_family == AF_INET6) {
421  const struct sockaddr_in6 *sin
422  = (const struct sockaddr_in6 *)saddr;
423 
424  memcpy(ip_addr->addr, &sin->sin6_addr, sizeof(struct in6_addr));
425 
426  ret = 0;
427  }
428  return ret;
429 }
430 
431 int totemip_getifaddrs(struct list_head *addrs)
432 {
433  struct ifaddrs *ifap, *ifa;
434  struct totem_ip_if_address *if_addr;
435 
436  if (getifaddrs(&ifap) != 0)
437  return (-1);
438 
439  list_init(addrs);
440 
441  for (ifa = ifap; ifa; ifa = ifa->ifa_next) {
442  if (ifa->ifa_addr == NULL || ifa->ifa_netmask == NULL)
443  continue ;
444 
445  if ((ifa->ifa_addr->sa_family != AF_INET && ifa->ifa_addr->sa_family != AF_INET6) ||
446  (ifa->ifa_netmask->sa_family != AF_INET && ifa->ifa_netmask->sa_family != AF_INET6 &&
447  ifa->ifa_netmask->sa_family != 0))
448  continue ;
449 
450  if (ifa->ifa_netmask->sa_family == 0) {
451  ifa->ifa_netmask->sa_family = ifa->ifa_addr->sa_family;
452  }
453 
454  if_addr = malloc(sizeof(struct totem_ip_if_address));
455  if (if_addr == NULL) {
456  goto error_free_ifaddrs;
457  }
458 
459  list_init(&if_addr->list);
460 
461  memset(if_addr, 0, sizeof(struct totem_ip_if_address));
462 
463  if_addr->interface_up = ifa->ifa_flags & IFF_UP;
464  if_addr->interface_num = if_nametoindex(ifa->ifa_name);
465  if_addr->name = strdup(ifa->ifa_name);
466  if (if_addr->name == NULL) {
467  goto error_free_addr;
468  }
469 
470  if (totemip_sockaddr_to_totemip_convert((const struct sockaddr_storage *)ifa->ifa_addr,
471  &if_addr->ip_addr) == -1) {
472  goto error_free_addr_name;
473  }
474 
475  if (totemip_sockaddr_to_totemip_convert((const struct sockaddr_storage *)ifa->ifa_netmask,
476  &if_addr->mask_addr) == -1) {
477  goto error_free_addr_name;
478  }
479 
480  list_add_tail(&if_addr->list, addrs);
481  }
482 
483  freeifaddrs(ifap);
484 
485  return (0);
486 
487 error_free_addr_name:
488  free(if_addr->name);
489 
490 error_free_addr:
491  free(if_addr);
492 
493 error_free_ifaddrs:
494  totemip_freeifaddrs(addrs);
495  freeifaddrs(ifap);
496  return (-1);
497 }
498 
499 void totemip_freeifaddrs(struct list_head *addrs)
500 {
501  struct totem_ip_if_address *if_addr;
502  struct list_head *list;
503 
504  for (list = addrs->next; list != addrs;) {
505  if_addr = list_entry(list, struct totem_ip_if_address, list);
506  list = list->next;
507 
508  free(if_addr->name);
509  list_del(&if_addr->list);
510  free(if_addr);
511  }
512  list_init(addrs);
513 }
514 
516  struct totem_ip_address *boundto,
517  int *interface_up,
518  int *interface_num,
519  int mask_high_bit)
520 {
521  struct list_head addrs;
522  struct list_head *list;
523  struct totem_ip_if_address *if_addr;
524  struct totem_ip_address bn_netaddr, if_netaddr;
525  socklen_t addr_len;
526  socklen_t si;
527  int res = -1;
528  int exact_match_found = 0;
529  int net_match_found = 0;
530 
531  *interface_up = 0;
532  *interface_num = 0;
533 
534  if (totemip_getifaddrs(&addrs) == -1) {
535  return (-1);
536  }
537 
538  for (list = addrs.next; list != &addrs; list = list->next) {
539  if_addr = list_entry(list, struct totem_ip_if_address, list);
540 
541  if (bindnet->family != if_addr->ip_addr.family)
542  continue ;
543 
544  addr_len = 0;
545 
546  switch (bindnet->family) {
547  case AF_INET:
548  addr_len = sizeof(struct in_addr);
549  break;
550  case AF_INET6:
551  addr_len = sizeof(struct in6_addr);
552  break;
553  }
554 
555  if (addr_len == 0)
556  continue ;
557 
558  totemip_copy(&bn_netaddr, bindnet);
559  totemip_copy(&if_netaddr, &if_addr->ip_addr);
560 
561  if (totemip_equal(&bn_netaddr, &if_netaddr)) {
562  exact_match_found = 1;
563  }
564 
565  for (si = 0; si < addr_len; si++) {
566  bn_netaddr.addr[si] = bn_netaddr.addr[si] & if_addr->mask_addr.addr[si];
567  if_netaddr.addr[si] = if_netaddr.addr[si] & if_addr->mask_addr.addr[si];
568  }
569 
570  if (exact_match_found || (!net_match_found && totemip_equal(&bn_netaddr, &if_netaddr))) {
571  totemip_copy(boundto, &if_addr->ip_addr);
572  boundto->nodeid = bindnet->nodeid;
573  *interface_up = if_addr->interface_up;
574  *interface_num = if_addr->interface_num;
575 
576  if (boundto->family == AF_INET && boundto->nodeid == 0) {
577  unsigned int nodeid = 0;
578  memcpy (&nodeid, boundto->addr, sizeof (int));
579 #if __BYTE_ORDER == __LITTLE_ENDIAN
580  nodeid = swab32 (nodeid);
581 #endif
582  if (mask_high_bit) {
583  nodeid &= 0x7FFFFFFF;
584  }
585  boundto->nodeid = nodeid;
586  }
587 
588  net_match_found = 1;
589  res = 0;
590 
591  if (exact_match_found) {
592  goto finished;
593  }
594  }
595  }
596 
597 finished:
598  totemip_freeifaddrs(&addrs);
599  return (res);
600 }
601 
602 #define TOTEMIP_UDP_HEADER_SIZE 8
603 #define TOTEMIP_IPV4_HEADER_SIZE 20
604 #define TOTEMIP_IPV6_HEADER_SIZE 40
605 
607 {
608  size_t header_size;
609 
610  header_size = 0;
611 
612  switch (family) {
613  case AF_INET:
615  break;
616  case AF_INET6:
618  break;
619  }
620 
621  return (header_size);
622 }
unsigned short family
Definition: coroapi.h:113
void totemip_freeifaddrs(struct list_head *addrs)
Definition: totemip.c:499
#define TOTEMIP_IPV4_HEADER_SIZE
Definition: totemip.c:603
struct list_head * next
Definition: list.h:47
The totem_ip_address struct.
Definition: coroapi.h:111
unsigned char addr[TOTEMIP_ADDRLEN]
Definition: coroapi.h:114
void totemip_copy(struct totem_ip_address *addr1, const struct totem_ip_address *addr2)
Definition: totemip.c:123
struct list_head list
Definition: totemip.h:77
int totemip_totemip_to_sockaddr_convert_with_scopeid(const struct totem_ip_address *ip_addr, uint16_t port, struct sockaddr_storage *saddr, int *addrlen, int fill_scopeid)
Definition: totemip.c:317
unsigned char addr[TOTEMIP_ADDRLEN]
Definition: coroapi.h:77
int totemip_localhost(int family, struct totem_ip_address *localhost)
Definition: totemip.c:210
int totemip_parse(struct totem_ip_address *totemip, const char *addr, int family)
Definition: totemip.c:373
Definition: list.h:46
#define log_printf(level, format, args...)
Definition: logsys.h:320
#define totemip_nosigpipe(s)
Definition: totemip.h:56
const char * totemip_print(const struct totem_ip_address *addr)
Definition: totemip.c:264
int32_t totemip_is_mcast(struct totem_ip_address *ip_addr)
Definition: totemip.c:142
int totemip_localhost_check(const struct totem_ip_address *addr)
Definition: totemip.c:233
#define LOGSYS_LEVEL_WARNING
Definition: logsys.h:71
int totemip_totemip_to_sockaddr_convert(struct totem_ip_address *ip_addr, uint16_t port, struct sockaddr_storage *saddr, int *addrlen)
Definition: totemip.c:362
int totemip_iface_check(struct totem_ip_address *bindnet, struct totem_ip_address *boundto, int *interface_up, int *interface_num, int mask_high_bit)
Definition: totemip.c:515
unsigned int nodeid
Definition: coroapi.h:112
size_t totemip_udpip_header_size(int family)
Definition: totemip.c:606
const char * totemip_sa_print(const struct sockaddr *sa)
Definition: totemip.c:242
int totemip_getifaddrs(struct list_head *addrs)
Definition: totemip.c:431
struct totem_ip_address mask_addr
Definition: totemip.h:73
#define LOCALHOST_IPV4
Definition: totemip.c:58
int totemip_compare(const void *a, const void *b)
Definition: totemip.c:158
#define swab32(x)
The swab32 macro.
Definition: swab.h:51
#define TOTEMIP_ADDRLEN
Definition: coroapi.h:86
#define LOCALHOST_IPV6
Definition: totemip.c:59
int totemip_equal(const struct totem_ip_address *addr1, const struct totem_ip_address *addr2)
Definition: totemip.c:72
#define swab16(x)
The swab16 macro.
Definition: swab.h:39
unsigned short family
Definition: coroapi.h:76
int totemip_sockaddr_to_totemip_convert(const struct sockaddr_storage *saddr, struct totem_ip_address *ip_addr)
Definition: totemip.c:405
#define TOTEMIP_IPV6_HEADER_SIZE
Definition: totemip.c:604
#define list_entry(ptr, type, member)
Definition: list.h:84
int totemip_sa_equal(const struct totem_ip_address *totem_ip, const struct sockaddr *sa)
Definition: totemip.c:95
#define TOTEMIP_UDP_HEADER_SIZE
Definition: totemip.c:602
unsigned int nodeid
Definition: coroapi.h:75
struct totem_ip_address ip_addr
Definition: totemip.h:72
void totemip_copy_endian_convert(struct totem_ip_address *addr1, const struct totem_ip_address *addr2)
Definition: totemip.c:129