libosip  5.3.0
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-2020 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 #ifndef _OSIP_BODY_H_
21 #define _OSIP_BODY_H_
22 
24 
41 typedef struct osip_body osip_body_t;
42 
47 struct osip_body {
48  char *body;
49  size_t length;
53 };
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
63 int osip_body_init(osip_body_t **body);
68 void osip_body_free(osip_body_t *body);
75 int osip_body_parse(osip_body_t *body, const char *buf, size_t length);
81 int osip_body_clone(const osip_body_t *body, osip_body_t **dest);
88 int osip_body_parse_mime(osip_body_t *body, const char *buf, size_t length);
95 int osip_body_to_str(const osip_body_t *body, char **dest, size_t *length);
96 
102 int osip_body_set_contenttype(osip_body_t *body, const char *hvalue);
103 
110 int osip_body_set_header(osip_body_t *body, const char *hname, const char *hvalue);
111 
112 #ifdef __cplusplus
113 }
114 #endif
116 #endif
int osip_body_clone(const osip_body_t *body, osip_body_t **dest)
Definition: osip_body.c:73
void osip_body_free(osip_body_t *body)
Definition: osip_body.c:491
int osip_body_parse(osip_body_t *body, const char *buf, size_t length)
Definition: osip_body.c:295
int osip_body_to_str(const osip_body_t *body, char **dest, size_t *length)
Definition: osip_body.c:372
int osip_body_parse_mime(osip_body_t *body, const char *buf, size_t length)
Definition: osip_body.c:316
int osip_body_init(osip_body_t **body)
Definition: osip_body.c:30
int osip_body_set_header(osip_body_t *body, const char *hname, const char *hvalue)
Definition: osip_body.c:161
int osip_body_set_contenttype(osip_body_t *body, const char *hvalue)
Definition: osip_body.c:136
oSIP osip_content_type header definition.
Definition: osip_body.h:47
osip_content_type_t * content_type
Definition: osip_body.h:51
char * body
Definition: osip_body.h:48
osip_list_t * headers
Definition: osip_body.h:50
size_t length
Definition: osip_body.h:49
Definition: osip_content_type.h:46
Definition: osip_list.h:87