kernel_null.c 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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_add_route (struct prefix_ipv4 *a, struct in_addr *b, int c, int d)
  41. { return 0; }
  42. int kernel_address_add_ipv4 (struct interface *a, struct connected *b)
  43. {
  44. zlog_debug ("%s", __func__);
  45. SET_FLAG (b->conf, ZEBRA_IFC_REAL);
  46. connected_add_ipv4 (a, 0, &b->address->u.prefix4, b->address->prefixlen,
  47. (b->destination ? &b->destination->u.prefix4 : NULL),
  48. NULL);
  49. return 0;
  50. }
  51. int kernel_address_delete_ipv4 (struct interface *a, struct connected *b)
  52. {
  53. zlog_debug ("%s", __func__);
  54. connected_delete_ipv4 (a, 0, &b->address->u.prefix4, b->address->prefixlen,
  55. (b->destination ? &b->destination->u.prefix4 : NULL));
  56. return 0;
  57. }
  58. void kernel_init (void) { return; }
  59. #ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
  60. #pragma weak route_read = kernel_init
  61. #else
  62. void route_read (void) { return; }
  63. #endif