This file is indexed.

/usr/share/gtk-doc/html/libnice/libnice-StunAgent.html is in libnice-doc 0.1.4-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
<!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</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.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.18 (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="2">
<tr valign="middle">
<td><a accesskey="p" href="ch03.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch03.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">libnice Reference Manual</th>
<td><a accesskey="n" href="libnice-StunMessage.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#libnice-StunAgent.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#libnice-StunAgent.description" class="shortcut">Description</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 valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="libnice-StunAgent.stability-level"></a><h2>Stability Level</h2>
Stable, unless otherwise indicated
</div>
<div class="refsynopsisdiv">
<a name="libnice-StunAgent.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;stun/stunagent.h&gt;

typedef             <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent">StunAgent</a>;
enum                <a class="link" href="libnice-StunAgent.html#StunCompatibility" title="enum StunCompatibility">StunCompatibility</a>;
enum                <a class="link" href="libnice-StunAgent.html#StunAgentUsageFlags" title="enum StunAgentUsageFlags">StunAgentUsageFlags</a>;
enum                <a class="link" href="libnice-StunAgent.html#StunValidationStatus" title="enum StunValidationStatus">StunValidationStatus</a>;
<span class="returnvalue">bool</span>                (<a class="link" href="libnice-StunAgent.html#StunMessageIntegrityValidate" title="StunMessageIntegrityValidate ()">*StunMessageIntegrityValidate</a>)     (<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>);
                    <a class="link" href="libnice-StunAgent.html#StunDefaultValidaterData" title="StunDefaultValidaterData">StunDefaultValidaterData</a>;
<span class="returnvalue">void</span>                <a class="link" href="libnice-StunAgent.html#stun-agent-init" title="stun_agent_init ()">stun_agent_init</a>                     (<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>);
<a class="link" href="libnice-StunAgent.html#StunValidationStatus" title="enum StunValidationStatus"><span class="returnvalue">StunValidationStatus</span></a> <a class="link" href="libnice-StunAgent.html#stun-agent-validate" title="stun_agent_validate ()">stun_agent_validate</a>                (<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>);
<span class="returnvalue">bool</span>                <a class="link" href="libnice-StunAgent.html#stun-agent-default-validater" title="stun_agent_default_validater ()">stun_agent_default_validater</a>        (<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>);
<span class="returnvalue">bool</span>                <a class="link" href="libnice-StunAgent.html#stun-agent-init-request" title="stun_agent_init_request ()">stun_agent_init_request</a>             (<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>);
<span class="returnvalue">bool</span>                <a class="link" href="libnice-StunAgent.html#stun-agent-init-indication" title="stun_agent_init_indication ()">stun_agent_init_indication</a>          (<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>);
<span class="returnvalue">bool</span>                <a class="link" href="libnice-StunAgent.html#stun-agent-init-response" title="stun_agent_init_response ()">stun_agent_init_response</a>            (<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>);
<span class="returnvalue">bool</span>                <a class="link" href="libnice-StunAgent.html#stun-agent-init-error" title="stun_agent_init_error ()">stun_agent_init_error</a>               (<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>);
<span class="returnvalue">size_t</span>              <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>
                                                        (<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>);
<span class="returnvalue">size_t</span>              <a class="link" href="libnice-StunAgent.html#stun-agent-finish-message" title="stun_agent_finish_message ()">stun_agent_finish_message</a>           (<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>);
<span class="returnvalue">bool</span>                <a class="link" href="libnice-StunAgent.html#stun-agent-forget-transaction" title="stun_agent_forget_transaction ()">stun_agent_forget_transaction</a>       (<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>);
<span class="returnvalue">void</span>                <a class="link" href="libnice-StunAgent.html#stun-agent-set-software" title="stun_agent_set_software ()">stun_agent_set_software</a>             (<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>);
<span class="returnvalue">void</span>                <a class="link" href="libnice-StunAgent.html#stun-debug-enable" title="stun_debug_enable ()">stun_debug_enable</a>                   (<em class="parameter"><code><span class="type">void</span></code></em>);
<span class="returnvalue">void</span>                <a class="link" href="libnice-StunAgent.html#stun-debug-disable" title="stun_debug_disable ()">stun_debug_disable</a>                  (<em class="parameter"><code><span class="type">void</span></code></em>);
</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.details"></a><h2>Details</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>
<pre class="programlisting">typedef enum {
  STUN_COMPATIBILITY_RFC3489,
  STUN_COMPATIBILITY_RFC5389,
  STUN_COMPATIBILITY_WLM2009,
  STUN_COMPATIBILITY_OC2007,
  STUN_COMPATIBILITY_LAST = STUN_COMPATIBILITY_OC2007
} StunCompatibility;
</pre>
<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="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="STUN-COMPATIBILITY-RFC3489:CAPS"></a><span class="term"><code class="literal">STUN_COMPATIBILITY_RFC3489</code></span></p></td>
<td>Use the STUN specifications compatible with
RFC 3489
</td>
</tr>
<tr>
<td><p><a name="STUN-COMPATIBILITY-RFC5389:CAPS"></a><span class="term"><code class="literal">STUN_COMPATIBILITY_RFC5389</code></span></p></td>
<td>Use the STUN specifications compatible with
RFC 5389
</td>
</tr>
<tr>
<td><p><a name="STUN-COMPATIBILITY-WLM2009:CAPS"></a><span class="term"><code class="literal">STUN_COMPATIBILITY_WLM2009</code></span></p></td>
<td>Use the STUN specifications compatible with
Windows Live Messenger 2009 (a mix between RFC3489 and RFC5389, as well as
a special usecase against a typo in their code)
</td>
</tr>
<tr>
<td><p><a name="STUN-COMPATIBILITY-OC2007:CAPS"></a><span class="term"><code class="literal">STUN_COMPATIBILITY_OC2007</code></span></p></td>
<td>Use the STUN specifications compatible with
Microsoft Office Communicator 2007 (basically RFC3489 with swapped
REALM and NONCE attribute hex IDs, attributes are not aligned)
</td>
</tr>
<tr>
<td><p><a name="STUN-COMPATIBILITY-LAST:CAPS"></a><span class="term"><code class="literal">STUN_COMPATIBILITY_LAST</code></span></p></td>
<td>Dummy last compatibility mode
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="StunAgentUsageFlags"></a><h3>enum StunAgentUsageFlags</h3>
<pre class="programlisting">typedef enum {
  STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS    = (1 &lt;&lt; 0),
  STUN_AGENT_USAGE_LONG_TERM_CREDENTIALS     = (1 &lt;&lt; 1),
  STUN_AGENT_USAGE_USE_FINGERPRINT           = (1 &lt;&lt; 2),
  STUN_AGENT_USAGE_ADD_SOFTWARE              = (1 &lt;&lt; 3),
  STUN_AGENT_USAGE_IGNORE_CREDENTIALS        = (1 &lt;&lt; 4),
  STUN_AGENT_USAGE_NO_INDICATION_AUTH        = (1 &lt;&lt; 5),
  STUN_AGENT_USAGE_FORCE_VALIDATER           = (1 &lt;&lt; 6),
  STUN_AGENT_USAGE_NO_ALIGNED_ATTRIBUTES     = (1 &lt;&lt; 7),
} StunAgentUsageFlags;
</pre>
<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>
</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>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="STUN-AGENT-USAGE-SHORT-TERM-CREDENTIALS:CAPS"></a><span class="term"><code class="literal">STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS</code></span></p></td>
<td>The agent should be using the short
term credentials mechanism for authenticating STUN messages
</td>
</tr>
<tr>
<td><p><a name="STUN-AGENT-USAGE-LONG-TERM-CREDENTIALS:CAPS"></a><span class="term"><code class="literal">STUN_AGENT_USAGE_LONG_TERM_CREDENTIALS</code></span></p></td>
<td>The agent should be using the long
term credentials mechanism for authenticating STUN messages
</td>
</tr>
<tr>
<td><p><a name="STUN-AGENT-USAGE-USE-FINGERPRINT:CAPS"></a><span class="term"><code class="literal">STUN_AGENT_USAGE_USE_FINGERPRINT</code></span></p></td>
<td>The agent should add the FINGERPRINT
attribute to the STUN messages it creates.
</td>
</tr>
<tr>
<td><p><a name="STUN-AGENT-USAGE-ADD-SOFTWARE:CAPS"></a><span class="term"><code class="literal">STUN_AGENT_USAGE_ADD_SOFTWARE</code></span></p></td>
<td>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 WLM2009 compatibility modes.
</td>
</tr>
<tr>
<td><p><a name="STUN-AGENT-USAGE-IGNORE-CREDENTIALS:CAPS"></a><span class="term"><code class="literal">STUN_AGENT_USAGE_IGNORE_CREDENTIALS</code></span></p></td>
<td>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>)
</td>
</tr>
<tr>
<td><p><a name="STUN-AGENT-USAGE-NO-INDICATION-AUTH:CAPS"></a><span class="term"><code class="literal">STUN_AGENT_USAGE_NO_INDICATION_AUTH</code></span></p></td>
<td>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)
</td>
</tr>
<tr>
<td><p><a name="STUN-AGENT-USAGE-FORCE-VALIDATER:CAPS"></a><span class="term"><code class="literal">STUN_AGENT_USAGE_FORCE_VALIDATER</code></span></p></td>
<td>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.
</td>
</tr>
<tr>
<td><p><a name="STUN-AGENT-USAGE-NO-ALIGNED-ATTRIBUTES:CAPS"></a><span class="term"><code class="literal">STUN_AGENT_USAGE_NO_ALIGNED_ATTRIBUTES</code></span></p></td>
<td>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.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="StunValidationStatus"></a><h3>enum StunValidationStatus</h3>
<pre class="programlisting">typedef enum {
  STUN_VALIDATION_SUCCESS,
  STUN_VALIDATION_NOT_STUN,
  STUN_VALIDATION_INCOMPLETE_STUN,
  STUN_VALIDATION_BAD_REQUEST,
  STUN_VALIDATION_UNAUTHORIZED_BAD_REQUEST,
  STUN_VALIDATION_UNAUTHORIZED,
  STUN_VALIDATION_UNMATCHED_RESPONSE,
  STUN_VALIDATION_UNKNOWN_REQUEST_ATTRIBUTE,
  STUN_VALIDATION_UNKNOWN_ATTRIBUTE,
} StunValidationStatus;
</pre>
<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="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="STUN-VALIDATION-SUCCESS:CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_SUCCESS</code></span></p></td>
<td>The message is validated
</td>
</tr>
<tr>
<td><p><a name="STUN-VALIDATION-NOT-STUN:CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_NOT_STUN</code></span></p></td>
<td>This is not a valid STUN message
</td>
</tr>
<tr>
<td><p><a name="STUN-VALIDATION-INCOMPLETE-STUN:CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_INCOMPLETE_STUN</code></span></p></td>
<td>The message seems to be valid but incomplete
</td>
</tr>
<tr>
<td><p><a name="STUN-VALIDATION-BAD-REQUEST:CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_BAD_REQUEST</code></span></p></td>
<td>The message does not have the cookie or the
fingerprint while the agent needs it with its usage
</td>
</tr>
<tr>
<td><p><a name="STUN-VALIDATION-UNAUTHORIZED-BAD-REQUEST:CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_UNAUTHORIZED_BAD_REQUEST</code></span></p></td>
<td>The message is valid but
unauthorized with no username and message-integrity attributes.
A BAD_REQUEST error must be generated
</td>
</tr>
<tr>
<td><p><a name="STUN-VALIDATION-UNAUTHORIZED:CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_UNAUTHORIZED</code></span></p></td>
<td>The message is valid but unauthorized as
the username/password do not match.
An UNAUTHORIZED error must be generated
</td>
</tr>
<tr>
<td><p><a name="STUN-VALIDATION-UNMATCHED-RESPONSE:CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_UNMATCHED_RESPONSE</code></span></p></td>
<td>The message is valid but this is a
response/error that doesn't match a previously sent request
</td>
</tr>
<tr>
<td><p><a name="STUN-VALIDATION-UNKNOWN-REQUEST-ATTRIBUTE:CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_UNKNOWN_REQUEST_ATTRIBUTE</code></span></p></td>
<td>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
</td>
</tr>
<tr>
<td><p><a name="STUN-VALIDATION-UNKNOWN-ATTRIBUTE:CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_UNKNOWN_ATTRIBUTE</code></span></p></td>
<td>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
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="StunMessageIntegrityValidate"></a><h3>StunMessageIntegrityValidate ()</h3>
<pre class="programlisting"><span class="returnvalue">bool</span>                (*StunMessageIntegrityValidate)     (<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>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>agent</code></em> :</span></p></td>
<td>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>message</code></em> :</span></p></td>
<td>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> being validated</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>username</code></em> :</span></p></td>
<td>The username found in the <em class="parameter"><code>message</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>username_len</code></em> :</span></p></td>
<td>The length of <em class="parameter"><code>username</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>password</code></em> :</span></p></td>
<td>The password associated with that username. This argument is a
pointer to a byte array that must be set by the validater function.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>password_len</code></em> :</span></p></td>
<td>The length of <em class="parameter"><code>password</code></em> which must also be set by the
validater function.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>Data to give the function</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the authentication was successful,
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if the authentication failed</td>
</tr>
</tbody>
</table></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>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><span class="type">uint8_t</span> *<em class="structfield"><code><a name="StunDefaultValidaterData.username"></a>username</code></em>;</span></p></td>
<td>The username</td>
</tr>
<tr>
<td><p><span class="term"><span class="type">size_t</span> <em class="structfield"><code><a name="StunDefaultValidaterData.username-len"></a>username_len</code></em>;</span></p></td>
<td>The length of the <em class="parameter"><code>username</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="type">uint8_t</span> *<em class="structfield"><code><a name="StunDefaultValidaterData.password"></a>password</code></em>;</span></p></td>
<td>The password</td>
</tr>
<tr>
<td><p><span class="term"><span class="type">size_t</span> <em class="structfield"><code><a name="StunDefaultValidaterData.password-len"></a>password_len</code></em>;</span></p></td>
<td>The length of the <em class="parameter"><code>password</code></em>
</td>
</tr>
</tbody>
</table></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>
<p>
 </p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<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-WLM2009:CAPS"><span class="type">STUN_COMPATIBILITY_WLM2009</span></a> <em class="parameter"><code>compatibility</code></em> is used
    </p>
</div>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>agent</code></em> :</span></p></td>
<td>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> to initialize</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>known_attributes</code></em> :</span></p></td>
<td>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>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>compatibility</code></em> :</span></p></td>
<td>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</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>usage_flags</code></em> :</span></p></td>
<td>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.</td>
</tr>
</tbody>
</table></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>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>agent</code></em> :</span></p></td>
<td>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td>
<td>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> to build</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>The data buffer of the STUN message</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer_len</code></em> :</span></p></td>
<td>The length of <em class="parameter"><code>buffer</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>validater</code></em> :</span></p></td>
<td>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.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>validater_data</code></em> :</span></p></td>
<td>A user data to give to the <em class="parameter"><code>validater</code></em> callback when it gets
called.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A <a class="link" href="libnice-StunAgent.html#StunValidationStatus" title="enum StunValidationStatus"><span class="type">StunValidationStatus</span></a>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<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>
</td>
</tr>
</tbody>
</table></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>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>agent</code></em> :</span></p></td>
<td>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>message</code></em> :</span></p></td>
<td>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> being validated</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>username</code></em> :</span></p></td>
<td>The username found in the <em class="parameter"><code>message</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>username_len</code></em> :</span></p></td>
<td>The length of <em class="parameter"><code>username</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>password</code></em> :</span></p></td>
<td>The password associated with that username. This argument is a
pointer to a byte array that must be set by the validater function.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>password_len</code></em> :</span></p></td>
<td>The length of <em class="parameter"><code>password</code></em> which must also be set by the
validater function.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>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</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the authentication was successful,
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if the authentication failed</td>
</tr>
</tbody>
</table></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="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>agent</code></em> :</span></p></td>
<td>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td>
<td>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> to build</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>The buffer to use in the <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer_len</code></em> :</span></p></td>
<td>The length of the buffer</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>m</code></em> :</span></p></td>
<td>The <a class="link" href="libnice-StunMessage.html#StunMethod" title="enum StunMethod"><span class="type">StunMethod</span></a> of the request</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the message was initialized correctly, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</td>
</tr>
</tbody>
</table></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="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>agent</code></em> :</span></p></td>
<td>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td>
<td>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> to build</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>The buffer to use in the <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer_len</code></em> :</span></p></td>
<td>The length of the buffer</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>m</code></em> :</span></p></td>
<td>The <a class="link" href="libnice-StunMessage.html#StunMethod" title="enum StunMethod"><span class="type">StunMethod</span></a> of the indication</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the message was initialized correctly, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</td>
</tr>
</tbody>
</table></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="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>agent</code></em> :</span></p></td>
<td>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td>
<td>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> to build</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>The buffer to use in the <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer_len</code></em> :</span></p></td>
<td>The length of the buffer</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>request</code></em> :</span></p></td>
<td>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</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the message was initialized correctly, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</td>
</tr>
</tbody>
</table></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="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>agent</code></em> :</span></p></td>
<td>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td>
<td>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> to build</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>The buffer to use in the <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer_len</code></em> :</span></p></td>
<td>The length of the buffer</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>request</code></em> :</span></p></td>
<td>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</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>err</code></em> :</span></p></td>
<td>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</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the message was initialized correctly, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</td>
</tr>
</tbody>
</table></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="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>agent</code></em> :</span></p></td>
<td>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td>
<td>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> to build</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>The buffer to use in the <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer_len</code></em> :</span></p></td>
<td>The length of the buffer</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>request</code></em> :</span></p></td>
<td>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</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The size of the message built</td>
</tr>
</tbody>
</table></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>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>agent</code></em> :</span></p></td>
<td>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td>
<td>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> to finish</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
<td>The key to use for the MESSAGE-INTEGRITY attribute</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>key_len</code></em> :</span></p></td>
<td>The length of the <em class="parameter"><code>key</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The final size of the message built or 0 if an error occured
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<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>
</td>
</tr>
</tbody>
</table></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>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>agent</code></em> :</span></p></td>
<td>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>id</code></em> :</span></p></td>
<td>The <a class="link" href="libnice-StunMessage.html#StunTransactionId" title="StunTransactionId"><span class="type">StunTransactionId</span></a> of the transaction to forget</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the transaction was found, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.0.6</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 WLM2009 compatibility modes.
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<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>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>agent</code></em> :</span></p></td>
<td>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>software</code></em> :</span></p></td>
<td>The value of the SOFTWARE attribute to add.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.0.10</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>
</div>
<div class="refsect1">
<a name="libnice-StunAgent.see-also"></a><h2>See Also</h2>
<a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>