parse_event.h

Go to the documentation of this file.
00001 /*
00002  * $Id$
00003  *
00004  * Copyright (C) 2001-2003 FhG Fokus
00005  *
00006  * This file is part of ser, a free SIP server.
00007  *
00008  * ser is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or
00011  * (at your option) any later version
00012  *
00013  * ser is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License 
00019  * along with this program; if not, write to the Free Software 
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021  */
00022 
00031 #ifndef PARSE_EVENT_H
00032 #define PARSE_EVENT_H
00033 
00034 #include "../str.h"
00035 #include "hf.h"
00036 #include "parse_param.h"
00037 
00038 /* Recognized event types */
00039 enum event_type {
00040         EVENT_OTHER = 0,
00041         EVENT_PRESENCE,
00042         EVENT_PRESENCE_WINFO,
00043         EVENT_SIP_PROFILE,
00044         EVENT_XCAP_CHANGE,
00045         EVENT_DIALOG,
00046         EVENT_MESSAGE_SUMMARY,
00047         EVENT_UA_PROFILE
00048 };
00049 
00050 
00051 struct event_params {
00052         param_hooks_t hooks; /* Well known dialog package params */
00053         param_t* list; /* Linked list of all parsed parameters */
00054 };
00055 
00056 
00057 typedef struct event {
00058         enum event_type type; /* Parsed variant */
00059         str name;             /* Original string representation */
00060         struct event_params params;
00061 } event_t;
00062 
00063 
00064 /*
00065  * Parse Event HF body
00066  */
00067 int parse_event(struct hdr_field* hf);
00068 
00069 
00070 /*
00071  * Release memory
00072  */
00073 void free_event(event_t** e);
00074 
00075 
00076 /*
00077  * Print structure, for debugging only
00078  */
00079 void print_event(event_t* e);
00080 
00081 int event_parser(char* s, int l, event_t* e);
00082 
00083 
00084 #endif /* PARSE_EVENT_H */