socket.h revision e99e38bbdcca3fe5956823bdb3d38544ccf93221
/*-*- Mode: C; c-basic-offset: 8 -*-*/
#ifndef foosockethfoo
#define foosockethfoo
/***
This file is part of systemd.
Copyright 2010 Lennart Poettering
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include "manager.h"
#include "unit.h"
#include "socket-util.h"
#include "mount.h"
typedef enum SocketState {
} SocketState;
typedef enum SocketExecCommand {
typedef enum SocketType {
_SOCKET_FIFO_INVALID = -1
} SocketType;
typedef struct SocketPort SocketPort;
struct SocketPort {
int fd;
char *path;
};
struct Socket {
/* Only for INET6 sockets: issue IPV6_V6ONLY sockopt */
bool bind_ipv6_only;
unsigned backlog;
char *bind_to_device;
bool accept;
unsigned n_accepted;
bool failure;
};
/* Called from the service code when collecting fds */
/* Called from the service when it shut down */
void socket_notify_service_dead(Socket *s);
/* Called from the mount code figure out if a mount is a dependency of
* any of the sockets of this socket */
extern const UnitVTable socket_vtable;
const char* socket_state_to_string(SocketState i);
SocketState socket_state_from_string(const char *s);
const char* socket_exec_command_to_string(SocketExecCommand i);
SocketExecCommand socket_exec_command_from_string(const char *s);
#endif