1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5include protocol PBackground;
6
7#ifdef MOZ_WEBRTC
8include WebrtcProxyConfig;
9
10// ParamTraits stuff for generated code and other classes we don't want to change
11include "mozilla/net/NrIceStunAddrMessageUtils.h";
12include "mozilla/media/webrtc/WebrtcIPCTraits.h";
13using StringVector from "mozilla/media/webrtc/WebrtcIPCTraits.h";
14using CandidateInfo from "mozilla/media/webrtc/WebrtcIPCTraits.h";
15using DtlsDigestList from "mozilla/media/webrtc/WebrtcIPCTraits.h";
16using std::string from "ipc/IPCMessageUtils.h";
17using struct mozilla::dom::NotReallyMovableButLetsPretendItIsRTCStatsCollection from "mozilla/dom/RTCStatsReportBinding.h";
18using WebrtcGlobalLog from "mozilla/media/webrtc/WebrtcGlobal.h";
19using mozilla::dom::RTCIceServer from "mozilla/dom/RTCConfigurationBinding.h";
20using mozilla::dom::RTCIceTransportPolicy from "mozilla/dom/RTCConfigurationBinding.h";
21
22// ParamTraits stuff for our own classes
23using MediaPacket from "mtransport/mediapacket.h";
24include "mozilla/net/NrIceStunAddrMessageUtils.h";
25using net::NrIceStunAddrArray from "mozilla/net/PStunAddrsParams.h";
26#endif // MOZ_WEBRTC
27
28namespace mozilla {
29namespace dom {
30
31async protocol PMediaTransport {
32  manager PBackground;
33
34parent:
35  async __delete__();
36
37#ifdef MOZ_WEBRTC
38  async GetIceLog(nsCString pattern) returns (WebrtcGlobalLog loglines);
39  async ClearIceLog();
40  async EnterPrivateMode();
41  async ExitPrivateMode();
42
43  async CreateIceCtx(string name,
44                     RTCIceServer[] iceServers,
45                     RTCIceTransportPolicy icePolicy);
46
47  async SetProxyConfig(WebrtcProxyConfig proxyConfig);
48
49  async EnsureProvisionalTransport(string transportId,
50                                   string localUfrag,
51                                   string localPwd,
52                                   int componentCount);
53
54  async SetTargetForDefaultLocalAddressLookup(string targetIp,
55                                              uint16_t targetPort);
56
57  async StartIceGathering(bool defaultRouteOnly,
58                          bool obfuscateHostAddresses,
59                          NrIceStunAddrArray stunAddrs);
60
61  async ActivateTransport(string transportId,
62                          string localUfrag,
63                          string localPwd,
64                          int componentCount,
65                          string remoteUfrag,
66                          string remotePwd,
67                          uint8_t[] keyDer,
68                          uint8_t[] certDer,
69                          int authType,
70                          bool dtlsClient,
71                          DtlsDigestList digests,
72                          bool privacyRequested);
73
74  async RemoveTransportsExcept(StringVector transportIds);
75
76  async StartIceChecks(bool isControlling,
77                       StringVector iceOptions);
78
79  async SendPacket(string transportId, MediaPacket packet);
80
81  async AddIceCandidate(string transportId,
82                        string candidate,
83                        string ufrag,
84                        string obfuscatedAddr);
85
86  async UpdateNetworkState(bool online);
87
88  async GetIceStats(string transportId, double now) returns (NotReallyMovableButLetsPretendItIsRTCStatsCollection stats);
89
90child:
91  async OnCandidate(string transportId, CandidateInfo candidateInfo);
92  async OnAlpnNegotiated(string alpn);
93  async OnGatheringStateChange(int state);
94  async OnConnectionStateChange(int state);
95  async OnPacketReceived(string transportId, MediaPacket packet);
96  async OnEncryptedSending(string transportId, MediaPacket packet);
97  async OnStateChange(string transportId, int state);
98  async OnRtcpStateChange(string transportId, int state);
99
100#endif // MOZ_WEBRTC
101};
102} // namespace dom
103} // namespace mozilla
104