00001 /* 00002 * $Id: parse_disposition.h 4720 2008-08-23 10:56:15Z henningw $ 00003 * 00004 * Copyright (C) 2001-2003 FhG Fokus 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 * 2003-09-09 created (bogdan) 00024 */ 00025 00026 /*! 00027 * \file 00028 * \brief Parse disposition header field 00029 * \ingroup parser 00030 */ 00031 00032 #ifndef _PARSE_DISPOSITION_H_ 00033 #define _PARSE_DISPOSITION_H_ 00034 00035 #include "../str.h" 00036 #include "msg_parser.h" 00037 00038 00039 #define get_content_disposition(_msg_) \ 00040 ((struct disposition*)((_msg_)->content_disposition->parsed)) 00041 00042 00043 struct disposition_param { 00044 str name; 00045 str body; 00046 int is_quoted; 00047 struct disposition_param *next; 00048 }; 00049 00050 00051 struct disposition { 00052 str type; 00053 struct disposition_param *params; 00054 }; 00055 00056 00057 /*! looks inside the message, gets the Content-Disposition hdr, parse it, builds 00058 * and fills a disposition structure for it what will be attached to hdr as 00059 * parsed link. 00060 * \return -1 on error, 0 on success, -1 when hdr not found 00061 */ 00062 int parse_content_disposition( struct sip_msg *msg ); 00063 00064 00065 /*! parse a string that supposed to be a disposition and fills up the structure 00066 * \return -1 on error, 0 on success */ 00067 int parse_disposition( str *s, struct disposition *disp); 00068 00069 00070 /*! Frees the entire disposition structure (params + itself) */ 00071 void free_disposition( struct disposition **disp); 00072 00073 /*! Prints recursive a disposition structure */ 00074 void print_disposition( struct disposition *disp); 00075 00076 #endif
1.5.6