parse_event.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * Copyright (C) 2001-2003 FhG Fokus
  3. *
  4. * This file is part of ser, a free SIP server.
  5. *
  6. * ser is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version
  10. *
  11. * ser is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. /*! \file
  21. * \brief Parser :: Event header field body parser.
  22. *
  23. *
  24. * \ingroup parser
  25. */
  26. #ifndef PARSE_EVENT_H
  27. #define PARSE_EVENT_H
  28. #include "../str.h"
  29. #include "hf.h"
  30. #include "parse_param.h"
  31. /* Recognized event types */
  32. enum event_type {
  33. EVENT_OTHER = 0,
  34. EVENT_PRESENCE,
  35. EVENT_PRESENCE_WINFO,
  36. EVENT_SIP_PROFILE,
  37. EVENT_XCAP_CHANGE,
  38. EVENT_DIALOG,
  39. EVENT_MESSAGE_SUMMARY,
  40. EVENT_UA_PROFILE
  41. };
  42. struct event_params {
  43. param_hooks_t hooks; /* Well known dialog package params */
  44. param_t* list; /* Linked list of all parsed parameters */
  45. };
  46. typedef struct event {
  47. enum event_type type; /* Parsed variant */
  48. str name; /* Original string representation */
  49. struct event_params params;
  50. } event_t;
  51. /*
  52. * Parse Event HF body
  53. */
  54. int parse_event(struct hdr_field* hf);
  55. /*
  56. * Release memory
  57. */
  58. void free_event(event_t** e);
  59. /*
  60. * Print structure, for debugging only
  61. */
  62. void print_event(event_t* e);
  63. int event_parser(char* s, int l, event_t* e);
  64. #endif /* PARSE_EVENT_H */