headers.h 35.9 KB
Newer Older
jehan's avatar
jehan committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
/*
	belle-sip - SIP (RFC3261) library.
    Copyright (C) 2010  Belledonne Communications SARL

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef HEADERS_H_
#define HEADERS_H_

22
#include "belle-sip/defs.h"
jehan's avatar
jehan committed
23
#include "belle-sip/uri.h"
Ghislain MARY's avatar
Ghislain MARY committed
24
#include "belle-sip/utils.h"
25

Simon Morlat's avatar
Simon Morlat committed
26
#include <time.h>
27 28


jehan's avatar
jehan committed
29 30 31 32 33 34 35
/***************************************************************************************
 * header address
 *
 **************************************************************************************/

typedef struct _belle_sip_header_address belle_sip_header_address_t;

Sylvain Berfini's avatar
Sylvain Berfini committed
36
BELLESIP_EXPORT belle_sip_header_address_t* belle_sip_header_address_new();
jehan's avatar
jehan committed
37 38 39 40 41 42 43
/*
 * creates an address from a display name and an uri
 * Note the uri not copied but only its ref count is incremented
 * @param  display display name. May be null.
 * @param uri uri set to the newly created header_address
 * @return
 * */
44
BELLESIP_EXPORT belle_sip_header_address_t* belle_sip_header_address_create(const char* display, belle_sip_uri_t* uri);
jehan's avatar
jehan committed
45

46
BELLESIP_EXPORT belle_sip_header_address_t* belle_sip_header_address_parse (const char* address) ;
jehan's avatar
jehan committed
47 48 49 50

/**
 *
 */
51
BELLESIP_EXPORT belle_sip_uri_t* belle_sip_header_address_get_uri(const belle_sip_header_address_t* address);
jehan's avatar
jehan committed
52 53 54
/**
 *
 */
55
BELLESIP_EXPORT void belle_sip_header_address_set_uri(belle_sip_header_address_t* address, belle_sip_uri_t* uri);
jehan's avatar
jehan committed
56 57 58 59

/**
 *
 */
60
BELLESIP_EXPORT const char* belle_sip_header_address_get_displayname(const belle_sip_header_address_t* address);
jehan's avatar
jehan committed
61 62 63
/**
 *
 */
Sylvain Berfini's avatar
Sylvain Berfini committed
64
BELLESIP_EXPORT void belle_sip_header_address_set_displayname(belle_sip_header_address_t* address, const char* uri);
jehan's avatar
jehan committed
65

66 67 68
#define BELLE_SIP_HEADER_ADDRESS(t) BELLE_SIP_CAST(t,belle_sip_header_address_t)


jehan's avatar
jehan committed
69 70 71 72 73 74 75

/***************************************************************************************
 * header common
 *
 **************************************************************************************/

typedef struct _belle_sip_header belle_sip_header_t;
76
BELLESIP_EXPORT belle_sip_header_t* belle_sip_header_create (const char* name,const char* value);
Ghislain MARY's avatar
Ghislain MARY committed
77
BELLESIP_EXPORT const char* belle_sip_header_get_name (const belle_sip_header_t* obj);
78
BELLESIP_EXPORT void belle_sip_header_set_name (belle_sip_header_t* obj,const char* value);
79
BELLESIP_EXPORT belle_sip_error_code belle_sip_header_marshal(belle_sip_header_t* header, char* buff, size_t buff_size, size_t *offset);
Simon Morlat's avatar
Simon Morlat committed
80
BELLESIP_EXPORT const char *belle_sip_header_get_unparsed_value(belle_sip_header_t* obj);
jehan's avatar
jehan committed
81 82

#define BELLE_SIP_HEADER(t) BELLE_SIP_CAST(t,belle_sip_header_t)
83 84 85 86 87 88 89 90 91 92

/******************************
 *
 * Allow header inherit from header
 *
 ******************************/
typedef struct _belle_sip_header_allow belle_sip_header_allow_t;

belle_sip_header_allow_t* belle_sip_header_allow_new();

93 94
BELLESIP_EXPORT belle_sip_header_allow_t* belle_sip_header_allow_parse (const char* allow) ;
BELLESIP_EXPORT belle_sip_header_allow_t* belle_sip_header_allow_create (const char* methods) ;
jehan's avatar
jehan committed
95

96
BELLESIP_EXPORT const char* belle_sip_header_allow_get_method(const belle_sip_header_allow_t* allow);
Ghislain MARY's avatar
Ghislain MARY committed
97
BELLESIP_EXPORT void belle_sip_header_allow_set_method(belle_sip_header_allow_t* allow,const char* method);
98
#define BELLE_SIP_HEADER_ALLOW(t) BELLE_SIP_CAST(t,belle_sip_header_allow_t)
jehan's avatar
jehan committed
99
#define BELLE_SIP_ALLOW "Allow"
100

101
/***********************
jehan's avatar
jehan committed
102
 * Contact header object
103
 ************************/
jehan's avatar
jehan committed
104 105
typedef struct _belle_sip_header_contact belle_sip_header_contact_t;

106
BELLESIP_EXPORT belle_sip_header_contact_t* belle_sip_header_contact_new();
jehan's avatar
jehan committed
107 108


109
BELLESIP_EXPORT belle_sip_header_contact_t* belle_sip_header_contact_parse (const char* contact) ;
jehan's avatar
jehan committed
110

Sylvain Berfini's avatar
Sylvain Berfini committed
111
BELLESIP_EXPORT belle_sip_header_contact_t* belle_sip_header_contact_create (const belle_sip_header_address_t* contact) ;
jehan's avatar
jehan committed
112

jehan's avatar
jehan committed
113 114 115 116 117 118

/**
* Returns the value of the expires parameter or -1 if no expires parameter was specified or if the parameter value cannot be parsed as an int.
*@returns value of the expires parameter measured in delta-seconds, O implies removal of Registration specified in Contact Header.
*
*/
119
 BELLESIP_EXPORT int	belle_sip_header_contact_get_expires(const belle_sip_header_contact_t* contact);
jehan's avatar
jehan committed
120 121 122 123
/**
 * Returns the value of the q-value parameter of this ContactHeader. The q-value parameter indicates the relative preference amongst a set of locations. q-values are decimal numbers from 0 to 1, with higher values indicating higher preference.
 * @return the q-value parameter of this ContactHeader, -1 if the q-value is not set.
 */
124
 BELLESIP_EXPORT float	belle_sip_header_contact_get_qvalue(const belle_sip_header_contact_t* contact);
jehan's avatar
jehan committed
125 126 127 128
 /**
  * Returns a boolean value that indicates if the contact header has the format of Contact: *.
  * @return true if this is a wildcard address, false otherwise.
  */
Ghislain MARY's avatar
Ghislain MARY committed
129
 BELLESIP_EXPORT unsigned int belle_sip_header_contact_is_wildcard(const belle_sip_header_contact_t* contact);
jehan's avatar
jehan committed
130 131 132
 /**
 *
 */
133
 BELLESIP_EXPORT int belle_sip_header_contact_set_expires(belle_sip_header_contact_t* contact, int expires);
jehan's avatar
jehan committed
134 135 136
/**
 *  Sets the qValue value of the Name Address.
 */
Ghislain MARY's avatar
Ghislain MARY committed
137
 BELLESIP_EXPORT int belle_sip_header_contact_set_qvalue(belle_sip_header_contact_t* contact, float qvalue);
jehan's avatar
jehan committed
138 139 140 141
/**
 * Sets a wildcard on this contact address that is "*" is assigned to the contact header so that the header will have the format of Contact: *.
 *
 */
Ghislain MARY's avatar
Ghislain MARY committed
142
 BELLESIP_EXPORT void belle_sip_header_contact_set_wildcard(belle_sip_header_contact_t* contact,unsigned int is_wildcard);
jehan's avatar
jehan committed
143 144 145 146
 /** Contact heaader equality function
  * @return 0 if not equals
  *
  * */
Ghislain MARY's avatar
Ghislain MARY committed
147
 BELLESIP_EXPORT unsigned int belle_sip_header_contact_equals(const belle_sip_header_contact_t* a,const belle_sip_header_contact_t* b);
jehan's avatar
jehan committed
148

149 150 151 152
 /** Contact heaader equality function, same as #belle_sip_header_contact_equals but return 0 if equals, very useful with #belle_sip_list
   * @return 0 if equals
   *
   * */
Ghislain MARY's avatar
Ghislain MARY committed
153
 BELLESIP_EXPORT unsigned int belle_sip_header_contact_not_equals(const belle_sip_header_contact_t* a,const belle_sip_header_contact_t* b);
154 155


156
#define BELLE_SIP_RANDOM_TAG ((const char*)-1)
157
#define BELLE_SIP_HEADER_CONTACT(t) BELLE_SIP_CAST(t,belle_sip_header_contact_t)
jehan's avatar
jehan committed
158
#define BELLE_SIP_CONTACT "Contact"
159
 /******************************
jehan's avatar
jehan committed
160 161
 * From header object inherent from header_address
 *
162
 ******************************/
jehan's avatar
jehan committed
163 164
 typedef struct _belle_sip_header_from belle_sip_header_from_t;

Ghislain MARY's avatar
Ghislain MARY committed
165
 BELLESIP_EXPORT belle_sip_header_from_t* belle_sip_header_from_new();
jehan's avatar
jehan committed
166

167
 BELLESIP_EXPORT belle_sip_header_from_t* belle_sip_header_from_create(const belle_sip_header_address_t* address, const char *tag);
jehan's avatar
jehan committed
168

169
 BELLESIP_EXPORT belle_sip_header_from_t* belle_sip_header_from_create2(const char *address, const char *tag);
jehan's avatar
jehan committed
170

171
 BELLESIP_EXPORT belle_sip_header_from_t* belle_sip_header_from_parse(const char* from) ;
jehan's avatar
jehan committed
172

Ghislain MARY's avatar
Ghislain MARY committed
173
 BELLESIP_EXPORT void belle_sip_header_from_set_tag(belle_sip_header_from_t* from, const char* tag);
jehan's avatar
jehan committed
174

175
 BELLESIP_EXPORT const char* belle_sip_header_from_get_tag(const belle_sip_header_from_t* from);
jehan's avatar
jehan committed
176

Ghislain MARY's avatar
Ghislain MARY committed
177
 BELLESIP_EXPORT void belle_sip_header_from_set_random_tag(belle_sip_header_from_t *obj);
178

179
#define BELLE_SIP_HEADER_FROM(t) BELLE_SIP_CAST(t,belle_sip_header_from_t)
jehan's avatar
jehan committed
180
#define BELLE_SIP_FROM "From"
181 182 183 184 185 186
 /******************************
 * To header object inherent from header_address
 *
 ******************************/
 typedef struct _belle_sip_header_to belle_sip_header_to_t;

Ghislain MARY's avatar
Ghislain MARY committed
187
 BELLESIP_EXPORT belle_sip_header_to_t* belle_sip_header_to_new();
188

189
 BELLESIP_EXPORT belle_sip_header_to_t* belle_sip_header_to_parse(const char* to) ;
190

191
 BELLESIP_EXPORT belle_sip_header_to_t* belle_sip_header_to_create(const belle_sip_header_address_t *address, const char *tag);
jehan's avatar
jehan committed
192

193
 BELLESIP_EXPORT belle_sip_header_to_t* belle_sip_header_to_create2(const char *address, const char *tag);
194

Ghislain MARY's avatar
Ghislain MARY committed
195
 BELLESIP_EXPORT void belle_sip_header_to_set_tag(belle_sip_header_to_t* from, const char* tag);
196

197
 BELLESIP_EXPORT const char* belle_sip_header_to_get_tag(const belle_sip_header_to_t* from);
jehan's avatar
jehan committed
198

Ghislain MARY's avatar
Ghislain MARY committed
199
 BELLESIP_EXPORT void belle_sip_header_to_set_random_tag(belle_sip_header_to_t *obj);
200

201
#define BELLE_SIP_HEADER_TO(t) BELLE_SIP_CAST(t,belle_sip_header_to_t)
jehan's avatar
jehan committed
202
#define BELLE_SIP_TO "To"
203 204 205 206 207 208 209

/******************************
 * Via header object inherent from header_address
 *
 ******************************/
typedef struct _belle_sip_header_via belle_sip_header_via_t;

210
BELLESIP_EXPORT belle_sip_header_via_t* belle_sip_header_via_new();
Ghislain MARY's avatar
Ghislain MARY committed
211
BELLESIP_EXPORT belle_sip_header_via_t* belle_sip_header_via_create(const char *host, int port, const char *transport, const char *branch);
212 213 214
BELLESIP_EXPORT belle_sip_header_via_t* belle_sip_header_via_parse (const char* via) ;
BELLESIP_EXPORT const char*	belle_sip_header_via_get_branch(const belle_sip_header_via_t* via);
BELLESIP_EXPORT const char*	belle_sip_header_via_get_transport(const belle_sip_header_via_t* via);
215 216 217 218
/**
 * Get lower case version of the transport
 * @return the lower case version of the transport if from tcp,udp,tls or dtls else, return the value from #belle_sip_header_via_get_transport
 */
Sylvain Berfini's avatar
Sylvain Berfini committed
219
BELLESIP_EXPORT const char*	belle_sip_header_via_get_transport_lowercase(const belle_sip_header_via_t* via);
220 221
BELLESIP_EXPORT const char*	belle_sip_header_via_get_host(const belle_sip_header_via_t* via);
BELLESIP_EXPORT int belle_sip_header_via_get_port(const belle_sip_header_via_t* via);
Sylvain Berfini's avatar
Sylvain Berfini committed
222
BELLESIP_EXPORT int belle_sip_header_via_get_listening_port(const belle_sip_header_via_t *via);
223

224
BELLESIP_EXPORT const char*	belle_sip_header_via_get_maddr(const belle_sip_header_via_t* via);
225 226
BELLESIP_EXPORT const char*	belle_sip_header_via_get_protocol(const belle_sip_header_via_t* via);
BELLESIP_EXPORT const char*	belle_sip_header_via_get_received(const belle_sip_header_via_t* via);
Sylvain Berfini's avatar
Sylvain Berfini committed
227
BELLESIP_EXPORT int belle_sip_header_via_get_rport(const belle_sip_header_via_t* via);
228
BELLESIP_EXPORT int	belle_sip_header_via_get_ttl(const belle_sip_header_via_t* via);
229

230 231 232 233 234
BELLESIP_EXPORT void belle_sip_header_via_set_branch(belle_sip_header_via_t* via,const char* branch);
BELLESIP_EXPORT void belle_sip_header_via_set_host(belle_sip_header_via_t* via, const char* host);
BELLESIP_EXPORT int belle_sip_header_via_set_port(belle_sip_header_via_t* via,int port);
BELLESIP_EXPORT void belle_sip_header_via_set_maddr(belle_sip_header_via_t* via, const char* maddr);
BELLESIP_EXPORT void belle_sip_header_via_set_protocol(belle_sip_header_via_t* via, const char* protocol);
235
BELLESIP_EXPORT void belle_sip_header_via_set_received(belle_sip_header_via_t* via, const char* received);
236 237 238
BELLESIP_EXPORT int belle_sip_header_via_set_rport(belle_sip_header_via_t* via,int rport);
BELLESIP_EXPORT void belle_sip_header_via_set_transport(belle_sip_header_via_t* via,const char* transport);
BELLESIP_EXPORT int belle_sip_header_via_set_ttl(belle_sip_header_via_t* via, int ttl);
239
#define BELLE_SIP_HEADER_VIA(t) BELLE_SIP_CAST(t,belle_sip_header_via_t)
jehan's avatar
jehan committed
240
#define BELLE_SIP_VIA "Via"
jehan's avatar
jehan committed
241

242 243 244 245
/******************************
 * Call id object inherent from object
 *
 ******************************/
jehan's avatar
jehan committed
246
typedef struct _belle_sip_header_call_id belle_sip_header_call_id_t;
247

Ghislain MARY's avatar
Ghislain MARY committed
248
BELLESIP_EXPORT belle_sip_header_call_id_t* belle_sip_header_call_id_new();
249

250 251
BELLESIP_EXPORT belle_sip_header_call_id_t* belle_sip_header_call_id_parse (const char* call_id) ;
BELLESIP_EXPORT const char*	belle_sip_header_call_id_get_call_id(const belle_sip_header_call_id_t* call_id);
Ghislain MARY's avatar
Ghislain MARY committed
252
BELLESIP_EXPORT void belle_sip_header_call_id_set_call_id(belle_sip_header_call_id_t* call_id,const char* id);
253
unsigned int belle_sip_header_call_id_equals(const belle_sip_header_call_id_t* a,const belle_sip_header_call_id_t* b);
jehan's avatar
jehan committed
254
#define BELLE_SIP_HEADER_CALL_ID(t) BELLE_SIP_CAST(t,belle_sip_header_call_id_t)
jehan's avatar
jehan committed
255
#define BELLE_SIP_CALL_ID "Call-ID"
256 257 258 259 260 261
/******************************
 * cseq object inherent from object
 *
 ******************************/
typedef struct _belle_sip_header_cseq belle_sip_header_cseq_t;

Ghislain MARY's avatar
Ghislain MARY committed
262
BELLESIP_EXPORT belle_sip_header_cseq_t* belle_sip_header_cseq_new();
263 264 265
BELLESIP_EXPORT belle_sip_header_cseq_t* belle_sip_header_cseq_create(unsigned int number, const char *method);
BELLESIP_EXPORT belle_sip_header_cseq_t* belle_sip_header_cseq_parse (const char* cseq) ;
BELLESIP_EXPORT const char*	belle_sip_header_cseq_get_method(const belle_sip_header_cseq_t* cseq);
Ghislain MARY's avatar
Ghislain MARY committed
266
BELLESIP_EXPORT void belle_sip_header_cseq_set_method(belle_sip_header_cseq_t* cseq,const char* method);
267 268
BELLESIP_EXPORT unsigned int	belle_sip_header_cseq_get_seq_number(const belle_sip_header_cseq_t* cseq);
BELLESIP_EXPORT void belle_sip_header_cseq_set_seq_number(belle_sip_header_cseq_t* cseq,unsigned int seq_number);
269
#define BELLE_SIP_HEADER_CSEQ(t) BELLE_SIP_CAST(t,belle_sip_header_cseq_t)
270
#define BELLE_SIP_CSEQ "CSeq"
271 272 273 274 275 276
/******************************
 * content type object inherent from parameters
 *
 ******************************/
typedef struct _belle_sip_header_content_type belle_sip_header_content_type_t;

Ghislain MARY's avatar
Ghislain MARY committed
277
BELLESIP_EXPORT belle_sip_header_content_type_t* belle_sip_header_content_type_new();
278 279
BELLESIP_EXPORT belle_sip_header_content_type_t* belle_sip_header_content_type_parse (const char* content_type) ;
BELLESIP_EXPORT belle_sip_header_content_type_t* belle_sip_header_content_type_create (const char* type,const char* sub_type) ;
jehan's avatar
jehan committed
280

Ghislain MARY's avatar
Ghislain MARY committed
281
BELLESIP_EXPORT belle_sip_header_content_type_t* belle_sip_header_content_type_parse (const char* content_type) ;
282
BELLESIP_EXPORT const char*	belle_sip_header_content_type_get_type(const belle_sip_header_content_type_t* content_type);
Ghislain MARY's avatar
Ghislain MARY committed
283
BELLESIP_EXPORT void belle_sip_header_content_type_set_type(belle_sip_header_content_type_t* content_type,const char* type);
284
BELLESIP_EXPORT const char*	belle_sip_header_content_type_get_subtype(const belle_sip_header_content_type_t* content_type);
Ghislain MARY's avatar
Ghislain MARY committed
285
BELLESIP_EXPORT void belle_sip_header_content_type_set_subtype(belle_sip_header_content_type_t* content_type,const char* sub_type);
286
#define BELLE_SIP_HEADER_CONTENT_TYPE(t) BELLE_SIP_CAST(t,belle_sip_header_content_type_t)
jehan's avatar
jehan committed
287
#define BELLE_SIP_CONTENT_TYPE "Content-Type"
288 289 290 291 292 293 294
/******************************
 *
 * Expires inherit from header
 *
 ******************************/
typedef struct _belle_sip_header_expires belle_sip_header_expires_t;

Sylvain Berfini's avatar
Sylvain Berfini committed
295
BELLESIP_EXPORT belle_sip_header_expires_t* belle_sip_header_expires_new();
296

297 298 299
BELLESIP_EXPORT belle_sip_header_expires_t* belle_sip_header_expires_parse (const char* expires) ;
BELLESIP_EXPORT int belle_sip_header_expires_get_expires(const belle_sip_header_expires_t* expires);
BELLESIP_EXPORT void belle_sip_header_expires_set_expires(belle_sip_header_expires_t* expires,int value);
Ghislain MARY's avatar
Ghislain MARY committed
300
BELLESIP_EXPORT int belle_sip_header_expires_decrement_expires(belle_sip_header_expires_t* expires);
301
BELLESIP_EXPORT belle_sip_header_expires_t* belle_sip_header_expires_create(int expires);
302
#define BELLE_SIP_HEADER_EXPIRES(t) BELLE_SIP_CAST(t,belle_sip_header_expires_t)
303
#define BELLE_SIP_EXPIRES "Expires"
304 305 306 307 308 309
/******************************
 * Route header object inherent from header_address
 *
 ******************************/
 typedef struct _belle_sip_header_route belle_sip_header_route_t;

Ghislain MARY's avatar
Ghislain MARY committed
310
 BELLESIP_EXPORT belle_sip_header_route_t* belle_sip_header_route_new();
311 312
 BELLESIP_EXPORT belle_sip_header_route_t* belle_sip_header_route_parse (const char* route) ;
 BELLESIP_EXPORT belle_sip_header_route_t* belle_sip_header_route_create(const belle_sip_header_address_t* route);
313 314

#define BELLE_SIP_HEADER_ROUTE(t) BELLE_SIP_CAST(t,belle_sip_header_route_t)
315
#define BELLE_SIP_ROUTE "Route"
316 317 318 319 320 321
/******************************
 * Record route header object inherent from header_address
 *
 ******************************/
 typedef struct _belle_sip_header_record_route belle_sip_header_record_route_t;

Ghislain MARY's avatar
Ghislain MARY committed
322
 BELLESIP_EXPORT belle_sip_header_record_route_t* belle_sip_header_record_route_new();
323
 BELLESIP_EXPORT belle_sip_header_record_route_t* belle_sip_header_record_route_parse (const char* route) ;
324

jehan's avatar
jehan committed
325
#define BELLE_SIP_HEADER_RECORD_ROUTE(t) BELLE_SIP_CAST(t,belle_sip_header_record_route_t)
Simon Morlat's avatar
Simon Morlat committed
326
#define BELLE_SIP_RECORD_ROUTE	"Record-route"
jehan's avatar
jehan committed
327 328 329 330 331 332
 /******************************
  * Service route header object inherent from header_address
  *
  ******************************/
  typedef struct _belle_sip_header_service_route belle_sip_header_service_route_t;

Ghislain MARY's avatar
Ghislain MARY committed
333
  BELLESIP_EXPORT belle_sip_header_service_route_t* belle_sip_header_service_route_new();
334
  BELLESIP_EXPORT belle_sip_header_service_route_t* belle_sip_header_service_route_parse (const char* route) ;
jehan's avatar
jehan committed
335 336 337

 #define BELLE_SIP_HEADER_SERVICE_ROUTE(t) BELLE_SIP_CAST(t,belle_sip_header_service_route_t)
 #define BELLE_SIP_SERVICE_ROUTE	"Service-route"
338 339 340 341 342 343 344
 /******************************
  *
  * user-Agent header inherit from header
  *
  ******************************/
 typedef struct _belle_sip_header_user_agent belle_sip_header_user_agent_t;

Sylvain Berfini's avatar
Sylvain Berfini committed
345
 BELLESIP_EXPORT belle_sip_header_user_agent_t* belle_sip_header_user_agent_new();
346

347 348
 BELLESIP_EXPORT belle_sip_header_user_agent_t* belle_sip_header_user_agent_parse (const char* user_agent) ;
 BELLESIP_EXPORT belle_sip_list_t* belle_sip_header_user_agent_get_products(const belle_sip_header_user_agent_t* user_agent);
jehan's avatar
jehan committed
349 350 351 352 353 354 355
 /**
  * concatenates products
  * @param user_agent [in] user agent header
  * @param value [out]buffer where to put result in
  * @param value_size [in] size of the buffer
  * @return number of written characters or -1 inca se of error;
  */
Sylvain Berfini's avatar
Sylvain Berfini committed
356 357 358
 BELLESIP_EXPORT int belle_sip_header_user_agent_get_products_as_string(const belle_sip_header_user_agent_t* user_agent,char* value,unsigned int value_size);
 BELLESIP_EXPORT void belle_sip_header_user_agent_set_products(belle_sip_header_user_agent_t* user_agent,belle_sip_list_t* value);
 BELLESIP_EXPORT void belle_sip_header_user_agent_add_product(belle_sip_header_user_agent_t* user_agent,const char* product);
359 360 361
 #define BELLE_SIP_HEADER_USER_AGENT(t) BELLE_SIP_CAST(t,belle_sip_header_user_agent_t)

 /******************************
jehan's avatar
jehan committed
362 363 364 365 366
 * Content length inherent from object
 *
 ******************************/
typedef struct _belle_sip_header_content_length belle_sip_header_content_length_t;

Ghislain MARY's avatar
Ghislain MARY committed
367
BELLESIP_EXPORT belle_sip_header_content_length_t* belle_sip_header_content_length_new();
jehan's avatar
jehan committed
368

369 370 371
BELLESIP_EXPORT belle_sip_header_content_length_t* belle_sip_header_content_length_parse (const char* content_length) ;
BELLESIP_EXPORT belle_sip_header_content_length_t* belle_sip_header_content_length_create (int content_length) ;
BELLESIP_EXPORT unsigned int belle_sip_header_content_length_get_content_length(const belle_sip_header_content_length_t* content_length);
Ghislain MARY's avatar
Ghislain MARY committed
372
BELLESIP_EXPORT void belle_sip_header_content_length_set_content_length(belle_sip_header_content_length_t* content_length,unsigned int length);
jehan's avatar
jehan committed
373
#define BELLE_SIP_HEADER_CONTENT_LENGTH(t) BELLE_SIP_CAST(t,belle_sip_header_content_length_t)
jehan's avatar
jehan committed
374
#define BELLE_SIP_CONTENT_LENGTH "Content-Length"
375

376
/******************************
377
 * authorization header inherit from parameters
378 379 380 381
 *
 ******************************/
typedef struct _belle_sip_header_authorization belle_sip_header_authorization_t;

Ghislain MARY's avatar
Ghislain MARY committed
382
BELLESIP_EXPORT belle_sip_header_authorization_t* belle_sip_header_authorization_new();
383 384 385 386
BELLESIP_EXPORT belle_sip_header_authorization_t* belle_sip_header_authorization_parse(const char* authorization);
BELLESIP_EXPORT const char*	belle_sip_header_authorization_get_algorithm(const belle_sip_header_authorization_t* authorization );
BELLESIP_EXPORT const char*	belle_sip_header_authorization_get_cnonce(const belle_sip_header_authorization_t* authorization );
BELLESIP_EXPORT const char* belle_sip_header_authorization_get_nonce(const belle_sip_header_authorization_t* authorization);
jehan's avatar
jehan committed
387 388 389
/*convert nonce count as string id present
 * @return 0 in case of success
 * */
Ghislain MARY's avatar
Ghislain MARY committed
390
BELLESIP_EXPORT int belle_sip_header_authorization_get_nonce_count_as_string(const belle_sip_header_authorization_t* authorization,char nounce_count[9]);
391 392 393 394 395 396 397 398
BELLESIP_EXPORT int	belle_sip_header_authorization_get_nonce_count(const belle_sip_header_authorization_t* authorization);
BELLESIP_EXPORT const char*	belle_sip_header_authorization_get_opaque(const belle_sip_header_authorization_t* authorization);
BELLESIP_EXPORT const char*	belle_sip_header_authorization_get_qop(const belle_sip_header_authorization_t* authorization);
BELLESIP_EXPORT const char*	belle_sip_header_authorization_get_realm(const belle_sip_header_authorization_t* authorization);
BELLESIP_EXPORT const char*	belle_sip_header_authorization_get_response(const belle_sip_header_authorization_t* authorization);
BELLESIP_EXPORT const char*	belle_sip_header_authorization_get_scheme(const belle_sip_header_authorization_t* authorization);
BELLESIP_EXPORT belle_sip_uri_t* belle_sip_header_authorization_get_uri(const belle_sip_header_authorization_t* authorization);
BELLESIP_EXPORT const char*	belle_sip_header_authorization_get_username(const belle_sip_header_authorization_t* authorization);
Ghislain MARY's avatar
Ghislain MARY committed
399
BELLESIP_EXPORT void belle_sip_header_authorization_set_algorithm(belle_sip_header_authorization_t* authorization, const char* algorithm);
400
BELLESIP_EXPORT void belle_sip_header_authorization_set_cnonce(belle_sip_header_authorization_t* authorization, const char* cNonce);
Ghislain MARY's avatar
Ghislain MARY committed
401
BELLESIP_EXPORT void belle_sip_header_authorization_set_nonce(belle_sip_header_authorization_t* authorization, const char* nonce);
402
BELLESIP_EXPORT void belle_sip_header_authorization_set_nonce_count(belle_sip_header_authorization_t* authorization, int nonceCount);
Ghislain MARY's avatar
Ghislain MARY committed
403
BELLESIP_EXPORT void belle_sip_header_authorization_set_opaque(belle_sip_header_authorization_t* authorization, const char* opaque);
404
BELLESIP_EXPORT void belle_sip_header_authorization_set_qop(belle_sip_header_authorization_t* authorization, const char* qop);
Ghislain MARY's avatar
Ghislain MARY committed
405 406 407 408
BELLESIP_EXPORT void belle_sip_header_authorization_add_qop(belle_sip_header_authorization_t* authorization, const char* qop);
BELLESIP_EXPORT void belle_sip_header_authorization_set_realm(belle_sip_header_authorization_t* authorization, const char* realm);
BELLESIP_EXPORT void belle_sip_header_authorization_set_response(belle_sip_header_authorization_t* authorization, const char* response);
BELLESIP_EXPORT void belle_sip_header_authorization_set_scheme(belle_sip_header_authorization_t* authorization, const char* scheme);
409
BELLESIP_EXPORT void belle_sip_header_authorization_set_uri(belle_sip_header_authorization_t* authorization, belle_sip_uri_t* uri);
Ghislain MARY's avatar
Ghislain MARY committed
410
BELLESIP_EXPORT void belle_sip_header_authorization_set_username(belle_sip_header_authorization_t* authorization, const char* username);
411 412

#define BELLE_SIP_HEADER_AUTHORIZATION(t) BELLE_SIP_CAST(t,belle_sip_header_authorization_t)
413
#define BELLE_SIP_AUTHORIZATION "Authorization"
414

415 416 417 418
/*******************************
 * proxy_authorization inherit from Authorization
 */
typedef struct _belle_sip_header_proxy_authorization belle_sip_header_proxy_authorization_t;
Ghislain MARY's avatar
Ghislain MARY committed
419
BELLESIP_EXPORT belle_sip_header_proxy_authorization_t* belle_sip_header_proxy_authorization_new();
420
BELLESIP_EXPORT belle_sip_header_proxy_authorization_t* belle_sip_header_proxy_authorization_parse(const char* proxy_authorization);
421
#define BELLE_SIP_HEADER_PROXY_AUTHORIZATION(t) BELLE_SIP_CAST(t,belle_sip_header_proxy_authorization_t)
422
#define BELLE_SIP_PROXY_AUTHORIZATION "Proxy-Authorization"
423

jehan's avatar
jehan committed
424 425 426 427
/*******************************
 * www_authenticate inherit from parameters
 */
typedef struct _belle_sip_header_www_authenticate belle_sip_header_www_authenticate_t;
Ghislain MARY's avatar
Ghislain MARY committed
428
BELLESIP_EXPORT belle_sip_header_www_authenticate_t* belle_sip_header_www_authenticate_new();
429 430 431 432 433
BELLESIP_EXPORT belle_sip_header_www_authenticate_t* belle_sip_header_www_authenticate_parse(const char* www_authenticate);
BELLESIP_EXPORT const char*	belle_sip_header_www_authenticate_get_algorithm(const belle_sip_header_www_authenticate_t* www_authenticate );
BELLESIP_EXPORT const char* belle_sip_header_www_authenticate_get_nonce(const belle_sip_header_www_authenticate_t* www_authenticate);
BELLESIP_EXPORT const char*	belle_sip_header_www_authenticate_get_opaque(const belle_sip_header_www_authenticate_t* www_authenticate);
BELLESIP_EXPORT belle_sip_list_t* belle_sip_header_www_authenticate_get_qop(const belle_sip_header_www_authenticate_t* www_authetication);
Ghislain MARY's avatar
Ghislain MARY committed
434
BELLESIP_EXPORT const char* belle_sip_header_www_authenticate_get_qop_first(const belle_sip_header_www_authenticate_t* www_authetication);
435 436 437 438
BELLESIP_EXPORT const char*	belle_sip_header_www_authenticate_get_realm(const belle_sip_header_www_authenticate_t* www_authenticate);
BELLESIP_EXPORT const char*	belle_sip_header_www_authenticate_get_scheme(const belle_sip_header_www_authenticate_t* www_authenticate);
BELLESIP_EXPORT const char*	belle_sip_header_www_authenticate_get_domain(const belle_sip_header_www_authenticate_t* www_authenticate);
BELLESIP_EXPORT unsigned int belle_sip_header_www_authenticate_is_stale(const belle_sip_header_www_authenticate_t* www_authenticate);
Ghislain MARY's avatar
Ghislain MARY committed
439
BELLESIP_EXPORT void belle_sip_header_www_authenticate_set_algorithm(belle_sip_header_www_authenticate_t* www_authenticate, const char* algorithm);
440
BELLESIP_EXPORT void belle_sip_header_www_authenticate_set_nonce(belle_sip_header_www_authenticate_t* www_authenticate, const char* nonce);
Ghislain MARY's avatar
Ghislain MARY committed
441 442
BELLESIP_EXPORT void belle_sip_header_www_authenticate_set_opaque(belle_sip_header_www_authenticate_t* www_authenticate, const char* opaque);
BELLESIP_EXPORT void belle_sip_header_www_authenticate_set_qop(belle_sip_header_www_authenticate_t* www_authentication, belle_sip_list_t*  qop);
443
BELLESIP_EXPORT void belle_sip_header_www_authenticate_add_qop(belle_sip_header_www_authenticate_t* www_authentication, const char*  qop_param);
Ghislain MARY's avatar
Ghislain MARY committed
444 445 446 447
BELLESIP_EXPORT void belle_sip_header_www_authenticate_set_realm(belle_sip_header_www_authenticate_t* www_authenticate, const char* realm);
BELLESIP_EXPORT void belle_sip_header_www_authenticate_set_scheme(belle_sip_header_www_authenticate_t* www_authenticate, const char* scheme);
BELLESIP_EXPORT void belle_sip_header_www_authenticate_set_domain(belle_sip_header_www_authenticate_t* www_authenticate,const char* domain);
BELLESIP_EXPORT void belle_sip_header_www_authenticate_set_stale(belle_sip_header_www_authenticate_t* www_authenticate, unsigned int enable);
jehan's avatar
jehan committed
448
#define BELLE_SIP_HEADER_WWW_AUTHENTICATE(t) BELLE_SIP_CAST(t,belle_sip_header_www_authenticate_t)
jehan's avatar
jehan committed
449
#define BELLE_SIP_WWW_AUTHENTICATE "WWW-Authenticate"
jehan's avatar
jehan committed
450

jehan's avatar
jehan committed
451 452 453 454
/*******************************
 * proxy_authenticate inherit from www_authenticate
 */
typedef struct _belle_sip_header_proxy_authenticate belle_sip_header_proxy_authenticate_t;
Ghislain MARY's avatar
Ghislain MARY committed
455
BELLESIP_EXPORT belle_sip_header_proxy_authenticate_t* belle_sip_header_proxy_authenticate_new();
456
BELLESIP_EXPORT belle_sip_header_proxy_authenticate_t* belle_sip_header_proxy_authenticate_parse(const char* proxy_authenticate);
jehan's avatar
jehan committed
457
#define BELLE_SIP_HEADER_PROXY_AUTHENTICATE(t) BELLE_SIP_CAST(t,belle_sip_header_proxy_authenticate_t)
jehan's avatar
jehan committed
458
#define BELLE_SIP_PROXY_AUTHENTICATE "Proxy-Authenticate"
jehan's avatar
jehan committed
459

460
/******************************
461
 *
462
 * Extension header inherit from header
463 464 465 466
 *
 ******************************/
typedef struct _belle_sip_header_extension belle_sip_header_extension_t;

Ghislain MARY's avatar
Ghislain MARY committed
467
BELLESIP_EXPORT belle_sip_header_extension_t* belle_sip_header_extension_new();
468

469
BELLESIP_EXPORT belle_sip_header_extension_t* belle_sip_header_extension_parse (const char* extension) ;
Ghislain MARY's avatar
Ghislain MARY committed
470
BELLESIP_EXPORT belle_sip_header_extension_t* belle_sip_header_extension_create (const char* name,const char* value);
471
BELLESIP_EXPORT const char* belle_sip_header_extension_get_value(const belle_sip_header_extension_t* extension);
Ghislain MARY's avatar
Ghislain MARY committed
472
BELLESIP_EXPORT void belle_sip_header_extension_set_value(belle_sip_header_extension_t* extension,const char* value);
473
#define BELLE_SIP_HEADER_EXTENSION(t) BELLE_SIP_CAST(t,belle_sip_header_extension_t)
jehan's avatar
jehan committed
474 475 476 477 478 479 480
/******************************
 *
 * Max forward inherit from header
 *
 ******************************/
typedef struct _belle_sip_header_max_forwards belle_sip_header_max_forwards_t;

Ghislain MARY's avatar
Ghislain MARY committed
481
BELLESIP_EXPORT belle_sip_header_max_forwards_t* belle_sip_header_max_forwards_new();
jehan's avatar
jehan committed
482

483 484
BELLESIP_EXPORT belle_sip_header_max_forwards_t* belle_sip_header_max_forwards_parse (const char* max_forwards) ;
BELLESIP_EXPORT int belle_sip_header_max_forwards_get_max_forwards(const belle_sip_header_max_forwards_t* max_forwards);
Ghislain MARY's avatar
Ghislain MARY committed
485
BELLESIP_EXPORT void belle_sip_header_max_forwards_set_max_forwards(belle_sip_header_max_forwards_t* max_forwards,int value);
486
BELLESIP_EXPORT int belle_sip_header_max_forwards_decrement_max_forwards(belle_sip_header_max_forwards_t* max_forwards);
jehan's avatar
jehan committed
487
#define BELLE_SIP_HEADER_MAX_FORWARDS(t) BELLE_SIP_CAST(t,belle_sip_header_max_forwards_t)
jehan's avatar
jehan committed
488 489 490 491 492 493 494 495 496
#define BELLE_SIP_MAX_FORWARDS "Max-Forwards"

/******************************
 *
 * Subscription state  inherit from parameters
 *
 ******************************/
typedef struct _belle_sip_header_subscription_state belle_sip_header_subscription_state_t;

Ghislain MARY's avatar
Ghislain MARY committed
497
BELLESIP_EXPORT belle_sip_header_subscription_state_t* belle_sip_header_subscription_state_new();
jehan's avatar
jehan committed
498

499
BELLESIP_EXPORT belle_sip_header_subscription_state_t* belle_sip_header_subscription_state_parse (const char* subscription_state) ;
Sylvain Berfini's avatar
Sylvain Berfini committed
500
BELLESIP_EXPORT belle_sip_header_subscription_state_t* belle_sip_header_subscription_state_create (const char* subscription_state,int expires);
jehan's avatar
jehan committed
501

502 503
BELLESIP_EXPORT const char* belle_sip_header_subscription_state_get_state(const belle_sip_header_subscription_state_t* subscription_state);
BELLESIP_EXPORT int belle_sip_header_subscription_state_get_expires(const belle_sip_header_subscription_state_t* subscription_state);
Ghislain MARY's avatar
Ghislain MARY committed
504 505
BELLESIP_EXPORT const char* belle_sip_header_subscription_state_get_reason(const belle_sip_header_subscription_state_t* subscription_state);
BELLESIP_EXPORT int belle_sip_header_subscription_state_get_retry_after(const belle_sip_header_subscription_state_t* subscription_state);
jehan's avatar
jehan committed
506

Ghislain MARY's avatar
Ghislain MARY committed
507 508 509 510
BELLESIP_EXPORT void belle_sip_header_subscription_state_set_state(belle_sip_header_subscription_state_t* subscription_state,const char* state);
BELLESIP_EXPORT void belle_sip_header_subscription_state_set_expires(belle_sip_header_subscription_state_t* subscription_state,int expire);
BELLESIP_EXPORT void belle_sip_header_subscription_state_set_reason(belle_sip_header_subscription_state_t* subscription_state, const char* reason);
BELLESIP_EXPORT void belle_sip_header_subscription_state_set_retry_after(belle_sip_header_subscription_state_t* subscription_state, int retry_after );
jehan's avatar
jehan committed
511 512 513 514 515 516 517


#define BELLE_SIP_HEADER_SUBSCRIPTION_STATE(t) BELLE_SIP_CAST(t,belle_sip_header_subscription_state_t)
#define BELLE_SIP_SUBSCRIPTION_STATE "Subscription-State"
#define BELLE_SIP_SUBSCRIPTION_STATE_ACTIVE  "active"
#define BELLE_SIP_SUBSCRIPTION_STATE_PENDING "pending"
#define BELLE_SIP_SUBSCRIPTION_STATE_TERMINATED "terminated"
518

jehan's avatar
jehan committed
519 520 521 522 523
/******************************
 * Refer-To header object inherent from header_address
 *
 ******************************/
 typedef struct _belle_sip_header_refer_to belle_sip_header_refer_to_t;
Ghislain MARY's avatar
Ghislain MARY committed
524
 BELLESIP_EXPORT belle_sip_header_refer_to_t* belle_sip_header_refer_to_new();
jehan's avatar
jehan committed
525 526 527 528 529
 BELLESIP_EXPORT belle_sip_header_refer_to_t* belle_sip_header_refer_to_parse(const char* refer_to) ;
 BELLESIP_EXPORT belle_sip_header_refer_to_t* belle_sip_header_refer_to_create(const belle_sip_header_address_t *address);
#define BELLE_SIP_HEADER_REFER_TO(t) BELLE_SIP_CAST(t,belle_sip_header_refer_to_t)
#define BELLE_SIP_REFER_TO "Refer-To"

jehan's avatar
jehan committed
530 531 532 533 534
 /******************************
  * Referred-by header object inherent from header_address
  *
  ******************************/
  typedef struct _belle_sip_header_referred_by belle_sip_header_referred_by_t;
Ghislain MARY's avatar
Ghislain MARY committed
535
  BELLESIP_EXPORT belle_sip_header_referred_by_t* belle_sip_header_referred_by_new();
jehan's avatar
jehan committed
536 537 538 539 540 541 542 543 544 545
  BELLESIP_EXPORT belle_sip_header_referred_by_t* belle_sip_header_referred_by_parse(const char* referred_by) ;
  BELLESIP_EXPORT belle_sip_header_referred_by_t* belle_sip_header_referred_by_create(const belle_sip_header_address_t *address);
 #define BELLE_SIP_HEADER_REFERRED_BY(t) BELLE_SIP_CAST(t,belle_sip_header_referred_by_t)
 #define BELLE_SIP_REFERRED_BY "Referred-By"

  /******************************
   * Replace header object inherent from parameters
   *
   ******************************/
typedef struct _belle_sip_header_replaces belle_sip_header_replaces_t;
Ghislain MARY's avatar
Ghislain MARY committed
546
BELLESIP_EXPORT belle_sip_header_replaces_t* belle_sip_header_replaces_new();
jehan's avatar
jehan committed
547 548 549 550 551 552 553 554 555 556 557 558 559 560 561
BELLESIP_EXPORT belle_sip_header_replaces_t* belle_sip_header_replaces_parse(const char* replaces) ;

BELLESIP_EXPORT belle_sip_header_replaces_t* belle_sip_header_replaces_create(const char* call_id,const char* from_tag,const char* to_tag);
/*
 * Creates a Eeplaces header from an escaped value that can be found in Referred-by header
 * @param escaped_replace ex : 12345%40192.168.118.3%3Bto-tag%3D12345%3Bfrom-tag%3D5FFE-3994
 * @return a newly allocated Replace header
 * */
BELLESIP_EXPORT belle_sip_header_replaces_t* belle_sip_header_replaces_create2(const char* escaped_replace);
BELLESIP_EXPORT const char* belle_sip_header_replaces_get_call_id(const belle_sip_header_replaces_t* obj);
BELLESIP_EXPORT const char* belle_sip_header_replaces_get_from_tag(const belle_sip_header_replaces_t* obj);
BELLESIP_EXPORT const char* belle_sip_header_replaces_get_to_tag(const belle_sip_header_replaces_t* obj);
BELLESIP_EXPORT void belle_sip_header_replaces_set_call_id(belle_sip_header_replaces_t* obj, const char* callid);
BELLESIP_EXPORT void belle_sip_header_replaces_set_from_tag(belle_sip_header_replaces_t* obj,const char* from_tag);
BELLESIP_EXPORT void belle_sip_header_replaces_set_to_tag(belle_sip_header_replaces_t* obj,const char* to_tag);
562 563 564 565 566
/*return a newly allocated string with the content of the header value in escaped form.
 * <br> Purpose of this function is to be used to set Refer-To uri header Replaces
 * @param obj Replaces object
 * @return newly allocated string ex: 12345%40192.168.118.3%3Bto-tag%3D12345%3Bfrom-tag%3D5FFE-3994*/
BELLESIP_EXPORT char* belle_sip_header_replaces_value_to_escaped_string(const belle_sip_header_replaces_t* obj);
jehan's avatar
jehan committed
567 568 569
#define BELLE_SIP_HEADER_REPLACES(t) BELLE_SIP_CAST(t,belle_sip_header_replaces_t)
#define BELLE_SIP_REPLACES "Replaces"

Simon Morlat's avatar
Simon Morlat committed
570 571 572
/*******
 * Date header
 *******/
jehan's avatar
jehan committed
573

Simon Morlat's avatar
Simon Morlat committed
574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590
typedef struct belle_sip_header_date belle_sip_header_date_t;

BELLESIP_EXPORT belle_sip_header_date_t* belle_sip_header_date_new();
BELLESIP_EXPORT belle_sip_header_date_t* belle_sip_header_date_parse(const char* date) ;

BELLESIP_EXPORT belle_sip_header_date_t* belle_sip_header_date_create_from_time(const time_t *utc_time);

BELLESIP_EXPORT time_t belle_sip_header_date_get_time(belle_sip_header_date_t *obj);

BELLESIP_EXPORT void belle_sip_header_date_set_time(belle_sip_header_date_t *obj, const time_t *utc_time);

BELLESIP_EXPORT const char * belle_sip_header_date_get_date(const belle_sip_header_date_t *obj);

BELLESIP_EXPORT void belle_sip_header_date_set_date(belle_sip_header_date_t *obj, const char *date);

#define BELLE_SIP_HEADER_DATE(obj)	BELLE_SIP_CAST(obj,belle_sip_header_date_t)
#define BELLE_SIP_DATE "Date"
591

jehan's avatar
jehan committed
592
/******************************
jehan's avatar
jehan committed
593
* P-Preferred-Identity header object inherent from header_address
jehan's avatar
jehan committed
594 595 596 597 598 599 600 601 602 603 604 605 606
*
******************************/
typedef struct _belle_sip_header_p_preferred_identity belle_sip_header_p_preferred_identity_t;

BELLESIP_EXPORT belle_sip_header_p_preferred_identity_t* belle_sip_header_p_preferred_identity_new();

BELLESIP_EXPORT belle_sip_header_p_preferred_identity_t* belle_sip_header_p_preferred_identity_parse(const char* p_preferred_identity) ;

BELLESIP_EXPORT belle_sip_header_p_preferred_identity_t* belle_sip_header_p_preferred_identity_create(const belle_sip_header_address_t *address);

#define BELLE_SIP_HEADER_P_PREFERRED_IDENTITY(t) BELLE_SIP_CAST(t,belle_sip_header_p_preferred_identity_t)
#define BELLE_SIP_P_PREFERRED_IDENTITY "P-Preferred-Identity"

jehan's avatar
jehan committed
607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628
/******************************
* Privacy header object inherent from header
*
******************************/
typedef struct _belle_sip_header_privacy belle_sip_header_privacy_t;

BELLESIP_EXPORT belle_sip_header_privacy_t* belle_sip_header_privacy_new();

BELLESIP_EXPORT belle_sip_header_privacy_t* belle_sip_header_privacy_parse(const char* privacy) ;

BELLESIP_EXPORT belle_sip_header_privacy_t* belle_sip_header_privacy_create(const char* privacy);

BELLESIP_EXPORT void belle_sip_header_privacy_add_privacy(belle_sip_header_privacy_t* privacy, const char* value);

BELLESIP_EXPORT void belle_sip_header_privacy_set_privacy(belle_sip_header_privacy_t* privacy, belle_sip_list_t* privacy_values);

BELLESIP_EXPORT belle_sip_list_t* belle_sip_header_privacy_get_privacy(const belle_sip_header_privacy_t* privacy);


#define BELLE_SIP_HEADER_PRIVACY(t) BELLE_SIP_CAST(t,belle_sip_header_privacy_t)
#define BELLE_SIP_PRIVACY "Privacy"

jehan's avatar
jehan committed
629
#endif /* HEADERS_H_ */