|
42 | 42 | #include "network.h"
|
43 | 43 | #include "srtp.h"
|
44 | 44 | #include "tls.h"
|
45 |
| -#include <errno.h> |
46 | 45 | /**
|
47 | 46 | * Maximum size limit of a Session Description Protocol (SDP),
|
48 | 47 | * be it an offer or answer.
|
|
162 | 161 | /* STUN Attribute, comprehension-required range (0x0000-0x7FFF) */
|
163 | 162 | enum STUNAttr {
|
164 | 163 | STUN_ATTR_USERNAME = 0x0006, /// shared secret response/bind request
|
165 |
| - STUN_ATTR_PRIORITY = 0x0024, /// ICE controlling/controlled |
166 | 164 | STUN_ATTR_USE_CANDIDATE = 0x0025, /// bind request
|
167 | 165 | STUN_ATTR_MESSAGE_INTEGRITY = 0x0008, /// bind request/response
|
168 | 166 | STUN_ATTR_FINGERPRINT = 0x8028, /// rfc5389
|
169 |
| - STUN_ATTR_ICE_CONTROLLING = 0x802A, /// full agent talking to ice-lite |
170 | 167 | };
|
171 | 168 |
|
172 | 169 | enum WHIPState {
|
@@ -316,10 +313,6 @@ typedef struct WHIPContext {
|
316 | 313 | int consent_interval;
|
317 | 314 | int64_t last_consent_tx;
|
318 | 315 | int consent_failures;
|
319 |
| - |
320 |
| - /* ICE-lite support */ |
321 |
| - int ice_lite_remote; |
322 |
| - uint64_t ice_tie_breaker; /* random 64-bit, for ICE-CONTROLLING */ |
323 | 316 | } WHIPContext;
|
324 | 317 |
|
325 | 318 | /**
|
@@ -429,9 +422,6 @@ static av_cold int initialize(AVFormatContext *s)
|
429 | 422 | seed = av_get_random_seed();
|
430 | 423 | av_lfg_init(&whip->rnd, seed);
|
431 | 424 |
|
432 |
| - /* 64-bit tie-breaker for ICE-CONTROLLING (RFC 8445 6.1.1) */ |
433 |
| - whip->ice_tie_breaker = ((uint64_t)av_lfg_get(&whip->rnd) << 32) | (uint64_t)av_lfg_get(&whip->rnd); |
434 |
| - |
435 | 425 | /* Initialise consent-freshness timers */
|
436 | 426 | if (whip->consent_interval <= 0)
|
437 | 427 | whip->consent_interval = WHIP_CONSENT_DEF_INTERVAL;
|
@@ -920,8 +910,6 @@ static int parse_answer(AVFormatContext *s)
|
920 | 910 | goto end;
|
921 | 911 | }
|
922 | 912 | }
|
923 |
| - } else if (av_strstart(line, "a=ice-lite", NULL)) { |
924 |
| - whip->ice_lite_remote = 1; |
925 | 913 | }
|
926 | 914 | }
|
927 | 915 |
|
@@ -1013,21 +1001,6 @@ static int ice_create_request(AVFormatContext *s, uint8_t *buf, int buf_size, in
|
1013 | 1001 | avio_wb16(pb, STUN_ATTR_USE_CANDIDATE); /* attribute type use-candidate */
|
1014 | 1002 | avio_wb16(pb, 0); /* size of use-candidate */
|
1015 | 1003 |
|
1016 |
| - /** |
1017 |
| - * For ICE-lite peers we are *always* the controlling agent (RFC 8445 6.1.3.1). |
1018 |
| - * Add PRIORITY + ICE-CONTROLLING attributes. |
1019 |
| - */ |
1020 |
| - if (whip->ice_lite_remote) { |
1021 |
| - /* we are controlling, use host-candidate priority 126 << 24 | 65535 << 8 | 255 = 2130706431 */ |
1022 |
| - avio_wb16(pb, STUN_ATTR_PRIORITY); |
1023 |
| - avio_wb16(pb, 4); |
1024 |
| - avio_wb32(pb, 2130706431); |
1025 |
| - |
1026 |
| - avio_wb16(pb, STUN_ATTR_ICE_CONTROLLING); |
1027 |
| - avio_wb16(pb, 8); |
1028 |
| - avio_wb32(pb, (uint32_t)(whip->ice_tie_breaker >> 32)); |
1029 |
| - avio_wb32(pb, (uint32_t)(whip->ice_tie_breaker & 0xffffffff)); |
1030 |
| - } |
1031 | 1004 |
|
1032 | 1005 | /* Build and update message integrity */
|
1033 | 1006 | avio_wb16(pb, STUN_ATTR_MESSAGE_INTEGRITY); /* attribute type message integrity */
|
|
0 commit comments