]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG: dgram: rename proto_udp to dgram
authorWilly Tarreau <w@1wt.eu>
Thu, 11 Jun 2020 07:23:02 +0000 (09:23 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 11 Jun 2020 08:18:59 +0000 (10:18 +0200)
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_".

Makefile
include/haproxy/dgram-t.h [moved from include/haproxy/proto_udp-t.h with 88% similarity]
include/haproxy/dgram.h [moved from include/haproxy/proto_udp.h with 78% similarity]
include/haproxy/dns-t.h
src/check.c
src/dgram.c [moved from src/proto_udp.c with 90% similarity]
src/dns.c
src/tools.c

index 53136be21357fb31c3740fc6a98cd44831f2b3ed..681fe39549ff000772dde97995ed9783dba404ef 100644 (file)
--- 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),)
similarity index 88%
rename from include/haproxy/proto_udp-t.h
rename to include/haproxy/dgram-t.h
index 04f8708b51af1a0d35021ddbc06162bd1c0f5663..1a6f4c83a969c5d90479b0df68ce04f5c966aea1 100644 (file)
@@ -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 <bedis9@gmail.com>
  *
@@ -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 <arpa/inet.h>
 
@@ -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 */
similarity index 78%
rename from include/haproxy/proto_udp.h
rename to include/haproxy/dgram.h
index 9f7178c192a05ebcaa9da05914e3a9a87bf62e32..92d00ab11aca5c75fcb22cbac09e85dd7d3b42af 100644 (file)
@@ -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 <bedis9@gmail.com>
  *
  * 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 <haproxy/dgram-t.h>
 
 void dgram_fd_handler(int);
 
-#endif // _HAPROXY_PROTO_UDP_H
+#endif // _HAPROXY_PROTO_DGRAM_H
index 9ba60012cf2b653fd833123bfe0752832fe366ba..b1b43976cc3bde89293443ca58314c7f8380d6c8 100644 (file)
@@ -25,8 +25,8 @@
 #include <import/eb32tree.h>
 
 #include <haproxy/connection-t.h>
+#include <haproxy/dgram-t.h>
 #include <haproxy/obj_type-t.h>
-#include <haproxy/proto_udp-t.h>
 #include <haproxy/task-t.h>
 #include <haproxy/thread.h>
 
index 1a9938d64305d26712510d777e8bb3fd4a732895..18f83fa1b0a0fff2c5669c638398b4a747bd6e81 100644 (file)
@@ -35,6 +35,7 @@
 #include <haproxy/cfgparse.h>
 #include <haproxy/check.h>
 #include <haproxy/chunk.h>
+#include <haproxy/dgram.h>
 #include <haproxy/dns.h>
 #include <haproxy/extcheck.h>
 #include <haproxy/fd.h>
@@ -49,7 +50,6 @@
 #include <haproxy/mailers.h>
 #include <haproxy/port_range.h>
 #include <haproxy/proto_tcp.h>
-#include <haproxy/proto_udp.h>
 #include <haproxy/protocol.h>
 #include <haproxy/proxy.h>
 #include <haproxy/queue.h>
similarity index 90%
rename from src/proto_udp.c
rename to src/dgram.c
index f5202f816b10aa08b20839849b67ed4427d79a96..54823d157fdf11f39e0067f117f22fed54e782eb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * UDP protocol related functions
+ * Datagram processing functions
  *
  * Copyright 2014 Baptiste Assmann <bedis9@gmail.com>
  *
@@ -11,7 +11,7 @@
  */
 
 #include <haproxy/fd.h>
-#include <haproxy/proto_udp-t.h>
+#include <haproxy/dgram.h>
 
 /* datagram handler callback */
 void dgram_fd_handler(int fd)
index 55b5a3716436a3190df4881bce80756ca7fd5f0e..6f951ab5a8a729001af2fcc3b6f717e239c81e77 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
@@ -25,6 +25,7 @@
 #include <haproxy/channel.h>
 #include <haproxy/check.h>
 #include <haproxy/cli.h>
+#include <haproxy/dgram.h>
 #include <haproxy/dns.h>
 #include <haproxy/errors.h>
 #include <haproxy/fd.h>
@@ -32,7 +33,6 @@
 #include <haproxy/http_rules.h>
 #include <haproxy/log.h>
 #include <haproxy/net_helper.h>
-#include <haproxy/proto_udp.h>
 #include <haproxy/proxy.h>
 #include <haproxy/sample.h>
 #include <haproxy/server.h>
index 0b7e77e7550e7ec8bd940a02d04a539dcab03cba..35936b55830601a7885f60e08eb0b67ad31cddb5 100644 (file)
 
 #include <haproxy/api.h>
 #include <haproxy/chunk.h>
+#include <haproxy/dgram.h>
 #include <haproxy/dns.h>
 #include <haproxy/global.h>
 #include <haproxy/hlua.h>
 #include <haproxy/listener.h>
 #include <haproxy/namespace.h>
-#include <haproxy/proto_udp.h>
 #include <haproxy/ssl_sock.h>
 #include <haproxy/stream_interface.h>
 #include <haproxy/task.h>