zebra-guile.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /* Zebra guile interface.
  2. Copyright (C) 1998, 99 Kunihiro Ishiguro
  3. This file is part of GNU Zebra.
  4. GNU Zebra is free software; you can redistribute it and/or modify it
  5. under the terms of the GNU General Public License as published by the
  6. Free Software Foundation; either version 2, or (at your option) any
  7. later version.
  8. GNU Zebra is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GNU Zebra; see the file COPYING. If not, write to the Free
  14. Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  15. 02111-1307, USA. */
  16. #include <libguile.h>
  17. #include "zebra-guile.h"
  18. #include "zebra.h"
  19. #include "thread.h"
  20. struct thread *master;
  21. static void
  22. init_libzebra ()
  23. {
  24. void cmd_init();
  25. void vty_init();
  26. void memory_init();
  27. cmd_init (1);
  28. vty_init ();
  29. memory_init ();
  30. }
  31. /* Install scheme procudures. */
  32. void
  33. init_zebra_guile ()
  34. {
  35. init_libzebra ();
  36. init_bgp ();
  37. #if 0
  38. init_zebra ();
  39. init_rip ();
  40. init_ospf ();
  41. #endif /* 0 */
  42. }
  43. static void
  44. inner_main (void *closure, int argc, char **argv)
  45. {
  46. /* Install zebra related scheme procedures. */
  47. init_zebra_guile ();
  48. /* Invoke interpreter. */
  49. scm_shell (argc, argv);
  50. }
  51. int
  52. main (int argc, char **argv)
  53. {
  54. scm_boot_guile (argc, argv, inner_main, 0);
  55. return 0; /* Not reached */
  56. }