sourceroute6.c 319 B

12345678910111213141516
  1. #include "unp.h"
  2. void
  3. inet6_srcrt_print(void *ptr)
  4. {
  5. int i, segments;
  6. char str[INET6_ADDRSTRLEN];
  7. segments = Inet6_rth_segments(ptr);
  8. printf("received source route: ");
  9. for (i = 0; i < segments; i++)
  10. printf("%s ", Inet_ntop(AF_INET6, Inet6_rth_getaddr(ptr, i),
  11. str, sizeof(str)));
  12. printf("\n");
  13. }