kernel_null.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. #include "zebra/rib.h"
  29. int kernel_route_rib (struct prefix *a, struct rib *old, struct rib *new) { return 0; }
  30. int kernel_add_route (struct prefix_ipv4 *a, struct in_addr *b, int c, int d)
  31. { return 0; }
  32. int kernel_address_add_ipv4 (struct interface *a, struct connected *b)
  33. {
  34. zlog_debug ("%s", __func__);
  35. SET_FLAG (b->conf, ZEBRA_IFC_REAL);
  36. connected_add_ipv4 (a, 0, &b->address->u.prefix4, b->address->prefixlen,
  37. (b->destination ? &b->destination->u.prefix4 : NULL),
  38. NULL);
  39. return 0;
  40. }
  41. int kernel_address_delete_ipv4 (struct interface *a, struct connected *b)
  42. {
  43. zlog_debug ("%s", __func__);
  44. connected_delete_ipv4 (a, 0, &b->address->u.prefix4, b->address->prefixlen,
  45. (b->destination ? &b->destination->u.prefix4 : NULL));
  46. return 0;
  47. }
  48. void kernel_init (struct zebra_vrf *zvrf) { return; }
  49. void kernel_terminate (struct zebra_vrf *zvrf) { return; }
  50. #ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
  51. #pragma weak route_read = kernel_init
  52. #else
  53. void route_read (struct zebra_vrf *zvrf) { return; }
  54. #endif