2018-05-01 23:45:06 +00:00
|
|
|
using Go = import "go.capnp";
|
|
|
|
@0xdb8274f9144abc7e;
|
2024-05-14 04:22:06 +00:00
|
|
|
$Go.package("proto");
|
2018-05-01 23:45:06 +00:00
|
|
|
$Go.import("github.com/cloudflare/cloudflared/tunnelrpc");
|
|
|
|
|
2024-05-20 23:09:25 +00:00
|
|
|
# === DEPRECATED Legacy Tunnel Authentication and Registration methods/servers ===
|
|
|
|
#
|
|
|
|
# These structs and interfaces are no longer used but it is important to keep
|
|
|
|
# them around to make sure backwards compatibility within the rpc protocol is
|
|
|
|
# maintained.
|
|
|
|
|
2024-05-14 04:22:06 +00:00
|
|
|
struct Authentication @0xc082ef6e0d42ed1d {
|
2024-05-20 23:09:25 +00:00
|
|
|
# DEPRECATED: Legacy tunnel authentication mechanism
|
2018-05-01 23:45:06 +00:00
|
|
|
key @0 :Text;
|
|
|
|
email @1 :Text;
|
|
|
|
originCAKey @2 :Text;
|
|
|
|
}
|
|
|
|
|
2024-05-14 04:22:06 +00:00
|
|
|
struct TunnelRegistration @0xf41a0f001ad49e46 {
|
2024-05-20 23:09:25 +00:00
|
|
|
# DEPRECATED: Legacy tunnel authentication mechanism
|
2018-05-01 23:45:06 +00:00
|
|
|
err @0 :Text;
|
|
|
|
# the url to access the tunnel
|
|
|
|
url @1 :Text;
|
|
|
|
# Used to inform the client of actions taken.
|
|
|
|
logLines @2 :List(Text);
|
|
|
|
# In case of error, whether the client should attempt to reconnect.
|
|
|
|
permanentFailure @3 :Bool;
|
|
|
|
# Displayed to user
|
|
|
|
tunnelID @4 :Text;
|
2019-11-18 19:56:04 +00:00
|
|
|
# How long should this connection wait to retry in seconds, if the error wasn't permanent
|
|
|
|
retryAfterSeconds @5 :UInt16;
|
2019-11-22 16:17:23 +00:00
|
|
|
# A unique ID used to reconnect this tunnel.
|
|
|
|
eventDigest @6 :Data;
|
2020-03-05 21:20:12 +00:00
|
|
|
# A unique ID used to prove this tunnel was previously connected to a given metal.
|
|
|
|
connDigest @7 :Data;
|
2018-05-01 23:45:06 +00:00
|
|
|
}
|
|
|
|
|
2024-05-14 04:22:06 +00:00
|
|
|
struct RegistrationOptions @0xc793e50592935b4a {
|
2024-05-20 23:09:25 +00:00
|
|
|
# DEPRECATED: Legacy tunnel authentication mechanism
|
|
|
|
|
2018-05-01 23:45:06 +00:00
|
|
|
# The tunnel client's unique identifier, used to verify a reconnection.
|
|
|
|
clientId @0 :Text;
|
|
|
|
# Information about the running binary.
|
|
|
|
version @1 :Text;
|
|
|
|
os @2 :Text;
|
|
|
|
# What to do with existing tunnels for the given hostname.
|
|
|
|
existingTunnelPolicy @3 :ExistingTunnelPolicy;
|
|
|
|
# If using the balancing policy, identifies the LB pool to use.
|
|
|
|
poolName @4 :Text;
|
|
|
|
# Client-defined tags to associate with the tunnel
|
|
|
|
tags @5 :List(Tag);
|
|
|
|
# A unique identifier for a high-availability connection made by a single client.
|
|
|
|
connectionId @6 :UInt8;
|
|
|
|
# origin LAN IP
|
|
|
|
originLocalIp @7 :Text;
|
|
|
|
# whether Argo Tunnel client has been autoupdated
|
|
|
|
isAutoupdated @8 :Bool;
|
|
|
|
# whether Argo Tunnel client is run from a terminal
|
|
|
|
runFromTerminal @9 :Bool;
|
|
|
|
# cross stream compression setting, 0 - off, 3 - high
|
|
|
|
compressionQuality @10 :UInt64;
|
2018-10-08 19:20:28 +00:00
|
|
|
uuid @11 :Text;
|
2019-11-18 19:56:04 +00:00
|
|
|
# number of previous attempts to send RegisterTunnel/ReconnectTunnel
|
|
|
|
numPreviousAttempts @12 :UInt8;
|
2020-02-25 23:45:48 +00:00
|
|
|
# Set of features this cloudflared knows it supports
|
|
|
|
features @13 :List(Text);
|
2018-05-01 23:45:06 +00:00
|
|
|
}
|
|
|
|
|
2024-05-14 04:22:06 +00:00
|
|
|
enum ExistingTunnelPolicy @0x84cb9536a2cf6d3c {
|
2024-05-20 23:09:25 +00:00
|
|
|
# DEPRECATED: Legacy tunnel registration mechanism
|
|
|
|
|
2018-05-01 23:45:06 +00:00
|
|
|
ignore @0;
|
|
|
|
disconnect @1;
|
|
|
|
balance @2;
|
|
|
|
}
|
|
|
|
|
2024-05-14 04:22:06 +00:00
|
|
|
struct ServerInfo @0xf2c68e2547ec3866 {
|
2024-05-20 23:09:25 +00:00
|
|
|
# DEPRECATED: Legacy tunnel registration mechanism
|
|
|
|
|
2018-05-01 23:45:06 +00:00
|
|
|
locationName @0 :Text;
|
|
|
|
}
|
|
|
|
|
2024-05-14 04:22:06 +00:00
|
|
|
struct AuthenticateResponse @0x82c325a07ad22a65 {
|
2024-05-20 23:09:25 +00:00
|
|
|
# DEPRECATED: Legacy tunnel registration mechanism
|
|
|
|
|
2019-11-18 16:28:18 +00:00
|
|
|
permanentErr @0 :Text;
|
|
|
|
retryableErr @1 :Text;
|
|
|
|
jwt @2 :Data;
|
|
|
|
hoursUntilRefresh @3 :UInt8;
|
|
|
|
}
|
|
|
|
|
2024-05-20 23:09:25 +00:00
|
|
|
interface TunnelServer @0xea58385c65416035 extends (RegistrationServer) {
|
|
|
|
# DEPRECATED: Legacy tunnel authentication server
|
|
|
|
|
|
|
|
registerTunnel @0 (originCert :Data, hostname :Text, options :RegistrationOptions) -> (result :TunnelRegistration);
|
|
|
|
getServerInfo @1 () -> (result :ServerInfo);
|
|
|
|
unregisterTunnel @2 (gracePeriodNanoSec :Int64) -> ();
|
|
|
|
# obsoleteDeclarativeTunnelConnect RPC deprecated in TUN-3019
|
|
|
|
obsoleteDeclarativeTunnelConnect @3 () -> ();
|
|
|
|
authenticate @4 (originCert :Data, hostname :Text, options :RegistrationOptions) -> (result :AuthenticateResponse);
|
|
|
|
reconnectTunnel @5 (jwt :Data, eventDigest :Data, connDigest :Data, hostname :Text, options :RegistrationOptions) -> (result :TunnelRegistration);
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Tag @0xcbd96442ae3bb01a {
|
|
|
|
# DEPRECATED: Legacy tunnel additional HTTP header mechanism
|
|
|
|
|
|
|
|
name @0 :Text;
|
|
|
|
value @1 :Text;
|
|
|
|
}
|
|
|
|
|
|
|
|
# === End DEPRECATED Objects ===
|
|
|
|
|
2024-05-14 04:22:06 +00:00
|
|
|
struct ClientInfo @0x83ced0145b2f114b {
|
2020-06-02 18:19:19 +00:00
|
|
|
# The tunnel client's unique identifier, used to verify a reconnection.
|
|
|
|
clientId @0 :Data;
|
|
|
|
# Set of features this cloudflared knows it supports
|
|
|
|
features @1 :List(Text);
|
|
|
|
# Information about the running binary.
|
|
|
|
version @2 :Text;
|
|
|
|
# Client OS and CPU info
|
|
|
|
arch @3 :Text;
|
|
|
|
}
|
|
|
|
|
2024-05-14 04:22:06 +00:00
|
|
|
struct ConnectionOptions @0xb4bf9861fe035d04 {
|
2020-06-02 18:19:19 +00:00
|
|
|
# client details
|
|
|
|
client @0 :ClientInfo;
|
|
|
|
# origin LAN IP
|
|
|
|
originLocalIp @1 :Data;
|
|
|
|
# What to do if connection already exists
|
|
|
|
replaceExisting @2 :Bool;
|
|
|
|
# cross stream compression setting, 0 - off, 3 - high
|
|
|
|
compressionQuality @3 :UInt8;
|
2020-07-31 15:22:23 +00:00
|
|
|
# number of previous attempts to send RegisterConnection
|
|
|
|
numPreviousAttempts @4 :UInt8;
|
2020-06-02 18:19:19 +00:00
|
|
|
}
|
|
|
|
|
2024-05-14 04:22:06 +00:00
|
|
|
struct ConnectionResponse @0xdbaa9d03d52b62dc {
|
2020-06-02 18:19:19 +00:00
|
|
|
result :union {
|
|
|
|
error @0 :ConnectionError;
|
|
|
|
connectionDetails @1 :ConnectionDetails;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-05-14 04:22:06 +00:00
|
|
|
struct ConnectionError @0xf5f383d2785edb86 {
|
2020-06-02 18:19:19 +00:00
|
|
|
cause @0 :Text;
|
|
|
|
# How long should this connection wait to retry in ns
|
|
|
|
retryAfter @1 :Int64;
|
|
|
|
shouldRetry @2 :Bool;
|
|
|
|
}
|
|
|
|
|
2024-05-14 04:22:06 +00:00
|
|
|
struct ConnectionDetails @0xb5f39f082b9ac18a {
|
2020-06-02 18:19:19 +00:00
|
|
|
# identifier of this connection
|
|
|
|
uuid @0 :Data;
|
|
|
|
# airport code of the colo where this connection landed
|
|
|
|
locationName @1 :Text;
|
2022-04-27 13:34:11 +00:00
|
|
|
# tells if the tunnel is remotely managed
|
|
|
|
tunnelIsRemotelyManaged @2: Bool;
|
2020-06-02 18:19:19 +00:00
|
|
|
}
|
|
|
|
|
2024-05-14 04:22:06 +00:00
|
|
|
struct TunnelAuth @0x9496331ab9cd463f {
|
2020-06-12 02:47:40 +00:00
|
|
|
accountTag @0 :Text;
|
|
|
|
tunnelSecret @1 :Data;
|
|
|
|
}
|
|
|
|
|
2024-05-14 04:22:06 +00:00
|
|
|
interface RegistrationServer @0xf71695ec7fe85497 {
|
2020-06-12 02:47:40 +00:00
|
|
|
registerConnection @0 (auth :TunnelAuth, tunnelId :Data, connIndex :UInt8, options :ConnectionOptions) -> (result :ConnectionResponse);
|
2020-06-02 18:19:19 +00:00
|
|
|
unregisterConnection @1 () -> ();
|
2022-04-20 16:52:55 +00:00
|
|
|
updateLocalConfiguration @2 (config :Data) -> ();
|
2020-06-02 18:19:19 +00:00
|
|
|
}
|
|
|
|
|
2024-05-14 04:22:06 +00:00
|
|
|
struct RegisterUdpSessionResponse @0xab6d5210c1f26687 {
|
2021-11-12 09:37:28 +00:00
|
|
|
err @0 :Text;
|
2022-09-07 22:06:06 +00:00
|
|
|
spans @1 :Data;
|
2021-11-12 09:37:28 +00:00
|
|
|
}
|
|
|
|
|
2024-05-14 04:22:06 +00:00
|
|
|
interface SessionManager @0x839445a59fb01686 {
|
2021-12-02 11:02:27 +00:00
|
|
|
# Let the edge decide closeAfterIdle to make sure cloudflared doesn't close session before the edge closes its side
|
2022-09-07 22:06:06 +00:00
|
|
|
registerUdpSession @0 (sessionId :Data, dstIp :Data, dstPort :UInt16, closeAfterIdleHint :Int64, traceContext :Text = "") -> (result :RegisterUdpSessionResponse);
|
|
|
|
unregisterUdpSession @1 (sessionId :Data, message :Text) -> ();
|
2022-02-02 12:27:49 +00:00
|
|
|
}
|
|
|
|
|
2024-05-14 04:22:06 +00:00
|
|
|
struct UpdateConfigurationResponse @0xdb58ff694ba05cf9 {
|
2022-02-02 12:27:49 +00:00
|
|
|
# Latest configuration that was applied successfully. The err field might be populated at the same time to indicate
|
|
|
|
# that cloudflared is using an older configuration because the latest cannot be applied
|
|
|
|
latestAppliedVersion @0 :Int32;
|
|
|
|
# Any error encountered when trying to apply the last configuration
|
|
|
|
err @1 :Text;
|
|
|
|
}
|
|
|
|
|
|
|
|
# ConfigurationManager defines RPC to manage cloudflared configuration remotely
|
2024-05-14 04:22:06 +00:00
|
|
|
interface ConfigurationManager @0xb48edfbdaa25db04 {
|
2022-02-02 12:27:49 +00:00
|
|
|
updateConfiguration @0 (version :Int32, config :Data) -> (result: UpdateConfigurationResponse);
|
|
|
|
}
|
|
|
|
|
2024-05-14 04:22:06 +00:00
|
|
|
interface CloudflaredServer @0xf548cef9dea2a4a1 extends(SessionManager, ConfigurationManager) {}
|