if_nametoindex.c 470 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. unsigned int
  8. if_nametoindex(const char *name)
  9. {
  10. return(0);
  11. }
  12. unsigned int
  13. If_nametoindex(const char *name)
  14. {
  15. int index;
  16. if ( (index = if_nametoindex(name)) == 0)
  17. err_quit("if_nametoindex error for %s", name);
  18. return(index);
  19. }