2019-03-15 11:23:40 +01:00
|
|
|
/* SPDX-License-Identifier: ISC */
|
|
|
|
#ifndef INITSOCK_H
|
|
|
|
#define INITSOCK_H
|
|
|
|
|
|
|
|
#include "config.h"
|
2019-03-18 14:00:20 +01:00
|
|
|
#include "service.h"
|
2019-03-15 11:23:40 +01:00
|
|
|
|
|
|
|
#define INIT_SOCK_PATH SOCKDIR "/init.sock"
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
EIR_STATUS = 0x00,
|
|
|
|
} E_INIT_REQUEST;
|
|
|
|
|
2019-03-18 14:00:20 +01:00
|
|
|
typedef enum {
|
|
|
|
ESS_NONE = 0x00,
|
|
|
|
ESS_RUNNING = 0x01,
|
|
|
|
ESS_ENQUEUED = 0x02,
|
|
|
|
ESS_EXITED = 0x03,
|
|
|
|
} E_SERVICE_STATE;
|
|
|
|
|
2019-03-15 11:23:40 +01:00
|
|
|
typedef struct {
|
|
|
|
E_INIT_REQUEST rq;
|
|
|
|
} init_request_t;
|
|
|
|
|
2019-03-18 14:00:20 +01:00
|
|
|
typedef struct {
|
|
|
|
E_SERVICE_STATE state;
|
|
|
|
int exit_status;
|
|
|
|
char *filename;
|
|
|
|
char *service_name;
|
|
|
|
} init_status_response_t;
|
|
|
|
|
2019-03-15 11:23:40 +01:00
|
|
|
int init_socket_create(void);
|
|
|
|
|
|
|
|
int init_socket_open(const char *tmppath);
|
|
|
|
|
|
|
|
int init_socket_send_request(int fd, E_INIT_REQUEST rq);
|
|
|
|
|
2019-03-18 14:00:20 +01:00
|
|
|
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);
|
|
|
|
|
2019-03-15 11:23:40 +01:00
|
|
|
#endif /* INITSOCK_H */
|