This file is indexed.

/usr/share/gtk-doc/html/libnice/libnice-StunAgent.html is in libnice-doc 0.1.14-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   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
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>StunAgent: libnice Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="libnice Reference Manual">
<link rel="up" href="ch03.html" title="">
<link rel="prev" href="ch03.html" title="">
<link rel="next" href="libnice-StunMessage.html" title="StunMessage">
<meta name="generator" content="GTK-Doc V1.25 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#libnice-StunAgent.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="ch03.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="ch03.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="libnice-StunMessage.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="libnice-StunAgent"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libnice-StunAgent.top_of_page"></a>StunAgent</span></h2>
<p>StunAgent — STUN agent for building and validating STUN messages</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="libnice-StunAgent.stability-level"></a><h2>Stability Level</h2>
<acronym title="The intention of a Stable interface is to enable arbitrary third parties to
develop applications to these interfaces, release them, and have confidence that
they will run on all minor releases of the product (after the one in which the
interface was introduced, and within the same major release). Even at a major
release, incompatible changes are expected to be rare, and to have strong
justifications.
"><span class="acronym">Stable</span></acronym>, unless otherwise indicated
</div>
<div class="refsect1">
<a name="libnice-StunAgent.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<span class="returnvalue">bool</span>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="libnice-StunAgent.html#StunMessageIntegrityValidate" title="StunMessageIntegrityValidate ()">*StunMessageIntegrityValidate</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="libnice-StunAgent.html#StunDebugHandler" title="StunDebugHandler ()">*StunDebugHandler</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="libnice-StunAgent.html#stun-agent-init" title="stun_agent_init ()">stun_agent_init</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="libnice-StunAgent.html#StunValidationStatus" title="enum StunValidationStatus"><span class="returnvalue">StunValidationStatus</span></a>
</td>
<td class="function_name">
<a class="link" href="libnice-StunAgent.html#stun-agent-validate" title="stun_agent_validate ()">stun_agent_validate</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">bool</span>
</td>
<td class="function_name">
<a class="link" href="libnice-StunAgent.html#stun-agent-default-validater" title="stun_agent_default_validater ()">stun_agent_default_validater</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">bool</span>
</td>
<td class="function_name">
<a class="link" href="libnice-StunAgent.html#stun-agent-init-request" title="stun_agent_init_request ()">stun_agent_init_request</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">bool</span>
</td>
<td class="function_name">
<a class="link" href="libnice-StunAgent.html#stun-agent-init-indication" title="stun_agent_init_indication ()">stun_agent_init_indication</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">bool</span>
</td>
<td class="function_name">
<a class="link" href="libnice-StunAgent.html#stun-agent-init-response" title="stun_agent_init_response ()">stun_agent_init_response</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">bool</span>
</td>
<td class="function_name">
<a class="link" href="libnice-StunAgent.html#stun-agent-init-error" title="stun_agent_init_error ()">stun_agent_init_error</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">size_t</span>
</td>
<td class="function_name">
<a class="link" href="libnice-StunAgent.html#stun-agent-build-unknown-attributes-error" title="stun_agent_build_unknown_attributes_error ()">stun_agent_build_unknown_attributes_error</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">size_t</span>
</td>
<td class="function_name">
<a class="link" href="libnice-StunAgent.html#stun-agent-finish-message" title="stun_agent_finish_message ()">stun_agent_finish_message</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">bool</span>
</td>
<td class="function_name">
<a class="link" href="libnice-StunAgent.html#stun-agent-forget-transaction" title="stun_agent_forget_transaction ()">stun_agent_forget_transaction</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="libnice-StunAgent.html#stun-agent-set-software" title="stun_agent_set_software ()">stun_agent_set_software</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="libnice-StunAgent.html#stun-debug-enable" title="stun_debug_enable ()">stun_debug_enable</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="libnice-StunAgent.html#stun-debug-disable" title="stun_debug_disable ()">stun_debug_disable</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="libnice-StunAgent.html#stun-set-debug-handler" title="stun_set_debug_handler ()">stun_set_debug_handler</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libnice-StunAgent.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody>
<tr>
<td class="typedef_keyword">typedef</td>
<td class="function_name"><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent">StunAgent</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="libnice-StunAgent.html#StunCompatibility" title="enum StunCompatibility">StunCompatibility</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="libnice-StunAgent.html#StunAgentUsageFlags" title="enum StunAgentUsageFlags">StunAgentUsageFlags</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="libnice-StunAgent.html#StunValidationStatus" title="enum StunValidationStatus">StunValidationStatus</a></td>
</tr>
<tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="libnice-StunAgent.html#StunDefaultValidaterData" title="StunDefaultValidaterData">StunDefaultValidaterData</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libnice-StunAgent.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;stun/stunagent.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="libnice-StunAgent.description"></a><h2>Description</h2>
<p>The STUN Agent allows you to create and validate STUN messages easily.
It's main purpose is to make sure the building and validation methods used
are compatible with the RFC you create it with. It also tracks the transaction
ids of the requests you send, so you can validate if a STUN response you
received should be processed by that agent or not.</p>
</div>
<div class="refsect1">
<a name="libnice-StunAgent.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="StunMessageIntegrityValidate"></a><h3>StunMessageIntegrityValidate ()</h3>
<pre class="programlisting"><span class="returnvalue">bool</span>
<span class="c_punctuation">(</span>*StunMessageIntegrityValidate<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
                                 <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> *message</code></em>,
                                 <em class="parameter"><code><span class="type">uint8_t</span> *username</code></em>,
                                 <em class="parameter"><code><span class="type">uint16_t</span> username_len</code></em>,
                                 <em class="parameter"><code><span class="type">uint8_t</span> **password</code></em>,
                                 <em class="parameter"><code><span class="type">size_t</span> *password_len</code></em>,
                                 <em class="parameter"><code><span class="type">void</span> *user_data</code></em>);</pre>
<p>This is the prototype for the <em class="parameter"><code>validater</code></em>
 argument of the <a class="link" href="libnice-StunAgent.html#stun-agent-validate" title="stun_agent_validate ()"><code class="function">stun_agent_validate()</code></a>
function.</p>
<p> See also: <a class="link" href="libnice-StunAgent.html#stun-agent-validate" title="stun_agent_validate ()"><code class="function">stun_agent_validate()</code></a> </p>
<div class="refsect3">
<a name="StunMessageIntegrityValidate.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>agent</p></td>
<td class="parameter_description"><p>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>message</p></td>
<td class="parameter_description"><p>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> being validated</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>username</p></td>
<td class="parameter_description"><p>The username found in the <em class="parameter"><code>message</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>username_len</p></td>
<td class="parameter_description"><p>The length of <em class="parameter"><code>username</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>password</p></td>
<td class="parameter_description"><p>The password associated with that username. This argument is a
pointer to a byte array that must be set by the validater function.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>password_len</p></td>
<td class="parameter_description"><p>The length of <em class="parameter"><code>password</code></em>
which must also be set by the
validater function.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>Data to give the function</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="StunMessageIntegrityValidate.returns"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the authentication was successful,
<a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if the authentication failed</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="StunDebugHandler"></a><h3>StunDebugHandler ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
<span class="c_punctuation">(</span>*StunDebugHandler<span class="c_punctuation">)</span> (<em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
                     <em class="parameter"><code><span class="type">va_list</span> ap</code></em>);</pre>
<p>Callback for a debug message from the STUN code.</p>
<div class="refsect3">
<a name="StunDebugHandler.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>printf()-style debug message format string</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>ap</p></td>
<td class="parameter_description"><p>Parameters to substitute into message placeholders</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="stun-agent-init"></a><h3>stun_agent_init ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
stun_agent_init (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
                 <em class="parameter"><code>const <span class="type">uint16_t</span> *known_attributes</code></em>,
                 <em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunCompatibility" title="enum StunCompatibility"><span class="type">StunCompatibility</span></a> compatibility</code></em>,
                 <em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgentUsageFlags" title="enum StunAgentUsageFlags"><span class="type">StunAgentUsageFlags</span></a> usage_flags</code></em>);</pre>
<p>This function must be called to initialize an agent before it is being used.</p>
<div class="note">
<p>
    The <em class="parameter"><code>known_attributes</code></em> data must exist in memory as long as the <em class="parameter"><code>agent</code></em> is used
    </p>
<p>
    If the <a class="link" href="libnice-StunAgent.html#STUN-AGENT-USAGE-SHORT-TERM-CREDENTIALS:CAPS"><span class="type">STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS</span></a> and
    <a class="link" href="libnice-StunAgent.html#STUN-AGENT-USAGE-LONG-TERM-CREDENTIALS:CAPS"><span class="type">STUN_AGENT_USAGE_LONG_TERM_CREDENTIALS</span></a> usage flags are not set, then the
    agent will default in using the short term credentials mechanism
    </p>
<p>
    The <a class="link" href="libnice-StunAgent.html#STUN-AGENT-USAGE-USE-FINGERPRINT:CAPS"><span class="type">STUN_AGENT_USAGE_USE_FINGERPRINT</span></a> and <a class="link" href="libnice-StunAgent.html#STUN-AGENT-USAGE-ADD-SOFTWARE:CAPS"><span class="type">STUN_AGENT_USAGE_ADD_SOFTWARE</span></a>
    usage flags are only valid if the <a class="link" href="libnice-StunAgent.html#STUN-COMPATIBILITY-RFC5389:CAPS"><span class="type">STUN_COMPATIBILITY_RFC5389</span></a> or
    <a class="link" href="libnice-StunAgent.html#STUN-COMPATIBILITY-MSICE2:CAPS"><span class="type">STUN_COMPATIBILITY_MSICE2</span></a> <em class="parameter"><code>compatibility</code></em> is used
    </p>
</div>
<div class="refsect3">
<a name="stun-agent-init.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>agent</p></td>
<td class="parameter_description"><p>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> to initialize</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>known_attributes</p></td>
<td class="parameter_description"><p>An array of <span class="type">uint16_t</span> specifying which attributes should
be known by the agent. Any STUN message received that contains a mandatory
attribute that is not in this array will yield a
<a class="link" href="libnice-StunAgent.html#STUN-VALIDATION-UNKNOWN-REQUEST-ATTRIBUTE:CAPS"><span class="type">STUN_VALIDATION_UNKNOWN_REQUEST_ATTRIBUTE</span></a> or a
<a class="link" href="libnice-StunAgent.html#STUN-VALIDATION-UNKNOWN-ATTRIBUTE:CAPS"><span class="type">STUN_VALIDATION_UNKNOWN_ATTRIBUTE</span></a> error when calling <a class="link" href="libnice-StunAgent.html#stun-agent-validate" title="stun_agent_validate ()"><code class="function">stun_agent_validate()</code></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>compatibility</p></td>
<td class="parameter_description"><p>The <a class="link" href="libnice-StunAgent.html#StunCompatibility" title="enum StunCompatibility"><span class="type">StunCompatibility</span></a> to use for this agent. This will affect
how the agent builds and validates the STUN messages</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>usage_flags</p></td>
<td class="parameter_description"><p>A bitflag using <a class="link" href="libnice-StunAgent.html#StunAgentUsageFlags" title="enum StunAgentUsageFlags"><span class="type">StunAgentUsageFlags</span></a> values to define which
STUN usages the agent should use.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="stun-agent-validate"></a><h3>stun_agent_validate ()</h3>
<pre class="programlisting"><a class="link" href="libnice-StunAgent.html#StunValidationStatus" title="enum StunValidationStatus"><span class="returnvalue">StunValidationStatus</span></a>
stun_agent_validate (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
                     <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> *msg</code></em>,
                     <em class="parameter"><code>const <span class="type">uint8_t</span> *buffer</code></em>,
                     <em class="parameter"><code><span class="type">size_t</span> buffer_len</code></em>,
                     <em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunMessageIntegrityValidate" title="StunMessageIntegrityValidate ()"><span class="type">StunMessageIntegrityValidate</span></a> validater</code></em>,
                     <em class="parameter"><code><span class="type">void</span> *validater_data</code></em>);</pre>
<p>This function is used to validate an inbound STUN message and transform its
data buffer into a <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a>. It will take care of various validation
algorithms to make sure that the STUN message is valid and correctly
authenticated.</p>
<p> See also: <a class="link" href="libnice-StunAgent.html#stun-agent-default-validater" title="stun_agent_default_validater ()"><code class="function">stun_agent_default_validater()</code></a> </p>
<div class="refsect3">
<a name="stun-agent-validate.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>agent</p></td>
<td class="parameter_description"><p>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>msg</p></td>
<td class="parameter_description"><p>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> to build</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>buffer</p></td>
<td class="parameter_description"><p>The data buffer of the STUN message</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>buffer_len</p></td>
<td class="parameter_description"><p>The length of <em class="parameter"><code>buffer</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>validater</p></td>
<td class="parameter_description"><p>A <a class="link" href="libnice-StunAgent.html#StunMessageIntegrityValidate" title="StunMessageIntegrityValidate ()"><span class="type">StunMessageIntegrityValidate</span></a> function callback that will
be called if the agent needs to validate a MESSAGE-INTEGRITY attribute. It
will only be called if the agent finds a message that needs authentication
and a USERNAME is present in the STUN message, but no password is known.
The validater will not be called if the <a class="link" href="libnice-StunAgent.html#STUN-AGENT-USAGE-IGNORE-CREDENTIALS:CAPS"><span class="type">STUN_AGENT_USAGE_IGNORE_CREDENTIALS</span></a>
usage flag is set on the agent, and it will always be called if the
<a class="link" href="libnice-StunAgent.html#STUN-AGENT-USAGE-FORCE-VALIDATER:CAPS"><span class="type">STUN_AGENT_USAGE_FORCE_VALIDATER</span></a> usage flag is set on the agent.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>validater_data</p></td>
<td class="parameter_description"><p>A user data to give to the <em class="parameter"><code>validater</code></em>
callback when it gets
called.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="stun-agent-validate.returns"></a><h4>Returns</h4>
<p> A <a class="link" href="libnice-StunAgent.html#StunValidationStatus" title="enum StunValidationStatus"><span class="type">StunValidationStatus</span></a></p>
<div class="note"><p>
if the return value is different from <a class="link" href="libnice-StunAgent.html#STUN-VALIDATION-NOT-STUN:CAPS"><span class="type">STUN_VALIDATION_NOT_STUN</span></a> or
<a class="link" href="libnice-StunAgent.html#STUN-VALIDATION-INCOMPLETE-STUN:CAPS"><span class="type">STUN_VALIDATION_INCOMPLETE_STUN</span></a>, then the <em class="parameter"><code>msg</code></em> argument will contain a valid
STUN message that can be used.
This means that you can use the <em class="parameter"><code>msg</code></em> variable as the <em class="parameter"><code>request</code></em> argument to
functions like <a class="link" href="libnice-StunAgent.html#stun-agent-init-error" title="stun_agent_init_error ()"><code class="function">stun_agent_init_error()</code></a> or
<a class="link" href="libnice-StunAgent.html#stun-agent-build-unknown-attributes-error" title="stun_agent_build_unknown_attributes_error ()"><code class="function">stun_agent_build_unknown_attributes_error()</code></a>.
If the return value is <a class="link" href="libnice-StunAgent.html#STUN-VALIDATION-BAD-REQUEST:CAPS"><span class="type">STUN_VALIDATION_BAD_REQUEST</span></a>,
<a class="link" href="libnice-StunAgent.html#STUN-VALIDATION-UNAUTHORIZED:CAPS"><span class="type">STUN_VALIDATION_UNAUTHORIZED</span></a> or <a class="link" href="libnice-StunAgent.html#STUN-VALIDATION-UNAUTHORIZED-BAD-REQUEST:CAPS"><span class="type">STUN_VALIDATION_UNAUTHORIZED_BAD_REQUEST</span></a>
then the <em class="parameter"><code>key</code></em> in the <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> will not be set, so that error responses
will not have a MESSAGE-INTEGRITY attribute.
</p></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="stun-agent-default-validater"></a><h3>stun_agent_default_validater ()</h3>
<pre class="programlisting"><span class="returnvalue">bool</span>
stun_agent_default_validater (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
                              <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> *message</code></em>,
                              <em class="parameter"><code><span class="type">uint8_t</span> *username</code></em>,
                              <em class="parameter"><code><span class="type">uint16_t</span> username_len</code></em>,
                              <em class="parameter"><code><span class="type">uint8_t</span> **password</code></em>,
                              <em class="parameter"><code><span class="type">size_t</span> *password_len</code></em>,
                              <em class="parameter"><code><span class="type">void</span> *user_data</code></em>);</pre>
<p>This is a helper function to be used with <a class="link" href="libnice-StunAgent.html#stun-agent-validate" title="stun_agent_validate ()"><code class="function">stun_agent_validate()</code></a>. If no
complicated processing of the username needs to be done, this function can
be used with <a class="link" href="libnice-StunAgent.html#stun-agent-validate" title="stun_agent_validate ()"><code class="function">stun_agent_validate()</code></a> to quickly and easily match the username
of a STUN message with its password. Its <em class="parameter"><code>user_data</code></em>
 argument must be an array
of <a class="link" href="libnice-StunAgent.html#StunDefaultValidaterData" title="StunDefaultValidaterData"><span class="type">StunDefaultValidaterData</span></a> which will allow us to map a username to a
password</p>
<p> See also: <a class="link" href="libnice-StunAgent.html#stun-agent-validate" title="stun_agent_validate ()"><code class="function">stun_agent_validate()</code></a> </p>
<div class="refsect3">
<a name="stun-agent-default-validater.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>agent</p></td>
<td class="parameter_description"><p>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>message</p></td>
<td class="parameter_description"><p>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> being validated</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>username</p></td>
<td class="parameter_description"><p>The username found in the <em class="parameter"><code>message</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>username_len</p></td>
<td class="parameter_description"><p>The length of <em class="parameter"><code>username</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>password</p></td>
<td class="parameter_description"><p>The password associated with that username. This argument is a
pointer to a byte array that must be set by the validater function.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>password_len</p></td>
<td class="parameter_description"><p>The length of <em class="parameter"><code>password</code></em>
which must also be set by the
validater function.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>This must be an array of <a class="link" href="libnice-StunAgent.html#StunDefaultValidaterData" title="StunDefaultValidaterData"><span class="type">StunDefaultValidaterData</span></a> structures.
The last element in the array must have a username set to NULL</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="stun-agent-default-validater.returns"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the authentication was successful,
<a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if the authentication failed</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="stun-agent-init-request"></a><h3>stun_agent_init_request ()</h3>
<pre class="programlisting"><span class="returnvalue">bool</span>
stun_agent_init_request (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
                         <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> *msg</code></em>,
                         <em class="parameter"><code><span class="type">uint8_t</span> *buffer</code></em>,
                         <em class="parameter"><code><span class="type">size_t</span> buffer_len</code></em>,
                         <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMethod" title="enum StunMethod"><span class="type">StunMethod</span></a> m</code></em>);</pre>
<p>Creates a new STUN message of class <a class="link" href="libnice-StunMessage.html#STUN-REQUEST:CAPS"><span class="type">STUN_REQUEST</span></a> and with the method <em class="parameter"><code>m</code></em>
</p>
<div class="refsect3">
<a name="stun-agent-init-request.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>agent</p></td>
<td class="parameter_description"><p>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>msg</p></td>
<td class="parameter_description"><p>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> to build</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>buffer</p></td>
<td class="parameter_description"><p>The buffer to use in the <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>buffer_len</p></td>
<td class="parameter_description"><p>The length of the buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>m</p></td>
<td class="parameter_description"><p>The <a class="link" href="libnice-StunMessage.html#StunMethod" title="enum StunMethod"><span class="type">StunMethod</span></a> of the request</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="stun-agent-init-request.returns"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the message was initialized correctly, <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="stun-agent-init-indication"></a><h3>stun_agent_init_indication ()</h3>
<pre class="programlisting"><span class="returnvalue">bool</span>
stun_agent_init_indication (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
                            <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> *msg</code></em>,
                            <em class="parameter"><code><span class="type">uint8_t</span> *buffer</code></em>,
                            <em class="parameter"><code><span class="type">size_t</span> buffer_len</code></em>,
                            <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMethod" title="enum StunMethod"><span class="type">StunMethod</span></a> m</code></em>);</pre>
<p>Creates a new STUN message of class <a class="link" href="libnice-StunMessage.html#STUN-INDICATION:CAPS"><span class="type">STUN_INDICATION</span></a> and with the method <em class="parameter"><code>m</code></em>
</p>
<div class="refsect3">
<a name="stun-agent-init-indication.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>agent</p></td>
<td class="parameter_description"><p>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>msg</p></td>
<td class="parameter_description"><p>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> to build</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>buffer</p></td>
<td class="parameter_description"><p>The buffer to use in the <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>buffer_len</p></td>
<td class="parameter_description"><p>The length of the buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>m</p></td>
<td class="parameter_description"><p>The <a class="link" href="libnice-StunMessage.html#StunMethod" title="enum StunMethod"><span class="type">StunMethod</span></a> of the indication</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="stun-agent-init-indication.returns"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the message was initialized correctly, <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="stun-agent-init-response"></a><h3>stun_agent_init_response ()</h3>
<pre class="programlisting"><span class="returnvalue">bool</span>
stun_agent_init_response (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
                          <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> *msg</code></em>,
                          <em class="parameter"><code><span class="type">uint8_t</span> *buffer</code></em>,
                          <em class="parameter"><code><span class="type">size_t</span> buffer_len</code></em>,
                          <em class="parameter"><code>const <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> *request</code></em>);</pre>
<p>Creates a new STUN message of class <a class="link" href="libnice-StunMessage.html#STUN-RESPONSE:CAPS"><span class="type">STUN_RESPONSE</span></a> and with the same method
and transaction ID as the message <em class="parameter"><code>request</code></em>
. This will also copy the pointer
to the key that was used to authenticate the request, so you won't need to
specify the key with <a class="link" href="libnice-StunAgent.html#stun-agent-finish-message" title="stun_agent_finish_message ()"><code class="function">stun_agent_finish_message()</code></a></p>
<div class="refsect3">
<a name="stun-agent-init-response.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>agent</p></td>
<td class="parameter_description"><p>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>msg</p></td>
<td class="parameter_description"><p>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> to build</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>buffer</p></td>
<td class="parameter_description"><p>The buffer to use in the <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>buffer_len</p></td>
<td class="parameter_description"><p>The length of the buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>request</p></td>
<td class="parameter_description"><p>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> of class <a class="link" href="libnice-StunMessage.html#STUN-REQUEST:CAPS"><span class="type">STUN_REQUEST</span></a> that this response is for</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="stun-agent-init-response.returns"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the message was initialized correctly, <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="stun-agent-init-error"></a><h3>stun_agent_init_error ()</h3>
<pre class="programlisting"><span class="returnvalue">bool</span>
stun_agent_init_error (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
                       <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> *msg</code></em>,
                       <em class="parameter"><code><span class="type">uint8_t</span> *buffer</code></em>,
                       <em class="parameter"><code><span class="type">size_t</span> buffer_len</code></em>,
                       <em class="parameter"><code>const <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> *request</code></em>,
                       <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunError" title="enum StunError"><span class="type">StunError</span></a> err</code></em>);</pre>
<p>Creates a new STUN message of class <a class="link" href="libnice-StunMessage.html#STUN-ERROR:CAPS"><span class="type">STUN_ERROR</span></a> and with the same method
and transaction ID as the message <em class="parameter"><code>request</code></em>
. This will also copy the pointer
to the key that was used to authenticate the request (if authenticated),
so you won't need to specify the key with <a class="link" href="libnice-StunAgent.html#stun-agent-finish-message" title="stun_agent_finish_message ()"><code class="function">stun_agent_finish_message()</code></a>.
It will then add the ERROR-CODE attribute with code <em class="parameter"><code>err</code></em>
 and the associated
string.</p>
<div class="refsect3">
<a name="stun-agent-init-error.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>agent</p></td>
<td class="parameter_description"><p>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>msg</p></td>
<td class="parameter_description"><p>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> to build</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>buffer</p></td>
<td class="parameter_description"><p>The buffer to use in the <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>buffer_len</p></td>
<td class="parameter_description"><p>The length of the buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>request</p></td>
<td class="parameter_description"><p>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> of class <a class="link" href="libnice-StunMessage.html#STUN-REQUEST:CAPS"><span class="type">STUN_REQUEST</span></a> that this error response
is for</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>err</p></td>
<td class="parameter_description"><p>The <a class="link" href="libnice-StunMessage.html#StunError" title="enum StunError"><span class="type">StunError</span></a> to put in the ERROR-CODE attribute of the error response</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="stun-agent-init-error.returns"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the message was initialized correctly, <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="stun-agent-build-unknown-attributes-error"></a><h3>stun_agent_build_unknown_attributes_error ()</h3>
<pre class="programlisting"><span class="returnvalue">size_t</span>
stun_agent_build_unknown_attributes_error
                               (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
                                <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> *msg</code></em>,
                                <em class="parameter"><code><span class="type">uint8_t</span> *buffer</code></em>,
                                <em class="parameter"><code><span class="type">size_t</span> buffer_len</code></em>,
                                <em class="parameter"><code>const <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> *request</code></em>);</pre>
<p>Creates a new STUN message of class <a class="link" href="libnice-StunMessage.html#STUN-ERROR:CAPS"><span class="type">STUN_ERROR</span></a> and with the same method
and transaction ID as the message <em class="parameter"><code>request</code></em>
.  It will then add the ERROR-CODE
attribute with code <a class="link" href="libnice-StunMessage.html#STUN-ERROR-UNKNOWN-ATTRIBUTE:CAPS"><span class="type">STUN_ERROR_UNKNOWN_ATTRIBUTE</span></a> and add all the unknown
mandatory attributes from the <em class="parameter"><code>request</code></em>
 STUN message in the
<a class="link" href="libnice-StunMessage.html#STUN-ATTRIBUTE-UNKNOWN-ATTRIBUTES:CAPS"><span class="type">STUN_ATTRIBUTE_UNKNOWN_ATTRIBUTES</span></a> attribute, it will then finish the message
by calling <a class="link" href="libnice-StunAgent.html#stun-agent-finish-message" title="stun_agent_finish_message ()"><code class="function">stun_agent_finish_message()</code></a></p>
<div class="refsect3">
<a name="stun-agent-build-unknown-attributes-error.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>agent</p></td>
<td class="parameter_description"><p>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>msg</p></td>
<td class="parameter_description"><p>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> to build</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>buffer</p></td>
<td class="parameter_description"><p>The buffer to use in the <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>buffer_len</p></td>
<td class="parameter_description"><p>The length of the buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>request</p></td>
<td class="parameter_description"><p>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> of class <a class="link" href="libnice-StunMessage.html#STUN-REQUEST:CAPS"><span class="type">STUN_REQUEST</span></a> that this response is for</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="stun-agent-build-unknown-attributes-error.returns"></a><h4>Returns</h4>
<p> The size of the message built</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="stun-agent-finish-message"></a><h3>stun_agent_finish_message ()</h3>
<pre class="programlisting"><span class="returnvalue">size_t</span>
stun_agent_finish_message (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
                           <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> *msg</code></em>,
                           <em class="parameter"><code>const <span class="type">uint8_t</span> *key</code></em>,
                           <em class="parameter"><code><span class="type">size_t</span> key_len</code></em>);</pre>
<p>This function will 'finish' a message and make it ready to be sent. It will
add the MESSAGE-INTEGRITY and FINGERPRINT attributes if necessary. If the
STUN message has a <a class="link" href="libnice-StunMessage.html#STUN-REQUEST:CAPS"><span class="type">STUN_REQUEST</span></a> class, it will save the transaction id of
the message in the agent for future matching of the response.</p>
<p>See also: <a class="link" href="libnice-StunAgent.html#stun-agent-forget-transaction" title="stun_agent_forget_transaction ()"><code class="function">stun_agent_forget_transaction()</code></a></p>
<div class="refsect3">
<a name="stun-agent-finish-message.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>agent</p></td>
<td class="parameter_description"><p>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>msg</p></td>
<td class="parameter_description"><p>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> to finish</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>key</p></td>
<td class="parameter_description"><p>The key to use for the MESSAGE-INTEGRITY attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>key_len</p></td>
<td class="parameter_description"><p>The length of the <em class="parameter"><code>key</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="stun-agent-finish-message.returns"></a><h4>Returns</h4>
<p> The final size of the message built or 0 if an error occured</p>
<div class="note">
<p>
The return value must always be checked. a value of 0 means the either
the buffer's size is too small to contain the finishing attributes
(MESSAGE-INTEGRITY, FINGERPRINT), or that there is no more free slots
for saving the sent id in the agent's state.
</p>
<p>
Everytime <a class="link" href="libnice-StunAgent.html#stun-agent-finish-message" title="stun_agent_finish_message ()"><code class="function">stun_agent_finish_message()</code></a> is called for a <a class="link" href="libnice-StunMessage.html#STUN-REQUEST:CAPS"><span class="type">STUN_REQUEST</span></a>
message, you must make sure to call <a class="link" href="libnice-StunAgent.html#stun-agent-forget-transaction" title="stun_agent_forget_transaction ()"><code class="function">stun_agent_forget_transaction()</code></a> in
case the response times out and is never received. This is to avoid
filling up the <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>'s sent ids state preventing any further
use of the <a class="link" href="libnice-StunAgent.html#stun-agent-finish-message" title="stun_agent_finish_message ()"><code class="function">stun_agent_finish_message()</code></a>
</p>
</div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="stun-agent-forget-transaction"></a><h3>stun_agent_forget_transaction ()</h3>
<pre class="programlisting"><span class="returnvalue">bool</span>
stun_agent_forget_transaction (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
                               <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunTransactionId" title="StunTransactionId"><span class="type">StunTransactionId</span></a> id</code></em>);</pre>
<p>This function is used to make the <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> forget about a previously
created transaction.</p>
<p>
This function should be called when a STUN request was previously
created with <a class="link" href="libnice-StunAgent.html#stun-agent-finish-message" title="stun_agent_finish_message ()"><code class="function">stun_agent_finish_message()</code></a> and for which no response was ever
received (timed out). The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> keeps a list of the sent transactions
in order to validate the responses received. If the response is never received
this will allow the <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> to forget about the timed out transaction and
free its slot for future transactions.
</p>
<div class="refsect3">
<a name="stun-agent-forget-transaction.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>agent</p></td>
<td class="parameter_description"><p>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>id</p></td>
<td class="parameter_description"><p>The <a class="link" href="libnice-StunMessage.html#StunTransactionId" title="StunTransactionId"><span class="type">StunTransactionId</span></a> of the transaction to forget</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="stun-agent-forget-transaction.returns"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the transaction was found, <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</p>
</div>
<p class="since">Since: <a class="link" href="ix04.html#api-index-0.0.6">0.0.6</a></p>
</div>
<hr>
<div class="refsect2">
<a name="stun-agent-set-software"></a><h3>stun_agent_set_software ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
stun_agent_set_software (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
                         <em class="parameter"><code>const <span class="type">char</span> *software</code></em>);</pre>
<p>This function will set the value of the SOFTWARE attribute to be added to
STUN requests, responses and error responses.</p>
<p>
Calling this function will automatically enable the addition of the SOFTWARE
attribute for RFC5389 and MSICE2 compatibility modes.

</p>
<div class="note">
<p>
       The <em class="parameter"><code>software</code></em> argument must be in UTF-8 encoding and only the first
       128 characters will be sent.
     </p>
<p>
       The value of the <em class="parameter"><code>software</code></em> argument must stay valid throughout the life of
       the StunAgent's life. Do not free its content.
     </p>
</div>
<div class="refsect3">
<a name="stun-agent-set-software.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>agent</p></td>
<td class="parameter_description"><p>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>software</p></td>
<td class="parameter_description"><p>The value of the SOFTWARE attribute to add.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="ix07.html#api-index-0.0.10">0.0.10</a></p>
</div>
<hr>
<div class="refsect2">
<a name="stun-debug-enable"></a><h3>stun_debug_enable ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
stun_debug_enable (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Enable debug messages to stderr</p>
</div>
<hr>
<div class="refsect2">
<a name="stun-debug-disable"></a><h3>stun_debug_disable ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
stun_debug_disable (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Disable debug messages to stderr</p>
</div>
<hr>
<div class="refsect2">
<a name="stun-set-debug-handler"></a><h3>stun_set_debug_handler ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
stun_set_debug_handler (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunDebugHandler" title="StunDebugHandler ()"><span class="type">StunDebugHandler</span></a> handler</code></em>);</pre>
<p>Set a callback function to be invoked for each debug message from the STUN
code. The callback will only be invoked if STUN debugging is enabled using
<a class="link" href="libnice-StunAgent.html#stun-debug-enable" title="stun_debug_enable ()"><code class="function">stun_debug_enable()</code></a>.</p>
<p>The default callback prints the formatted debug message to stderr.</p>
<div class="refsect3">
<a name="stun-set-debug-handler.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>handler</p></td>
<td class="parameter_description"><p> Handler for STUN debug messages, or <a href="/usr/share/gtk-doc/html/liboilliboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> to use the
default. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
<div class="refsect1">
<a name="libnice-StunAgent.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="StunAgent"></a><h3>StunAgent</h3>
<pre class="programlisting">typedef struct stun_agent_t StunAgent;
</pre>
<p>An opaque structure representing the STUN agent.</p>
</div>
<hr>
<div class="refsect2">
<a name="StunCompatibility"></a><h3>enum StunCompatibility</h3>
<p>Enum that specifies the STUN compatibility mode of the <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a></p>
<div class="warning">
<em class="parameter"><code>STUN_COMPATIBILITY_WLM2009</code></em> is deprecated and should not be used
in newly-written code. It is kept for compatibility reasons and represents
the same compatibility as <em class="parameter"><code>STUN_COMPATIBILITY_MSICE2</code></em>.</div>
<div class="refsect3">
<a name="StunCompatibility.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="STUN-COMPATIBILITY-RFC3489:CAPS"></a>STUN_COMPATIBILITY_RFC3489</p></td>
<td class="enum_member_description">
<p>Use the STUN specifications compatible with
RFC 3489</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="STUN-COMPATIBILITY-RFC5389:CAPS"></a>STUN_COMPATIBILITY_RFC5389</p></td>
<td class="enum_member_description">
<p>Use the STUN specifications compatible with
RFC 5389</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="STUN-COMPATIBILITY-MSICE2:CAPS"></a>STUN_COMPATIBILITY_MSICE2</p></td>
<td class="enum_member_description">
<p>Use the STUN specifications compatible with
[MS-ICE2] (a mix between RFC3489 and RFC5389)</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="STUN-COMPATIBILITY-OC2007:CAPS"></a>STUN_COMPATIBILITY_OC2007</p></td>
<td class="enum_member_description">
<p>Use the STUN specifications compatible with
Microsoft Office Communicator 2007 (basically RFC3489 with swapped
REALM and NONCE attribute hex IDs, attributes are not aligned)</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="STUN-COMPATIBILITY-WLM2009:CAPS"></a>STUN_COMPATIBILITY_WLM2009</p></td>
<td class="enum_member_description">
<p>An alias for <em class="parameter"><code>STUN_COMPATIBILITY_MSICE2</code></em>
</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="STUN-COMPATIBILITY-LAST:CAPS"></a>STUN_COMPATIBILITY_LAST</p></td>
<td class="enum_member_description">
<p>Dummy last compatibility mode</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="StunAgentUsageFlags"></a><h3>enum StunAgentUsageFlags</h3>
<p>This enum defines a bitflag usages for a <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> and they will define how
the agent should behave, independently of the compatibility mode it uses.</p>
<p> See also: <a class="link" href="libnice-StunAgent.html#stun-agent-init" title="stun_agent_init ()"><code class="function">stun_agent_init()</code></a> </p>
<p> See also: <a class="link" href="libnice-StunAgent.html#stun-agent-validate" title="stun_agent_validate ()"><code class="function">stun_agent_validate()</code></a> </p>
<div class="refsect3">
<a name="StunAgentUsageFlags.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="STUN-AGENT-USAGE-SHORT-TERM-CREDENTIALS:CAPS"></a>STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS</p></td>
<td class="enum_member_description">
<p>The agent should be using the short
term credentials mechanism for authenticating STUN messages</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="STUN-AGENT-USAGE-LONG-TERM-CREDENTIALS:CAPS"></a>STUN_AGENT_USAGE_LONG_TERM_CREDENTIALS</p></td>
<td class="enum_member_description">
<p>The agent should be using the long
term credentials mechanism for authenticating STUN messages</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="STUN-AGENT-USAGE-USE-FINGERPRINT:CAPS"></a>STUN_AGENT_USAGE_USE_FINGERPRINT</p></td>
<td class="enum_member_description">
<p>The agent should add the FINGERPRINT
attribute to the STUN messages it creates.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="STUN-AGENT-USAGE-ADD-SOFTWARE:CAPS"></a>STUN_AGENT_USAGE_ADD_SOFTWARE</p></td>
<td class="enum_member_description">
<p>The agent should add the SOFTWARE attribute
to the STUN messages it creates. Calling <a class="link" href="NiceAgent.html#nice-agent-set-software" title="nice_agent_set_software ()"><code class="function">nice_agent_set_software()</code></a> will have
the same effect as enabling this Usage. STUN Indications do not have the
SOFTWARE attributes added to them though. The SOFTWARE attribute is only
added for the RFC5389 and MSICE2 compatibility modes.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="STUN-AGENT-USAGE-IGNORE-CREDENTIALS:CAPS"></a>STUN_AGENT_USAGE_IGNORE_CREDENTIALS</p></td>
<td class="enum_member_description">
<p>The agent should ignore any credentials
in the STUN messages it receives (the MESSAGE-INTEGRITY attribute
will never be validated by <a class="link" href="libnice-StunAgent.html#stun-agent-validate" title="stun_agent_validate ()"><code class="function">stun_agent_validate()</code></a>)</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="STUN-AGENT-USAGE-NO-INDICATION-AUTH:CAPS"></a>STUN_AGENT_USAGE_NO_INDICATION_AUTH</p></td>
<td class="enum_member_description">
<p>The agent should ignore credentials
in the STUN messages it receives if the <a class="link" href="libnice-StunMessage.html#StunClass" title="enum StunClass"><span class="type">StunClass</span></a> of the message is
<a class="link" href="libnice-StunMessage.html#STUN-INDICATION:CAPS"><span class="type">STUN_INDICATION</span></a> (some implementation require <a class="link" href="libnice-StunMessage.html#STUN-INDICATION:CAPS"><span class="type">STUN_INDICATION</span></a> messages to
be authenticated, while others never add a MESSAGE-INTEGRITY attribute to a
<a class="link" href="libnice-StunMessage.html#STUN-INDICATION:CAPS"><span class="type">STUN_INDICATION</span></a> message)</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="STUN-AGENT-USAGE-FORCE-VALIDATER:CAPS"></a>STUN_AGENT_USAGE_FORCE_VALIDATER</p></td>
<td class="enum_member_description">
<p>The agent should always try to validate
the password of a STUN message, even if it already knows what the password
should be (a response to a previously created request). This means that the
<a class="link" href="libnice-StunAgent.html#StunMessageIntegrityValidate" title="StunMessageIntegrityValidate ()"><span class="type">StunMessageIntegrityValidate</span></a> callback will always be called when there is
a MESSAGE-INTEGRITY attribute.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="STUN-AGENT-USAGE-NO-ALIGNED-ATTRIBUTES:CAPS"></a>STUN_AGENT_USAGE_NO_ALIGNED_ATTRIBUTES</p></td>
<td class="enum_member_description">
<p>The agent should not assume STUN
attributes are aligned on 32-bit boundaries when parsing messages and also
do not add padding when creating messages.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="StunValidationStatus"></a><h3>enum StunValidationStatus</h3>
<p>This enum is used as the return value of <a class="link" href="libnice-StunAgent.html#stun-agent-validate" title="stun_agent_validate ()"><code class="function">stun_agent_validate()</code></a> and represents
the status result of the validation of a STUN message.</p>
<div class="refsect3">
<a name="StunValidationStatus.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="STUN-VALIDATION-SUCCESS:CAPS"></a>STUN_VALIDATION_SUCCESS</p></td>
<td class="enum_member_description">
<p>The message is validated</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="STUN-VALIDATION-NOT-STUN:CAPS"></a>STUN_VALIDATION_NOT_STUN</p></td>
<td class="enum_member_description">
<p>This is not a valid STUN message</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="STUN-VALIDATION-INCOMPLETE-STUN:CAPS"></a>STUN_VALIDATION_INCOMPLETE_STUN</p></td>
<td class="enum_member_description">
<p>The message seems to be valid but incomplete</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="STUN-VALIDATION-BAD-REQUEST:CAPS"></a>STUN_VALIDATION_BAD_REQUEST</p></td>
<td class="enum_member_description">
<p>The message does not have the cookie or the
fingerprint while the agent needs it with its usage</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="STUN-VALIDATION-UNAUTHORIZED-BAD-REQUEST:CAPS"></a>STUN_VALIDATION_UNAUTHORIZED_BAD_REQUEST</p></td>
<td class="enum_member_description">
<p>The message is valid but
unauthorized with no username and message-integrity attributes.
A BAD_REQUEST error must be generated</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="STUN-VALIDATION-UNAUTHORIZED:CAPS"></a>STUN_VALIDATION_UNAUTHORIZED</p></td>
<td class="enum_member_description">
<p>The message is valid but unauthorized as
the username/password do not match.
An UNAUTHORIZED error must be generated</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="STUN-VALIDATION-UNMATCHED-RESPONSE:CAPS"></a>STUN_VALIDATION_UNMATCHED_RESPONSE</p></td>
<td class="enum_member_description">
<p>The message is valid but this is a
response/error that doesn't match a previously sent request</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="STUN-VALIDATION-UNKNOWN-REQUEST-ATTRIBUTE:CAPS"></a>STUN_VALIDATION_UNKNOWN_REQUEST_ATTRIBUTE</p></td>
<td class="enum_member_description">
<p>The message is valid but
contains one or more unknown comprehension attributes.
<a class="link" href="libnice-StunAgent.html#stun-agent-build-unknown-attributes-error" title="stun_agent_build_unknown_attributes_error ()"><code class="function">stun_agent_build_unknown_attributes_error()</code></a> should be called</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="STUN-VALIDATION-UNKNOWN-ATTRIBUTE:CAPS"></a>STUN_VALIDATION_UNKNOWN_ATTRIBUTE</p></td>
<td class="enum_member_description">
<p>The message is valid but contains one
or more unknown comprehension attributes. This is a response, or error,
or indication message and no error response should be sent</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="StunDefaultValidaterData"></a><h3>StunDefaultValidaterData</h3>
<pre class="programlisting">typedef struct {
  uint8_t *username;
  size_t username_len;
  uint8_t *password;
  size_t password_len;
} StunDefaultValidaterData;
</pre>
<p>This structure is used as an element of the user_data to the
<a class="link" href="libnice-StunAgent.html#stun-agent-default-validater" title="stun_agent_default_validater ()"><code class="function">stun_agent_default_validater()</code></a> function for authenticating a STUN
message during validationg.</p>
<p> See also: <a class="link" href="libnice-StunAgent.html#stun-agent-default-validater" title="stun_agent_default_validater ()"><code class="function">stun_agent_default_validater()</code></a> </p>
<div class="refsect3">
<a name="StunDefaultValidaterData.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="struct_member_name"><p><span class="type">uint8_t</span> *<em class="structfield"><code><a name="StunDefaultValidaterData.username"></a>username</code></em>;</p></td>
<td class="struct_member_description"><p>The username</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">size_t</span> <em class="structfield"><code><a name="StunDefaultValidaterData.username-len"></a>username_len</code></em>;</p></td>
<td class="struct_member_description"><p>The length of the <em class="parameter"><code>username</code></em>
</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">uint8_t</span> *<em class="structfield"><code><a name="StunDefaultValidaterData.password"></a>password</code></em>;</p></td>
<td class="struct_member_description"><p>The password</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">size_t</span> <em class="structfield"><code><a name="StunDefaultValidaterData.password-len"></a>password_len</code></em>;</p></td>
<td class="struct_member_description"><p>The length of the <em class="parameter"><code>password</code></em>
</p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="refsect1">
<a name="libnice-StunAgent.see-also"></a><h2>See Also</h2>
<p><a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a></p>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.25</div>
</body>
</html>