Willy Tarreau | 063d47d | 2020-08-28 16:29:53 +0200 | [diff] [blame] | 1 | /* |
| 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 Tarreau | a2c1787 | 2020-08-28 19:09:19 +0200 | [diff] [blame] | 30 | #define SOCK_XFER_OPT_FOREIGN 0x000000001 |
| 31 | #define SOCK_XFER_OPT_V6ONLY 0x000000002 |
Willy Tarreau | 9dbb6c4 | 2020-08-28 19:20:23 +0200 | [diff] [blame] | 32 | #define SOCK_XFER_OPT_DGRAM 0x000000004 |
Willy Tarreau | a2c1787 | 2020-08-28 19:09:19 +0200 | [diff] [blame] | 33 | |
Willy Tarreau | 063d47d | 2020-08-28 16:29:53 +0200 | [diff] [blame] | 34 | /* The list used to transfer sockets between old and new processes */ |
| 35 | struct xfer_sock_list { |
| 36 | int fd; |
Willy Tarreau | a2c1787 | 2020-08-28 19:09:19 +0200 | [diff] [blame] | 37 | int options; /* socket options as SOCK_XFER_OPT_* */ |
Willy Tarreau | 063d47d | 2020-08-28 16:29:53 +0200 | [diff] [blame] | 38 | char *iface; |
| 39 | char *namespace; |
Willy Tarreau | a6473ed | 2020-08-28 16:35:06 +0200 | [diff] [blame] | 40 | int if_namelen; |
| 41 | int ns_namelen; |
Willy Tarreau | 063d47d | 2020-08-28 16:29:53 +0200 | [diff] [blame] | 42 | 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 | */ |