belle_sip_headers_impl.c 17 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/>.
*/



#include "belle-sip/headers.h"
jehan's avatar
jehan committed
22
#include "belle-sip/parameters.h"
jehan's avatar
jehan committed
23 24 25 26 27 28 29
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include "belle_sip_messageParser.h"
#include "belle_sip_messageLexer.h"
#include "belle_sip_internal.h"

jehan's avatar
jehan committed
30 31 32
/************************
 * header
 ***********************/
jehan's avatar
jehan committed
33

jehan's avatar
jehan committed
34
GET_SET_STRING(belle_sip_header,name);
35

jehan's avatar
jehan committed
36
void belle_sip_header_init(belle_sip_header_t *header) {
Simon Morlat's avatar
Simon Morlat committed
37

jehan's avatar
jehan committed
38
}
39

Simon Morlat's avatar
Simon Morlat committed
40
static void belle_sip_header_destroy(belle_sip_header_t *header){
jehan's avatar
jehan committed
41
	if (header->name) belle_sip_free((void*)header->name);
jehan's avatar
jehan committed
42 43 44 45 46 47 48 49 50
	if (header->next) belle_sip_object_unref(BELLE_SIP_OBJECT(header->next));
}
void belle_sip_header_set_next(belle_sip_header_t* header,belle_sip_header_t* next) {
	if (header->next) belle_sip_object_unref(BELLE_SIP_OBJECT(header));
	header->next = next;
	belle_sip_object_ref(BELLE_SIP_OBJECT(next));
}
belle_sip_header_t* belle_sip_header_get_next(const belle_sip_header_t* header) {
	return header->next;
jehan's avatar
jehan committed
51
}
jehan's avatar
jehan committed
52

Simon Morlat's avatar
Simon Morlat committed
53 54 55
BELLE_SIP_INSTANCIATE_VPTR(belle_sip_header_t,belle_sip_object_t,belle_sip_header_destroy,NULL);


jehan's avatar
jehan committed
56 57 58 59
/************************
 * header_address
 ***********************/
struct _belle_sip_header_address {
Simon Morlat's avatar
Simon Morlat committed
60
	belle_sip_parameters_t base;
jehan's avatar
jehan committed
61 62 63
	const char* displayname;
	belle_sip_uri_t* uri;
};
Simon Morlat's avatar
Simon Morlat committed
64

jehan's avatar
jehan committed
65 66
static void belle_sip_header_address_init(belle_sip_header_address_t* object){
	belle_sip_parameters_init((belle_sip_parameters_t*)object); /*super*/
jehan's avatar
jehan committed
67 68
}

jehan's avatar
jehan committed
69 70 71
static void belle_sip_header_address_destroy(belle_sip_header_address_t* contact) {
	if (contact->displayname) belle_sip_free((void*)(contact->displayname));
	if (contact->uri) belle_sip_object_unref(BELLE_SIP_OBJECT(contact->uri));
jehan's avatar
jehan committed
72 73
}

Simon Morlat's avatar
Simon Morlat committed
74 75 76 77
static void belle_sip_header_address_clone(belle_sip_header_address_t *addr){
}

BELLE_SIP_NEW(header_address,parameters)
jehan's avatar
jehan committed
78 79
GET_SET_STRING(belle_sip_header_address,displayname);

jehan's avatar
jehan committed
80 81
void belle_sip_header_address_set_quoted_displayname(belle_sip_header_address_t* address,const char* value) {
		if (address->displayname != NULL) belle_sip_free((void*)(address->displayname));
82
		address->displayname=_belle_sip_str_dup_and_unquote_string(value);
jehan's avatar
jehan committed
83
}
jehan's avatar
jehan committed
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
belle_sip_uri_t* belle_sip_header_address_get_uri(belle_sip_header_address_t* address) {
	return address->uri;
}

void belle_sip_header_address_set_uri(belle_sip_header_address_t* address, belle_sip_uri_t* uri) {
	address->uri=uri;
}



/************************
 * header_contact
 ***********************/
struct _belle_sip_header_contact {
	belle_sip_header_address_t address;
	unsigned int wildcard;
 };

jehan's avatar
jehan committed
102
void belle_sip_header_contact_destroy(belle_sip_header_contact_t* contact) {
Simon Morlat's avatar
Simon Morlat committed
103 104 105
}

void belle_sip_header_contact_clone(belle_sip_header_contact_t *contact, const belle_sip_header_contact_t *orig){
jehan's avatar
jehan committed
106 107
}

jehan's avatar
jehan committed
108
BELLE_SIP_NEW_HEADER(header_contact,header_address,"Contact")
jehan's avatar
jehan committed
109
BELLE_SIP_PARSE(header_contact)
jehan's avatar
jehan committed
110

jehan's avatar
jehan committed
111 112
GET_SET_INT_PARAM_PRIVATE(belle_sip_header_contact,expires,int,_)
GET_SET_INT_PARAM_PRIVATE(belle_sip_header_contact,q,float,_);
jehan's avatar
jehan committed
113 114
GET_SET_BOOL(belle_sip_header_contact,wildcard,is);

jehan's avatar
jehan committed
115

jehan's avatar
jehan committed
116 117
int belle_sip_header_contact_set_expires(belle_sip_header_contact_t* contact, int expires) {
	if (expires < 0 ) {
118
		 belle_sip_error("bad expires value [%i] for contact",expires);
jehan's avatar
jehan committed
119 120 121 122 123 124
		return -1;
	}
	_belle_sip_header_contact_set_expires(contact,expires);
	return 0;
 }
int belle_sip_header_contact_set_qvalue(belle_sip_header_contact_t* contact, float qValue) {
jehan's avatar
jehan committed
125
	 if (qValue != -1 && qValue < 0 && qValue >1) {
126
		 belle_sip_error("bad q value [%f] for contact",qValue);
jehan's avatar
jehan committed
127 128
		 return -1;
	 }
jehan's avatar
jehan committed
129
	 _belle_sip_header_contact_set_q(contact,qValue);
jehan's avatar
jehan committed
130 131
	 return 0;
}
132
float	belle_sip_header_contact_get_qvalue(const belle_sip_header_contact_t* contact) {
jehan's avatar
jehan committed
133 134 135
	return belle_sip_header_contact_get_q(contact);
}
/**************************
jehan's avatar
jehan committed
136
* From header object inherent from header_address
jehan's avatar
jehan committed
137
****************************
jehan's avatar
jehan committed
138 139 140 141 142
*/
struct _belle_sip_header_from  {
	belle_sip_header_address_t address;
};

jehan's avatar
jehan committed
143 144 145
static void belle_sip_header_from_destroy(belle_sip_header_from_t* from) {
}

Simon Morlat's avatar
Simon Morlat committed
146 147 148 149
static void belle_sip_header_from_clone(belle_sip_header_from_t* from, const belle_sip_header_from_t* cloned) {
}


jehan's avatar
jehan committed
150
BELLE_SIP_NEW_HEADER(header_from,header_address,"From")
jehan's avatar
jehan committed
151
BELLE_SIP_PARSE(header_from)
jehan's avatar
jehan committed
152 153 154
GET_SET_STRING_PARAM(belle_sip_header_from,tag);

/**************************
Simon Morlat's avatar
Simon Morlat committed
155
* To header object inherits from header_address
jehan's avatar
jehan committed
156 157 158 159 160
****************************
*/
struct _belle_sip_header_to  {
	belle_sip_header_address_t address;
};
jehan's avatar
jehan committed
161

jehan's avatar
jehan committed
162
static void belle_sip_header_to_destroy(belle_sip_header_to_t* to) {
Simon Morlat's avatar
Simon Morlat committed
163 164 165
}

void belle_sip_header_to_clone(belle_sip_header_to_t *contact, const belle_sip_header_to_t *orig){
jehan's avatar
jehan committed
166
}
jehan's avatar
jehan committed
167

jehan's avatar
jehan committed
168
BELLE_SIP_NEW_HEADER(header_to,header_address,"To")
jehan's avatar
jehan committed
169 170
BELLE_SIP_PARSE(header_to)
GET_SET_STRING_PARAM(belle_sip_header_to,tag);
171

jehan's avatar
jehan committed
172
/**************************
Simon Morlat's avatar
Simon Morlat committed
173
* Via header object inherits from parameters
jehan's avatar
jehan committed
174 175 176
****************************
*/
struct _belle_sip_header_via  {
177
	belle_sip_parameters_t params_list;
Simon Morlat's avatar
Simon Morlat committed
178 179 180
	char* protocol;
	char* transport;
	char* host;
181
	int port;
jehan's avatar
jehan committed
182 183
};

184
static void belle_sip_header_via_destroy(belle_sip_header_via_t* via) {
Simon Morlat's avatar
Simon Morlat committed
185 186 187 188 189
	if (via->host) belle_sip_free(via->host);
	if (via->protocol) belle_sip_free(via->protocol);
}

static void belle_sip_header_via_clone(belle_sip_header_via_t* via, const belle_sip_header_via_t*orig){
jehan's avatar
jehan committed
190 191
}

jehan's avatar
jehan committed
192
BELLE_SIP_NEW_HEADER(header_via,header_address,"Via")
jehan's avatar
jehan committed
193
BELLE_SIP_PARSE(header_via)
194 195 196 197 198 199 200 201 202 203 204
GET_SET_STRING(belle_sip_header_via,protocol);
GET_SET_STRING(belle_sip_header_via,transport);
GET_SET_STRING(belle_sip_header_via,host);
GET_SET_INT_PRIVATE(belle_sip_header_via,port,int,_);

GET_SET_STRING_PARAM(belle_sip_header_via,branch);
GET_SET_STRING_PARAM(belle_sip_header_via,maddr);
GET_SET_STRING_PARAM(belle_sip_header_via,received);

GET_SET_INT_PARAM_PRIVATE(belle_sip_header_via,rport,int,_)
GET_SET_INT_PARAM_PRIVATE(belle_sip_header_via,ttl,int,_)
Simon Morlat's avatar
Simon Morlat committed
205

206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
int belle_sip_header_via_set_rport (belle_sip_header_via_t* obj,int  value) {
	if (value ==-1 || (value>0 && value<65536)) {
		_belle_sip_header_via_set_rport(obj,value);
		return 0;
	} else {
		belle_sip_error("bad rport value [%i] for via",value);
		return -1;
	}
}
int belle_sip_header_via_set_ttl (belle_sip_header_via_t* obj,int  value) {
	if (value ==-1 || (value>0 && value<=255)) {
		_belle_sip_header_via_set_ttl(obj,value);
		return 0;
	} else {
		belle_sip_error("bad ttl value [%i] for via",value);
		return -1;
	}
}
224

225 226 227 228 229 230 231 232 233
int belle_sip_header_via_set_port (belle_sip_header_via_t* obj,int  value) {
	if (value ==-1 || (value>0 && value<65536)) {
		_belle_sip_header_via_set_port(obj,value);
		return 0;
	} else {
		belle_sip_error("bad port value [%i] for via",value);
		return -1;
	}
}
Simon Morlat's avatar
Simon Morlat committed
234

235
int belle_sip_header_via_get_listening_port(const belle_sip_header_via_t *via){
Simon Morlat's avatar
Simon Morlat committed
236 237 238 239 240
	int ret=belle_sip_header_via_get_port(via);
	if (ret==-1) ret=belle_sip_listening_point_get_well_known_port(via->protocol);
	return ret;
}

241
/**************************
Simon Morlat's avatar
Simon Morlat committed
242
* call_id header object inherits from object
243 244
****************************
*/
jehan's avatar
jehan committed
245
struct _belle_sip_header_call_id  {
jehan's avatar
jehan committed
246
	belle_sip_header_t header;
jehan's avatar
jehan committed
247
	const char* call_id;
248
};
jehan's avatar
jehan committed
249

jehan's avatar
jehan committed
250 251
static void belle_sip_header_call_id_destroy(belle_sip_header_call_id_t* call_id) {
	if (call_id->call_id) belle_sip_free((void*)call_id->call_id);
Simon Morlat's avatar
Simon Morlat committed
252
}
jehan's avatar
jehan committed
253

Simon Morlat's avatar
Simon Morlat committed
254
static void belle_sip_header_call_id_clone(belle_sip_header_call_id_t* call_id,const belle_sip_header_call_id_t *orig){
255 256
}

jehan's avatar
jehan committed
257
BELLE_SIP_NEW_HEADER(header_call_id,header,"Call-ID")
jehan's avatar
jehan committed
258 259
BELLE_SIP_PARSE(header_call_id)
GET_SET_STRING(belle_sip_header_call_id,call_id);
260 261 262 263 264
/**************************
* cseq header object inherent from object
****************************
*/
struct _belle_sip_header_cseq  {
jehan's avatar
jehan committed
265
	belle_sip_header_t header;
266 267 268
	const char* method;
	unsigned int seq_number;
};
jehan's avatar
jehan committed
269

270 271
static void belle_sip_header_cseq_destroy(belle_sip_header_cseq_t* cseq) {
	if (cseq->method) belle_sip_free((void*)cseq->method);
Simon Morlat's avatar
Simon Morlat committed
272
}
273

Simon Morlat's avatar
Simon Morlat committed
274 275
static void belle_sip_header_cseq_clone(belle_sip_header_cseq_t* cseq, const belle_sip_header_cseq_t *orig) {
	if (cseq->method) belle_sip_free((void*)cseq->method);
276 277
}

jehan's avatar
jehan committed
278
BELLE_SIP_NEW_HEADER(header_cseq,header,"CSeq")
279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295
BELLE_SIP_PARSE(header_cseq)
GET_SET_STRING(belle_sip_header_cseq,method);
GET_SET_INT(belle_sip_header_cseq,seq_number,unsigned int)
/**************************
* content type header object inherent from parameters
****************************
*/
struct _belle_sip_header_content_type  {
	belle_sip_parameters_t params_list;
	const char* type;
	const char* subtype;
};

static void belle_sip_header_content_type_destroy(belle_sip_header_content_type_t* content_type) {
	if (content_type->type) belle_sip_free((void*)content_type->type);
	if (content_type->subtype) belle_sip_free((void*)content_type->subtype);
}
jehan's avatar
jehan committed
296

Simon Morlat's avatar
Simon Morlat committed
297 298 299
static void belle_sip_header_content_type_clone(belle_sip_header_content_type_t* content_type, const belle_sip_header_content_type_t* orig){
}

jehan's avatar
jehan committed
300
BELLE_SIP_NEW_HEADER(header_content_type,parameters,"Content-Type")
301 302 303
BELLE_SIP_PARSE(header_content_type)
GET_SET_STRING(belle_sip_header_content_type,type);
GET_SET_STRING(belle_sip_header_content_type,subtype);
jehan's avatar
jehan committed
304 305 306 307 308 309 310 311 312
/**************************
* Route header object inherent from header_address
****************************
*/
struct _belle_sip_header_route  {
	belle_sip_header_address_t address;
};

static void belle_sip_header_route_destroy(belle_sip_header_route_t* route) {
Simon Morlat's avatar
Simon Morlat committed
313 314 315
}

static void belle_sip_header_route_clone(belle_sip_header_route_t* route, const belle_sip_header_route_t* orig) {
jehan's avatar
jehan committed
316 317
}

jehan's avatar
jehan committed
318
BELLE_SIP_NEW_HEADER(header_route,header_address,"Route")
jehan's avatar
jehan committed
319 320 321 322 323 324 325 326 327 328
BELLE_SIP_PARSE(header_route)
/**************************
* Record route header object inherent from header_address
****************************
*/
struct _belle_sip_header_record_route  {
	belle_sip_header_address_t address;
};

static void belle_sip_header_record_route_destroy(belle_sip_header_record_route_t* record_route) {
Simon Morlat's avatar
Simon Morlat committed
329 330 331 332
}

static void belle_sip_header_record_route_clone(belle_sip_header_record_route_t* record_route,
                                const belle_sip_header_record_route_t* orig               ) {
jehan's avatar
jehan committed
333 334
}

jehan's avatar
jehan committed
335
BELLE_SIP_NEW_HEADER(header_record_route,header_address,"Record-Route")
jehan's avatar
jehan committed
336
BELLE_SIP_PARSE(header_record_route)
jehan's avatar
jehan committed
337 338 339 340 341
/**************************
* content length header object inherent from object
****************************
*/
struct _belle_sip_header_content_length  {
jehan's avatar
jehan committed
342
	belle_sip_header_t header;
jehan's avatar
jehan committed
343 344 345 346
	unsigned int content_length;
};

static void belle_sip_header_content_length_destroy(belle_sip_header_content_length_t* content_length) {
Simon Morlat's avatar
Simon Morlat committed
347
}
jehan's avatar
jehan committed
348

Simon Morlat's avatar
Simon Morlat committed
349 350
static void belle_sip_header_content_length_clone(belle_sip_header_content_length_t* content_length,
                                                 const belle_sip_header_content_length_t *orig ) {
jehan's avatar
jehan committed
351
}
Simon Morlat's avatar
Simon Morlat committed
352 353


jehan's avatar
jehan committed
354
BELLE_SIP_NEW_HEADER(header_content_length,header,"Content-Length")
jehan's avatar
jehan committed
355 356
BELLE_SIP_PARSE(header_content_length)
GET_SET_INT(belle_sip_header_content_length,content_length,unsigned int)
jehan's avatar
jehan committed
357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398
/******************************
 * Extension header hinerite from header
 *
 ******************************/
struct _belle_sip_header_extension  {
	belle_sip_header_t header;
	const char* value;
};

static void belle_sip_header_extension_destroy(belle_sip_header_extension_t* extension) {
	if (extension->value) belle_sip_free((void*)extension->value);
}

static void belle_sip_header_extension_clone(belle_sip_header_extension_t* extension, const belle_sip_header_extension_t* orig){
}

BELLE_SIP_NEW_HEADER(header_extension,header,NULL)

/**
 * special case for this header. I don't know why
 */
belle_sip_header_extension_t* belle_sip_header_extension_parse (const char* value) {
	pANTLR3_INPUT_STREAM           input;
	pbelle_sip_messageLexer               lex;
	pANTLR3_COMMON_TOKEN_STREAM    tokens;
	pbelle_sip_messageParser              parser;
	input  = antlr3NewAsciiStringCopyStream	(
			(pANTLR3_UINT8)value,
			(ANTLR3_UINT32)strlen(value),
			((void *)0));
	lex    = belle_sip_messageLexerNew                (input);
	tokens = antlr3CommonTokenStreamSourceNew  (1025, lex->pLexer->rec->state->tokSource);
	parser = belle_sip_messageParserNew               (tokens);
	belle_sip_messageParser_header_extension_return l_parsed_object = parser->header_extension(parser,FALSE);
	parser ->free(parser);
	tokens ->free(tokens);
	lex    ->free(lex);
	input  ->close(input);
	if (l_parsed_object.ret == NULL) belle_sip_error("Parser error for [%s]",value);\
	return BELLE_SIP_HEADER_EXTENSION(l_parsed_object.ret);
}
GET_SET_STRING(belle_sip_header_extension,value);
399
/**************************
400
*Authorization header object inherent from parameters
401 402
****************************
*/
jehan's avatar
jehan committed
403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421
#define AUTH_BASE \
	belle_sip_parameters_t params_list; \
	const char* scheme; \
	const char* realm; \
	const char* nonce; \
	const char* algorithm; \
	const char* opaque; \
	const char* qop; \

#define AUTH_BASE_DESTROY(obj) \
	if (obj->scheme) belle_sip_free((void*)obj->scheme);\
	if (obj->realm) belle_sip_free((void*)obj->realm);\
	if (obj->nonce) belle_sip_free((void*)obj->nonce);\
	if (obj->algorithm) belle_sip_free((void*)obj->algorithm);\
	if (obj->opaque) belle_sip_free((void*)obj->opaque);\
	if (obj->qop) belle_sip_free((void*)obj->qop);\



422
struct _belle_sip_header_authorization  {
jehan's avatar
jehan committed
423
	AUTH_BASE
424
	const char* username;
jehan's avatar
jehan committed
425
	belle_sip_uri_t* uri;
jehan's avatar
jehan committed
426
	const char* response;
427 428
	const char* cnonce;
	int nonce_count;
429 430 431 432 433 434

};


static void belle_sip_header_authorization_destroy(belle_sip_header_authorization_t* authorization) {
	if (authorization->username) belle_sip_free((void*)authorization->username);
jehan's avatar
jehan committed
435 436 437
	if (authorization->uri) {
			belle_sip_object_unref(BELLE_SIP_OBJECT(authorization->uri));
	}
438
	if (authorization->cnonce) belle_sip_free((void*)authorization->cnonce);
jehan's avatar
jehan committed
439
	AUTH_BASE_DESTROY(authorization)
440 441 442 443 444
}

static void belle_sip_header_authorization_clone(belle_sip_header_authorization_t* authorization,
                                                 const belle_sip_header_authorization_t *orig ) {
}
445 446
static void belle_sip_header_authorization_init(belle_sip_header_authorization_t* authorization) {
}
447

jehan's avatar
jehan committed
448 449 450
belle_sip_uri_t* belle_sip_header_authorization_get_uri(const belle_sip_header_authorization_t* authorization) {
	return authorization->uri;
}
451

jehan's avatar
jehan committed
452 453 454 455 456 457 458
void belle_sip_header_authorization_set_uri(belle_sip_header_authorization_t* authorization, belle_sip_uri_t* uri) {
	if (authorization->uri) {
		belle_sip_object_unref(BELLE_SIP_OBJECT(authorization->uri));
	}
	authorization->uri=uri;
	if (authorization->uri) belle_sip_object_ref(authorization->uri);
}
459
BELLE_SIP_NEW_HEADER(header_authorization,parameters,"Authorization")
460
BELLE_SIP_PARSE(header_authorization)
jehan's avatar
jehan committed
461
GET_SET_STRING(belle_sip_header_authorization,scheme);
462
GET_SET_STRING(belle_sip_header_authorization,username);
jehan's avatar
jehan committed
463 464
GET_SET_STRING(belle_sip_header_authorization,realm);
GET_SET_STRING(belle_sip_header_authorization,nonce);
jehan's avatar
jehan committed
465
GET_SET_STRING(belle_sip_header_authorization,response);
jehan's avatar
jehan committed
466
GET_SET_STRING(belle_sip_header_authorization,algorithm);
467 468
GET_SET_STRING(belle_sip_header_authorization,cnonce);
GET_SET_STRING(belle_sip_header_authorization,opaque);
jehan's avatar
jehan committed
469
GET_SET_STRING(belle_sip_header_authorization,qop);
470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488
GET_SET_INT(belle_sip_header_authorization,nonce_count,int)

/**************************
*Proxy-Authorization header object inherent from parameters
****************************
*/
struct _belle_sip_header_proxy_authorization  {
	belle_sip_header_authorization_t authorization;
};


static void belle_sip_header_proxy_authorization_destroy(belle_sip_header_proxy_authorization_t* proxy_authorization) {
}

static void belle_sip_header_proxy_authorization_clone(belle_sip_header_proxy_authorization_t* proxy_authorization,
                                                 const belle_sip_header_proxy_authorization_t *orig ) {
}
BELLE_SIP_NEW_HEADER(header_proxy_authorization,header_authorization,"Proxy-Authorization")
BELLE_SIP_PARSE(header_proxy_authorization)
jehan's avatar
jehan committed
489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505
/**************************
*WWW-Authorization header object inherent from parameters
****************************
*/
struct _belle_sip_header_www_authenticate  {
	AUTH_BASE
	const char* domain;
	unsigned int stale;
};


static void belle_sip_header_www_authenticate_destroy(belle_sip_header_www_authenticate_t* www_authenticate) {
}

static void belle_sip_header_www_authenticate_clone(belle_sip_header_www_authenticate_t* www_authenticate,
                                                 const belle_sip_header_www_authenticate_t *orig ) {
}
jehan's avatar
jehan committed
506
BELLE_SIP_NEW_HEADER(header_www_authenticate,parameters,"WWW-Authenticate")
jehan's avatar
jehan committed
507 508 509 510 511 512 513 514 515
BELLE_SIP_PARSE(header_www_authenticate)
GET_SET_STRING(belle_sip_header_www_authenticate,scheme);
GET_SET_STRING(belle_sip_header_www_authenticate,realm);
GET_SET_STRING(belle_sip_header_www_authenticate,nonce);
GET_SET_STRING(belle_sip_header_www_authenticate,algorithm);
GET_SET_STRING(belle_sip_header_www_authenticate,opaque);
GET_SET_STRING(belle_sip_header_www_authenticate,qop);
GET_SET_STRING(belle_sip_header_www_authenticate,domain)
GET_SET_BOOL(belle_sip_header_www_authenticate,stale,is)