LeviLamina
Loading...
Searching...
No Matches
PortInterface.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/external/absl/AnyInvocable.h"
7#include "mc/external/webrtc/DiffServCodePoint.h"
8#include "mc/external/webrtc/IceCandidateType.h"
9#include "mc/external/webrtc/IceRole.h"
10#include "mc/external/webrtc/ProtocolType.h"
11#include "mc/external/webrtc/Socket.h"
12
13// auto generated forward declare list
14// clang-format off
15namespace webrtc { class Candidate; }
16namespace webrtc { class Connection; }
17namespace webrtc { class IceMessage; }
18namespace webrtc { class Network; }
19namespace webrtc { class PacketSocketFactory; }
20namespace webrtc { class SocketAddress; }
21namespace webrtc { class StunMessage; }
22namespace webrtc { class StunStats; }
23namespace webrtc { class TaskQueueBase; }
24namespace webrtc { struct AsyncSocketPacketOptions; }
25// clang-format on
26
27namespace webrtc {
28
29class PortInterface {
30public:
31 // PortInterface inner types define
32 enum class CandidateOrigin : int {
33 ThisPort = 0,
34 OtherPort = 1,
35 Message = 2,
36 };
37
38public:
39 // member variables
40 // NOLINTBEGIN
45 // NOLINTEND
46
47public:
48 // prevent constructor by default
49 PortInterface& operator=(PortInterface const&);
50 PortInterface(PortInterface const&);
51
52public:
53 // virtual functions
54 // NOLINTBEGIN
55 virtual ~PortInterface();
56
57 virtual ::webrtc::IceCandidateType Type() const = 0;
58
59 virtual ::webrtc::Network const* Network() const = 0;
60
61 virtual void SetIceRole(::webrtc::IceRole role) = 0;
62
63 virtual ::webrtc::IceRole GetIceRole() const = 0;
64
65 virtual void SetIceTiebreaker(uint64 tiebreaker) = 0;
66
67 virtual uint64 IceTiebreaker() const = 0;
68
69 virtual bool SharedSocket() const = 0;
70
71 virtual bool SupportsProtocol(::std::string_view protocol) const = 0;
72
73 virtual void PrepareAddress() = 0;
74
75 virtual ::webrtc::Connection* GetConnection(::webrtc::SocketAddress const& remote_addr) = 0;
76
77 virtual ::webrtc::Connection*
78 CreateConnection(::webrtc::Candidate const& address, ::webrtc::PortInterface::CandidateOrigin origin) = 0;
79
80 virtual int SetOption(::webrtc::Socket::Option opt, int value) = 0;
81
82 virtual int GetOption(::webrtc::Socket::Option opt, int* value) = 0;
83
84 virtual int GetError() = 0;
85
86 virtual ::webrtc::ProtocolType GetProtocol() const = 0;
87
88 virtual ::std::vector<::webrtc::Candidate> const& Candidates() const = 0;
89
90 virtual int SendTo(
91 void const* data,
92 uint64 size,
93 ::webrtc::SocketAddress const& addr,
95 bool payload
96 ) = 0;
97
98 virtual void SendBindingErrorResponse(
99 ::webrtc::StunMessage* message,
100 ::webrtc::SocketAddress const& addr,
101 int error_code,
102 ::std::string_view reason
103 ) = 0;
104
105 virtual void SubscribePortDestroyed(::std::function<void(::webrtc::PortInterface*)> callback) = 0;
106
107 virtual void SubscribeRoleConflict(::absl::AnyInvocable<void()> callback) = 0;
108
109 virtual void NotifyRoleConflict() = 0;
110
111 virtual void EnablePortPackets() = 0;
112
113 virtual ::std::string ToString() const = 0;
114
115 virtual void GetStunStats(::std::optional<::webrtc::StunStats>* stats) = 0;
116
117 virtual void DestroyConnection(::webrtc::Connection* conn) = 0;
118
119 virtual void DestroyConnectionAsync(::webrtc::Connection* conn) = 0;
120
121 virtual ::webrtc::TaskQueueBase* thread() = 0;
122
123 virtual ::webrtc::PacketSocketFactory* socket_factory() const = 0;
124
125 virtual uint generation() const = 0;
126
127 virtual void set_generation(uint generation) = 0;
128
129 virtual bool send_retransmit_count_attribute() const = 0;
130
131 virtual ::std::string const& content_name() const = 0;
132
133 virtual void AddPrflxCandidate(::webrtc::Candidate const& local) = 0;
134
135 virtual void UpdateNetworkCost() = 0;
136
137 virtual ::webrtc::DiffServCodePoint StunDscpValue() const = 0;
138
139 virtual bool GetStunMessage(
140 char const* data,
141 uint64 size,
142 ::webrtc::SocketAddress const& addr,
143 ::std::unique_ptr<::webrtc::IceMessage>* out_msg,
144 ::std::string* out_username
145 ) = 0;
146
147 virtual bool ParseStunUsername(
148 ::webrtc::StunMessage const* stun_msg,
149 ::std::string* local_ufrag,
150 ::std::string* remote_ufrag
151 ) const = 0;
152
153 virtual ::std::string CreateStunUsername(::std::string_view remote_username) const = 0;
154
155 virtual bool MaybeIceRoleConflict(
156 ::webrtc::SocketAddress const& addr,
157 ::webrtc::IceMessage* stun_msg,
158 ::std::string_view remote_ufrag
159 ) = 0;
160
161 virtual short network_cost() const = 0;
162 // NOLINTEND
163
164public:
165 // member functions
166 // NOLINTBEGIN
168 // NOLINTEND
169
170public:
171 // constructor thunks
172 // NOLINTBEGIN
173 MCNAPI void* $ctor();
174 // NOLINTEND
175
176public:
177 // destructor thunk
178 // NOLINTBEGIN
179 MCNAPI void $dtor();
180 // NOLINTEND
181
182public:
183 // vftables
184 // NOLINTBEGIN
185 MCNAPI static void** $vftable();
186 // NOLINTEND
187};
188
189} // namespace webrtc
Definition AnyInvocable.h:8
Definition Candidate.h:12
Definition Connection.h:35
Definition IceMessage.h:11
Definition Network.h:18
Definition PacketSocketFactory.h:16
Definition PortInterface.h:29
static MCAPI void ** $vftable()
MCAPI void * $ctor()
Definition SocketAddress.h:11
Definition StunMessage.h:24
Definition StunStats.h:7
Definition TaskQueueBase.h:16
Definition Alias.h:14
Definition AsyncSocketPacketOptions.h:10