parser/parse_event.h
a054d7d5
 /*
  * $Id$
  *
c32feee5
  * Copyright (C) 2001-2003 FhG Fokus
7dd0b342
  *
  * This file is part of ser, a free SIP server.
  *
  * ser is free software; you can redistribute it and/or modify
  * 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
  *
  * ser is distributed in the hope that it will be useful,
  * 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 
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  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,
 	EVENT_MESSAGE_SUMMARY
 };
 
 
 struct event_params {
 	struct event_dialog_hooks dialog; /* Well known dialog package params */
 	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 */