parse_event.h 1.8 KB

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