+static const char *domain_type_str(enum lttng_domain_type domain_type)
+{
+ switch (domain_type) {
+ case LTTNG_DOMAIN_NONE:
+ return "none";
+ case LTTNG_DOMAIN_KERNEL:
+ return "kernel";
+ case LTTNG_DOMAIN_UST:
+ return "ust";
+ case LTTNG_DOMAIN_JUL:
+ return "jul";
+ case LTTNG_DOMAIN_LOG4J:
+ return "log4j";
+ case LTTNG_DOMAIN_PYTHON:
+ return "python";
+ default:
+ return "unknown";
+ }
+}
+
+static bool is_agent_protocol_version_supported(
+ const struct agent_protocol_version *version)
+{
+ const bool is_supported = version->major == AGENT_MAJOR_VERSION &&
+ version->minor == AGENT_MINOR_VERSION;
+
+ if (!is_supported) {
+ WARN("Refusing agent connection: unsupported protocol version %ui.%ui, expected %i.%i",
+ version->major, version->minor,
+ AGENT_MAJOR_VERSION, AGENT_MINOR_VERSION);
+ }
+
+ return is_supported;
+}
+