LeviLamina
Loading...
Searching...
No Matches
UDPPort.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/external/cricket/Port.h"
7#include "mc/external/cricket/PortInterface.h"
8#include "mc/external/cricket/ProtocolType.h"
9#include "mc/external/rtc/DiffServCodePoint.h"
10#include "mc/external/rtc/Socket.h"
11#include "mc/external/rtc/SocketAddress.h"
12#include "mc/external/webrtc/IceCandidateType.h"
13
14// auto generated forward declare list
15// clang-format off
16namespace cricket { class Candidate; }
17namespace cricket { class Connection; }
18namespace cricket { class StunRequest; }
19namespace cricket { class StunStats; }
20namespace rtc { class AsyncPacketSocket; }
21namespace rtc { class Network; }
22namespace rtc { class PacketSocketFactory; }
23namespace rtc { class ReceivedPacket; }
24namespace rtc { class Thread; }
25namespace rtc { struct PacketOptions; }
26namespace rtc { struct SentPacket; }
27namespace webrtc { class AsyncDnsResolverInterface; }
28namespace webrtc { class FieldTrialsView; }
29// clang-format on
30
31namespace cricket {
32
33class UDPPort : public ::cricket::Port {
34public:
35 // UDPPort inner types declare
36 // clang-format off
37 class AddressResolver;
38 // clang-format on
39
40 // UDPPort inner types define
41 class AddressResolver {
42 public:
43 // member variables
44 // NOLINTBEGIN
48 // NOLINTEND
49
50 public:
51 // prevent constructor by default
52 AddressResolver& operator=(AddressResolver const&);
53 AddressResolver(AddressResolver const&);
54 AddressResolver();
55
56 public:
57 // member functions
58 // NOLINTBEGIN
59 MCNAPI void
60 Resolve(::rtc::SocketAddress const& address, int family, ::webrtc::FieldTrialsView const& field_trials);
61 // NOLINTEND
62 };
63
64public:
65 // member variables
66 // NOLINTBEGIN
83 // NOLINTEND
84
85public:
86 // prevent constructor by default
87 UDPPort& operator=(UDPPort const&);
88 UDPPort(UDPPort const&);
89 UDPPort();
90
91public:
92 // virtual functions
93 // NOLINTBEGIN
94 virtual ~UDPPort() /*override*/;
95
96 virtual void PrepareAddress() /*override*/;
97
98 virtual ::cricket::Connection* CreateConnection(
99 ::cricket::Candidate const& address,
100 ::cricket::PortInterface::CandidateOrigin origin
101 ) /*override*/;
102
103 virtual int SetOption(::rtc::Socket::Option opt, int value) /*override*/;
104
105 virtual int GetOption(::rtc::Socket::Option opt, int* value) /*override*/;
106
107 virtual int GetError() /*override*/;
108
109 virtual bool
110 HandleIncomingPacket(::rtc::AsyncPacketSocket* socket, ::rtc::ReceivedPacket const& packet) /*override*/;
111
112 virtual bool SupportsProtocol(::std::string_view protocol) const /*override*/;
113
114 virtual ::cricket::ProtocolType GetProtocol() const /*override*/;
115
116 virtual void GetStunStats(::std::optional<::cricket::StunStats>* stats) /*override*/;
117
118 virtual int SendTo(
119 void const* data,
120 uint64 size,
121 ::rtc::SocketAddress const& addr,
122 ::rtc::PacketOptions const& options,
123 bool payload
124 ) /*override*/;
125
126 virtual void UpdateNetworkCost() /*override*/;
127
128 virtual ::rtc::DiffServCodePoint StunDscpValue() const /*override*/;
129
130 virtual void PostAddAddress(bool is_final) /*override*/;
131
132 virtual void OnSentPacket(::rtc::AsyncPacketSocket* socket, ::rtc::SentPacket const& sent_packet) /*override*/;
133 // NOLINTEND
134
135public:
136 // member functions
137 // NOLINTBEGIN
138 MCNAPI bool Init();
139
140 MCNAPI bool MaybeSetDefaultLocalAddress(::rtc::SocketAddress* addr) const;
141
143
144 MCNAPI void OnLocalAddressReady(::rtc::AsyncPacketSocket* socket, ::rtc::SocketAddress const& address);
145
146 MCNAPI void OnReadPacket(::rtc::AsyncPacketSocket* socket, ::rtc::ReceivedPacket const& packet);
147
148 MCNAPI void OnReadyToSend(::rtc::AsyncPacketSocket* socket);
149
150 MCNAPI void OnResolveResult(::rtc::SocketAddress const& input, int error);
151
152 MCNAPI void OnSendPacket(void const* data, uint64 size, ::cricket::StunRequest* req);
153
155 ::rtc::SocketAddress const& stun_server_addr,
156 int error_code,
157 ::std::string_view reason
158 );
159
161 int rtt_ms,
162 ::rtc::SocketAddress const& stun_server_addr,
163 ::rtc::SocketAddress const& stun_reflected_addr
164 );
165
166 MCNAPI void ResolveStunAddress(::rtc::SocketAddress const& stun_addr);
167
168 MCNAPI void SendStunBindingRequest(::rtc::SocketAddress const& stun_addr);
169
171
172 MCNAPI UDPPort(
173 ::rtc::Thread* thread,
174 ::webrtc::IceCandidateType type,
175 ::rtc::PacketSocketFactory* factory,
176 ::rtc::Network const* network,
177 ::std::shared_ptr<::rtc::AsyncPacketSocket> socket,
178 ::std::string_view username,
179 ::std::string_view password,
180 bool emit_local_for_anyaddress,
181 ::webrtc::FieldTrialsView const* field_trials
182 );
183
184 MCNAPI UDPPort(
185 ::rtc::Thread* thread,
186 ::webrtc::IceCandidateType type,
187 ::rtc::PacketSocketFactory* factory,
188 ::rtc::Network const* network,
189 ushort min_port,
190 ushort max_port,
191 ::std::string_view username,
192 ::std::string_view password,
193 bool emit_local_for_anyaddress,
194 ::webrtc::FieldTrialsView const* field_trials
195 );
196
197 MCNAPI void set_stun_keepalive_delay(::std::optional<int> const& delay);
198 // NOLINTEND
199
200public:
201 // static functions
202 // NOLINTBEGIN
203 MCNAPI static ::std::unique_ptr<::cricket::UDPPort> Create(
204 ::rtc::Thread* thread,
205 ::rtc::PacketSocketFactory* factory,
206 ::rtc::Network const* network,
207 ::std::shared_ptr<::rtc::AsyncPacketSocket> socket,
208 ::std::string_view username,
209 ::std::string_view password,
210 bool emit_local_for_anyaddress,
211 ::std::optional<int> stun_keepalive_interval,
212 ::webrtc::FieldTrialsView const* field_trials
213 );
214 // NOLINTEND
215
216public:
217 // constructor thunks
218 // NOLINTBEGIN
219 MCNAPI void* $ctor(
220 ::rtc::Thread* thread,
221 ::webrtc::IceCandidateType type,
222 ::rtc::PacketSocketFactory* factory,
223 ::rtc::Network const* network,
224 ::std::shared_ptr<::rtc::AsyncPacketSocket> socket,
225 ::std::string_view username,
226 ::std::string_view password,
227 bool emit_local_for_anyaddress,
228 ::webrtc::FieldTrialsView const* field_trials
229 );
230
231 MCNAPI void* $ctor(
232 ::rtc::Thread* thread,
233 ::webrtc::IceCandidateType type,
234 ::rtc::PacketSocketFactory* factory,
235 ::rtc::Network const* network,
236 ushort min_port,
237 ushort max_port,
238 ::std::string_view username,
239 ::std::string_view password,
240 bool emit_local_for_anyaddress,
241 ::webrtc::FieldTrialsView const* field_trials
242 );
243 // NOLINTEND
244
245public:
246 // destructor thunk
247 // NOLINTBEGIN
248 MCNAPI void $dtor();
249 // NOLINTEND
250
251public:
252 // virtual function thunks
253 // NOLINTBEGIN
254 MCNAPI void $PrepareAddress();
255
256 MCNAPI ::cricket::Connection*
257 $CreateConnection(::cricket::Candidate const& address, ::cricket::PortInterface::CandidateOrigin origin);
258
259 MCNAPI int $SetOption(::rtc::Socket::Option opt, int value);
260
261 MCNAPI int $GetOption(::rtc::Socket::Option opt, int* value);
262
263 MCNAPI int $GetError();
264
265 MCNAPI bool $HandleIncomingPacket(::rtc::AsyncPacketSocket* socket, ::rtc::ReceivedPacket const& packet);
266
267 MCNAPI bool $SupportsProtocol(::std::string_view protocol) const;
268
269 MCNAPI ::cricket::ProtocolType $GetProtocol() const;
270
271 MCNAPI void $GetStunStats(::std::optional<::cricket::StunStats>* stats);
272
273 MCNAPI int $SendTo(
274 void const* data,
275 uint64 size,
276 ::rtc::SocketAddress const& addr,
277 ::rtc::PacketOptions const& options,
278 bool payload
279 );
280
281 MCNAPI void $UpdateNetworkCost();
282
283 MCNAPI ::rtc::DiffServCodePoint $StunDscpValue() const;
284
285 MCNAPI void $PostAddAddress(bool is_final);
286
287 MCNAPI void $OnSentPacket(::rtc::AsyncPacketSocket* socket, ::rtc::SentPacket const& sent_packet);
288
289
290 // NOLINTEND
291
292public:
293 // vftables
294 // NOLINTBEGIN
295 MCNAPI static void** $vftableForPortInterface();
296
297 MCNAPI static void** $vftableForHasSlots();
298 // NOLINTEND
299};
300
301} // namespace cricket
Definition Option.h:22
Definition Candidate.h:15
Definition Connection.h:33
Definition PortInterface.h:29
Definition Port.h:36
Definition StunRequest.h:14
Definition StunStats.h:7
Definition UDPPort.h:41
MCAPI void Resolve(::rtc::SocketAddress const &address, int family, ::webrtc::FieldTrialsView const &field_trials)
MCAPI void $PrepareAddress()
MCAPI void OnStunBindingRequestSucceeded(int rtt_ms, ::rtc::SocketAddress const &stun_server_addr, ::rtc::SocketAddress const &stun_reflected_addr)
MCAPI void $GetStunStats(::std::optional<::cricket::StunStats > *stats)
MCAPI void * $ctor(::rtc::Thread *thread, ::webrtc::IceCandidateType type, ::rtc::PacketSocketFactory *factory, ::rtc::Network const *network, ::std::shared_ptr<::rtc::AsyncPacketSocket > socket, ::std::string_view username, ::std::string_view password, bool emit_local_for_anyaddress, ::webrtc::FieldTrialsView const *field_trials)
static MCAPI ::std::unique_ptr<::cricket::UDPPort > Create(::rtc::Thread *thread, ::rtc::PacketSocketFactory *factory, ::rtc::Network const *network, ::std::shared_ptr<::rtc::AsyncPacketSocket > socket, ::std::string_view username, ::std::string_view password, bool emit_local_for_anyaddress, ::std::optional< int > stun_keepalive_interval, ::webrtc::FieldTrialsView const *field_trials)
static MCAPI void ** $vftableForPortInterface()
MCAPI void OnLocalAddressReady(::rtc::AsyncPacketSocket *socket, ::rtc::SocketAddress const &address)
MCAPI bool $HandleIncomingPacket(::rtc::AsyncPacketSocket *socket, ::rtc::ReceivedPacket const &packet)
MCAPI void $OnSentPacket(::rtc::AsyncPacketSocket *socket, ::rtc::SentPacket const &sent_packet)
MCAPI::cricket::Connection * $CreateConnection(::cricket::Candidate const &address, ::cricket::PortInterface::CandidateOrigin origin)
MCAPI void $UpdateNetworkCost()
static MCAPI void ** $vftableForHasSlots()
MCAPI bool MaybeSetDefaultLocalAddress(::rtc::SocketAddress *addr) const
MCAPI void $PostAddAddress(bool is_final)
MCAPI void SendStunBindingRequests()
MCAPI void MaybeSetPortCompleteOrError()
MCAPI void OnSendPacket(void const *data, uint64 size, ::cricket::StunRequest *req)
MCAPI::rtc::DiffServCodePoint $StunDscpValue() const
MCAPI int $SetOption(::rtc::Socket::Option opt, int value)
MCAPI void OnReadPacket(::rtc::AsyncPacketSocket *socket, ::rtc::ReceivedPacket const &packet)
MCAPI bool Init()
MCAPI bool $SupportsProtocol(::std::string_view protocol) const
MCAPI void $dtor()
MCAPI void OnResolveResult(::rtc::SocketAddress const &input, int error)
MCAPI void SendStunBindingRequest(::rtc::SocketAddress const &stun_addr)
MCAPI void set_stun_keepalive_delay(::std::optional< int > const &delay)
MCAPI::cricket::ProtocolType $GetProtocol() const
MCAPI int $GetError()
MCAPI int $SendTo(void const *data, uint64 size, ::rtc::SocketAddress const &addr, ::rtc::PacketOptions const &options, bool payload)
MCAPI int $GetOption(::rtc::Socket::Option opt, int *value)
MCAPI void OnReadyToSend(::rtc::AsyncPacketSocket *socket)
MCAPI void OnStunBindingOrResolveRequestFailed(::rtc::SocketAddress const &stun_server_addr, int error_code, ::std::string_view reason)
MCAPI void ResolveStunAddress(::rtc::SocketAddress const &stun_addr)
Definition AsyncPacketSocket.h:20
Definition Network.h:18
Definition PacketSocketFactory.h:17
Definition ReceivedPacket.h:16
Definition SocketAddress.h:12
Definition Thread.h:20
Definition AsyncDnsResolverInterface.h:16
Definition FieldTrialsView.h:7
STL namespace.
Definition Alias.h:14
Definition PacketOptions.h:10
Definition SentPacket.h:12