LeviLamina
Loading...
Searching...
No Matches
P2PTransportChannel.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/external/webrtc/ArrayView.h"
7#include "mc/external/webrtc/IceAgentInterface.h"
8#include "mc/external/webrtc/IceGatheringState.h"
9#include "mc/external/webrtc/IceMode.h"
10#include "mc/external/webrtc/IceRole.h"
11#include "mc/external/webrtc/IceSwitchReason.h"
12#include "mc/external/webrtc/IceTransportInternal.h"
13#include "mc/external/webrtc/IceTransportState.h"
14#include "mc/external/webrtc/IceTransportStateInternal.h"
15#include "mc/external/webrtc/LocalNetworkAccessPermissionStatus.h"
16#include "mc/external/webrtc/ProtocolType.h"
17#include "mc/external/webrtc/Socket.h"
18
19// auto generated forward declare list
20// clang-format off
21namespace webrtc { class ActiveIceControllerFactoryInterface; }
22namespace webrtc { class AsyncDnsResolverFactoryInterface; }
23namespace webrtc { class AsyncDnsResolverInterface; }
24namespace webrtc { class AsyncDnsResolverResult; }
25namespace webrtc { class Candidate; }
26namespace webrtc { class Connection; }
27namespace webrtc { class DtlsStunPiggybackCallbacks; }
28namespace webrtc { class Environment; }
29namespace webrtc { class FieldTrialsView; }
30namespace webrtc { class IceControllerFactoryInterface; }
31namespace webrtc { class IceMessage; }
32namespace webrtc { class IceTransportInit; }
33namespace webrtc { class LocalNetworkAccessPermissionFactoryInterface; }
34namespace webrtc { class LocalNetworkAccessPermissionInterface; }
35namespace webrtc { class PortAllocator; }
36namespace webrtc { class PortAllocatorSession; }
37namespace webrtc { class PortInterface; }
38namespace webrtc { class SocketAddress; }
39namespace webrtc { class StunDictionaryWriter; }
40namespace webrtc { struct AsyncSocketPacketOptions; }
41namespace webrtc { struct CandidatePair; }
42namespace webrtc { struct IceCandidateErrorEvent; }
43namespace webrtc { struct IceConfig; }
44namespace webrtc { struct IceParameters; }
45namespace webrtc { struct IceTransportStats; }
46namespace webrtc { struct NetworkRoute; }
47namespace webrtc { struct SentPacketInfo; }
48// clang-format on
49
50namespace webrtc {
51
52class P2PTransportChannel : public ::webrtc::IceTransportInternal, public ::webrtc::IceAgentInterface {
53public:
54 // P2PTransportChannel inner types declare
55 // clang-format off
58 // clang-format on
59
60 // P2PTransportChannel inner types define
61 struct CandidateAndPermission {
62 public:
63 // member variables
64 // NOLINTBEGIN
67 // NOLINTEND
68
69 public:
70 // prevent constructor by default
71 CandidateAndPermission& operator=(CandidateAndPermission const&);
72 CandidateAndPermission(CandidateAndPermission const&);
73 CandidateAndPermission();
74 };
75
76 struct CandidateAndResolver {
77 public:
78 // member variables
79 // NOLINTBEGIN
82 // NOLINTEND
83
84 public:
85 // prevent constructor by default
86 CandidateAndResolver& operator=(CandidateAndResolver const&);
87 CandidateAndResolver(CandidateAndResolver const&);
88 CandidateAndResolver();
89 };
90
91public:
92 // member variables
93 // NOLINTBEGIN
143 // NOLINTEND
144
145public:
146 // prevent constructor by default
147 P2PTransportChannel& operator=(P2PTransportChannel const&);
148 P2PTransportChannel(P2PTransportChannel const&);
149 P2PTransportChannel();
150
151public:
152 // virtual functions
153 // NOLINTBEGIN
154 virtual ~P2PTransportChannel() /*override*/;
155
156 virtual ::webrtc::IceTransportStateInternal GetState() const /*override*/;
157
158 virtual ::webrtc::IceTransportState GetIceTransportState() const /*override*/;
159
160 virtual ::std::string const& transport_name() const /*override*/;
161
162 virtual int component() const /*override*/;
163
164 virtual bool writable() const /*override*/;
165
166 virtual bool receiving() const /*override*/;
167
168 virtual void SetIceRole(::webrtc::IceRole ice_role) /*override*/;
169
170 virtual ::webrtc::IceRole GetIceRole() const /*override*/;
171
172 virtual void SetIceParameters(::webrtc::IceParameters const& ice_params) /*override*/;
173
174 virtual void SetRemoteIceParameters(::webrtc::IceParameters const& ice_params) /*override*/;
175
176 virtual void SetRemoteIceMode(::webrtc::IceMode mode) /*override*/;
177
178 virtual void MaybeStartGathering() /*override*/;
179
180 virtual ::webrtc::IceGatheringState gathering_state() const /*override*/;
181
182 virtual void AddRemoteCandidate(::webrtc::Candidate const& candidate) /*override*/;
183
184 virtual void RemoveRemoteCandidate(::webrtc::Candidate const& cand_to_remove) /*override*/;
185
186 virtual void RemoveAllRemoteCandidates() /*override*/;
187
188 virtual void SetIceConfig(::webrtc::IceConfig const& config) /*override*/;
189
190 virtual ::webrtc::IceConfig const& config() const /*override*/;
191
192 virtual int
193 SendPacket(char const* data, uint64 len, ::webrtc::AsyncSocketPacketOptions const& options, int flags) /*override*/;
194
195 virtual int SetOption(::webrtc::Socket::Option opt, int value) /*override*/;
196
197 virtual bool GetOption(::webrtc::Socket::Option opt, int* value) /*override*/;
198
199 virtual int GetError() /*override*/;
200
201 virtual bool GetStats(::webrtc::IceTransportStats* ice_transport_stats) /*override*/;
202
203 virtual ::std::optional<int> GetRttEstimate() /*override*/;
204
205 virtual ::webrtc::Connection const* selected_connection() const /*override*/;
206
207 virtual ::std::optional<::webrtc::CandidatePair const> GetSelectedCandidatePair() const /*override*/;
208
209 virtual void OnStartedPinging() /*override*/;
210
211 virtual int64 GetLastPingSentMs() const /*override*/;
212
213 virtual void UpdateConnectionStates() /*override*/;
214
215 virtual void UpdateState() /*override*/;
216
217 virtual void SendPingRequest(::webrtc::Connection const* connection) /*override*/;
218
219 virtual void
220 SwitchSelectedConnection(::webrtc::Connection const* new_connection, ::webrtc::IceSwitchReason reason) /*override*/;
221
222 virtual void
223 ForgetLearnedStateForConnections(::webrtc::ArrayView<::webrtc::Connection const* const> connections) /*override*/;
224
225 virtual bool PruneConnections(::webrtc::ArrayView<::webrtc::Connection const* const> connections) /*override*/;
226
227 virtual ::std::optional<::webrtc::NetworkRoute> network_route() const /*override*/;
228
229 virtual ::std::optional<::std::reference_wrapper<::webrtc::StunDictionaryWriter>>
230 GetDictionaryWriter() /*override*/;
231
232 virtual ::webrtc::FieldTrialsView const* field_trials() const /*override*/;
233
234 virtual void ResetDtlsStunPiggybackCallbacks() /*override*/;
235
236 virtual void SetDtlsStunPiggybackCallbacks(::webrtc::DtlsStunPiggybackCallbacks&& callbacks) /*override*/;
237
238 virtual ::webrtc::IceParameters const* local_ice_parameters() const /*override*/;
239
240 virtual ::webrtc::IceParameters const* remote_ice_parameters() const /*override*/;
241 // NOLINTEND
242
243public:
244 // member functions
245 // NOLINTBEGIN
246 MCAPI void AddAllocatorSession(::std::unique_ptr<::webrtc::PortAllocatorSession> session);
247
248 MCAPI void AddConnection(::webrtc::Connection* connection);
249
250 MCAPI void
251 AddRemoteCandidateWithResult(::webrtc::Candidate candidate, ::webrtc::AsyncDnsResolverResult const& result);
252
253 MCAPI void CheckLocalNetworkAccessPermission(::webrtc::Candidate const& candidate);
254
255 MCAPI ::webrtc::IceTransportState ComputeIceTransportState() const;
256
257 MCAPI ::webrtc::IceTransportStateInternal ComputeState() const;
258
259 MCAPI ::webrtc::NetworkRoute ConfigureNetworkRoute(::webrtc::Connection const* conn);
260
261 MCAPI bool CreateConnection(
262 ::webrtc::PortInterface* port,
263 ::webrtc::Candidate const& remote_candidate,
264 ::webrtc::PortInterface* origin_port
265 );
266
267 MCAPI void FinishAddingRemoteCandidate(::webrtc::Candidate const& new_remote_candidate);
268
269 MCAPI void HandleAllTimedOut();
270
271 MCAPI bool IsDuplicateRemoteCandidate(::webrtc::Candidate const& candidate);
272
273 MCAPI void OnCandidateError(::webrtc::PortAllocatorSession*, ::webrtc::IceCandidateErrorEvent const& event);
274
275 MCAPI void OnCandidateFilterChanged(uint prev_filter, uint cur_filter);
276
277 MCAPI void OnCandidateResolved(::webrtc::AsyncDnsResolverInterface* resolver);
278
279 MCAPI void OnCandidatesAllocationDone(::webrtc::PortAllocatorSession*);
280
281 MCAPI void OnCandidatesReady(::webrtc::PortAllocatorSession*, ::std::vector<::webrtc::Candidate> const& candidates);
282
283 MCAPI void
284 OnCandidatesRemoved(::webrtc::PortAllocatorSession* session, ::std::vector<::webrtc::Candidate> const& candidates);
285
286 MCAPI void OnConnectionDestroyed(::webrtc::Connection* connection);
287
288 MCAPI void OnConnectionStateChange(::webrtc::Connection* connection);
289
290 MCAPI void OnLocalNetworkAccessResult(
291 ::webrtc::LocalNetworkAccessPermissionInterface* permission_query,
292 ::webrtc::LocalNetworkAccessPermissionStatus status
293 );
294
295 MCAPI void OnNominated(::webrtc::Connection* conn);
296
297 MCAPI void OnPortReady(::webrtc::PortAllocatorSession*, ::webrtc::PortInterface* port);
298
299 MCAPI void OnPortsPruned(::webrtc::PortAllocatorSession*, ::std::vector<::webrtc::PortInterface*> const& ports);
300
301 MCAPI void OnReadyToSend(::webrtc::Connection* connection);
302
303 MCAPI void OnSelectedConnectionDestroyed();
304
305 MCAPI void OnSentPacket(::webrtc::SentPacketInfo const& sent_packet);
306
307 MCAPI void OnUnknownAddress(
308 ::webrtc::PortInterface* port,
309 ::webrtc::SocketAddress const& address,
310 ::webrtc::ProtocolType proto,
311 ::webrtc::IceMessage* stun_msg,
312 ::std::string const& remote_username,
313 bool port_muxed
314 );
315
316 MCAPI P2PTransportChannel(
317 ::webrtc::Environment const& env,
318 ::std::string_view transport_name,
319 int component,
320 ::webrtc::PortAllocator* allocator,
321 ::webrtc::AsyncDnsResolverFactoryInterface* async_dns_resolver_factory,
322 ::std::unique_ptr<::webrtc::AsyncDnsResolverFactoryInterface> owned_dns_resolver_factory,
323 ::webrtc::LocalNetworkAccessPermissionFactoryInterface* lna_permission_factory,
324 ::webrtc::IceControllerFactoryInterface* ice_controller_factory,
325 ::webrtc::ActiveIceControllerFactoryInterface* active_ice_controller_factory
326 );
327
328 MCAPI void ParseFieldTrials(::webrtc::FieldTrialsView const& field_trials);
329
330 MCAPI bool PresumedWritable(::webrtc::Connection const* conn) const;
331
332 MCAPI void
333 RememberRemoteCandidate(::webrtc::Candidate const& remote_candidate, ::webrtc::PortInterface* origin_port);
334
335 MCAPI void RemoveConnection(::webrtc::Connection* connection);
336
337 MCAPI void ResolveHostnameCandidate(::webrtc::Candidate const& candidate);
338
339 MCAPI ::webrtc::Candidate SanitizeRemoteCandidate(::webrtc::Candidate const& c) const;
340
341 MCAPI void SendPingRequestInternal(::webrtc::Connection* connection);
342
343 MCAPI void SwitchSelectedConnectionInternal(::webrtc::Connection* conn, ::webrtc::IceSwitchReason reason);
344
345 MCAPI ::std::string ToString() const;
346
347 MCAPI void UpdateTransportState();
348 // NOLINTEND
349
350public:
351 // static functions
352 // NOLINTBEGIN
353 MCAPI static ::std::unique_ptr<::webrtc::P2PTransportChannel>
354 Create(::std::string_view transport_name, int component, ::webrtc::IceTransportInit init);
355 // NOLINTEND
356
357public:
358 // constructor thunks
359 // NOLINTBEGIN
360 MCAPI void* $ctor(
361 ::webrtc::Environment const& env,
362 ::std::string_view transport_name,
363 int component,
364 ::webrtc::PortAllocator* allocator,
365 ::webrtc::AsyncDnsResolverFactoryInterface* async_dns_resolver_factory,
366 ::std::unique_ptr<::webrtc::AsyncDnsResolverFactoryInterface> owned_dns_resolver_factory,
367 ::webrtc::LocalNetworkAccessPermissionFactoryInterface* lna_permission_factory,
368 ::webrtc::IceControllerFactoryInterface* ice_controller_factory,
369 ::webrtc::ActiveIceControllerFactoryInterface* active_ice_controller_factory
370 );
371 // NOLINTEND
372
373public:
374 // destructor thunk
375 // NOLINTBEGIN
376 MCAPI void $dtor();
377 // NOLINTEND
378
379public:
380 // virtual function thunks
381 // NOLINTBEGIN
382 MCAPI ::webrtc::IceTransportStateInternal $GetState() const;
383
384 MCAPI ::webrtc::IceTransportState $GetIceTransportState() const;
385
386 MCAPI ::std::string const& $transport_name() const;
387
388 MCAPI int $component() const;
389
390 MCAPI bool $writable() const;
391
392 MCAPI bool $receiving() const;
393
394 MCAPI void $SetIceRole(::webrtc::IceRole ice_role);
395
396 MCAPI ::webrtc::IceRole $GetIceRole() const;
397
398 MCAPI void $SetIceParameters(::webrtc::IceParameters const& ice_params);
399
400 MCAPI void $SetRemoteIceParameters(::webrtc::IceParameters const& ice_params);
401
402 MCAPI void $SetRemoteIceMode(::webrtc::IceMode mode);
403
404 MCAPI void $MaybeStartGathering();
405
406 MCAPI ::webrtc::IceGatheringState $gathering_state() const;
407
408 MCAPI void $AddRemoteCandidate(::webrtc::Candidate const& candidate);
409
410 MCAPI void $RemoveRemoteCandidate(::webrtc::Candidate const& cand_to_remove);
411
412 MCAPI void $RemoveAllRemoteCandidates();
413
414 MCAPI void $SetIceConfig(::webrtc::IceConfig const& config);
415
416 MCAPI ::webrtc::IceConfig const& $config() const;
417
418 MCAPI int $SendPacket(char const* data, uint64 len, ::webrtc::AsyncSocketPacketOptions const& options, int flags);
419
420 MCAPI int $SetOption(::webrtc::Socket::Option opt, int value);
421
422 MCAPI bool $GetOption(::webrtc::Socket::Option opt, int* value);
423
424 MCAPI int $GetError();
425
426 MCAPI bool $GetStats(::webrtc::IceTransportStats* ice_transport_stats);
427
428 MCAPI ::std::optional<int> $GetRttEstimate();
429
430 MCAPI ::webrtc::Connection const* $selected_connection() const;
431
432 MCAPI ::std::optional<::webrtc::CandidatePair const> $GetSelectedCandidatePair() const;
433
434 MCAPI void $OnStartedPinging();
435
436 MCAPI int64 $GetLastPingSentMs() const;
437
438 MCAPI void $UpdateConnectionStates();
439
440 MCAPI void $UpdateState();
441
442 MCAPI void $SendPingRequest(::webrtc::Connection const* connection);
443
444 MCAPI void $SwitchSelectedConnection(::webrtc::Connection const* new_connection, ::webrtc::IceSwitchReason reason);
445
446 MCAPI void $ForgetLearnedStateForConnections(::webrtc::ArrayView<::webrtc::Connection const* const> connections);
447
448 MCAPI bool $PruneConnections(::webrtc::ArrayView<::webrtc::Connection const* const> connections);
449
450 MCAPI ::std::optional<::webrtc::NetworkRoute> $network_route() const;
451
452 MCAPI ::std::optional<::std::reference_wrapper<::webrtc::StunDictionaryWriter>> $GetDictionaryWriter();
453
454 MCAPI ::webrtc::FieldTrialsView const* $field_trials() const;
455
456 MCAPI void $ResetDtlsStunPiggybackCallbacks();
457
458 MCAPI void $SetDtlsStunPiggybackCallbacks(::webrtc::DtlsStunPiggybackCallbacks&& callbacks);
459
460 MCAPI ::webrtc::IceParameters const* $local_ice_parameters() const;
461
462 MCAPI ::webrtc::IceParameters const* $remote_ice_parameters() const;
463
464
465 // NOLINTEND
466
467public:
468 // vftables
469 // NOLINTBEGIN
470 MCNAPI static void** $vftableForIceTransportInternal();
471
472 MCNAPI static void** $vftableForIceAgentInterface();
473 // NOLINTEND
474};
475
476} // namespace webrtc
Definition Option.h:22
Definition ActiveIceControllerFactoryInterface.h:13
Definition ArrayView.h:8
Definition AsyncDnsResolverFactoryInterface.h:16
Definition AsyncDnsResolverInterface.h:16
Definition AsyncDnsResolverResult.h:12
Definition Candidate.h:12
Definition Connection.h:35
Definition DtlsStunPiggybackCallbacks.h:7
Definition Environment.h:7
Definition FieldTrialsView.h:7
Definition IceAgentInterface.h:17
Definition IceControllerFactoryInterface.h:13
Definition IceMessage.h:11
Definition IceTransportInit.h:7
Definition IceTransportInternal.h:29
Definition LocalNetworkAccessPermissionFactoryInterface.h:12
Definition LocalNetworkAccessPermissionInterface.h:16
static MCAPI void ** $vftableForIceTransportInternal()
static MCAPI void ** $vftableForIceAgentInterface()
Definition PortAllocatorSession.h:18
Definition PortAllocator.h:26
Definition PortInterface.h:29
Definition SocketAddress.h:11
Definition Socket.h:12
Definition StunDictionaryWriter.h:13
STL namespace.
Definition Alias.h:14
Definition AsyncSocketPacketOptions.h:10
Definition CandidatePair.h:15
Definition IceCandidateErrorEvent.h:7
Definition IceConfig.h:16
Definition IceParameters.h:12
Definition IceTransportStats.h:7
Definition NetworkRoute.h:7
Definition P2PTransportChannel.h:61
Definition P2PTransportChannel.h:76
Definition SentPacketInfo.h:12