From edb7101e6a01f449350a45ee92d5a15abb7bc4bb Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Wed, 19 Jun 2024 15:08:20 +0100 Subject: Default to PROTO_NEWEST if no protocol is negotiated. --- src/modules/m_spanningtree/treesocket.h | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'src/modules/m_spanningtree/treesocket.h') diff --git a/src/modules/m_spanningtree/treesocket.h b/src/modules/m_spanningtree/treesocket.h index de1bd1212..ded461c3b 100644 --- a/src/modules/m_spanningtree/treesocket.h +++ b/src/modules/m_spanningtree/treesocket.h @@ -31,6 +31,27 @@ #include "utils.h" +/** An enumeration of all known protocol versions. + * + * If you introduce new protocol versions please document them here: + * https://docs.inspircd.org/server/change-log/ + */ +enum ProtocolVersion + : uint16_t +{ + /** The linking protocol version introduced in InspIRCd v3.0. */ + PROTO_INSPIRCD_3 = 1205, + + /** The linking protocol version introduced in InspIRCd v4.0. */ + PROTO_INSPIRCD_4 = 1206, + + /** The oldest version of the protocol that we support. */ + PROTO_OLDEST = PROTO_INSPIRCD_3, + + /** The newest version of the protocol that we support. */ + PROTO_NEWEST = PROTO_INSPIRCD_4 +}; + /* * The server list in InspIRCd is maintained as two structures * which hold the data in different ways. Most of the time, we @@ -183,7 +204,7 @@ public: const time_t age; // The protocol version which has been negotiated with the remote server. - uint16_t proto_version = 0; + uint16_t proto_version = PROTO_NEWEST; /** Because most of the I/O gubbins are encapsulated within * BufferedSocket, we just call the superclass constructor for -- cgit v1.3.1-10-gc9f91