From: Willy Tarreau Date: Thu, 11 Jun 2020 07:23:02 +0000 (+0200) Subject: REORG: dgram: rename proto_udp to dgram X-Git-Tag: v2.2-dev9~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7c18b54106ec21273aea3fe59ba23280e86821f5;p=thirdparty%2Fhaproxy.git REORG: dgram: rename proto_udp to dgram The set of files proto_udp.{c,h} were misleadingly named, as they do not provide anything related to the UDP protocol but to datagram handling instead, since currently all UDP processing is hard-coded where it's used (dns, logs). They are to UDP what connection.{c,h} are to proto_tcp. This was causing confusion about how to insert UDP socket management code, so let's rename them right now to dgram.{c,h} which more accurately matches what's inside since every function and type is already prefixed with "dgram_". --- diff --git a/Makefile b/Makefile index 53136be213..681fe39549 100644 --- a/Makefile +++ b/Makefile @@ -816,7 +816,7 @@ OBJS = src/mux_fcgi.o src/mux_h1.o src/mux_h2.o src/backend.o \ src/buffer.o src/uri_auth.o src/protocol.o src/auth.o \ src/ebsttree.o src/pipe.o src/hpack-enc.o src/fcgi.o \ src/eb64tree.o src/dict.o src/shctx.o src/ebimtree.o \ - src/eb32tree.o src/ebtree.o src/proto_udp.o \ + src/eb32tree.o src/ebtree.o src/dgram.o \ src/hpack-huff.o src/base64.o src/version.o ifneq ($(TRACE),) diff --git a/include/haproxy/proto_udp-t.h b/include/haproxy/dgram-t.h similarity index 88% rename from include/haproxy/proto_udp-t.h rename to include/haproxy/dgram-t.h index 04f8708b51..1a6f4c83a9 100644 --- a/include/haproxy/proto_udp-t.h +++ b/include/haproxy/dgram-t.h @@ -1,6 +1,6 @@ /* - * include/haproxy/proto_udp-t.h - * This file provides structures and types for UDP protocol. + * include/haproxy/dgram-t.h + * This file provides structures and types for datagram processing * * Copyright (C) 2014 Baptiste Assmann * @@ -19,8 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _HAPROXY_HAPROXY_UDP_T_H -#define _HAPROXY_HAPROXY_UDP_T_H +#ifndef _HAPROXY_HAPROXY_DGRAM_T_H +#define _HAPROXY_HAPROXY_DGRAM_T_H #include @@ -49,4 +49,4 @@ struct dgram_data_cb { void (*send)(struct dgram_conn *dgram); /* send callback */ }; -#endif /* _HAPROXY_HAPROXY_UDP_T_H */ +#endif /* _HAPROXY_HAPROXY_DGRAM_T_H */ diff --git a/include/haproxy/proto_udp.h b/include/haproxy/dgram.h similarity index 78% rename from include/haproxy/proto_udp.h rename to include/haproxy/dgram.h index 9f7178c192..92d00ab11a 100644 --- a/include/haproxy/proto_udp.h +++ b/include/haproxy/dgram.h @@ -1,6 +1,6 @@ /* - * include/haproxy/proto_udp.h - * This file provides functions related to UDP protocol. + * include/haproxy/proto_dgram.h + * This file provides functions related to DGRAM processing. * * Copyright (C) 2014 Baptiste Assmann * @@ -19,9 +19,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _HAPROXY_PROTO_UDP_H -#define _HAPROXY_PROTO_UDP_H +#ifndef _HAPROXY_PROTO_DGRAM_H +#define _HAPROXY_PROTO_DGRAM_H + +#include void dgram_fd_handler(int); -#endif // _HAPROXY_PROTO_UDP_H +#endif // _HAPROXY_PROTO_DGRAM_H diff --git a/include/haproxy/dns-t.h b/include/haproxy/dns-t.h index 9ba60012cf..b1b43976cc 100644 --- a/include/haproxy/dns-t.h +++ b/include/haproxy/dns-t.h @@ -25,8 +25,8 @@ #include #include +#include #include -#include #include #include diff --git a/src/check.c b/src/check.c index 1a9938d643..18f83fa1b0 100644 --- a/src/check.c +++ b/src/check.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -49,7 +50,6 @@ #include #include #include -#include #include #include #include diff --git a/src/proto_udp.c b/src/dgram.c similarity index 90% rename from src/proto_udp.c rename to src/dgram.c index f5202f816b..54823d157f 100644 --- a/src/proto_udp.c +++ b/src/dgram.c @@ -1,5 +1,5 @@ /* - * UDP protocol related functions + * Datagram processing functions * * Copyright 2014 Baptiste Assmann * @@ -11,7 +11,7 @@ */ #include -#include +#include /* datagram handler callback */ void dgram_fd_handler(int fd) diff --git a/src/dns.c b/src/dns.c index 55b5a37164..6f951ab5a8 100644 --- a/src/dns.c +++ b/src/dns.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -32,7 +33,6 @@ #include #include #include -#include #include #include #include diff --git a/src/tools.c b/src/tools.c index 0b7e77e755..35936b5583 100644 --- a/src/tools.c +++ b/src/tools.c @@ -41,12 +41,12 @@ #include #include +#include #include #include #include #include #include -#include #include #include #include