ioctl_null.c 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * Copyright (C) 2006 Sun Microsystems, Inc.
  3. *
  4. * This file is part of Quagga.
  5. *
  6. * Quagga is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License as published by the
  8. * Free Software Foundation; either version 2, or (at your option) any
  9. * later version.
  10. *
  11. * Quagga is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with Quagga; see the file COPYING. If not, write to the Free
  18. * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  19. * 02111-1307, USA.
  20. */
  21. #include <zebra.h>
  22. #include "zebra/rib.h"
  23. #include "zebra/rt.h"
  24. #include "zebra/ioctl.h"
  25. void ifreq_set_name (struct ifreq *a, struct interface *b) { return; }
  26. int if_set_prefix (struct interface *a, struct connected *b)
  27. {
  28. kernel_address_add_ipv4 (a, b);
  29. return 0;
  30. }
  31. int if_unset_prefix (struct interface *a, struct connected *b)
  32. {
  33. kernel_address_delete_ipv4 (a, b);
  34. return 0;
  35. }
  36. int if_prefix_add_ipv6 (struct interface *a, struct connected *b) { return 0; }
  37. #ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
  38. #pragma weak if_prefix_delete_ipv6 = if_prefix_add_ipv6
  39. #else
  40. int if_prefix_delete_ipv6 (struct interface *a, struct connected *b) { return 0; }
  41. #endif
  42. int if_ioctl (u_long a, caddr_t b) { return 0; }
  43. int if_set_flags (struct interface *a, uint64_t b) { return 0; }
  44. #ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
  45. #pragma weak if_unset_flags = if_set_flags
  46. #else
  47. int if_unset_flags (struct interface *a, uint64_t b) { return 0; }
  48. #endif
  49. void if_get_flags (struct interface *a) { return; }
  50. #ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
  51. #pragma weak if_get_metric = if_get_flags
  52. #pragma weak if_get_mtu = if_get_flags
  53. #else
  54. /* void if_get_metric (struct interface *a) { return; } */
  55. /* void if_get_mtu (struct interface *a) { return; } */
  56. #endif
  57. #ifdef SOLARIS_IPV6
  58. #pragma weak if_ioctl_ipv6 = if_ioctl
  59. struct connected *if_lookup_linklocal(struct interface *a) { return 0; }
  60. #define AF_IOCTL(af, request, buffer) \
  61. ((af) == AF_INET? if_ioctl(request, buffer) : \
  62. if_ioctl_ipv6(request, buffer))
  63. #else /* SOLARIS_IPV6 */
  64. #define AF_IOCTL(af, request, buffer) if_ioctl(request, buffer)
  65. #endif /* SOLARIS_IPV6 */