LeviLamina
Loading...
Searching...
No Matches
NetherNet.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/nether_net/LogSeverity.h"
7#include "mc/deps/nether_net/utils/ErrorOr.h"
8
9// auto generated forward declare list
10// clang-format off
11namespace NetherNet { class AesContext; }
12namespace NetherNet { class CandidateAdd; }
13namespace NetherNet { class ConnectError; }
14namespace NetherNet { class ConnectRequest; }
15namespace NetherNet { class ConnectResponse; }
16namespace NetherNet { class INetherNetTransportInterface; }
17namespace NetherNet { class INetherNetTransportInterfaceCallbacks; }
18namespace NetherNet { struct GlobalConfiguration; }
19namespace NetherNet { struct NetworkID; }
20namespace NetherNet { struct TransportConfiguration; }
21namespace rtc { class IPAddress; }
22// clang-format on
23
24namespace NetherNet {
25// functions
26// NOLINTBEGIN
27MCNAPI ::NetherNet::ErrorOr<::std::unique_ptr<::NetherNet::AesContext>, ::std::error_code> CreateEnvelope(uint64 id);
28
29MCNAPI uint64 CreateID();
30
31MCNAPI ::NetherNet::ErrorOr<::std::vector<uchar>, ::std::error_code> CreateKey(uint64 id);
32
33MCNAPI ::NetherNet::INetherNetTransportInterface* CreateNetherNetTransportInterface(
34 ::NetherNet::NetworkID localID,
35 ::NetherNet::TransportConfiguration* pConfiguration,
36 ::NetherNet::INetherNetTransportInterfaceCallbacks* pCallbacks
37);
38
39MCNAPI void DestroyNetherNetTransportInterface(::NetherNet::INetherNetTransportInterface* transportInterface);
40
41MCNAPI ::std::error_code GetLastSystemError();
42
43MCNAPI ::std::error_code GetSystemError(int error);
44
45MCNAPI void InitializeNetherNetTransport(::NetherNet::GlobalConfiguration const& config);
46
47#ifdef LL_PLAT_C
48MCNAPI void SetNetherNetTransportLogging(::NetherNet::LogSeverity level);
49#endif
50
51MCNAPI void ShutdownNetherNetTransport();
52
53MCNAPI ::std::optional<::std::variant<
54 ::NetherNet::ConnectRequest,
55 ::NetherNet::ConnectResponse,
56 ::NetherNet::ConnectError,
57 ::NetherNet::CandidateAdd>>
58TryParseSignalingMessage(::std::string_view message);
59
60MCNAPI ::std::vector<::std::byte> makeDiscoveryMessagePacket(
61 ::NetherNet::NetworkID senderId,
62 ::NetherNet::NetworkID recipientId,
63 ::std::vector<::std::byte> data
64);
65
66MCNAPI ::std::vector<::std::byte>
67makeDiscoveryResponsePacket(::NetherNet::NetworkID senderId, ::std::vector<::std::byte> data);
68// NOLINTEND
69
70// static variables
71// NOLINTBEGIN
72MCNAPI ::rtc::IPAddress const& IPv4Any();
73
74MCNAPI ::rtc::IPAddress const& IPv4Broadcast();
75
76MCNAPI ::rtc::IPAddress const& IPv6AllHostsLinkLocal();
77
78MCNAPI ::rtc::IPAddress const& IPv6Any();
79// NOLINTEND
80
81} // namespace NetherNet
Definition AesContext.h:15
Definition CandidateAdd.h:7
Definition ConnectError.h:7
Definition ConnectRequest.h:7
Definition ConnectResponse.h:7
Definition INetherNetTransportInterfaceCallbacks.h:16
Definition INetherNetTransportInterface.h:21
Definition IPAddress.h:7
Definition GlobalConfiguration.h:7
Definition NetworkID.h:17
Definition TransportConfiguration.h:7