srtp.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Asterisk -- An open source telephony toolkit.
  3. *
  4. * Copyright (C) 2006 - 2007, Mikael Magnusson
  5. *
  6. * Mikael Magnusson <mikma@users.sourceforge.net>
  7. *
  8. * See http://www.asterisk.org for more information about
  9. * the Asterisk project. Please do not directly contact
  10. * any of the maintainers of this project for assistance;
  11. * the project provides a web site, mailing lists and IRC
  12. * channels for your use.
  13. *
  14. * This program is free software, distributed under the terms of
  15. * the GNU General Public License Version 2. See the LICENSE file
  16. * at the top of the source tree.
  17. */
  18. /*! \file sip_srtp.h
  19. *
  20. * \brief SIP Secure RTP (SRTP)
  21. *
  22. * Specified in RFC 3711
  23. *
  24. * \author Mikael Magnusson <mikma@users.sourceforge.net>
  25. */
  26. #ifndef _SIP_SRTP_H
  27. #define _SIP_SRTP_H
  28. #include "sdp_crypto.h"
  29. /* SRTP flags */
  30. #define SRTP_ENCR_OPTIONAL (1 << 1) /* SRTP encryption optional */
  31. #define SRTP_CRYPTO_ENABLE (1 << 2)
  32. #define SRTP_CRYPTO_OFFER_OK (1 << 3)
  33. #define SRTP_CRYPTO_TAG_32 (1 << 4)
  34. #define SRTP_CRYPTO_TAG_80 (1 << 5)
  35. /*! \brief structure for secure RTP audio */
  36. struct sip_srtp {
  37. unsigned int flags;
  38. struct sdp_crypto *crypto;
  39. };
  40. /*!
  41. * \brief allocate a sip_srtp structure
  42. * \retval a new malloc'd sip_srtp structure on success
  43. * \retval NULL on failure
  44. */
  45. struct sip_srtp *sip_srtp_alloc(void);
  46. /*!
  47. * \brief free a sip_srtp structure
  48. * \param srtp a sip_srtp structure
  49. */
  50. void sip_srtp_destroy(struct sip_srtp *srtp);
  51. #endif /* _SIP_SRTP_H */