nice 0.1.9

Bindings for libnice >= v0.1.4
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
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
use libc;

pub const FALSE:libc::c_int = 0;
pub const TRUE:libc::c_int = !FALSE;

//#[link(name="glib-2.0")]
extern "C" {
	pub fn g_free(addr: *mut libc::c_int);
}

//#[link(name="glib-2.0")]
extern "C" {
	pub fn g_object_unref(addr: *mut _NiceAgent);
}

/*
struct _NiceAgent
*/
#[repr(C)]
pub struct _NiceAgent;

#[repr(C)]
pub struct _NiceAddress;
#[repr(C)]
pub struct _GList;
#[repr(C)]
pub struct _GSList;
#[repr(C)]
pub struct _GError;
#[repr(C)]
pub struct _GSocket;
#[repr(C)]
pub struct _GIOStream;
#[repr(C)]
pub struct _GObject;
#[repr(C)]
pub struct _GObjectClass;
#[repr(C)]
pub struct _GMainContext;
#[repr(C)]
pub struct _GCancellable;
#[repr(C)]
pub struct _GCancellablePrivate;
#[repr(C)]
pub struct _GOutputVector;
#[repr(C)]
pub struct _GInputVector;
#[repr(C)]
pub struct sockaddr;

/*
struct _NiceCandidate
		(NiceCandidateType) type [NiceCandidateType]
		(NiceCandidateTransport) transport [NiceCandidateTransport]
		(NiceAddress) addr [struct _NiceAddress]
		(NiceAddress) base_addr [struct _NiceAddress]
		(guint32) priority [unsigned int]
		(guint) stream_id [unsigned int]
		(guint) component_id [unsigned int]
		(gchar [33]) foundation [char [33]]
		(gchar *) username [char *]
		(gchar *) password [char *]
		(TurnServer *) turn [struct _TurnServer *]
		(gpointer) sockptr [void *]
*/
#[repr(C)]
pub struct _NiceCandidate {
	pub type_: libc::c_uint,
	pub transport: libc::c_uint,
	pub addr: _NiceAddress,
	pub base_addr: _NiceAddress,
	pub priority: libc::c_uint,
	pub stream_id: libc::c_uint,
	pub component_id: libc::c_uint,
	pub foundation: [libc::c_char; 33],
	pub username: *mut libc::c_char,
	pub password: *mut libc::c_char,
	pub turn: *mut _TurnServer,
	pub sockptr: *mut libc::c_void,
}

/*
struct _TurnServer
		(gint) ref_count [int]
		(NiceAddress) server [struct _NiceAddress]
		(gchar *) username [char *]
		(gchar *) password [char *]
		(NiceRelayType) type [NiceRelayType]
*/
#[repr(C)]
pub struct _TurnServer {
	pub ref_count: libc::c_int,
	pub server: _NiceAddress,
	pub username: *mut libc::c_char,
	pub password: *mut libc::c_char,
	pub type_: libc::c_uint,
}

/*
struct _NiceAgentClass
		(GObjectClass) parent_class [struct _GObjectClass]
*/
#[repr(C)]
pub struct _NiceAgentClass {
	pub parent_class: _GObjectClass,
}

/*
struct NiceCandidate
		(NiceCandidateType) type [NiceCandidateType]
		(NiceCandidateTransport) transport [NiceCandidateTransport]
		(NiceAddress) addr [struct _NiceAddress]
		(NiceAddress) base_addr [struct _NiceAddress]
		(guint32) priority [unsigned int]
		(guint) stream_id [unsigned int]
		(guint) component_id [unsigned int]
		(gchar [33]) foundation [char [33]]
		(gchar *) username [char *]
		(gchar *) password [char *]
		(TurnServer *) turn [struct _TurnServer *]
		(gpointer) sockptr [void *]
*/
#[repr(C)]
pub struct NiceCandidate {
	pub type_: libc::c_uint,
	pub transport: libc::c_uint,
	pub addr: _NiceAddress,
	pub base_addr: _NiceAddress,
	pub priority: libc::c_uint,
	pub stream_id: libc::c_uint,
	pub component_id: libc::c_uint,
	pub foundation: [libc::c_char; 33],
	pub username: *mut libc::c_char,
	pub password: *mut libc::c_char,
	pub turn: *mut _TurnServer,
	pub sockptr: *mut libc::c_void,
}

/*
struct GMainContext
*/
#[repr(C)]
pub struct GMainContext;

/*
struct NiceAgent
*/
#[repr(C)]
pub struct NiceAgent;

/*
struct GSList
		(gpointer) data [void *]
		(GSList *) next [struct _GSList *]
*/
#[repr(C)]
pub struct GSList {
	pub data: *mut libc::c_void,
	pub next: *mut _GSList,
}

/*
struct NiceOutputMessage
		(GOutputVector *) buffers [struct _GOutputVector *]
		(gint) n_buffers [int]
*/
#[repr(C)]
pub struct NiceOutputMessage {
	pub buffers: *mut _GOutputVector,
	pub n_buffers: libc::c_int,
}

/*
struct GCancellable
		(GObject) parent_instance [struct _GObject]
		(GCancellablePrivate *) priv [struct _GCancellablePrivate *]
*/
#[repr(C)]
pub struct GCancellable {
	pub parent_instance: _GObject,
	pub priv_: *mut _GCancellablePrivate,
}

/*
struct NiceInputMessage
		(GInputVector *) buffers [struct _GInputVector *]
		(gint) n_buffers [int]
		(NiceAddress *) from [struct _NiceAddress *]
		(gsize) length [unsigned long]
*/
#[repr(C)]
pub struct NiceInputMessage {
	pub buffers: *mut _GInputVector,
	pub n_buffers: libc::c_int,
	pub from: *mut _NiceAddress,
	pub length: libc::c_ulong,
}

/*
void nice_address_init()
	(NiceAddress *) addr [struct _NiceAddress *]
*/
#[link(name="glib-2.0")]
#[link(name="nice")]
#[link(name="glib-2.0")]
extern "C" {
	pub fn nice_address_init(addr: *mut _NiceAddress);
}


/*
NiceAddress * nice_address_new() [struct _NiceAddress *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_address_new() -> *mut _NiceAddress;
}


/*
void nice_address_free()
	(NiceAddress *) addr [struct _NiceAddress *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_address_free(addr: *mut _NiceAddress);
}


/*
NiceAddress * nice_address_dup() [struct _NiceAddress *]
	(const NiceAddress *) addr [const struct _NiceAddress *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_address_dup(addr: *const _NiceAddress) -> *mut _NiceAddress;
}


/*
void nice_address_set_ipv4()
	(NiceAddress *) addr [struct _NiceAddress *]
	(guint32) addr_ipv4 [unsigned int]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_address_set_ipv4(addr: *mut _NiceAddress, addr_ipv4: libc::c_uint);
}


/*
void nice_address_set_ipv6()
	(NiceAddress *) addr [struct _NiceAddress *]
	(const guchar *) addr_ipv6 [const unsigned char *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_address_set_ipv6(addr: *mut _NiceAddress, addr_ipv6: *const libc::c_uchar);
}


/*
void nice_address_set_port()
	(NiceAddress *) addr [struct _NiceAddress *]
	(guint) port [unsigned int]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_address_set_port(addr: *mut _NiceAddress, port: libc::c_uint);
}


/*
guint nice_address_get_port() [unsigned int]
	(const NiceAddress *) addr [const struct _NiceAddress *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_address_get_port(addr: *const _NiceAddress) -> libc::c_uint;
}


/*
gboolean nice_address_set_from_string() [int]
	(NiceAddress *) addr [struct _NiceAddress *]
	(const gchar *) str [const char *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_address_set_from_string(addr: *mut _NiceAddress, str: *const libc::c_char) -> libc::c_int;
}


/*
void nice_address_set_from_sockaddr()
	(NiceAddress *) addr [struct _NiceAddress *]
	(const struct sockaddr *) sin [const struct sockaddr *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_address_set_from_sockaddr(addr: *mut _NiceAddress, sin: *const sockaddr);
}


/*
void nice_address_copy_to_sockaddr()
	(const NiceAddress *) addr [const struct _NiceAddress *]
	(struct sockaddr *) sin [struct sockaddr *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_address_copy_to_sockaddr(addr: *const _NiceAddress, sin: *mut sockaddr);
}


/*
gboolean nice_address_equal() [int]
	(const NiceAddress *) a [const struct _NiceAddress *]
	(const NiceAddress *) b [const struct _NiceAddress *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_address_equal(a: *const _NiceAddress, b: *const _NiceAddress) -> libc::c_int;
}


/*
void nice_address_to_string()
	(const NiceAddress *) addr [const struct _NiceAddress *]
	(gchar *) dst [char *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_address_to_string(addr: *const _NiceAddress, dst: *mut libc::c_char);
}


/*
gboolean nice_address_is_private() [int]
	(const NiceAddress *) addr [const struct _NiceAddress *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_address_is_private(addr: *const _NiceAddress) -> libc::c_int;
}


/*
gboolean nice_address_is_valid() [int]
	(const NiceAddress *) addr [const struct _NiceAddress *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_address_is_valid(addr: *const _NiceAddress) -> libc::c_int;
}


/*
int nice_address_ip_version()
	(const NiceAddress *) addr [const struct _NiceAddress *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_address_ip_version(addr: *const _NiceAddress) -> libc::c_int;
}


/*
NiceCandidate * nice_candidate_new() [struct _NiceCandidate *]
	(NiceCandidateType) type [NiceCandidateType]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_candidate_new(type_: libc::c_uint) -> *mut _NiceCandidate;
}


/*
void nice_candidate_free()
	(NiceCandidate *) candidate [struct _NiceCandidate *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_candidate_free(candidate: *mut _NiceCandidate);
}


/*
NiceCandidate * nice_candidate_copy() [struct _NiceCandidate *]
	(const NiceCandidate *) candidate [const struct _NiceCandidate *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_candidate_copy(candidate: *const _NiceCandidate) -> *mut _NiceCandidate;
}


/*
guint32 nice_candidate_jingle_priority() [unsigned int]
	(NiceCandidate *) candidate [struct _NiceCandidate *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_candidate_jingle_priority(candidate: *mut _NiceCandidate) -> libc::c_uint;
}


/*
guint32 nice_candidate_msn_priority() [unsigned int]
	(NiceCandidate *) candidate [struct _NiceCandidate *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_candidate_msn_priority(candidate: *mut _NiceCandidate) -> libc::c_uint;
}


/*
guint32 nice_candidate_ice_priority_full() [unsigned int]
	(guint) type_pref [unsigned int]
	(guint) local_pref [unsigned int]
	(guint) component_id [unsigned int]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_candidate_ice_priority_full(type_pref: libc::c_uint, local_pref: libc::c_uint, component_id: libc::c_uint) -> libc::c_uint;
}


/*
guint32 nice_candidate_ice_priority() [unsigned int]
	(const NiceCandidate *) candidate [const struct _NiceCandidate *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_candidate_ice_priority(candidate: *const _NiceCandidate) -> libc::c_uint;
}


/*
guint64 nice_candidate_pair_priority() [unsigned long]
	(guint32) o_prio [unsigned int]
	(guint32) a_prio [unsigned int]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_candidate_pair_priority(o_prio: libc::c_uint, a_prio: libc::c_uint) -> libc::c_ulong;
}


/*
void nice_debug_enable()
	(gboolean) with_stun [int]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_debug_enable(with_stun: libc::c_int);
}


/*
void nice_debug_disable()
	(gboolean) with_stun [int]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_debug_disable(with_stun: libc::c_int);
}


/*
GType nice_agent_get_type() [unsigned long]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_get_type() -> libc::c_ulong;
}


/*
NiceAgent * nice_agent_new() [struct _NiceAgent *]
	(GMainContext *) ctx [struct _GMainContext *]
	(NiceCompatibility) compat [NiceCompatibility]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_new(ctx: *mut _GMainContext, compat: libc::c_uint) -> *mut _NiceAgent;
}


/*
NiceAgent * nice_agent_new_reliable() [struct _NiceAgent *]
	(GMainContext *) ctx [struct _GMainContext *]
	(NiceCompatibility) compat [NiceCompatibility]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_new_reliable(ctx: *mut _GMainContext, compat: libc::c_uint) -> *mut _NiceAgent;
}


/*
gboolean nice_agent_add_local_address() [int]
	(NiceAgent *) agent [struct _NiceAgent *]
	(NiceAddress *) addr [struct _NiceAddress *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_add_local_address(agent: *mut _NiceAgent, addr: *mut _NiceAddress) -> libc::c_int;
}


/*
guint nice_agent_add_stream() [unsigned int]
	(NiceAgent *) agent [struct _NiceAgent *]
	(guint) n_components [unsigned int]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_add_stream(agent: *mut _NiceAgent, n_components: libc::c_uint) -> libc::c_uint;
}


/*
void nice_agent_remove_stream()
	(NiceAgent *) agent [struct _NiceAgent *]
	(guint) stream_id [unsigned int]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_remove_stream(agent: *mut _NiceAgent, stream_id: libc::c_uint);
}


/*
void nice_agent_set_port_range()
	(NiceAgent *) agent [struct _NiceAgent *]
	(guint) stream_id [unsigned int]
	(guint) component_id [unsigned int]
	(guint) min_port [unsigned int]
	(guint) max_port [unsigned int]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_set_port_range(agent: *mut _NiceAgent, stream_id: libc::c_uint, component_id: libc::c_uint, min_port: libc::c_uint, max_port: libc::c_uint);
}


/*
gboolean nice_agent_set_relay_info() [int]
	(NiceAgent *) agent [struct _NiceAgent *]
	(guint) stream_id [unsigned int]
	(guint) component_id [unsigned int]
	(const gchar *) server_ip [const char *]
	(guint) server_port [unsigned int]
	(const gchar *) username [const char *]
	(const gchar *) password [const char *]
	(NiceRelayType) type [NiceRelayType]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_set_relay_info(agent: *mut _NiceAgent, stream_id: libc::c_uint, component_id: libc::c_uint, server_ip: *const libc::c_char, server_port: libc::c_uint, username: *const libc::c_char, password: *const libc::c_char, type_: libc::c_uint) -> libc::c_int;
}


/*
gboolean nice_agent_gather_candidates() [int]
	(NiceAgent *) agent [struct _NiceAgent *]
	(guint) stream_id [unsigned int]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_gather_candidates(agent: *mut _NiceAgent, stream_id: libc::c_uint) -> libc::c_int;
}


/*
gboolean nice_agent_set_remote_credentials() [int]
	(NiceAgent *) agent [struct _NiceAgent *]
	(guint) stream_id [unsigned int]
	(const gchar *) ufrag [const char *]
	(const gchar *) pwd [const char *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_set_remote_credentials(agent: *mut _NiceAgent, stream_id: libc::c_uint, ufrag: *const libc::c_char, pwd: *const libc::c_char) -> libc::c_int;
}


/*
gboolean nice_agent_get_local_credentials() [int]
	(NiceAgent *) agent [struct _NiceAgent *]
	(guint) stream_id [unsigned int]
	(gchar **) ufrag [char **]
	(gchar **) pwd [char **]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_get_local_credentials(agent: *mut _NiceAgent, stream_id: libc::c_uint, ufrag: *mut *mut libc::c_char, pwd: *mut *mut libc::c_char) -> libc::c_int;
}


/*
int nice_agent_set_remote_candidates()
	(NiceAgent *) agent [struct _NiceAgent *]
	(guint) stream_id [unsigned int]
	(guint) component_id [unsigned int]
	(const GSList *) candidates [const struct _GSList *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_set_remote_candidates(agent: *mut _NiceAgent, stream_id: libc::c_uint, component_id: libc::c_uint, candidates: *const _GSList) -> libc::c_int;
}


/*
gint nice_agent_send() [int]
	(NiceAgent *) agent [struct _NiceAgent *]
	(guint) stream_id [unsigned int]
	(guint) component_id [unsigned int]
	(guint) len [unsigned int]
	(const gchar *) buf [const char *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_send(agent: *mut _NiceAgent, stream_id: libc::c_uint, component_id: libc::c_uint, len: libc::c_uint, buf: *const libc::c_char) -> libc::c_int;
}


/*
gint nice_agent_send_messages_nonblocking() [int]
	(NiceAgent *) agent [struct _NiceAgent *]
	(guint) stream_id [unsigned int]
	(guint) component_id [unsigned int]
	(const NiceOutputMessage *) messages [const NiceOutputMessage *]
	(guint) n_messages [unsigned int]
	(GCancellable *) cancellable [struct _GCancellable *]
	(GError **) error [struct _GError **]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_send_messages_nonblocking(agent: *mut _NiceAgent, stream_id: libc::c_uint, component_id: libc::c_uint, messages: *const NiceOutputMessage, n_messages: libc::c_uint, cancellable: *mut _GCancellable, error: *mut *mut _GError) -> libc::c_int;
}


/*
GSList * nice_agent_get_local_candidates() [struct _GSList *]
	(NiceAgent *) agent [struct _NiceAgent *]
	(guint) stream_id [unsigned int]
	(guint) component_id [unsigned int]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_get_local_candidates(agent: *mut _NiceAgent, stream_id: libc::c_uint, component_id: libc::c_uint) -> *mut _GSList;
}


/*
GSList * nice_agent_get_remote_candidates() [struct _GSList *]
	(NiceAgent *) agent [struct _NiceAgent *]
	(guint) stream_id [unsigned int]
	(guint) component_id [unsigned int]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_get_remote_candidates(agent: *mut _NiceAgent, stream_id: libc::c_uint, component_id: libc::c_uint) -> *mut _GSList;
}


/*
gboolean nice_agent_restart() [int]
	(NiceAgent *) agent [struct _NiceAgent *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_restart(agent: *mut _NiceAgent) -> libc::c_int;
}


/*
gboolean nice_agent_restart_stream() [int]
	(NiceAgent *) agent [struct _NiceAgent *]
	(guint) stream_id [unsigned int]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_restart_stream(agent: *mut _NiceAgent, stream_id: libc::c_uint) -> libc::c_int;
}


/*
gboolean nice_agent_attach_recv() [int]
	(NiceAgent *) agent [struct _NiceAgent *]
	(guint) stream_id [unsigned int]
	(guint) component_id [unsigned int]
	(GMainContext *) ctx [struct _GMainContext *]
	(NiceAgentRecvFunc) func [void (*)(struct _NiceAgent *, unsigned int, unsigned int, unsigned int, char *, void *)]
	(gpointer) data [void *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_attach_recv(agent: *mut _NiceAgent, stream_id: libc::c_uint, component_id: libc::c_uint, ctx: *mut _GMainContext, func: Option<extern fn(*mut _NiceAgent, libc::c_uint, libc::c_uint, libc::c_uint, *mut libc::c_char, *mut libc::c_void)>, data: *mut libc::c_void) -> libc::c_int;
}


/*
gssize nice_agent_recv() [long]
	(NiceAgent *) agent [struct _NiceAgent *]
	(guint) stream_id [unsigned int]
	(guint) component_id [unsigned int]
	(guint8 *) buf [unsigned char *]
	(gsize) buf_len [unsigned long]
	(GCancellable *) cancellable [struct _GCancellable *]
	(GError **) error [struct _GError **]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_recv(agent: *mut _NiceAgent, stream_id: libc::c_uint, component_id: libc::c_uint, buf: *mut libc::c_uchar, buf_len: libc::c_ulong, cancellable: *mut _GCancellable, error: *mut *mut _GError) -> libc::c_long;
}


/*
gint nice_agent_recv_messages() [int]
	(NiceAgent *) agent [struct _NiceAgent *]
	(guint) stream_id [unsigned int]
	(guint) component_id [unsigned int]
	(NiceInputMessage *) messages [NiceInputMessage *]
	(guint) n_messages [unsigned int]
	(GCancellable *) cancellable [struct _GCancellable *]
	(GError **) error [struct _GError **]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_recv_messages(agent: *mut _NiceAgent, stream_id: libc::c_uint, component_id: libc::c_uint, messages: *mut NiceInputMessage, n_messages: libc::c_uint, cancellable: *mut _GCancellable, error: *mut *mut _GError) -> libc::c_int;
}


/*
gssize nice_agent_recv_nonblocking() [long]
	(NiceAgent *) agent [struct _NiceAgent *]
	(guint) stream_id [unsigned int]
	(guint) component_id [unsigned int]
	(guint8 *) buf [unsigned char *]
	(gsize) buf_len [unsigned long]
	(GCancellable *) cancellable [struct _GCancellable *]
	(GError **) error [struct _GError **]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_recv_nonblocking(agent: *mut _NiceAgent, stream_id: libc::c_uint, component_id: libc::c_uint, buf: *mut libc::c_uchar, buf_len: libc::c_ulong, cancellable: *mut _GCancellable, error: *mut *mut _GError) -> libc::c_long;
}


/*
gint nice_agent_recv_messages_nonblocking() [int]
	(NiceAgent *) agent [struct _NiceAgent *]
	(guint) stream_id [unsigned int]
	(guint) component_id [unsigned int]
	(NiceInputMessage *) messages [NiceInputMessage *]
	(guint) n_messages [unsigned int]
	(GCancellable *) cancellable [struct _GCancellable *]
	(GError **) error [struct _GError **]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_recv_messages_nonblocking(agent: *mut _NiceAgent, stream_id: libc::c_uint, component_id: libc::c_uint, messages: *mut NiceInputMessage, n_messages: libc::c_uint, cancellable: *mut _GCancellable, error: *mut *mut _GError) -> libc::c_int;
}


/*
gboolean nice_agent_set_selected_pair() [int]
	(NiceAgent *) agent [struct _NiceAgent *]
	(guint) stream_id [unsigned int]
	(guint) component_id [unsigned int]
	(const gchar *) lfoundation [const char *]
	(const gchar *) rfoundation [const char *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_set_selected_pair(agent: *mut _NiceAgent, stream_id: libc::c_uint, component_id: libc::c_uint, lfoundation: *const libc::c_char, rfoundation: *const libc::c_char) -> libc::c_int;
}


/*
gboolean nice_agent_get_selected_pair() [int]
	(NiceAgent *) agent [struct _NiceAgent *]
	(guint) stream_id [unsigned int]
	(guint) component_id [unsigned int]
	(NiceCandidate **) local [struct _NiceCandidate **]
	(NiceCandidate **) remote [struct _NiceCandidate **]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_get_selected_pair(agent: *mut _NiceAgent, stream_id: libc::c_uint, component_id: libc::c_uint, local: *mut *mut _NiceCandidate, remote: *mut *mut _NiceCandidate) -> libc::c_int;
}


/*
GSocket * nice_agent_get_selected_socket() [struct _GSocket *]
	(NiceAgent *) agent [struct _NiceAgent *]
	(guint) stream_id [unsigned int]
	(guint) component_id [unsigned int]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_get_selected_socket(agent: *mut _NiceAgent, stream_id: libc::c_uint, component_id: libc::c_uint) -> *mut _GSocket;
}


/*
gboolean nice_agent_set_selected_remote_candidate() [int]
	(NiceAgent *) agent [struct _NiceAgent *]
	(guint) stream_id [unsigned int]
	(guint) component_id [unsigned int]
	(NiceCandidate *) candidate [struct _NiceCandidate *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_set_selected_remote_candidate(agent: *mut _NiceAgent, stream_id: libc::c_uint, component_id: libc::c_uint, candidate: *mut _NiceCandidate) -> libc::c_int;
}


/*
void nice_agent_set_stream_tos()
	(NiceAgent *) agent [struct _NiceAgent *]
	(guint) stream_id [unsigned int]
	(gint) tos [int]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_set_stream_tos(agent: *mut _NiceAgent, stream_id: libc::c_uint, tos: libc::c_int);
}


/*
void nice_agent_set_software()
	(NiceAgent *) agent [struct _NiceAgent *]
	(const gchar *) software [const char *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_set_software(agent: *mut _NiceAgent, software: *const libc::c_char);
}


/*
gboolean nice_agent_set_stream_name() [int]
	(NiceAgent *) agent [struct _NiceAgent *]
	(guint) stream_id [unsigned int]
	(const gchar *) name [const char *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_set_stream_name(agent: *mut _NiceAgent, stream_id: libc::c_uint, name: *const libc::c_char) -> libc::c_int;
}


/*
const gchar * nice_agent_get_stream_name() [const char *]
	(NiceAgent *) agent [struct _NiceAgent *]
	(guint) stream_id [unsigned int]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_get_stream_name(agent: *mut _NiceAgent, stream_id: libc::c_uint) -> *const libc::c_char;
}


/*
NiceCandidate * nice_agent_get_default_local_candidate() [struct _NiceCandidate *]
	(NiceAgent *) agent [struct _NiceAgent *]
	(guint) stream_id [unsigned int]
	(guint) component_id [unsigned int]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_get_default_local_candidate(agent: *mut _NiceAgent, stream_id: libc::c_uint, component_id: libc::c_uint) -> *mut _NiceCandidate;
}


/*
gchar * nice_agent_generate_local_sdp() [char *]
	(NiceAgent *) agent [struct _NiceAgent *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_generate_local_sdp(agent: *mut _NiceAgent) -> *mut libc::c_char;
}


/*
gchar * nice_agent_generate_local_stream_sdp() [char *]
	(NiceAgent *) agent [struct _NiceAgent *]
	(guint) stream_id [unsigned int]
	(gboolean) include_non_ice [int]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_generate_local_stream_sdp(agent: *mut _NiceAgent, stream_id: libc::c_uint, include_non_ice: libc::c_int) -> *mut libc::c_char;
}


/*
gchar * nice_agent_generate_local_candidate_sdp() [char *]
	(NiceAgent *) agent [struct _NiceAgent *]
	(NiceCandidate *) candidate [struct _NiceCandidate *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_generate_local_candidate_sdp(agent: *mut _NiceAgent, candidate: *mut _NiceCandidate) -> *mut libc::c_char;
}


/*
int nice_agent_parse_remote_sdp()
	(NiceAgent *) agent [struct _NiceAgent *]
	(const gchar *) sdp [const char *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_parse_remote_sdp(agent: *mut _NiceAgent, sdp: *const libc::c_char) -> libc::c_int;
}


/*
GSList * nice_agent_parse_remote_stream_sdp() [struct _GSList *]
	(NiceAgent *) agent [struct _NiceAgent *]
	(guint) stream_id [unsigned int]
	(const gchar *) sdp [const char *]
	(gchar **) ufrag [char **]
	(gchar **) pwd [char **]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_parse_remote_stream_sdp(agent: *mut _NiceAgent, stream_id: libc::c_uint, sdp: *const libc::c_char, ufrag: *mut *mut libc::c_char, pwd: *mut *mut libc::c_char) -> *mut _GSList;
}


/*
NiceCandidate * nice_agent_parse_remote_candidate_sdp() [struct _NiceCandidate *]
	(NiceAgent *) agent [struct _NiceAgent *]
	(guint) stream_id [unsigned int]
	(const gchar *) sdp [const char *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_parse_remote_candidate_sdp(agent: *mut _NiceAgent, stream_id: libc::c_uint, sdp: *const libc::c_char) -> *mut _NiceCandidate;
}


/*
GIOStream * nice_agent_get_io_stream() [struct _GIOStream *]
	(NiceAgent *) agent [struct _NiceAgent *]
	(guint) stream_id [unsigned int]
	(guint) component_id [unsigned int]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_get_io_stream(agent: *mut _NiceAgent, stream_id: libc::c_uint, component_id: libc::c_uint) -> *mut _GIOStream;
}


/*
const gchar * nice_component_state_to_string() [const char *]
	(NiceComponentState) state [NiceComponentState]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_component_state_to_string(state: libc::c_uint) -> *const libc::c_char;
}


/*
gboolean nice_agent_forget_relays() [int]
	(NiceAgent *) agent [struct _NiceAgent *]
	(guint) stream_id [unsigned int]
	(guint) component_id [unsigned int]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_agent_forget_relays(agent: *mut _NiceAgent, stream_id: libc::c_uint, component_id: libc::c_uint) -> libc::c_int;
}


/*
gchar * nice_interfaces_get_ip_for_interface() [char *]
	(gchar *) interface_name [char *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_interfaces_get_ip_for_interface(interface_name: *mut libc::c_char) -> *mut libc::c_char;
}


/*
GList * nice_interfaces_get_local_ips() [struct _GList *]
	(gboolean) include_loopback [int]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_interfaces_get_local_ips(include_loopback: libc::c_int) -> *mut _GList;
}


/*
GList * nice_interfaces_get_local_interfaces() [struct _GList *]
*/
#[link(name="nice")]
extern "C" {
	pub fn nice_interfaces_get_local_interfaces() -> *mut _GList;
}



/*
enum  {
	NICE_CANDIDATE_TYPE_HOST =	0x00000000 (0)
	NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE =	0x00000001 (1)
	NICE_CANDIDATE_TYPE_PEER_REFLEXIVE =	0x00000002 (2)
	NICE_CANDIDATE_TYPE_RELAYED =	0x00000003 (3)
}
*/
bitflags! {
	flags NiceCandidateType: libc::c_uint {
		const NICE_CANDIDATE_TYPE_HOST =	0 as libc::c_uint,
		const NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE =	1 as libc::c_uint,
		const NICE_CANDIDATE_TYPE_PEER_REFLEXIVE =	2 as libc::c_uint,
		const NICE_CANDIDATE_TYPE_RELAYED =	3 as libc::c_uint,
	}
}

/*
enum  {
	NICE_CANDIDATE_TRANSPORT_UDP =	0x00000000 (0)
}
*/
bitflags! {
	flags NiceCandidateTransport: libc::c_uint {
		const NICE_CANDIDATE_TRANSPORT_UDP =	0 as libc::c_uint,
	}
}


/*
enum  {
	NICE_RELAY_TYPE_TURN_UDP =	0x00000000 (0)
	NICE_RELAY_TYPE_TURN_TCP =	0x00000001 (1)
	NICE_RELAY_TYPE_TURN_TLS =	0x00000002 (2)
}
*/
bitflags! {
	flags NiceRelayType: libc::c_uint {
		const NICE_RELAY_TYPE_TURN_UDP =	0 as libc::c_uint,
		const NICE_RELAY_TYPE_TURN_TCP =	1 as libc::c_uint,
		const NICE_RELAY_TYPE_TURN_TLS =	2 as libc::c_uint,
	}
}


/*
enum  {
	NICE_COMPONENT_STATE_DISCONNECTED =	0x00000000 (0)
	NICE_COMPONENT_STATE_GATHERING =	0x00000001 (1)
	NICE_COMPONENT_STATE_CONNECTING =	0x00000002 (2)
	NICE_COMPONENT_STATE_CONNECTED =	0x00000003 (3)
	NICE_COMPONENT_STATE_READY =	0x00000004 (4)
	NICE_COMPONENT_STATE_FAILED =	0x00000005 (5)
	NICE_COMPONENT_STATE_LAST =	0x00000006 (6)
}
/*
*/
bitflags! {
	flags NiceComponentState: libc::c_uint {
		const NICE_COMPONENT_STATE_DISCONNECTED =	0 as libc::c_uint,
		const NICE_COMPONENT_STATE_GATHERING =	1 as libc::c_uint,
		const NICE_COMPONENT_STATE_CONNECTING =	2 as libc::c_uint,
		const NICE_COMPONENT_STATE_CONNECTED =	3 as libc::c_uint,
		const NICE_COMPONENT_STATE_READY =	4 as libc::c_uint,
		const NICE_COMPONENT_STATE_FAILED =	5 as libc::c_uint,
		const NICE_COMPONENT_STATE_LAST =	6 as libc::c_uint,
	}
}
*/
#[repr(C)]
#[derive(Clone,PartialEq,Debug)]
pub enum NiceComponentState {
	NICE_COMPONENT_STATE_DISCONNECTED =	0x00000000,
	NICE_COMPONENT_STATE_GATHERING =	0x00000001,
	NICE_COMPONENT_STATE_CONNECTING =	0x00000002,
	NICE_COMPONENT_STATE_CONNECTED =	0x00000003,
	NICE_COMPONENT_STATE_READY =	0x00000004,
	NICE_COMPONENT_STATE_FAILED =	0x00000005,
	NICE_COMPONENT_STATE_LAST =	0x00000006,
}



/*
enum  {
	NICE_COMPONENT_TYPE_RTP =	0x00000001 (1)
	NICE_COMPONENT_TYPE_RTCP =	0x00000002 (2)
}
*/
bitflags! {
	flags NiceComponentType: libc::c_uint {
		const NICE_COMPONENT_TYPE_RTP =	1 as libc::c_uint,
		const NICE_COMPONENT_TYPE_RTCP =	2 as libc::c_uint,
	}
}

/*
enum  {
	NICE_COMPATIBILITY_RFC5245 =	0x00000000 (0)
	NICE_COMPATIBILITY_GOOGLE =	0x00000001 (1)
	NICE_COMPATIBILITY_MSN =	0x00000002 (2)
	NICE_COMPATIBILITY_WLM2009 =	0x00000003 (3)
	NICE_COMPATIBILITY_OC2007 =	0x00000004 (4)
	NICE_COMPATIBILITY_OC2007R2 =	0x00000005 (5)
	NICE_COMPATIBILITY_DRAFT19 =	0x00000000 (0)
	NICE_COMPATIBILITY_LAST =	0x00000005 (5)
}
*/
bitflags! {
	flags NiceCompatibility: libc::c_uint {
		const NICE_COMPATIBILITY_RFC5245 =	0 as libc::c_uint,
		const NICE_COMPATIBILITY_GOOGLE =	1 as libc::c_uint,
		const NICE_COMPATIBILITY_MSN =	2 as libc::c_uint,
		const NICE_COMPATIBILITY_WLM2009 =	3 as libc::c_uint,
		const NICE_COMPATIBILITY_OC2007 =	4 as libc::c_uint,
		const NICE_COMPATIBILITY_OC2007R2 =	5 as libc::c_uint,
		const NICE_COMPATIBILITY_DRAFT19 =	0 as libc::c_uint,
		const NICE_COMPATIBILITY_LAST =	5 as libc::c_uint,
	}
}


/*
enum  {
	NICE_PROXY_TYPE_NONE =	0x00000000 (0)
	NICE_PROXY_TYPE_SOCKS5 =	0x00000001 (1)
	NICE_PROXY_TYPE_HTTP =	0x00000002 (2)
	NICE_PROXY_TYPE_LAST =	0x00000002 (2)
}
*/
bitflags! {
	flags NiceProxyType: libc::c_uint {
		const NICE_PROXY_TYPE_NONE =	0 as libc::c_uint,
		const NICE_PROXY_TYPE_SOCKS5 =	1 as libc::c_uint,
		const NICE_PROXY_TYPE_HTTP =	2 as libc::c_uint,
		const NICE_PROXY_TYPE_LAST =	2 as libc::c_uint,
	}
}


/* _NICE_H # */

/* _AGENT_H /**
 * SECTION:agent
 * @short_description:  ICE agent API implementation
 * @see_also: #NiceCandidate
 * @see_also: #NiceAddress
 * @include: agent.h
 * @stability: Stable
 *
 * The #NiceAgent is your main object when using libnice.
 * It is the agent that will take care of everything relating to ICE.
 * It will take care of discovering your local candidates and do
 *  connectivity checks to create a stream of data between you and your peer.
 *
 * Streams and their components are referenced by integer IDs (with respect to a
 * given #NiceAgent). These IDs are guaranteed to be positive (i.e. non-zero)
 * for valid streams/components.
 *
 * Each stream can receive data in one of two ways: using
 * nice_agent_attach_recv() or nice_agent_recv_messages() (and the derived
 * #NiceInputStream and #NiceIOStream classes accessible using
 * nice_agent_get_io_stream()). nice_agent_attach_recv() is non-blocking: it
 * takes a user-provided callback function and attaches the stream’s socket to
 * the provided #GMainContext, invoking the callback in that context for every
 * packet received. nice_agent_recv_messages() instead blocks on receiving a
 * packet, and writes it directly into a user-provided buffer. This reduces the
 * number of callback invokations and (potentially) buffer copies required to
 * receive packets. nice_agent_recv_messages() (or #NiceInputStream) is designed
 * to be used in a blocking loop in a separate thread.
 *
 <example>
   <title>Simple example on how to use libnice</title>
   <programlisting>
   guint stream_id;
   gchar buffer[] = "hello world!";
   GSList *lcands = NULL;

   // Create a nice agent
   NiceAgent *agent = nice_agent_new (NULL, NICE_COMPATIBILITY_RFC5245);

   // Connect the signals
   g_signal_connect (G_OBJECT (agent), "candidate-gathering-done",
                     G_CALLBACK (cb_candidate_gathering_done), NULL);
   g_signal_connect (G_OBJECT (agent), "component-state-changed",
                     G_CALLBACK (cb_component_state_changed), NULL);
   g_signal_connect (G_OBJECT (agent), "new-selected-pair",
                     G_CALLBACK (cb_new_selected_pair), NULL);

   // Create a new stream with one component and start gathering candidates
   stream_id = nice_agent_add_stream (agent, 1);
   nice_agent_gather_candidates (agent, stream_id);

   // Attach to the component to receive the data
   nice_agent_attach_recv (agent, stream_id, 1, NULL,
                          cb_nice_recv, NULL);

   // ... Wait until the signal candidate-gathering-done is fired ...
   lcands = nice_agent_get_local_candidates(agent, stream_id, 1);

   // ... Send local candidates to the peer and set the peer's remote candidates
   nice_agent_set_remote_candidates (agent, stream_id, 1, rcands);

   // ... Wait until the signal new-selected-pair is fired ...
   // Send our message!
   nice_agent_send (agent, stream_id, 1, sizeof(buffer), buffer);

   // Anything received will be received through the cb_nice_recv callback

   // Destroy the object
   g_object_unref(agent);

   </programlisting>
 </example>
 *
 * Refer to the examples in the examples/ subdirectory of the libnice source for
 * complete examples.
 *
 */ */

/* _ADDRESS_H /**
 * SECTION:address
 * @short_description: IP address convenience library
 * @stability: Stable
 *
 * The #NiceAddress structure will allow you to easily set/get and modify an IPv4
 * or IPv6 address in order to communicate with the #NiceAgent.
 */ */

/* NICE_ADDRESS_STRING_LEN INET6_ADDRSTRLEN typedef */

/* _CANDIDATE_H /**
 * SECTION:candidate
 * @short_description: ICE candidate representation
 * @see_also: #NiceAddress
 * @stability: Stable
 *
 * A representation of an ICE candidate. Make sure you read the ICE drafts[1] to
 * understand correctly the concept of ICE candidates.
 *
 * [1] http://tools.ietf.org/wg/mmusic/draft-ietf-mmusic-ice/
 */ */

/* NICE_CANDIDATE_TYPE_PREF_HOST 120 # */
pub const NICE_CANDIDATE_TYPE_PREF_HOST: i32 = 120;

/* NICE_CANDIDATE_TYPE_PREF_PEER_REFLEXIVE 110 # */
pub const NICE_CANDIDATE_TYPE_PREF_PEER_REFLEXIVE: i32 = 110;

/* NICE_CANDIDATE_TYPE_PREF_SERVER_REFLEXIVE 100 # */
pub const NICE_CANDIDATE_TYPE_PREF_SERVER_REFLEXIVE: i32 = 100;

/* NICE_CANDIDATE_TYPE_PREF_RELAYED 60 /* Max foundation size '1*32ice-char' plus terminating NULL, ICE ID-19  */ */
pub const NICE_CANDIDATE_TYPE_PREF_RELAYED: i32 = 60;

/* NICE_CANDIDATE_MAX_FOUNDATION ( 32 + 1 ) /**
 * NiceCandidateType:
 * @NICE_CANDIDATE_TYPE_HOST: A host candidate
 * @NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE: A server reflexive candidate
 * @NICE_CANDIDATE_TYPE_PEER_REFLEXIVE: A peer reflexive candidate
 * @NICE_CANDIDATE_TYPE_RELAYED: A relay candidate
 *
 * An enum represneting the type of a candidate
 */ */

/* _DEBUG_H /**
 * SECTION:debug
 * @short_description: Debug messages utility functions
 * @stability: Unstable
 *
 * <para>Libnice can output a lot of information when debug messages are enabled.
 * This can significantly help track down problems and/or understand what
 * it's doing.</para>
 *
 * <para>You can enable/disable the debug messages by calling nice_debug_enable()
 * or nice_debug_disable() and choosing whether you want only ICE debug messages
 * or also stun debug messages.</para>
 *
 * <para>By default, the debug messages are disabled, unless the environment
 * variable NICE_DEBUG is set, in which case, it must contain a comma separated
 * list of flags specifying which debug to enable.</para>
 * <para> The currently available flags are "nice", "stun", "pseudotcp",
 * "pseudotcp-verbose" or "all" to enable all debug messages.</para>
 * <para> If the 'pseudotcp' flag is enabled, then 'pseudotcp-verbose' gets
 * automatically disabled. This is to allow the use of the 'all' flag without
 * having verbose messages from pseudotcp. You can enable verbose debug messages
 * from the pseudotcp layer by specifying 'pseudotcp-verbose' without the
 * 'pseudotcp' flag.</para>
 *
 *
 * <para>This API is unstable and is subject to change at any time...
 * More flags are to come and a better API to enable/disable each flag
 * should be added.</para>
 */ */

/* NICE_TYPE_AGENT nice_agent_get_type ( ) # */

/* NICE_AGENT ( obj ) ( G_TYPE_CHECK_INSTANCE_CAST ( ( obj ) , NICE_TYPE_AGENT , NiceAgent ) ) # */

/* NICE_AGENT_CLASS ( klass ) ( G_TYPE_CHECK_CLASS_CAST ( ( klass ) , NICE_TYPE_AGENT , NiceAgentClass ) ) # */

/* NICE_IS_AGENT ( obj ) ( G_TYPE_CHECK_INSTANCE_TYPE ( ( obj ) , NICE_TYPE_AGENT ) ) # */

/* NICE_IS_AGENT_CLASS ( klass ) ( G_TYPE_CHECK_CLASS_TYPE ( ( klass ) , NICE_TYPE_AGENT ) ) # */

/* NICE_AGENT_GET_CLASS ( obj ) ( G_TYPE_INSTANCE_GET_CLASS ( ( obj ) , NICE_TYPE_AGENT , NiceAgentClass ) ) typedef */

/* NICE_AGENT_MAX_REMOTE_CANDIDATES 25 /**
 * NiceComponentState:
 * @NICE_COMPONENT_STATE_DISCONNECTED: No activity scheduled
 * @NICE_COMPONENT_STATE_GATHERING: Gathering local candidates
 * @NICE_COMPONENT_STATE_CONNECTING: Establishing connectivity
 * @NICE_COMPONENT_STATE_CONNECTED: At least one working candidate pair
 * @NICE_COMPONENT_STATE_READY: ICE concluded, candidate pair selection
 * is now final
 * @NICE_COMPONENT_STATE_FAILED: Connectivity checks have been completed,
 * but connectivity was not established
 * @NICE_COMPONENT_STATE_LAST: Dummy state
 *
 * An enum representing the state of a component.
 * <para> See also: #NiceAgent::component-state-changed </para>
 */ */
pub const NICE_AGENT_MAX_REMOTE_CANDIDATES: i32 = 25;

/* __INTERFACES_H__ /**
 * SECTION:interfaces
 * @short_description: Utility functions to discover local network interfaces
 * @include: interfaces.h
 * @stability: Stable
 *
 * These utility functions allow the discovery of local network interfaces
 * in a portable manner, they also allow finding the local ip addresses or
 * the address allocated to a network interface.
 */ */