+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#pragma once
+
+/** Stores a cached ban entry.
+ * Each ban has one of these hashed in a hash_map to make for faster removal
+ * of already-banned users in the case that they try to reconnect. As no wildcard
+ * matching is done on these IPs, the speed of the system is improved. These cache
+ * entries expire every few hours, which is a reasonable expiry for any reasonable
+ * sized network.
+ */
+class CoreExport BanCacheHit
+{
+ public:
+ /** Type of cached ban
+ */
+ std::string Type;
+ /** Reason, shown as quit message
+ */
+ std::string Reason;
+ /** Time that the ban expires at
+ */
+ time_t Expiry;
+
+ BanCacheHit(const std::string& type, const std::string& reason, time_t seconds);
+
+ bool IsPositive() const { return (!Reason.empty()); }
+};
+
+/** A manager for ban cache, which allocates and deallocates and checks cached bans.