parse_sst.h

Go to the documentation of this file.
00001 /*
00002  * $Id$
00003  *
00004  * Copyright (c) 2006 SOMA Networks, Inc. <http://www.somanetworks.com/>
00005  *
00006  * This file is part of Kamailio, a free SIP server.
00007  *
00008  * Kamailio 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  * Kamailio 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  * History:
00023  * --------
00024  * 2006-02-17 Initial revision (dhsueh@somanetworks.com)
00025  */
00026 
00033 #ifndef PARSE_SST_H
00034 #define PARSE_SST_H 1
00035 
00036 
00037 #include "../../parser/msg_parser.h"
00038 #include "../../parser/hf.h"
00039 
00040 
00044 enum sst_refresher {
00045         sst_refresher_unspecified,
00046         sst_refresher_uac,
00047         sst_refresher_uas,
00048 };
00049 
00050 
00055 struct session_expires {
00056         hf_parsed_free_f hfree;       /* function to free the content */
00057         unsigned            interval; /* in seconds */
00058         enum sst_refresher  refresher;
00059 };
00060 
00061 
00062 enum parse_sst_result {
00063         parse_sst_success,
00064         parse_sst_header_not_found,     /* no header */
00065         parse_sst_no_value,                     /* no interval specified */
00066 #if NOT_IMPLEMENTED_YET
00067         parse_sst_duplicate,            /* multiple s-e / x / min-se headers found */
00068 #endif
00069         parse_sst_out_of_mem,
00070         parse_sst_parse_error,          /* something puked */
00071 };
00072 
00073 
00077 struct session_expires *
00078 malloc_session_expires( void );
00079 
00080 
00084 void
00085 free_session_expires( struct session_expires * );
00086 
00087 
00110 enum parse_sst_result
00111 parse_session_expires( struct sip_msg *msg, struct session_expires *se );
00112 
00113 
00125 enum parse_sst_result
00126 parse_min_se( struct sip_msg *msg, unsigned *min_se );
00127 
00128 
00129 #endif /* ! PARSE_SST_H */