Willy Tarreau | 0d06df6 | 2020-08-28 15:10:11 +0200 | [diff] [blame] | 1 | /* |
| 2 | * include/haproxy/sock_inet.h |
| 3 | * This file contains declarations for AF_INET & AF_INET6 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_INET_H |
| 23 | #define _HAPROXY_SOCK_INET_H |
| 24 | |
| 25 | #include <sys/socket.h> |
| 26 | #include <sys/types.h> |
| 27 | |
| 28 | #include <haproxy/api.h> |
| 29 | |
Willy Tarreau | d88e8c0 | 2020-08-28 16:06:01 +0200 | [diff] [blame] | 30 | extern int sock_inet6_v6only_default; |
Willy Tarreau | e5bdc51 | 2020-08-28 18:03:10 +0200 | [diff] [blame] | 31 | extern int sock_inet_tcp_maxseg_default; |
| 32 | extern int sock_inet6_tcp_maxseg_default; |
Willy Tarreau | d88e8c0 | 2020-08-28 16:06:01 +0200 | [diff] [blame] | 33 | |
Willy Tarreau | b0254cb | 2020-09-04 08:07:11 +0200 | [diff] [blame] | 34 | extern struct proto_fam proto_fam_inet4; |
| 35 | extern struct proto_fam proto_fam_inet6; |
| 36 | |
Willy Tarreau | 0d06df6 | 2020-08-28 15:10:11 +0200 | [diff] [blame] | 37 | int sock_inet4_addrcmp(const struct sockaddr_storage *a, const struct sockaddr_storage *b); |
| 38 | int sock_inet6_addrcmp(const struct sockaddr_storage *a, const struct sockaddr_storage *b); |
Willy Tarreau | c5a94c9 | 2020-08-28 15:19:45 +0200 | [diff] [blame] | 39 | int sock_inet_get_dst(int fd, struct sockaddr *sa, socklen_t salen, int dir); |
Willy Tarreau | 25140cc | 2020-08-28 15:40:33 +0200 | [diff] [blame] | 40 | int sock_inet_is_foreign(int fd, sa_family_t family); |
Willy Tarreau | 37bafdc | 2020-08-28 17:23:40 +0200 | [diff] [blame] | 41 | int sock_inet4_make_foreign(int fd); |
| 42 | int sock_inet6_make_foreign(int fd); |
Willy Tarreau | 233ad28 | 2020-10-15 21:45:15 +0200 | [diff] [blame] | 43 | int sock_inet_bind_receiver(struct receiver *rx, char **errmsg); |
Willy Tarreau | 0d06df6 | 2020-08-28 15:10:11 +0200 | [diff] [blame] | 44 | |
| 45 | #endif /* _HAPROXY_SOCK_INET_H */ |