pim_msg.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. PIM for Quagga
  3. Copyright (C) 2008 Everton da Silva Marques
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program 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 this program; see the file COPYING; if not, write to the
  14. Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
  15. MA 02110-1301 USA
  16. $QuaggaId: $Format:%an, %ai, %h$ $
  17. */
  18. #ifndef PIM_MSG_H
  19. #define PIM_MSG_H
  20. #include <netinet/in.h>
  21. /*
  22. Number Description
  23. ---------- ------------------
  24. 0 Reserved
  25. 1 IP (IP version 4)
  26. 2 IP6 (IP version 6)
  27. From:
  28. http://www.iana.org/assignments/address-family-numbers
  29. */
  30. #define PIM_MSG_ADDRESS_FAMILY_IPV4 (1)
  31. void pim_msg_build_header(uint8_t *pim_msg, int pim_msg_size,
  32. uint8_t pim_msg_type);
  33. uint8_t *pim_msg_addr_encode_ipv4_ucast(uint8_t *buf,
  34. int buf_size,
  35. struct in_addr addr);
  36. uint8_t *pim_msg_addr_encode_ipv4_group(uint8_t *buf,
  37. int buf_size,
  38. struct in_addr addr);
  39. uint8_t *pim_msg_addr_encode_ipv4_source(uint8_t *buf,
  40. int buf_size,
  41. struct in_addr addr);
  42. #endif /* PIM_MSG_H */