+static int ipc_set_state(struct ipc_header *ipc, server_child_t *children)
+{
+ EC_INIT;
+ afp_child_t *child;
+
+ pthread_mutex_lock(&children->servch_lock);
+
+ if ((child = server_child_resolve(children, ipc->child_pid)) == NULL)
+ EC_FAIL;
+
+ memcpy(&child->afpch_state, ipc->msg, sizeof(uint16_t));
+
+EC_CLEANUP:
+ pthread_mutex_unlock(&children->servch_lock);
+ EC_EXIT;
+}
+
+static int ipc_set_volumes(struct ipc_header *ipc, server_child_t *children)
+{
+ EC_INIT;
+ afp_child_t *child;
+
+ pthread_mutex_lock(&children->servch_lock);
+
+ if ((child = server_child_resolve(children, ipc->child_pid)) == NULL)
+ EC_FAIL;
+
+ if (child->afpch_volumes) {
+ free(child->afpch_volumes);
+ child->afpch_volumes = NULL;
+ }
+ if (ipc->len)
+ child->afpch_volumes = strdup(ipc->msg);
+
+EC_CLEANUP:
+ pthread_mutex_unlock(&children->servch_lock);
+ EC_EXIT;
+}
+
+/***********************************************************************************
+ * Public functions
+ ***********************************************************************************/