X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=liblttsessiondcomm%2Fliblttsessiondcomm.h;h=ce85e8292130e34dcb0c0a0fcc1dac016acc93e8;hp=f4180cf0a4cd65413b46f6e6f575068cdf7cac02;hb=ce3d728cd9bfcc0f7d43e08275a92cf04e898662;hpb=5716705821202372fd16168f66f347ba293ef6b4 diff --git a/liblttsessiondcomm/liblttsessiondcomm.h b/liblttsessiondcomm/liblttsessiondcomm.h index f4180cf0a..ce85e8292 100644 --- a/liblttsessiondcomm/liblttsessiondcomm.h +++ b/liblttsessiondcomm/liblttsessiondcomm.h @@ -75,6 +75,11 @@ enum lttcomm_return_code { LTTCOMM_LIST_FAIL, /* Listing apps fail */ LTTCOMM_NO_APPS, /* No traceable application */ LTTCOMM_NO_SESS, /* No sessions available */ + LTTCOMM_NO_TRACE, /* No trace exist */ + LTTCOMM_FATAL, /* Session daemon had a fatal error */ + LTTCOMM_NO_TRACEABLE, /* Error for non traceable app */ + LTTCOMM_SELECT_SESS, /* Must select a session */ + LTTCOMM_EXIST_SESS, /* Session name already exist */ LTTCOMM_NR, /* Last element */ }; @@ -115,7 +120,11 @@ struct lttcomm_session_msg { }; /* - * Data structure for the lttng client response + * Data structure for the lttng client response. + * + * This data structure is the control struct use in + * the header of the transmission. NEVER put variable + * size data in here. */ struct lttcomm_lttng_msg { enum lttcomm_command_type cmd_type; @@ -123,28 +132,14 @@ struct lttcomm_lttng_msg { uuid_t session_id; pid_t pid; char trace_name[NAME_MAX]; - /* This flag indicates how many packet are in - * the transmission. Ex: If list apps is requested, - * and there is 4 pids registered, num_pckt will be 4 - */ - unsigned int num_pckt; - union { - /* UST_LIST_APPS */ - struct { - pid_t pid; - } list_apps; - /* LTTNG_LIST_SESSIONS */ - struct { - char name[NAME_MAX]; - char uuid[37]; /* See libuuid not exported size UUID_STR_LEN */ - } list_sessions; - } u; + unsigned int size_payload; }; extern int lttcomm_create_unix_sock(const char *pathname); extern int lttcomm_connect_unix_sock(const char *pathname); extern int lttcomm_accept_unix_sock(int sock); extern int lttcomm_listen_unix_sock(int sock); +extern int lttcomm_close_unix_sock(int sock); extern ssize_t lttcomm_recv_unix_sock(int sock, void *buf, size_t len); extern ssize_t lttcomm_send_unix_sock(int sock, void *buf, size_t len); extern const char *lttcomm_get_readable_code(enum lttcomm_return_code code);