if_indextoname.c 495 B

123456789101112131415161718192021222324
  1. #include "unp.h"
  2. /*
  3. * This is a placeholder if the system does not provide this RFC 2133
  4. * function. If routing sockets with sysctl() are provided, then the
  5. * if_XXX() functions in the libroute/ directory will replace these.
  6. */
  7. char *
  8. if_indextoname(unsigned int index, char *name)
  9. {
  10. return(NULL);
  11. }
  12. char *
  13. If_indextoname(unsigned int index, char *name)
  14. {
  15. char *ptr;
  16. if ( (ptr = if_indextoname(index, name)) == NULL)
  17. err_quit("if_indextoname error for %d", index);
  18. return(ptr);
  19. }