SIP Witch 1.9.15
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
osip_body.h
Go to the documentation of this file.
1 /*
2  The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-)
3  Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 
20 
21 #ifndef _OSIP_BODY_H_
22 #define _OSIP_BODY_H_
23 
25 
42 typedef struct osip_body osip_body_t;
43 
48 struct osip_body {
49  char *body;
50  size_t length;
54 };
55 
56 
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 
65  int osip_body_init (osip_body_t ** body);
70  void osip_body_free (osip_body_t * body);
77  int osip_body_parse (osip_body_t * body, const char *buf, size_t length);
83  int osip_body_clone (const osip_body_t * body, osip_body_t ** dest);
90  int osip_body_parse_mime (osip_body_t * body, const char *buf, size_t length);
97  int osip_body_to_str (const osip_body_t * body, char **dest, size_t * length);
98 
104  int osip_body_set_contenttype (osip_body_t * body, const char *hvalue);
105 
112  int osip_body_set_header (osip_body_t * body, const char *hname, const char *hvalue);
113 
114 #ifdef __cplusplus
115 }
116 #endif
117 
118 #endif
Structure for referencing a list of elements.
Definition: osip_list.h:82
size_t length
length of data
Definition: osip_body.h:50
Structure for holding Body.
Definition: osip_body.h:48
osip_content_type_t * content_type
Content-Type (when mime is used)
Definition: osip_body.h:52
Definition of the Content-Type header.
int osip_body_set_header(osip_body_t *body, const char *hname, const char *hvalue)
Add a header in the osip_body_t element.
int osip_body_init(osip_body_t **body)
Allocate a osip_body_t element.
void osip_body_free(osip_body_t *body)
Free a osip_body_t element.
int osip_body_parse_mime(osip_body_t *body, const char *buf, size_t length)
Parse a osip_body_t element.
int osip_body_set_contenttype(osip_body_t *body, const char *hvalue)
Set the Content-Type header in the osip_body_t element.
int osip_body_parse(osip_body_t *body, const char *buf, size_t length)
Parse a osip_body_t element.
char * body
buffer containing data
Definition: osip_body.h:49
int osip_body_to_str(const osip_body_t *body, char **dest, size_t *length)
Get a string representation of a osip_body_t element.
oSIP osip_content_type header definition.
osip_list_t * headers
List of headers (when mime is used)
Definition: osip_body.h:51
int osip_body_clone(const osip_body_t *body, osip_body_t **dest)
Clone a osip_body_t element.