1 /*
2  * Copyright (C) 2001-2003 FhG Fokus
3  *
4  * This file is part of Kamailio, a free SIP server.
5  *
6  * Kamailio is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version
10  *
11  * Kamailio is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
19  */
20 
21 /*! \file
22  * \brief Parser :: Parse CSEQ header
23  *
24  * \ingroup parser
25  */
26 
27 
28 
29 #ifndef PARSE_CSEQ
30 #define PARSE_CSEQ
31 
32 #include "../str.h"
33 
34 
35 struct cseq_body{
36 	int error;  /*!< Error code */
37 	str number; /*!< CSeq number */
38 	str method; /*!< Associated method */
39 	unsigned int method_id; /*!< Associated method ID */
40 };
41 
42 
43 /*! \brief casting macro for accessing CSEQ body */
44 #define get_cseq(p_msg) ((struct cseq_body*)(p_msg)->cseq->parsed)
45 
46 
47 /*! \brief
48  * Parse CSeq header field
49  */
50 char* parse_cseq(char* const buf, const char* const end, struct cseq_body* const cb);
51 
52 
53 /*! \brief
54  * Free all associated memory
55  */
56 void free_cseq(struct cseq_body* const cb);
57 
58 
59 #endif
60