fix warnings
[lttng-ust.git] / libustcomm / ustcomm.h
CommitLineData
f9e5ce61
PMF
1#ifndef USTCOMM_H
2#define USTCOMM_H
3
4#include <sys/types.h>
b02e31e5 5#include <sys/un.h>
f9e5ce61 6
aca1ad90
PMF
7#include "kcompat.h"
8
9struct ustcomm_connection {
10 struct list_head list;
11 int fd;
12};
13
3a7b90de 14/* ustcomm_server must be shallow-copyable */
811e4b93 15struct ustcomm_server {
b0540e11 16 /* the "server" socket for serving the external requests */
aca1ad90 17 int listen_fd;
d0b5f2b9 18 char *socketpath;
aca1ad90
PMF
19
20 struct list_head connections;
d0b5f2b9
PMF
21};
22
23struct ustcomm_ustd {
811e4b93
PMF
24 struct ustcomm_server server;
25};
aca1ad90 26
811e4b93
PMF
27struct ustcomm_app {
28 struct ustcomm_server server;
d0b5f2b9
PMF
29};
30
3a7b90de 31/* ustcomm_source must be shallow-copyable */
b02e31e5 32struct ustcomm_source {
811e4b93
PMF
33 int fd;
34 void *priv;
b02e31e5
PMF
35};
36
688760ef
PMF
37char *strdup_malloc(const char *s);
38
3bb56863 39//int send_message_pid(pid_t pid, const char *msg, char **reply);
9160b4e4 40int ustcomm_request_consumer(pid_t pid, const char *channel);
d0b5f2b9 41
688760ef
PMF
42int ustcomm_ustd_recv_message(struct ustcomm_ustd *ustd, char **msg, struct ustcomm_source *src, int timeout);
43int ustcomm_app_recv_message(struct ustcomm_app *app, char **msg, struct ustcomm_source *src, int timeout);
3847c3ba 44
d0b5f2b9
PMF
45int ustcomm_init_app(pid_t pid, struct ustcomm_app *handle);
46
47int ustcomm_init_ustd(struct ustcomm_ustd *handle);
f9e5ce61 48
3bb56863
PMF
49int ustcomm_connect_app(pid_t pid, struct ustcomm_connection *conn);
50int ustcomm_send_request(struct ustcomm_connection *conn, char *req, char **reply);
9160b4e4 51int ustcomm_send_reply(struct ustcomm_server *server, char *msg, struct ustcomm_source *src);
3bb56863 52
b02e31e5
PMF
53int nth_token_is(char *str, char *token, int tok_no);
54
55char *nth_token(char *str, int tok_no);
56
f9e5ce61 57#endif /* USTCOMM_H */
This page took 0.026229 seconds and 4 git commands to generate.