|
|||
|
|||
|
#include <hashcomp.h>
Inheritance diagram for irc::portparser:


Public Member Functions | |
| portparser (const std::string &source, bool allow_overlapped=true) | |
| Create a portparser and fill it with the provided data. | |
| ~portparser () | |
| Frees the internal commasepstream object. | |
| long | GetToken () |
| Fetch the next token from the stream. | |
Private Member Functions | |
| bool | Overlaps (long val) |
| Returns true if val overlaps an existing range. | |
Private Attributes | |
| commasepstream * | sep |
| Used to split on commas. | |
| long | in_range |
| Current position in a range of ports. | |
| long | range_begin |
| Starting port in a range of ports. | |
| long | range_end |
| Ending port in a range of ports. | |
| bool | overlapped |
| Allow overlapped port ranges. | |
| std::map< long, bool > | overlap_set |
| Used to determine overlapping of ports without O(n) algorithm being used. | |
A port range may be specified in the input string in the form "6660,6661,6662-6669,7020". The end of the stream is indicated by a return value of 0 from portparser::GetToken(). If you attempt to specify an illegal range (e.g. one where start >= end, or start or end < 0) then GetToken() will return the first element of the pair of numbers.
Definition at line 390 of file hashcomp.h.
|
||||||||||||
|
Create a portparser and fill it with the provided data.
Definition at line 418 of file hashcomp.cpp. References overlap_set, and sep. |
|
|
Frees the internal commasepstream object.
Definition at line 424 of file hashcomp.cpp. References sep. |
|
|
Fetch the next token from the stream.
Definition at line 443 of file hashcomp.cpp. References irc::sepstream::GetToken(), in_range, Overlaps(), range_begin, range_end, and sep. Referenced by InspIRCd::BindPorts(), ModuleXMLSocket::OnRehash(), ModuleSSLOpenSSL::OnRehash(), ModuleSSLGnuTLS::OnRehash(), ModuleHostChange::OnUserConnect(), ModuleDNSBL::ReadConf(), and SpanningTreeUtilities::ReadConfiguration(). |
|
|
Returns true if val overlaps an existing range.
Definition at line 429 of file hashcomp.cpp. References overlap_set, and overlapped. Referenced by GetToken(). |
|
|
Current position in a range of ports.
Definition at line 398 of file hashcomp.h. Referenced by GetToken(). |
|
|
Used to determine overlapping of ports without O(n) algorithm being used.
Definition at line 411 of file hashcomp.h. Referenced by Overlaps(), and portparser(). |
|
|
Allow overlapped port ranges.
Definition at line 407 of file hashcomp.h. Referenced by Overlaps(). |
|
|
Starting port in a range of ports.
Definition at line 401 of file hashcomp.h. Referenced by GetToken(). |
|
|
Ending port in a range of ports.
Definition at line 404 of file hashcomp.h. Referenced by GetToken(). |
|
|
Used to split on commas.
Definition at line 395 of file hashcomp.h. Referenced by GetToken(), portparser(), and ~portparser(). |