encode actual hostname in RSPRO
The RSPRO ComponentIdentity includes a 'name' for each remsim component.
So far we always used "fixme-name" instead of something meaningful.
Let's use the hostname of the system instead.
Change-Id: I14925f16ae242dae89fa853a2fe31c5c1b32981d
diff --git a/src/server/remsim_server.c b/src/server/remsim_server.c
index c2d54e5..71590f4 100644
--- a/src/server/remsim_server.c
+++ b/src/server/remsim_server.c
@@ -80,9 +80,13 @@
int main(int argc, char **argv)
{
+ char hostname[256];
void *talloc_rest_ctx;
int rc;
+ if (gethostname(hostname, sizeof(hostname)) < 0)
+ OSMO_STRLCPY_ARRAY(hostname, "unknown");
+
g_tall_ctx = talloc_named_const(NULL, 0, "global");
talloc_asn1_ctx = talloc_named_const(g_tall_ctx, 0, "asn1");
talloc_rest_ctx = talloc_named_const(g_tall_ctx, 0, "rest");
@@ -106,7 +110,7 @@
goto out_rspro;
g_rps->comp_id.type = ComponentType_remsimServer;
- OSMO_STRLCPY_ARRAY(g_rps->comp_id.name, "fixme-name");
+ OSMO_STRLCPY_ARRAY(g_rps->comp_id.name, hostname);
OSMO_STRLCPY_ARRAY(g_rps->comp_id.software, "remsim-server");
OSMO_STRLCPY_ARRAY(g_rps->comp_id.sw_version, PACKAGE_VERSION);
/* FIXME: other members of app_comp_id */