Commit | Line | Data |
---|---|---|
a09dac63 PMF |
1 | /* Copyright (C) 2009 Pierre-Marc Fournier |
2 | * | |
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. | |
7 | * | |
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. | |
12 | * | |
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 | |
16 | */ | |
17 | ||
ab33e65c PP |
18 | #ifndef _USTCMD_H |
19 | #define _USTCMD_H | |
20 | ||
21 | #include <stdio.h> | |
22 | #include <unistd.h> | |
23 | #include <getopt.h> | |
24 | #include <stdlib.h> | |
25 | #include <fcntl.h> | |
26 | ||
27 | #include "ustcomm.h" | |
28 | #include "ustcmd.h" | |
29 | ||
77957c95 PMF |
30 | #define USTCMD_ERR_CONN 1 /* Process connection error */ |
31 | #define USTCMD_ERR_ARG 2 /* Invalid function argument */ | |
32 | #define USTCMD_ERR_GEN 3 /* General ustcmd error */ | |
ab33e65c | 33 | |
77957c95 PMF |
34 | #define USTCMD_MS_CHR_OFF '0' /* Marker state 'on' character */ |
35 | #define USTCMD_MS_CHR_ON '1' /* Marker state 'on' character */ | |
36 | #define USTCMD_MS_OFF 0 /* Marker state 'on' value */ | |
37 | #define USTCMD_MS_ON 1 /* Marker state 'on' value */ | |
ab33e65c | 38 | |
77957c95 | 39 | #define USTCMD_SOCK_PATH "/tmp/socks/" |
ab33e65c | 40 | |
77957c95 | 41 | /* Channel/marker/state/format string (cmsf) info. structure */ |
08230db7 PMF |
42 | struct marker_status { |
43 | char *channel; /* Channel name (end of marker_status array if NULL) */ | |
44 | char *marker; /* Marker name (end of marker_status array if NULL) */ | |
77957c95 | 45 | int state; /* State (0 := marker disabled, 1 := marker enabled) */ |
08230db7 | 46 | char *fs; /* Format string (end of marker_status array if NULL) */ |
ab33e65c PP |
47 | }; |
48 | ||
08230db7 PMF |
49 | extern pid_t *ustcmd_get_online_pids(void); |
50 | extern int ustcmd_set_marker_state(const char *, int, pid_t); | |
763f41e5 DS |
51 | extern int ustcmd_set_subbuf_size(const char *, pid_t); |
52 | extern int ustcmd_set_subbuf_num(const char *, pid_t); | |
e77b8e8e DS |
53 | extern int ustcmd_get_subbuf_size(const char *, pid_t); |
54 | extern int ustcmd_get_subbuf_num(const char *, pid_t); | |
08230db7 PMF |
55 | extern int ustcmd_destroy_trace(pid_t); |
56 | extern int ustcmd_setup_and_start(pid_t); | |
57 | extern int ustcmd_stop_trace(pid_t); | |
62ec620f | 58 | extern int ustcmd_create_trace(pid_t); |
08230db7 | 59 | extern int ustcmd_start_trace(pid_t); |
763f41e5 | 60 | extern int ustcmd_alloc_trace(pid_t); |
08230db7 PMF |
61 | extern int ustcmd_free_cmsf(struct marker_status *); |
62 | extern unsigned int ustcmd_count_nl(const char *); | |
63 | extern int ustcmd_send_cmd(const char *, pid_t, char **); | |
64 | extern int ustcmd_get_cmsf(struct marker_status **, pid_t); | |
b2fb2f91 AH |
65 | extern int ustcmd_set_sock_path(const char *, pid_t); |
66 | extern int ustcmd_get_sock_path(char **, pid_t); | |
ab33e65c | 67 | |
77957c95 | 68 | #endif /* _USTCMD_H */ |