parser/parse_event.h
a054d7d5
 /*
c32feee5
  * Copyright (C) 2001-2003 FhG Fokus
7dd0b342
  *
07ca8c05
  * This file is part of Kamailio, a free SIP server.
7dd0b342
  *
07ca8c05
  * Kamailio is free software; you can redistribute it and/or modify
7dd0b342
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version
  *
07ca8c05
  * Kamailio is distributed in the hope that it will be useful,
7dd0b342
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License 
  * along with this program; if not, write to the Free Software 
9e1ff448
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
a054d7d5
  */
 
7b7456b0
 /*! \file
  * \brief Parser :: Event header field body parser.
  *
  *
  * \ingroup parser
  */
 
7dd0b342
 
a054d7d5
 #ifndef PARSE_EVENT_H
 #define PARSE_EVENT_H
 
 #include "../str.h"
 #include "hf.h"
1ee365fa
 #include "parse_param.h"
 
 /* Recognized event types */
 enum event_type {
 	EVENT_OTHER = 0,
 	EVENT_PRESENCE,
 	EVENT_PRESENCE_WINFO,
 	EVENT_SIP_PROFILE,
 	EVENT_XCAP_CHANGE,
 	EVENT_DIALOG,
081ed660
 	EVENT_MESSAGE_SUMMARY,
 	EVENT_UA_PROFILE
1ee365fa
 };
 
 
 struct event_params {
80b1421c
 	param_hooks_t hooks; /* Well known dialog package params */
1ee365fa
 	param_t* list; /* Linked list of all parsed parameters */
 };
a054d7d5
 
 
 typedef struct event {
1ee365fa
 	enum event_type type; /* Parsed variant */
 	str name;             /* Original string representation */
 	struct event_params params;
a054d7d5
 } event_t;
 
 
 /*
  * Parse Event HF body
  */
1ee365fa
 int parse_event(struct hdr_field* hf);
a054d7d5
 
 
 /*
  * Release memory
  */
1ee365fa
 void free_event(event_t** e);
a054d7d5
 
 
 /*
  * Print structure, for debugging only
  */
1ee365fa
 void print_event(event_t* e);
 
 int event_parser(char* s, int l, event_t* e);
a054d7d5
 
 
 #endif /* PARSE_EVENT_H */