OSDN Git Service

Add MS7619SE
[uclinux-h8/uClinux-dist.git] / user / ser / parser / parse_disposition.h
1 /*
2  * $Id: parse_disposition.h,v 1.3 2004/08/24 09:01:25 janakj Exp $
3  *
4  *
5  * Copyright (C) 2001-2003 FhG Fokus
6  *
7  * This file is part of ser, a free SIP server.
8  *
9  * ser is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version
13  *
14  * For a license to use the ser software under conditions
15  * other than those described here, or to purchase support for this
16  * software, please contact iptel.org by e-mail at the following addresses:
17  *    info@iptel.org
18  *
19  * ser is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License 
25  * along with this program; if not, write to the Free Software 
26  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
27  *
28  * History:
29  * 2003-09-09 created (bogdan)
30  */
31
32 #ifndef _PARSE_DISPOSITION_H_
33 #define _PARSE_DISPOSITION_H_
34
35 #include "../str.h"
36 #include "msg_parser.h"
37
38
39 #define get_content_disposition(_msg_) \
40         ((struct disposition*)((_msg_)->content_disposition->parsed))
41
42
43 struct disposition_param {
44         str name;
45         str body;
46         int is_quoted;
47         struct disposition_param *next;
48 };
49
50
51 struct disposition {
52         str type;
53         struct disposition_param *params;
54 };
55
56
57 /* looks inside the message, gets the Content-Disposition hdr, parse it, builds
58  * and fills a disposition structure for it what will be attached to hdr as
59  * parsed link.
60  * Returns:  -1 : error
61  *            0 : success
62  *            1 : hdr not found
63  */
64 int parse_content_disposition( struct sip_msg *msg );
65
66
67 /* parse a string that supposed to be a disposition and fills up the structure
68  * Returns: -1 : error
69  *           o : success */
70 int parse_disposition( str *s, struct disposition *disp);
71
72
73 /* Frees the entire disposition structure (params + itself) */
74 void free_disposition( struct disposition **disp);
75
76 /* Prints recursive a disposition structure */
77 void print_disposition( struct disposition *disp);
78
79 #endif
80