zebra_fpm_private.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Private header file for the zebra FPM module.
  3. *
  4. * Copyright (C) 2012 by Open Source Routing.
  5. * Copyright (C) 2012 by Internet Systems Consortium, Inc. ("ISC")
  6. *
  7. * This file is part of GNU Zebra.
  8. *
  9. * GNU Zebra is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2, or (at your option)
  12. * any later version.
  13. *
  14. * GNU Zebra is distributed in the hope that it will be useful, but
  15. * WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with GNU Zebra; see the file COPYING. If not, write to the
  21. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  22. * Boston, MA 02111-1307, USA.
  23. */
  24. #ifndef _ZEBRA_FPM_PRIVATE_H
  25. #define _ZEBRA_FPM_PRIVATE_H
  26. #include "zebra/debug.h"
  27. #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
  28. #define zfpm_debug(...) \
  29. do { \
  30. if (IS_ZEBRA_DEBUG_FPM) zlog_debug("FPM: " __VA_ARGS__); \
  31. } while(0)
  32. #elif defined __GNUC__
  33. #define zfpm_debug(_args...) \
  34. do { \
  35. if (IS_ZEBRA_DEBUG_FPM) zlog_debug("FPM: " _args); \
  36. } while(0)
  37. #else
  38. static inline void zfpm_debug(const char *format, ...) { return; }
  39. #endif
  40. /*
  41. * Externs
  42. */
  43. extern int
  44. zfpm_netlink_encode_route (int cmd, rib_dest_t *dest, struct rib *rib,
  45. char *in_buf, size_t in_buf_len);
  46. extern int
  47. zfpm_protobuf_encode_route (rib_dest_t *dest, struct rib *rib,
  48. uint8_t *in_buf, size_t in_buf_len);
  49. extern struct rib *zfpm_route_for_update (rib_dest_t *dest);
  50. #endif /* _ZEBRA_FPM_PRIVATE_H */