blob: 1a49dfa44460b2d018a6b2ab86fb70ee4d1551dd [file] [log] [blame]
Willy Tarreau063d47d2020-08-28 16:29:53 +02001/*
2 * include/haproxy/sock-t.h
3 * This file contains type definitions for native (BSD-compatible) sockets.
4 *
5 * Copyright (C) 2000-2020 Willy Tarreau - w@1wt.eu
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation, version 2.1
10 * exclusively.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#ifndef _HAPROXY_SOCK_T_H
23#define _HAPROXY_SOCK_T_H
24
25#include <sys/socket.h>
26#include <sys/types.h>
27
28#include <haproxy/api-t.h>
29
Willy Tarreaua2c17872020-08-28 19:09:19 +020030#define SOCK_XFER_OPT_FOREIGN 0x000000001
31#define SOCK_XFER_OPT_V6ONLY 0x000000002
Willy Tarreau9dbb6c42020-08-28 19:20:23 +020032#define SOCK_XFER_OPT_DGRAM 0x000000004
Willy Tarreaua2c17872020-08-28 19:09:19 +020033
Willy Tarreau063d47d2020-08-28 16:29:53 +020034/* The list used to transfer sockets between old and new processes */
35struct xfer_sock_list {
36 int fd;
Willy Tarreaua2c17872020-08-28 19:09:19 +020037 int options; /* socket options as SOCK_XFER_OPT_* */
Willy Tarreau063d47d2020-08-28 16:29:53 +020038 char *iface;
39 char *namespace;
Willy Tarreaua6473ed2020-08-28 16:35:06 +020040 int if_namelen;
41 int ns_namelen;
Willy Tarreau063d47d2020-08-28 16:29:53 +020042 struct xfer_sock_list *prev;
43 struct xfer_sock_list *next;
44 struct sockaddr_storage addr;
45};
46
47#endif /* _HAPROXY_SOCK_T_H */
48
49/*
50 * Local variables:
51 * c-indent-level: 8
52 * c-basic-offset: 8
53 * End:
54 */