ipforward_ews.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Ipforward value get function for NEC EWS.
  3. * Copyright (C) 1997 Kunihiro Ishiguro
  4. *
  5. * This file is part of GNU Zebra.
  6. *
  7. * GNU Zebra 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. * GNU Zebra 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 GNU Zebra; 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. int
  24. ipforward ()
  25. {
  26. int fd;
  27. char buf[BUFSIZ];
  28. struct mioc_rksym rks;
  29. fd = open ("/dev/kmem", O_RDWR);
  30. if (fd < 0) {
  31. /* need logging here */
  32. return -1;
  33. }
  34. rks.mirk_symname = "ipforwarding";
  35. rks.mirk_buf = buf;
  36. rks.mirk_buflen = sizeof (int);
  37. if (ioctl (fd, MIOC_READKSYM, &rks) < 0) {
  38. /* need logging here */
  39. return -1;
  40. }
  41. close (fd);
  42. return *(int *)buf;
  43. }
  44. int
  45. ipforward_on ()
  46. {
  47. ;
  48. }
  49. int
  50. ipforward_off ()
  51. {
  52. ;
  53. }