aboutsummaryrefslogtreecommitdiff
path: root/lib/include
diff options
context:
space:
mode:
authorDavid Oberhollenzer <goliath@infraroot.at>2019-03-18 14:00:20 +0100
committerDavid Oberhollenzer <goliath@infraroot.at>2019-03-18 18:29:02 +0100
commit23b713c3b5345c6df187cd494bac4ef20669c1cf (patch)
treefa4c2eb792c5f6dee19e48eff01638d94dd49ef7 /lib/include
parent08f72865b29598faa5074ef21f583508f94dea98 (diff)
Add functions to transmit service status accross initd socket
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
Diffstat (limited to 'lib/include')
-rw-r--r--lib/include/initsock.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/include/initsock.h b/lib/include/initsock.h
index 5c1437c..9c84f3e 100644
--- a/lib/include/initsock.h
+++ b/lib/include/initsock.h
@@ -3,6 +3,7 @@
#define INITSOCK_H
#include "config.h"
+#include "service.h"
#define INIT_SOCK_PATH SOCKDIR "/init.sock"
@@ -10,14 +11,33 @@ typedef enum {
EIR_STATUS = 0x00,
} E_INIT_REQUEST;
+typedef enum {
+ ESS_NONE = 0x00,
+ ESS_RUNNING = 0x01,
+ ESS_ENQUEUED = 0x02,
+ ESS_EXITED = 0x03,
+} E_SERVICE_STATE;
+
typedef struct {
E_INIT_REQUEST rq;
} init_request_t;
+typedef struct {
+ E_SERVICE_STATE state;
+ int exit_status;
+ char *filename;
+ char *service_name;
+} init_status_response_t;
+
int init_socket_create(void);
int init_socket_open(const char *tmppath);
int init_socket_send_request(int fd, E_INIT_REQUEST rq);
+int init_socket_send_status(int fd, const void *dest_addr, size_t addrlen,
+ E_SERVICE_STATE state, service_t *svc);
+
+int init_socket_recv_status(int fd, init_status_response_t *resp);
+
#endif /* INITSOCK_H */