MINOR: protocol: replace ctrl_type with xprt_type and clarify it
There's been some great confusion between proto_type, ctrl_type and
sock_type. It turns out that ctrl_type was improperly chosen because
it's not the control layer that is of this or that type, but the
transport layer, and it turns out that the transport layer doesn't
(normally) denaturate the underlying control layer, except for QUIC
which turns dgrams to streams. The fact that the SOCK_{DGRAM|STREAM}
set of values was used added to the confusion.
Let's replace it with xprt_type which reuses the later introduced
PROTO_TYPE_* values, and update the comments to explain which one
works at what level.
diff --git a/src/proto_udp.c b/src/proto_udp.c
index 3474d4e..542d287 100644
--- a/src/proto_udp.c
+++ b/src/proto_udp.c
@@ -49,7 +49,7 @@
.name = "udp4",
/* connection layer */
- .ctrl_type = SOCK_DGRAM,
+ .xprt_type = PROTO_TYPE_DGRAM,
.listen = udp_bind_listener,
.enable = udp_enable_listener,
.disable = udp_disable_listener,
@@ -83,7 +83,7 @@
.name = "udp6",
/* connection layer */
- .ctrl_type = SOCK_DGRAM,
+ .xprt_type = PROTO_TYPE_DGRAM,
.listen = udp_bind_listener,
.enable = udp_enable_listener,
.disable = udp_disable_listener,