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_".
This commit is contained in:
Willy Tarreau 2020-06-11 09:23:02 +02:00
parent e5793916f0
commit 7c18b54106
8 changed files with 19 additions and 17 deletions

View File

@ -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/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/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/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 src/hpack-huff.o src/base64.o src/version.o
ifneq ($(TRACE),) ifneq ($(TRACE),)

View File

@ -1,6 +1,6 @@
/* /*
* include/haproxy/proto_udp-t.h * include/haproxy/dgram-t.h
* This file provides structures and types for UDP protocol. * This file provides structures and types for datagram processing
* *
* Copyright (C) 2014 Baptiste Assmann <bedis9@gmail.com> * Copyright (C) 2014 Baptiste Assmann <bedis9@gmail.com>
* *
@ -19,8 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifndef _HAPROXY_HAPROXY_UDP_T_H #ifndef _HAPROXY_HAPROXY_DGRAM_T_H
#define _HAPROXY_HAPROXY_UDP_T_H #define _HAPROXY_HAPROXY_DGRAM_T_H
#include <arpa/inet.h> #include <arpa/inet.h>
@ -49,4 +49,4 @@ struct dgram_data_cb {
void (*send)(struct dgram_conn *dgram); /* send callback */ void (*send)(struct dgram_conn *dgram); /* send callback */
}; };
#endif /* _HAPROXY_HAPROXY_UDP_T_H */ #endif /* _HAPROXY_HAPROXY_DGRAM_T_H */

View File

@ -1,6 +1,6 @@
/* /*
* include/haproxy/proto_udp.h * include/haproxy/proto_dgram.h
* This file provides functions related to UDP protocol. * This file provides functions related to DGRAM processing.
* *
* Copyright (C) 2014 Baptiste Assmann <bedis9@gmail.com> * Copyright (C) 2014 Baptiste Assmann <bedis9@gmail.com>
* *
@ -19,9 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifndef _HAPROXY_PROTO_UDP_H #ifndef _HAPROXY_PROTO_DGRAM_H
#define _HAPROXY_PROTO_UDP_H #define _HAPROXY_PROTO_DGRAM_H
#include <haproxy/dgram-t.h>
void dgram_fd_handler(int); void dgram_fd_handler(int);
#endif // _HAPROXY_PROTO_UDP_H #endif // _HAPROXY_PROTO_DGRAM_H

View File

@ -25,8 +25,8 @@
#include <import/eb32tree.h> #include <import/eb32tree.h>
#include <haproxy/connection-t.h> #include <haproxy/connection-t.h>
#include <haproxy/dgram-t.h>
#include <haproxy/obj_type-t.h> #include <haproxy/obj_type-t.h>
#include <haproxy/proto_udp-t.h>
#include <haproxy/task-t.h> #include <haproxy/task-t.h>
#include <haproxy/thread.h> #include <haproxy/thread.h>

View File

@ -35,6 +35,7 @@
#include <haproxy/cfgparse.h> #include <haproxy/cfgparse.h>
#include <haproxy/check.h> #include <haproxy/check.h>
#include <haproxy/chunk.h> #include <haproxy/chunk.h>
#include <haproxy/dgram.h>
#include <haproxy/dns.h> #include <haproxy/dns.h>
#include <haproxy/extcheck.h> #include <haproxy/extcheck.h>
#include <haproxy/fd.h> #include <haproxy/fd.h>
@ -49,7 +50,6 @@
#include <haproxy/mailers.h> #include <haproxy/mailers.h>
#include <haproxy/port_range.h> #include <haproxy/port_range.h>
#include <haproxy/proto_tcp.h> #include <haproxy/proto_tcp.h>
#include <haproxy/proto_udp.h>
#include <haproxy/protocol.h> #include <haproxy/protocol.h>
#include <haproxy/proxy.h> #include <haproxy/proxy.h>
#include <haproxy/queue.h> #include <haproxy/queue.h>

View File

@ -1,5 +1,5 @@
/* /*
* UDP protocol related functions * Datagram processing functions
* *
* Copyright 2014 Baptiste Assmann <bedis9@gmail.com> * Copyright 2014 Baptiste Assmann <bedis9@gmail.com>
* *
@ -11,7 +11,7 @@
*/ */
#include <haproxy/fd.h> #include <haproxy/fd.h>
#include <haproxy/proto_udp-t.h> #include <haproxy/dgram.h>
/* datagram handler callback */ /* datagram handler callback */
void dgram_fd_handler(int fd) void dgram_fd_handler(int fd)

View File

@ -25,6 +25,7 @@
#include <haproxy/channel.h> #include <haproxy/channel.h>
#include <haproxy/check.h> #include <haproxy/check.h>
#include <haproxy/cli.h> #include <haproxy/cli.h>
#include <haproxy/dgram.h>
#include <haproxy/dns.h> #include <haproxy/dns.h>
#include <haproxy/errors.h> #include <haproxy/errors.h>
#include <haproxy/fd.h> #include <haproxy/fd.h>
@ -32,7 +33,6 @@
#include <haproxy/http_rules.h> #include <haproxy/http_rules.h>
#include <haproxy/log.h> #include <haproxy/log.h>
#include <haproxy/net_helper.h> #include <haproxy/net_helper.h>
#include <haproxy/proto_udp.h>
#include <haproxy/proxy.h> #include <haproxy/proxy.h>
#include <haproxy/sample.h> #include <haproxy/sample.h>
#include <haproxy/server.h> #include <haproxy/server.h>

View File

@ -41,12 +41,12 @@
#include <haproxy/api.h> #include <haproxy/api.h>
#include <haproxy/chunk.h> #include <haproxy/chunk.h>
#include <haproxy/dgram.h>
#include <haproxy/dns.h> #include <haproxy/dns.h>
#include <haproxy/global.h> #include <haproxy/global.h>
#include <haproxy/hlua.h> #include <haproxy/hlua.h>
#include <haproxy/listener.h> #include <haproxy/listener.h>
#include <haproxy/namespace.h> #include <haproxy/namespace.h>
#include <haproxy/proto_udp.h>
#include <haproxy/ssl_sock.h> #include <haproxy/ssl_sock.h>
#include <haproxy/stream_interface.h> #include <haproxy/stream_interface.h>
#include <haproxy/task.h> #include <haproxy/task.h>