#define _HAPROXY_PROTO_SOCKPAIR_H
extern struct proto_fam proto_fam_sockpair;
+extern struct protocol proto_sockpair;
int recv_fd_uxst(int sock);
int send_fd_uxst(int fd, int send_fd);
#include <haproxy/listener-t.h>
#include <haproxy/sample-t.h>
+extern struct protocol proto_tcp4;
+extern struct protocol proto_tcp6;
+
int tcp_bind_socket(int fd, int flags, struct sockaddr_storage *local, struct sockaddr_storage *remote);
int tcp_connect_server(struct connection *conn, int flags);
int tcp_is_foreign(int fd, sa_family_t family);
/*
- * include/proto/proto_udp.h
+ * include/haproxy/proto_udp.h
* This file contains UDP socket protocol definitions.
*
* Copyright 2019 HAProxy Technologies, Frédéric Lécaille <flecaille@haproxy.com>
#ifndef _PROTO_PROTO_UDP_H
#define _PROTO_PROTO_UDP_H
+extern struct protocol proto_udp4;
+extern struct protocol proto_udp6;
+
int udp_bind_socket(int fd, int flags, struct sockaddr_storage *local, struct sockaddr_storage *remote);
#endif /* _PROTO_PROTO_UDP_H */
--- /dev/null
+/*
+ * include/haproxy/proto_uxst.h
+ * This file contains UNIX stream socket protocol definitions.
+ *
+ * Copyright (C) 2000-2013 Willy Tarreau - w@1wt.eu
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation, version 2.1
+ * exclusively.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _PROTO_PROTO_UXST_H
+#define _PROTO_PROTO_UXST_H
+
+extern struct protocol proto_uxst;
+
+#endif /* _PROTO_PROTO_UXST_H */
+
+/*
+ * Local variables:
+ * c-indent-level: 8
+ * c-basic-offset: 8
+ * End:
+ */
};
/* Note: must not be declared <const> as its list will be overwritten */
-static struct protocol proto_sockpair = {
+struct protocol proto_sockpair = {
.name = "sockpair",
.fam = &proto_fam_sockpair,
.ctrl_type = SOCK_STREAM,
static void tcp_disable_listener(struct listener *listener);
/* Note: must not be declared <const> as its list will be overwritten */
-static struct protocol proto_tcpv4 = {
+struct protocol proto_tcpv4 = {
.name = "tcpv4",
.fam = &proto_fam_inet4,
.ctrl_type = SOCK_STREAM,
INITCALL1(STG_REGISTER, protocol_register, &proto_tcpv4);
/* Note: must not be declared <const> as its list will be overwritten */
-static struct protocol proto_tcpv6 = {
+struct protocol proto_tcpv6 = {
.name = "tcpv6",
.fam = &proto_fam_inet6,
.ctrl_type = SOCK_STREAM,
static void udp_disable_listener(struct listener *listener);
/* Note: must not be declared <const> as its list will be overwritten */
-static struct protocol proto_udp4 = {
+struct protocol proto_udp4 = {
.name = "udp4",
.fam = &proto_fam_inet4,
.ctrl_type = SOCK_DGRAM,
INITCALL1(STG_REGISTER, protocol_register, &proto_udp4);
/* Note: must not be declared <const> as its list will be overwritten */
-static struct protocol proto_udp6 = {
+struct protocol proto_udp6 = {
.name = "udp6",
.fam = &proto_fam_inet6,
.ctrl_type = SOCK_DGRAM,
#include <haproxy/listener.h>
#include <haproxy/log.h>
#include <haproxy/protocol.h>
+#include <haproxy/proto_uxst.h>
#include <haproxy/sock.h>
#include <haproxy/sock_unix.h>
#include <haproxy/time.h>
static int uxst_suspend_receiver(struct receiver *rx);
/* Note: must not be declared <const> as its list will be overwritten */
-static struct protocol proto_unix = {
+struct protocol proto_uxst = {
.name = "unix_stream",
.fam = &proto_fam_unix,
.ctrl_type = SOCK_STREAM,
.rx_listening = sock_accepting_conn,
.default_iocb = &sock_accept_iocb,
.connect = &uxst_connect_server,
- .receivers = LIST_HEAD_INIT(proto_unix.receivers),
+ .receivers = LIST_HEAD_INIT(proto_uxst.receivers),
.nb_receivers = 0,
};
-INITCALL1(STG_REGISTER, protocol_register, &proto_unix);
+INITCALL1(STG_REGISTER, protocol_register, &proto_uxst);
/********************************
* 1) low-level socket functions