summaryrefslogtreecommitdiffstats
path: root/tinyNET/src/turn/tnet_turn_attribute.c
blob: 5dc3ee3b60f67c65caa802c13f83fd302c0a9b57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
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
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
///*
//* Copyright (C) 2010-2011 Mamadou Diop.
//*
//* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
//*
//* This file is part of Open Source Doubango Framework.
//*
//* DOUBANGO 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.
//*
//* DOUBANGO 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 DOUBANGO.
//*
//*/
//
///**@file tnet_turn_attribute.c
// * @brief New STUN Attributes as per draft-ietf-behave-turn-16 subclause 14.
// *
// * @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
// *
//
// */
//#include "tnet_turn_attribute.h"
//
//#include "../stun/tnet_stun.h"
//
//#include "../tnet_endianness.h"
//
//#include "tsk_debug.h"
//
//#include <string.h>
//
//
///**@ingroup tnet_turn_group
//* draft-ietf-behave-turn-16 - 14.1.  CHANNEL-NUMBER */
//tnet_turn_attribute_channelnum_t* tnet_turn_attribute_channelnum_create(uint16_t number)
//{
//	return tsk_object_new(tnet_turn_attribute_channelnum_def_t, number);
//}
//
///**@ingroup tnet_turn_group
//* draft-ietf-behave-turn-16 - 14.2.  LIFETIME */
//tnet_turn_attribute_lifetime_t* tnet_turn_attribute_lifetime_create(uint32_t lifetime)
//{
//	return tsk_object_new(tnet_turn_attribute_lifetime_def_t, lifetime);
//}
//
//
///**@ingroup tnet_turn_group
//* draft-ietf-behave-turn-16 - 14.3.  XOR-PEER-ADDRESS */
//tnet_turn_attribute_xpeer_addr_t* tnet_turn_attribute_xpeer_addr_create(const void* payload, tsk_size_t payload_size)
//{
//	return tsk_object_new(tnet_turn_attribute_xpeer_addr_def_t, payload, payload_size);
//}
//
//tnet_turn_attribute_xpeer_addr_t* tnet_turn_attribute_xpeer_addr_create_null()
//{
//	return tnet_turn_attribute_xpeer_addr_create(tsk_null, 0);
//}
//
///**@ingroup tnet_turn_group
//* draft-ietf-behave-turn-16 - 14.4.  DATA */
//tnet_turn_attribute_data_t* tnet_turn_attribute_data_create(const void* payload, tsk_size_t payload_size)
//{
//	return tsk_object_new(tnet_turn_attribute_data_def_t, payload, payload_size);
//}
//
///**@ingroup tnet_turn_group
//* draft-ietf-behave-turn-16 - 14.5.  XOR-RELAYED-ADDRESS */
//tnet_turn_attribute_xrelayed_addr_t* tnet_turn_attribute_xrelayed_addr_create(const void* payload, tsk_size_t payload_size)
//{
//	return tsk_object_new(tnet_turn_attribute_xrelayed_addr_def_t, payload, payload_size);
//}
//
///**@ingroup tnet_turn_group
//* draft-ietf-behave-turn-16 - 14.6.  EVEN-PORT */
//tnet_turn_attribute_even_port_t* tnet_turn_attribute_even_port_create(unsigned R)
//{
//	return tsk_object_new(tnet_turn_attribute_even_port_def_t, R);
//}
//
///**@ingroup tnet_turn_group
//* draft-ietf-behave-turn-16 - 14.7.  REQUESTED-TRANSPORT */
//tnet_turn_attribute_reqtrans_t* tnet_turn_attribute_reqtrans_create(tnet_proto_t protocol)
//{
//	return tsk_object_new(tnet_turn_attribute_reqtrans_def_t, protocol);
//}
//
///**@ingroup tnet_turn_group
//* draft-ietf-behave-turn-16 - 14.8.  DONT-FRAGMENT */
//tnet_turn_attribute_dontfrag_t* tnet_turn_attribute_dontfrag_create()
//{
//	return tsk_object_new(tnet_turn_attribute_dontfrag_def_t);
//}
//
///**@ingroup tnet_turn_group
//* draft-ietf-behave-turn-16 - 14.9.  RESERVATION-TOKEN */
//tnet_turn_attribute_restoken_t* tnet_turn_attribute_restoken_create(const void* payload, tsk_size_t payload_size)
//{
//	return tsk_object_new(tnet_turn_attribute_restoken_def_t, payload, payload_size);
//}
//
///**@ingroup tnet_turn_group
//*/
//tnet_stun_attr_t* tnet_turn_attribute_deserialize(tnet_stun_attr_type_t type, uint16_t length, const void* payload, tsk_size_t payload_size)
//{
//	tnet_stun_attr_t *attribute = tsk_null;
//	const uint8_t* dataPtr = payload;
//
//	/* Attribute Value
//	*/
//
//	switch(type)
//	{
//	/*	draft-ietf-behave-turn-16 - 14.1.  CHANNEL-NUMBER */
//	case stun_channel_number:
//		{
//			uint32_t number = tnet_htonl_2(dataPtr);
//			attribute = (tnet_stun_attr_t *)tnet_turn_attribute_channelnum_create(number);
//			break;
//		}
//
//	/*	draft-ietf-behave-turn-16 - 14.2.  LIFETIME */
//	case stun_lifetime:
//		{
//			uint32_t lifetime = tnet_htonl_2(dataPtr);
//			attribute = (tnet_stun_attr_t *)tnet_turn_attribute_lifetime_create(lifetime);
//			break;
//		}
//
//	/*	draft-ietf-behave-turn-16 - 14.3.  XOR-PEER-ADDRESS */
//	case stun_xor_peer_address:
//		{
//			TSK_DEBUG_ERROR("==> NOT IMPLEMENTED");
//			break;
//		}
//
//	/*	draft-ietf-behave-turn-16 - 14.4.  DATA */
//	case stun_data:
//		{
//			TSK_DEBUG_ERROR("==> NOT IMPLEMENTED");
//			break;
//		}
//
//	/*	draft-ietf-behave-turn-16 - 14.5.  XOR-RELAYED-ADDRESS */
//	case stun_xor_relayed_address:
//		{
//			attribute = (tnet_stun_attr_t *)tnet_turn_attribute_xrelayed_addr_create(dataPtr, length);
//			break;
//		}
//
//	/*	draft-ietf-behave-turn-16 - 14.6.  EVEN-PORT */
//	case stun_even_port:
//		{
//			TSK_DEBUG_ERROR("==> NOT IMPLEMENTED");
//			break;
//		}
//
//	/*	draft-ietf-behave-turn-16 - 14.7.  REQUESTED-TRANSPORT */
//	case stun_requested_transport:
//		{
//			TSK_DEBUG_ERROR("==> NOT IMPLEMENTED");
//			break;
//		}
//
//	/*	draft-ietf-behave-turn-16 - 14.8.  DONT-FRAGMENT */
//	case stun_dont_fragment:
//		{
//			TSK_DEBUG_ERROR("==> NOT IMPLEMENTED");
//			break;
//		}
//
//	/*	draft-ietf-behave-turn-16 - 14.9.  RESERVATION-TOKEN */
//	case stun_reservation_token:
//		{
//			TSK_DEBUG_ERROR("==> NOT IMPLEMENTED");
//			break;
//		}
//
//	default:
//		{
//			TSK_DEBUG_ERROR("==> NOT IMPLEMENTED");
//			break;
//		}
//	}
//
//	if(!attribute){
//		/* Create default */
//		attribute = tnet_stun_attribute_create();
//	}
//
//	return attribute;
//}
//
///**@ingroup tnet_turn_group
//*/
//int tnet_turn_attribute_serialize(const tnet_stun_attr_t* attribute, tsk_buffer_t *output)
//{
//	if(!attribute || !output){
//		return -1;
//	}
//
//	/* Attribute Value
//	*/
//
//	switch(attribute->type){
//	/*	draft-ietf-behave-turn-16 - 14.1.  CHANNEL-NUMBER */
//	case stun_channel_number:
//		{
//			tnet_turn_attribute_channelnum_t *number = (tnet_turn_attribute_channelnum_t*)attribute;
//			tsk_buffer_append(output, &(number->number), 2);
//			return 0;
//		}
//
//	/*	draft-ietf-behave-turn-16 - 14.2.  LIFETIME */
//	case stun_lifetime:
//		{
//			tnet_turn_attribute_lifetime_t *lifetime = (tnet_turn_attribute_lifetime_t*)attribute;
//			tsk_buffer_append(output, &(lifetime->value), 4);
//			return 0;
//		}
//
//	/*	draft-ietf-behave-turn-16 - 14.3.  XOR-PEER-ADDRESS */
//	case stun_xor_peer_address:
//		{
//			tnet_turn_attribute_xpeer_addr_t* xpeer = (tnet_turn_attribute_xpeer_addr_t*)attribute;
//			if(xpeer){
//				if(xpeer->family == stun_ipv4){
//					uint8_t pad = 0x00;
//					tsk_buffer_append(output, &pad, 1);
//					tsk_buffer_append(output, &xpeer->family, 1);
//					tsk_buffer_append(output, &xpeer->xport, 2);
//					tsk_buffer_append(output, xpeer->xaddress, 4);
//				}
//				else
//				{
//					TSK_DEBUG_ERROR("SERIALIZE:XOR-PEER-ADDRESS ==> IPV6 - NOT IMPLEMENTED");
//					return -3;
//				}
//			}
//			return 0;
//		}
//
//	/*	draft-ietf-behave-turn-16 - 14.4.  DATA */
//	case stun_data:
//		{
//			tnet_turn_attribute_data_t *data = (tnet_turn_attribute_data_t*)attribute;
//			if(data->value){
//				tsk_buffer_append(output, data->value->data, data->value->size);
//			}
//			return 0;
//		}
//
//	/*	draft-ietf-behave-turn-16 - 14.5.  XOR-RELAYED-ADDRESS */
//	case stun_xor_relayed_address:
//		{
//			TSK_DEBUG_ERROR("SERIALIZE:XOR-RELAYED-ADDRESS ==> NOT IMPLEMENTED");
//			return -3;
//		}
//
//	/*	draft-ietf-behave-turn-16 - 14.6.  EVEN-PORT */
//	case stun_even_port:
//		{
//			tnet_turn_attribute_even_port_t *even_port = (tnet_turn_attribute_even_port_t*)attribute;
//			uint8_t value = (even_port->R << 7);
//			tsk_buffer_append(output, &(value), 1);
//			return 0;
//		}
//
//	/*	draft-ietf-behave-turn-16 - 14.7.  REQUESTED-TRANSPORT */
//	case stun_requested_transport:
//		{
//			tnet_turn_attribute_reqtrans_t *reqtrans = (tnet_turn_attribute_reqtrans_t*)attribute;
//			tsk_buffer_append(output, &(reqtrans->protocol), 1);
//			tsk_buffer_append(output, &(reqtrans->rffu), 3);
//			return 0;
//		}
//
//	/*	draft-ietf-behave-turn-16 - 14.8.  DONT-FRAGMENT */
//	case stun_dont_fragment:
//		{
//			TSK_DEBUG_ERROR("SERIALIZE:DONT-FRAGMENT ==> NOT IMPLEMENTED");
//			return -3;
//		}
//
//	/*	draft-ietf-behave-turn-16 - 14.9.  RESERVATION-TOKEN */
//	case stun_reservation_token:
//		{
//			TSK_DEBUG_ERROR("SERIALIZE:TOKEN ==> NOT IMPLEMENTED");
//			return -3;
//		}
//
//        default: break;
//	}
//
//	return 0;
//}
//
//
//
//
//
//
//
//
////=================================================================================================
////	[[draft-ietf-behave-turn-16 - 14.1.  CHANNEL-NUMBER]] object definition
////
//static tsk_object_t* tnet_turn_attribute_channelnum_ctor(tsk_object_t * self, va_list * app)
//{
//	tnet_turn_attribute_channelnum_t *attribute = self;
//	if(attribute){
//		attribute->number = tsk_va_arg_u16(*app);
//		TNET_STUN_ATTRIBUTE(attribute)->type = stun_channel_number;
//		TNET_STUN_ATTRIBUTE(attribute)->length = 2;
//	}
//	return self;
//}
//
//static tsk_object_t* tnet_turn_attribute_channelnum_dtor(tsk_object_t * self)
//{
//	tnet_turn_attribute_channelnum_t *attribute = self;
//	if(attribute){
//	}
//	return self;
//}
//
//static const tsk_object_def_t tnet_turn_attribute_channelnum_def_s =
//{
//	sizeof(tnet_turn_attribute_channelnum_t),
//	tnet_turn_attribute_channelnum_ctor,
//	tnet_turn_attribute_channelnum_dtor,
//	tsk_null,
//};
//const tsk_object_def_t *tnet_turn_attribute_channelnum_def_t = &tnet_turn_attribute_channelnum_def_s;
//
//
//
////=================================================================================================
////	[[draft-ietf-behave-turn-16 - 14.2.  LIFETIME]] object definition
////
//static tsk_object_t* tnet_turn_attribute_lifetime_ctor(tsk_object_t * self, va_list * app)
//{
//	tnet_turn_attribute_lifetime_t *attribute = self;
//	if(attribute){
//		attribute->value = /*tnet_htonl*/(va_arg(*app, uint32_t));
//		TNET_STUN_ATTRIBUTE(attribute)->type = stun_lifetime;
//		TNET_STUN_ATTRIBUTE(attribute)->length = 4;
//	}
//	return self;
//}
//
//static tsk_object_t* tnet_turn_attribute_lifetime_dtor(tsk_object_t * self)
//{
//	tnet_turn_attribute_lifetime_t *attribute = self;
//	if(attribute){
//	}
//	return self;
//}
//
//static const tsk_object_def_t tnet_turn_attribute_lifetime_def_s =
//{
//	sizeof(tnet_turn_attribute_lifetime_t),
//	tnet_turn_attribute_lifetime_ctor,
//	tnet_turn_attribute_lifetime_dtor,
//	tsk_null,
//};
//const tsk_object_def_t *tnet_turn_attribute_lifetime_def_t = &tnet_turn_attribute_lifetime_def_s;
//
//
//
//
////=================================================================================================
////	[[draft-ietf-behave-turn-16 - 14.3.  XOR-PEER-ADDRESS]] object definition
////
//static tsk_object_t* tnet_turn_attribute_xpeer_addr_ctor(tsk_object_t * self, va_list * app)
//{
//	tnet_turn_attribute_xpeer_addr_t *attribute = self;
//	if(attribute){
//		const void *payload = va_arg(*app, const void*);
//		tsk_size_t payload_size = va_arg(*app, tsk_size_t);
//
//		if(payload && payload_size){
//		}
//		TNET_STUN_ATTRIBUTE(attribute)->type = stun_xor_peer_address;
//		TNET_STUN_ATTRIBUTE(attribute)->length = 8;
//	}
//	return self;
//}
//
//static tsk_object_t* tnet_turn_attribute_xpeer_addr_dtor(tsk_object_t * self)
//{
//	tnet_turn_attribute_xpeer_addr_t *attribute = self;
//	if(attribute){
//	}
//	return self;
//}
//
//static const tsk_object_def_t tnet_turn_attribute_xpeer_addr_def_s =
//{
//	sizeof(tnet_turn_attribute_xpeer_addr_t),
//	tnet_turn_attribute_xpeer_addr_ctor,
//	tnet_turn_attribute_xpeer_addr_dtor,
//	tsk_null,
//};
//const tsk_object_def_t *tnet_turn_attribute_xpeer_addr_def_t = &tnet_turn_attribute_xpeer_addr_def_s;
//
//
////=================================================================================================
////	[[draft-ietf-behave-turn-16 - 14.4.  DATA]] object definition
////
//static tsk_object_t* tnet_turn_attribute_data_ctor(tsk_object_t * self, va_list * app)
//{
//	tnet_turn_attribute_data_t *attribute = self;
//	if(attribute){
//		const void *payload = va_arg(*app, const void*);
//		tsk_size_t payload_size = va_arg(*app, tsk_size_t);
//
//		if(payload && payload_size){
//			attribute->value = tsk_buffer_create(payload, payload_size);
//		}
//		TNET_STUN_ATTRIBUTE(attribute)->type = stun_data;
//		TNET_STUN_ATTRIBUTE(attribute)->length = (uint16_t)payload_size;
//	}
//	return self;
//}
//
//static tsk_object_t* tnet_turn_attribute_data_dtor(tsk_object_t * self)
//{
//	tnet_turn_attribute_data_t *attribute = self;
//	if(attribute){
//		TSK_OBJECT_SAFE_FREE(attribute->value);
//	}
//	return self;
//}
//
//static const tsk_object_def_t tnet_turn_attribute_data_def_s =
//{
//	sizeof(tnet_turn_attribute_data_t),
//	tnet_turn_attribute_data_ctor,
//	tnet_turn_attribute_data_dtor,
//	tsk_null,
//};
//const tsk_object_def_t *tnet_turn_attribute_data_def_t = &tnet_turn_attribute_data_def_s;
//
////=================================================================================================
////	[[draft-ietf-behave-turn-16 - 14.5.  XOR-RELAYED-ADDRESS]] object definition
////
//static tsk_object_t* tnet_turn_attribute_xrelayed_addr_ctor(tsk_object_t * self, va_list * app)
//{
//	tnet_turn_attribute_xrelayed_addr_t *attribute = self;
//	if(attribute){
//		const void *payload = va_arg(*app, const void*);
//		tsk_size_t payload_size = va_arg(*app, tsk_size_t);
//
//		if(payload && payload_size){
//			const uint8_t *payloadPtr = (const uint8_t*)payload;
//			payloadPtr += 1; /* Ignore first 8bits */
//
//			TNET_STUN_ATTRIBUTE(attribute)->type = stun_xor_relayed_address;
//			TNET_STUN_ATTRIBUTE(attribute)->length = payload_size;
//
//			attribute->family = (tnet_stun_addr_family_t)(*(payloadPtr++));
//
//			attribute->xport = tnet_ntohs_2(payloadPtr);
//			attribute->xport ^= 0x2112;
//			payloadPtr+=2;
//
//			{	/*=== Compute IP address */
//				tsk_size_t addr_size = (attribute->family == stun_ipv6) ? 16 : (attribute->family == stun_ipv4 ? 4 : 0);
//				if(addr_size){
//					tsk_size_t i;
//					uint32_t addr;
//
//					for(i=0; i<addr_size; i+=4){
//						addr = tnet_htonl_2(payloadPtr);
//						addr ^= kStunMagicCookieLong;
//						memcpy(&attribute->xaddress[i], &addr, 4);
//						payloadPtr+=4;
//					}
//				}
//				else{
//					TSK_DEBUG_ERROR("UNKNOWN FAMILY [%u].", attribute->family);
//				}
//			}
//		}
//	}
//	return self;
//}
//
//static tsk_object_t* tnet_turn_attribute_xrelayed_addr_dtor(tsk_object_t * self)
//{
//	tnet_turn_attribute_xrelayed_addr_t *attribute = self;
//	if(attribute){
//	}
//	return self;
//}
//
//static const tsk_object_def_t tnet_turn_attribute_xrelayed_addr_def_s =
//{
//	sizeof(tnet_turn_attribute_xrelayed_addr_t),
//	tnet_turn_attribute_xrelayed_addr_ctor,
//	tnet_turn_attribute_xrelayed_addr_dtor,
//	tsk_null,
//};
//const tsk_object_def_t *tnet_turn_attribute_xrelayed_addr_def_t = &tnet_turn_attribute_xrelayed_addr_def_s;
//
//
////=================================================================================================
////	[[draft-ietf-behave-turn-16 - 14.6.  EVEN-PORT]] object definition
////
//static tsk_object_t* tnet_turn_attribute_even_port_ctor(tsk_object_t * self, va_list * app)
//{
//	tnet_turn_attribute_even_port_t *attribute = self;
//	if(attribute){
//		attribute->R = va_arg(*app, unsigned);
//
//		TNET_STUN_ATTRIBUTE(attribute)->type = stun_even_port;
//		TNET_STUN_ATTRIBUTE(attribute)->length = 1;
//	}
//	return self;
//}
//
//static tsk_object_t* tnet_turn_attribute_even_port_dtor(tsk_object_t * self)
//{
//	tnet_turn_attribute_even_port_t *attribute = self;
//	if(attribute){
//	}
//	return self;
//}
//
//static const tsk_object_def_t tnet_turn_attribute_even_port_def_s =
//{
//	sizeof(tnet_turn_attribute_even_port_t),
//	tnet_turn_attribute_even_port_ctor,
//	tnet_turn_attribute_even_port_dtor,
//	tsk_null,
//};
//const tsk_object_def_t *tnet_turn_attribute_even_port_def_t = &tnet_turn_attribute_even_port_def_s;
//
//
////=================================================================================================
////	[[draft-ietf-behave-turn-16 - 14.7.  REQUESTED-TRANSPORT]] object definition
////
//static tsk_object_t* tnet_turn_attribute_reqtrans_ctor(tsk_object_t * self, va_list * app)
//{
//	tnet_turn_attribute_reqtrans_t *attribute = self;
//	if(attribute){
//		attribute->protocol = va_arg(*app, tnet_proto_t);
//
//		TNET_STUN_ATTRIBUTE(attribute)->type = stun_requested_transport;
//		TNET_STUN_ATTRIBUTE(attribute)->length = 4;
//	}
//	return self;
//}
//
//static tsk_object_t* tnet_turn_attribute_reqtrans_dtor(tsk_object_t * self)
//{
//	tnet_turn_attribute_reqtrans_t *attribute = self;
//	if(attribute){
//	}
//	return self;
//}
//
//static const tsk_object_def_t tnet_turn_attribute_reqtrans_def_s =
//{
//	sizeof(tnet_turn_attribute_reqtrans_t),
//	tnet_turn_attribute_reqtrans_ctor,
//	tnet_turn_attribute_reqtrans_dtor,
//	tsk_null,
//};
//const tsk_object_def_t *tnet_turn_attribute_reqtrans_def_t = &tnet_turn_attribute_reqtrans_def_s;
//
//
////=================================================================================================
////	[[draft-ietf-behave-turn-16 - 14.8.  DONT-FRAGMENT]] object definition
////
//static tsk_object_t* tnet_turn_attribute_dontfrag_ctor(tsk_object_t * self, va_list * app)
//{
//	tnet_turn_attribute_dontfrag_t *attribute = self;
//	if(attribute){
//		//const void *payload = va_arg(*app, const void*);
//		//tsk_size_t payload_size = va_arg(*app, tsk_size_t);
//
//		TNET_STUN_ATTRIBUTE(attribute)->type = stun_dont_fragment;
//	}
//	return self;
//}
//
//static tsk_object_t* tnet_turn_attribute_dontfrag_dtor(tsk_object_t * self)
//{
//	tnet_turn_attribute_dontfrag_t *attribute = self;
//	if(attribute){
//	}
//	return self;
//}
//
//static const tsk_object_def_t tnet_turn_attribute_dontfrag_def_s =
//{
//	sizeof(tnet_turn_attribute_dontfrag_t),
//	tnet_turn_attribute_dontfrag_ctor,
//	tnet_turn_attribute_dontfrag_dtor,
//	tsk_null,
//};
//const tsk_object_def_t *tnet_turn_attribute_dontfrag_def_t = &tnet_turn_attribute_dontfrag_def_s;
//
//
//
////=================================================================================================
////	[[draft-ietf-behave-turn-16 - 14.9.  RESERVATION-TOKEN]] object definition
////
//static tsk_object_t* tnet_turn_attribute_restoken_ctor(tsk_object_t * self, va_list * app)
//{
//	tnet_turn_attribute_restoken_t *attribute = self;
//	if(attribute){
//		//--const void *payload = va_arg(*app, const void*);
//		//--tsk_size_t payload_size = va_arg(*app, tsk_size_t);
//
//		TNET_STUN_ATTRIBUTE(attribute)->type = stun_reservation_token;
//	}
//	return self;
//}
//
//static tsk_object_t* tnet_turn_attribute_restoken_dtor(tsk_object_t * self)
//{
//	tnet_turn_attribute_restoken_t *attribute = self;
//	if(attribute){
//	}
//	return self;
//}
//
//static const tsk_object_def_t tnet_turn_attribute_restoken_def_s =
//{
//	sizeof(tnet_turn_attribute_restoken_t),
//	tnet_turn_attribute_restoken_ctor,
//	tnet_turn_attribute_restoken_dtor,
//	tsk_null,
//};
//const tsk_object_def_t *tnet_turn_attribute_restoken_def_t = &tnet_turn_attribute_restoken_def_s;
OpenPOWER on IntegriCloud