parse_date.h

Go to the documentation of this file.
00001 /*
00002  * $Id$
00003  *
00004  * Copyright (c) 2007 iptelorg GmbH
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_DATE
00032 #define PARSE_DATE
00033 
00034 #include <time.h>
00035 #include "msg_parser.h"
00036 
00037 #define RFC1123DATELENGTH       29
00038 
00039 struct date_body{
00040         int error;  /* Error code */
00041         struct tm date;
00042 };
00043 
00044 
00045 /* casting macro for accessing DATE body */
00046 #define get_date(p_msg) ((struct date_body*)(p_msg)->date->parsed)
00047 
00048 
00049 /*
00050  * Parse Date header field
00051  */
00052 void parse_date(char *buf, char *end, struct date_body *db);
00053 int parse_date_header(struct sip_msg *msg);
00054 
00055 /*
00056  * Free all associated memory
00057  */
00058 void free_date(struct date_body *db);
00059 
00060 
00061 #endif