Lines 516-528
Link Here
|
516 |
/* |
516 |
/* |
517 |
* function to dump the contents of the interface structure |
517 |
* function to dump the contents of the interface structure |
518 |
* for debugging use only. |
518 |
* for debugging use only. |
|
|
519 |
* We face a dilemma here -- sockets are FDs under POSIX and |
520 |
* actually HANDLES under Windows. So we use '%lld' as format |
521 |
* and cast the value to 'long long'; this should not hurt |
522 |
* with UNIX-like systems and does not truncate values on Win64. |
519 |
*/ |
523 |
*/ |
520 |
void |
524 |
void |
521 |
interface_dump(const endpt *itf) |
525 |
interface_dump(const endpt *itf) |
522 |
{ |
526 |
{ |
523 |
printf("Dumping interface: %p\n", itf); |
527 |
printf("Dumping interface: %p\n", itf); |
524 |
printf("fd = %d\n", itf->fd); |
528 |
printf("fd = %lld\n", (long long)itf->fd); |
525 |
printf("bfd = %d\n", itf->bfd); |
529 |
printf("bfd = %lld\n", (long long)itf->bfd); |
526 |
printf("sin = %s,\n", stoa(&itf->sin)); |
530 |
printf("sin = %s,\n", stoa(&itf->sin)); |
527 |
sockaddr_dump(&itf->sin); |
531 |
sockaddr_dump(&itf->sin); |
528 |
printf("bcast = %s,\n", stoa(&itf->bcast)); |
532 |
printf("bcast = %s,\n", stoa(&itf->bcast)); |
Lines 570-580
Link Here
|
570 |
static void |
574 |
static void |
571 |
print_interface(const endpt *iface, const char *pfx, const char *sfx) |
575 |
print_interface(const endpt *iface, const char *pfx, const char *sfx) |
572 |
{ |
576 |
{ |
573 |
printf("%sinterface #%d: fd=%d, bfd=%d, name=%s, flags=0x%x, ifindex=%u, sin=%s", |
577 |
printf("%sinterface #%d: fd=%lld, bfd=%lld, name=%s, flags=0x%x, ifindex=%u, sin=%s", |
574 |
pfx, |
578 |
pfx, |
575 |
iface->ifnum, |
579 |
iface->ifnum, |
576 |
iface->fd, |
580 |
(long long)iface->fd, |
577 |
iface->bfd, |
581 |
(long long)iface->bfd, |
578 |
iface->name, |
582 |
iface->name, |
579 |
iface->flags, |
583 |
iface->flags, |
580 |
iface->ifindex, |
584 |
iface->ifindex, |