From a9b538041a2773f84da5a479849f3dc166171c97 Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 11 Nov 2006 15:46:00 +0000 Subject: Allow checking of overlapped ports. A bit of sensible thought prevents this from being O(n^2) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5694 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/hashcomp.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/hashcomp.h b/include/hashcomp.h index 013523df3..11a491d62 100644 --- a/include/hashcomp.h +++ b/include/hashcomp.h @@ -333,10 +333,22 @@ namespace irc /** Ending port in a range of ports */ long range_end; + /** Allow overlapped port ranges + */ + bool overlapped; + /** Used to determine overlapping of ports + * without O(n) algorithm being used + */ + std::map overlap_set; + /** Returns true if val overlaps an existing range + */ + bool Overlaps(long val); public: /** Create a portparser and fill it with the provided data + * @param source The source text to parse from + * @param allow_overlapped Allow overlapped ranges */ - portparser(const std::string &source); + portparser(const std::string &source, bool allow_overlapped = true); /** Frees the internal commasepstream object */ ~portparser(); -- cgit v1.2.3