X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=libustcomm%2Fustcomm.h;h=995295810a5fc80ee4f8fcd1cae87618ed821a03;hb=1031eea2a5a72a647577fa131e0e83f7644d7be7;hp=689c151a5b300920cbf97b4d4177622afe30058e;hpb=0222e1213f196b66cbc08cd29093aca4a28e9ffb;p=ust.git diff --git a/libustcomm/ustcomm.h b/libustcomm/ustcomm.h index 689c151..9952958 100644 --- a/libustcomm/ustcomm.h +++ b/libustcomm/ustcomm.h @@ -25,6 +25,9 @@ #include #define SOCK_DIR "/tmp/ust-app-socks" +#define USER_TMP_DIR "/tmp" +#define USER_SOCK_DIR_BASE "ust-socks-" +#define USER_SOCK_DIR USER_TMP_DIR "/" USER_SOCK_DIR_BASE struct ustcomm_sock { struct cds_list_head list; @@ -78,8 +81,8 @@ enum tracectl_commands { STOP_TRACE, }; -struct ustcomm_trace_info { - char *trace; +struct ustcomm_single_field { + char *field; char data[USTCOMM_DATA_SIZE]; }; @@ -109,11 +112,6 @@ struct ustcomm_marker_info { char data[USTCOMM_DATA_SIZE]; }; -struct ustcomm_sock_path { - char *sock_path; - char data[USTCOMM_DATA_SIZE]; -}; - struct ustcomm_pidunique { s64 pidunique; }; @@ -123,7 +121,7 @@ struct ustcomm_notify_buf_mapped { }; /* Ensure directory existence, usefull for unix sockets */ -extern int ensure_dir_exists(const char *dir); +extern int ensure_dir_exists(const char *dir, mode_t mode); /* Create and delete sockets */ extern struct ustcomm_sock * ustcomm_init_sock(int fd, int epoll_fd, @@ -161,6 +159,9 @@ extern int ustcomm_req(int sock, char *res_data); extern int ustcomm_request_consumer(pid_t pid, const char *channel); + +/* Returns the current users socket directory, must be freed */ +extern char *ustcomm_user_sock_dir(void); extern int ustcomm_connect_app(pid_t pid, int *app_fd); extern int ustcomm_connect_path(const char *path, int *connection_fd); @@ -180,11 +181,11 @@ extern char * ustcomm_restore_ptr(char *ptr, char *data_field, (size_t) (long)(struct_ptr)->data - (long)(struct_ptr) + (offset) /* Packing and unpacking functions, making life easier */ -extern int ustcomm_pack_trace_info(struct ustcomm_header *header, - struct ustcomm_trace_info *trace_inf, +extern int ustcomm_pack_single_field(struct ustcomm_header *header, + struct ustcomm_single_field *sf, const char *trace); -extern int ustcomm_unpack_trace_info(struct ustcomm_trace_info *trace_inf); +extern int ustcomm_unpack_single_field(struct ustcomm_single_field *sf); extern int ustcomm_pack_channel_info(struct ustcomm_header *header, struct ustcomm_channel_info *ch_inf, @@ -209,11 +210,4 @@ extern int ustcomm_pack_marker_info(struct ustcomm_header *header, extern int ustcomm_unpack_marker_info(struct ustcomm_marker_info *marker_inf); - -extern int ustcomm_pack_sock_path(struct ustcomm_header *header, - struct ustcomm_sock_path *sock_path_inf, - const char *socket_path); - -extern int ustcomm_unpack_sock_path(struct ustcomm_sock_path *sock_path_inf); - #endif /* USTCOMM_H */