kernel_null.c 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* NULL kernel methods for testing. */
  2. /*
  3. * Copyright (C) 2006 Sun Microsystems, Inc.
  4. *
  5. * This file is part of Quagga.
  6. *
  7. * Quagga is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License as published by the
  9. * Free Software Foundation; either version 2, or (at your option) any
  10. * later version.
  11. *
  12. * Quagga is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with Quagga; see the file COPYING. If not, write to the Free
  19. * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  20. * 02111-1307, USA.
  21. */
  22. #include <zebra.h>
  23. #include <log.h>
  24. #include "zebra/zserv.h"
  25. #include "zebra/rt.h"
  26. #include "zebra/redistribute.h"
  27. #include "zebra/connected.h"
  28. int kernel_add_ipv4 (struct prefix *a, struct rib *b) { return 0; }
  29. #ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
  30. #pragma weak kernel_delete_ipv4 = kernel_add_ipv4
  31. #else
  32. int kernel_delete_ipv4 (struct prefix *a, struct rib *b) { return 0; }
  33. #endif
  34. int kernel_add_ipv6 (struct prefix *a, struct rib *b) { return 0; }
  35. #ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
  36. #pragma weak kernel_delete_ipv6 = kernel_add_ipv6
  37. #else
  38. int kernel_delete_ipv6 (struct prefix *a, struct rib *b) { return 0; }
  39. #endif
  40. int kernel_delete_ipv6_old (struct prefix_ipv6 *dest, struct in6_addr *gate,
  41. unsigned int index, int flags, int table)
  42. { return 0; }
  43. int kernel_add_route (struct prefix_ipv4 *a, struct in_addr *b, int c, int d)
  44. { return 0; }
  45. int kernel_address_add_ipv4 (struct interface *a, struct connected *b)
  46. {
  47. zlog_debug ("%s", __func__);
  48. SET_FLAG (b->conf, ZEBRA_IFC_REAL);
  49. connected_add_ipv4 (a, 0, &b->address->u.prefix4, b->address->prefixlen,
  50. (b->destination ? &b->destination->u.prefix4 : NULL),
  51. NULL);
  52. return 0;
  53. }
  54. int kernel_address_delete_ipv4 (struct interface *a, struct connected *b)
  55. {
  56. zlog_debug ("%s", __func__);
  57. connected_delete_ipv4 (a, 0, &b->address->u.prefix4, b->address->prefixlen,
  58. (b->destination ? &b->destination->u.prefix4 : NULL));
  59. return 0;
  60. }
  61. void kernel_init (void) { return; }
  62. #ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
  63. #pragma weak route_read = kernel_init
  64. #else
  65. void route_read (void) { return; }
  66. #endif