+/*
+ * lttng_list_traces
+ *
+ * Ask the session daemon for all traces (kernel and ust)
+ * for the session identified by uuid.
+ *
+ * Return the number of traces.
+ */
+int lttng_list_traces(uuid_t *uuid, struct lttng_trace **traces)
+{
+ int ret;
+
+ uuid_copy(lsm.session_id, *uuid);
+
+ ret = ask_sessiond(LTTNG_LIST_TRACES, (void **) traces);
+ if (ret < 0) {
+ return ret;
+ }
+
+ return ret / sizeof(struct lttng_trace);
+}
+
+/*
+ * lttng_create_session
+ *
+ * Create a brand new session using name. Allocate
+ * the session_id param pointing to the UUID.
+ */
+int lttng_create_session(char *name, uuid_t *session_id)
+{
+ int ret;
+
+ strncpy(lsm.session_name, name, sizeof(lsm.session_name));
+ lsm.session_name[sizeof(lsm.session_name) - 1] = '\0';
+
+ ret = ask_sessiond(LTTNG_CREATE_SESSION, NULL);
+ if (ret < 0) {
+ goto end;
+ }
+
+ uuid_copy(*session_id, llm.session_id);
+
+end:
+ return ret;
+}
+
+/*
+ * lttng_destroy_session
+ *
+ * Destroy session using name.
+ */
+int lttng_destroy_session(uuid_t *uuid)
+{
+ int ret;
+
+ uuid_copy(lsm.session_id, *uuid);
+
+ ret = ask_sessiond(LTTNG_DESTROY_SESSION, NULL);
+ if (ret < 0) {
+ goto end;
+ }
+
+end:
+ return ret;
+}
+