config_parser.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * Asterisk -- An open source telephony toolkit.
  3. *
  4. * Copyright (C) 2010, Digium, Inc.
  5. *
  6. * See http://www.asterisk.org for more information about
  7. * the Asterisk project. Please do not directly contact
  8. * any of the maintainers of this project for assistance;
  9. * the project provides a web site, mailing lists and IRC
  10. * channels for your use.
  11. *
  12. * This program is free software, distributed under the terms of
  13. * the GNU General Public License Version 2. See the LICENSE file
  14. * at the top of the source tree.
  15. */
  16. /*!
  17. * \file
  18. * \brief sip.conf parser header file
  19. */
  20. #include "sip.h"
  21. #ifndef _SIP_CONF_PARSE_H
  22. #define _SIP_CONF_PARSE_H
  23. /*!
  24. * \brief Parse register=> line in sip.conf
  25. *
  26. * \retval 0 on success
  27. * \retval -1 on failure
  28. */
  29. int sip_parse_register_line(struct sip_registry *reg, int default_expiry, const char *value, int lineno);
  30. /*!
  31. * \brief parses a config line for a host with a transport
  32. *
  33. * An example input would be:
  34. * <code>tls://www.google.com:8056</code>
  35. *
  36. * \retval 0 on success
  37. * \retval -1 on failure
  38. */
  39. int sip_parse_host(char *line, int lineno, char **hostname, int *portnum, enum ast_transport *transport);
  40. /*! \brief Parse the comma-separated nat= option values
  41. * \param value The comma-separated value
  42. * \param mask An array of ast_flags that will be set by this function
  43. * and used as a mask for copying the flags later
  44. * \param flags An array of ast_flags that will be set by this function
  45. *
  46. * \note The nat-related values in both mask and flags are assumed to empty. This function
  47. * will treat the first "yes" or "no" value in a list of values as overiding all other values
  48. * and will stop parsing. Auto values will override their non-auto counterparts.
  49. */
  50. void sip_parse_nat_option(const char *value, struct ast_flags *mask, struct ast_flags *flags);
  51. /*!
  52. * \brief register config parsing tests
  53. */
  54. void sip_config_parser_register_tests(void);
  55. /*!
  56. * \brief unregister config parsing tests
  57. */
  58. void sip_config_parser_unregister_tests(void);
  59. #endif