1 /*-*- Mode: C; c-basic-offset: 8 -*-*/
7 This file is part of systemd.
9 Copyright 2010 Lennart Poettering
11 systemd is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2 of the License, or
14 (at your option) any later version.
16 systemd is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with systemd; If not, see <http://www.gnu.org/licenses/>.
25 typedef struct Socket Socket;
29 #include "socket-util.h"
31 typedef enum SocketState {
38 SOCKET_STOP_PRE_SIGTERM,
39 SOCKET_STOP_PRE_SIGKILL,
41 SOCKET_STOP_POST_SIGTERM,
42 SOCKET_STOP_POST_SIGKILL,
47 typedef enum SocketExecCommand {
48 SOCKET_EXEC_START_PRE,
49 SOCKET_EXEC_START_POST,
51 SOCKET_EXEC_STOP_POST,
55 typedef enum SocketType {
60 typedef struct SocketPort SocketPort;
65 SocketAddress address;
71 LIST_FIELDS(SocketPort, port);
77 LIST_HEAD(SocketPort, ports);
79 /* Only for INET6 sockets: issue IPV6_V6ONLY sockopt */
85 ExecCommand* exec_command[_SOCKET_EXEC_MAX];
86 ExecContext exec_context;
94 ExecCommand* control_command;
98 mode_t directory_mode;
105 /* Called from the service code when collecting fds */
106 int socket_collect_fds(Socket *s, int **fds, unsigned *n_fds);
108 /* Called from the service when it shut down */
109 void socket_notify_service_dead(Socket *s);
111 extern const UnitVTable socket_vtable;