summaryrefslogtreecommitdiffhomepage
path: root/gui/src/shared
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2020-07-24 17:26:05 +0200
committerDavid Lönnhager <david.l@mullvad.net>2020-08-20 14:41:41 +0200
commitb6df1d34bd2738aaed874b06db133292911dc4ac (patch)
treeceeccb6e4939433db5103902111b090776803a7c /gui/src/shared
parent21753e328aecc88c2ee8891bcab566035c174651 (diff)
downloadmullvadvpn-b6df1d34bd2738aaed874b06db133292911dc4ac.tar.xz
mullvadvpn-b6df1d34bd2738aaed874b06db133292911dc4ac.zip
Change RPCs from JSONRPC to GRPC
Diffstat (limited to 'gui/src/shared')
-rw-r--r--gui/src/shared/daemon-rpc-types.ts16
1 files changed, 9 insertions, 7 deletions
diff --git a/gui/src/shared/daemon-rpc-types.ts b/gui/src/shared/daemon-rpc-types.ts
index a4b6554d7b..78b6f60c17 100644
--- a/gui/src/shared/daemon-rpc-types.ts
+++ b/gui/src/shared/daemon-rpc-types.ts
@@ -46,14 +46,14 @@ export type ErrorStateCause =
export type AfterDisconnect = 'nothing' | 'block' | 'reconnect';
-export type TunnelType = 'wireguard' | 'openvpn';
+export type TunnelType = 'any' | 'wireguard' | 'openvpn';
export function tunnelTypeToString(tunnel: TunnelType): string {
switch (tunnel) {
case 'wireguard':
return 'WireGuard';
case 'openvpn':
return 'OpenVPN';
- default:
+ case 'any':
return '';
}
}
@@ -235,14 +235,16 @@ export interface IOpenVpnTunnelData {
}
export interface IWireguardTunnelData {
- // Port ranges are an array of pairs, such as [[53,53], [10_000, 60_000]],
- // which in this case translates that the specific tunnel can be connected on
- // port 53 and ports 10'000 through 60'000.
- portRanges: Array<[number, number]>;
+ portRanges: Array<IPortRange>;
// Public key of the tunnel.
publicKey: string;
}
+export interface IPortRange {
+ first: number;
+ last: number;
+}
+
export interface IShadowsocksEndpointData {
port: number;
cipher: string;
@@ -328,7 +330,7 @@ export interface ISocketAddress {
}
export type VoucherResponse =
- | { type: 'success'; new_expiry: string }
+ | { type: 'success'; newExpiry: string; secondsAdded: number }
| { type: 'invalid' | 'already_used' | 'error' };
export enum VoucherErrorCode {