1 /* Copyright (C) 2009 Pierre-Marc Fournier
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 #include <sys/types.h>
23 #include <urcu/list.h>
25 #include <ust/kcompat/kcompat.h>
27 #define SOCK_DIR "/tmp/ust-app-socks"
28 #define UST_SIGNAL SIGIO
31 struct list_head list
;
36 struct ustcomm_header
{
45 //int send_message_pid(pid_t pid, const char *msg, char **reply);
47 /* Ensure directory existence, usefull for unix sockets */
48 extern int ensure_dir_exists(const char *dir
);
50 /* Create and delete sockets */
51 extern struct ustcomm_sock
* ustcomm_init_sock(int fd
, int epoll_fd
,
52 struct list_head
*list
);
53 extern void ustcomm_del_sock(struct ustcomm_sock
*sock
, int keep_in_epoll
);
55 /* Create and delete named sockets */
56 extern struct ustcomm_sock
* ustcomm_init_named_socket(const char *name
,
58 extern void ustcomm_del_named_sock(struct ustcomm_sock
*sock
,
59 int keep_socket_file
);
61 /* Send and receive functions for file descriptors */
62 extern int ustcomm_send_fd(int sock
, const struct ustcomm_header
*header
,
63 const char *data
, int *fd
);
64 extern int ustcomm_recv_fd(int sock
, struct ustcomm_header
*header
,
65 char **data
, int *fd
);
67 /* Normal send and receive functions */
68 extern int ustcomm_send(int sock
, const struct ustcomm_header
*header
,
70 extern int ustcomm_recv(int sock
, struct ustcomm_header
*header
,
74 extern int ustcomm_request_consumer(pid_t pid
, const char *channel
);
75 extern int ustcomm_connect_app(pid_t pid
, int *app_fd
);
76 extern int ustcomm_connect_path(const char *path
, int *connection_fd
);
77 extern int ustcomm_send_request(int sock
, const char *req
, char **reply
);
78 extern int ustcomm_send_reply(char *msg
, int sock
);
79 extern int recv_message_conn(int sock
, char **msg
);
80 extern int nth_token_is(const char *str
, const char *token
, int tok_no
);
82 extern char *nth_token(const char *str
, int tok_no
);
84 #endif /* USTCOMM_H */
This page took 0.03912 seconds and 5 git commands to generate.