Skip to content

Commit 57f0f7b

Browse files
committed
protocol_version: added protocol version 6 - transfusion
Ticket: ENT-14506 Changelog: Added network protocol version 6 "transfusion" and made it the default Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
1 parent 1cf917e commit 57f0f7b

5 files changed

Lines changed: 16 additions & 4 deletions

File tree

‎cf-net/cf-net.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ static const char *const HINTS[] =
133133
"Enable basic information output",
134134
"Minimum TLS version to use",
135135
"TLS ciphers to use (comma-separated list)",
136-
"Specify CFEngine protocol to use. Possible values: 'classic', 'tls', 'cookie', 'filestream', 'leech2', 'latest' (default)",
136+
"Specify CFEngine protocol to use. Possible values: 'classic', 'tls', 'cookie', 'filestream', 'leech2', 'transfusion', 'latest' (default)",
137137
"Print rsync performance statistics to stderr",
138138
NULL
139139
};

‎libcfnet/protocol_version.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ ProtocolVersion ParseProtocolVersionPolicy(const char *const s)
4141
{
4242
return CF_PROTOCOL_LEECH2;
4343
}
44+
else if (StringEqual(s, "6") || StringEqual(s, "transfusion"))
45+
{
46+
return CF_PROTOCOL_TRANSFUSION;
47+
}
4448
else if (StringEqual(s, "latest"))
4549
{
4650
return CF_PROTOCOL_LATEST;

‎libcfnet/protocol_version.h‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ typedef enum
4141
CF_PROTOCOL_COOKIE = 3,
4242
CF_PROTOCOL_FILESTREAM = 4,
4343
CF_PROTOCOL_LEECH2 = 5,
44+
CF_PROTOCOL_TRANSFUSION = 6,
4445
} ProtocolVersion;
4546

4647
/* We use CF_PROTOCOL_LATEST as the default for new connections. */
47-
#define CF_PROTOCOL_LATEST CF_PROTOCOL_LEECH2
48+
#define CF_PROTOCOL_LATEST CF_PROTOCOL_TRANSFUSION
4849

4950
static inline const char *ProtocolVersionString(const ProtocolVersion p)
5051
{
@@ -60,6 +61,8 @@ static inline const char *ProtocolVersionString(const ProtocolVersion p)
6061
return "filestream";
6162
case CF_PROTOCOL_LEECH2:
6263
return "leech2";
64+
case CF_PROTOCOL_TRANSFUSION:
65+
return "transfusion";
6366
default:
6467
return "undefined";
6568
}
@@ -100,6 +103,11 @@ static inline bool ProtocolSupportsLeech2(const ProtocolVersion p)
100103
return (p >= CF_PROTOCOL_LEECH2);
101104
}
102105

106+
static inline bool ProtocolSupportsTransfusion(const ProtocolVersion p)
107+
{
108+
return (p >= CF_PROTOCOL_TRANSFUSION);
109+
}
110+
103111
static inline bool ProtocolTerminateCSV(const ProtocolVersion p)
104112
{
105113
return (p < CF_PROTOCOL_COOKIE);

‎libpromises/mod_common.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ const ConstraintSyntax CFG_CONTROLBODY[COMMON_CONTROL_MAX + 1] =
266266
ConstraintSyntaxNewBool("fips_mode", "Activate full FIPS mode restrictions. Default value: false", SYNTAX_STATUS_NORMAL),
267267
ConstraintSyntaxNewReal("bwlimit", CF_VALRANGE, "Limit outgoing protocol bandwidth in Bytes per second", SYNTAX_STATUS_NORMAL),
268268
ConstraintSyntaxNewBool("cache_system_functions", "Cache the result of system functions. Default value: true", SYNTAX_STATUS_NORMAL),
269-
ConstraintSyntaxNewOption("protocol_version", "1,classic,2,tls,3,cookie,4,filestream,5,leech2,latest", "CFEngine protocol version to use when connecting to the server. Default: \"latest\"", SYNTAX_STATUS_NORMAL),
269+
ConstraintSyntaxNewOption("protocol_version", "1,classic,2,tls,3,cookie,4,filestream,5,leech2,6,transfusion,latest", "CFEngine protocol version to use when connecting to the server. Default: \"latest\"", SYNTAX_STATUS_NORMAL),
270270
ConstraintSyntaxNewString("tls_ciphers", "", "List of acceptable ciphers in outgoing TLS connections, defaults to OpenSSL's default. For syntax help see man page for \"openssl ciphers\"", SYNTAX_STATUS_NORMAL),
271271
ConstraintSyntaxNewString("tls_min_version", "", "Minimum acceptable TLS version for outgoing connections, defaults to OpenSSL's default", SYNTAX_STATUS_NORMAL),
272272
ConstraintSyntaxNewStringList("package_inventory", ".*", "Name of the package manager used for software inventory management", SYNTAX_STATUS_NORMAL),

‎libpromises/mod_files.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ static const ConstraintSyntax copy_from_constraints[] =
336336
ConstraintSyntaxNewBool("trustkey", "true/false trust public keys from remote server if previously unknown. Default value: false", SYNTAX_STATUS_NORMAL),
337337
ConstraintSyntaxNewBool("type_check", "true/false compare file types before copying and require match", SYNTAX_STATUS_NORMAL),
338338
ConstraintSyntaxNewBool("verify", "true/false verify transferred file by hashing after copy (resource penalty). Default value: false", SYNTAX_STATUS_NORMAL),
339-
ConstraintSyntaxNewOption("protocol_version", "1,classic,2,tls,3,cookie,4,filestream,5,leech2,latest", "CFEngine protocol version to use when connecting to the server. Default: undefined", SYNTAX_STATUS_NORMAL),
339+
ConstraintSyntaxNewOption("protocol_version", "1,classic,2,tls,3,cookie,4,filestream,5,leech2,6,transfusion,latest", "CFEngine protocol version to use when connecting to the server. Default: undefined", SYNTAX_STATUS_NORMAL),
340340
ConstraintSyntaxNewBool("missing_ok", "true/false Do not treat missing file as an error. Default value: false", SYNTAX_STATUS_NORMAL),
341341
ConstraintSyntaxNewNull()
342342
};

0 commit comments

Comments
 (0)