summaryrefslogtreecommitdiff
path: root/src/inspircd.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-06 15:26:16 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-06 15:26:16 +0000
commita9621bc98996e08d86734e6848de13223341ea64 (patch)
tree640e5bf984b9efbc53be3f7f4e62f34f62eee3da /src/inspircd.cpp
parentd07d41bf93ea6970e0b574c64c694abc6e3cd54c (diff)
Fix CIDR functions so they work
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4731 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r--src/inspircd.cpp59
1 files changed, 6 insertions, 53 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index a34f438f9..09cd74d69 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -940,61 +940,14 @@ int InspIRCd::Run()
int main(int argc, char** argv)
{
- /* TEST SUITE FOR TOKENSTREAM
- *
- * Expected output:
- *
- * String: 'PRIVMSG #test FOO BAR'
- * Token 0 = 'PRIVMSG'
- * Token 1 = '#test'
- * Token 2 = 'FOO'
- * Token 3 = 'BAR'
- * String: 'PRIVMSG #test :FOO BAR BAZ'
- * Token 0 = 'PRIVMSG'
- * Token 1 = '#test'
- * Token 2 = 'FOO BAR BAZ'
- * String: ':PRIVMSG #test :FOO BAR BAZ'
- * Token 0 = ':PRIVMSG'
- * String: 'AAAAAAA'
- * Token 0 = 'AAAAAAA'
- * String: ''
- * NumItems = 0
- *
- std::string a = "PRIVMSG #test FOO BAR";
- printf("String: '%s'\n",a.c_str());
- irc::tokenstream test(a);
- printf("Token 0 = '%s'\n",test.GetToken().c_str());
- printf("Token 1 = '%s'\n",test.GetToken().c_str());
- printf("Token 2 = '%s'\n",test.GetToken().c_str());
- printf("Token 3 = '%s'\n",test.GetToken().c_str());
- printf("Token 4 = '%s'\n",test.GetToken().c_str());
-
- std::string b = "PRIVMSG #test :FOO BAR BAZ";
- printf("String: '%s'\n",b.c_str());
- irc::tokenstream test2(b);
- printf("Token 0 = '%s'\n",test2.GetToken().c_str());
- printf("Token 1 = '%s'\n",test2.GetToken().c_str());
- printf("Token 2 = '%s'\n",test2.GetToken().c_str());
- printf("Token 3 = '%s'\n",test2.GetToken().c_str());
-
- std::string c = ":PRIVMSG #test :FOO BAR BAZ";
- printf("String: '%s'\n",c.c_str());
- irc::tokenstream test3(c);
- printf("Token 0 = '%s'\n",test3.GetToken().c_str());
-
- c = "AAAAAAA";
- printf("String: '%s'\n",c.c_str());
- irc::tokenstream test4(c);
- printf("Token 0 = '%s'\n",test4.GetToken().c_str());
- printf("Token 1 = '%s'\n",test4.GetToken().c_str());
-
- c = "";
- printf("String: '%s'\n",c.c_str());
- irc::tokenstream test5(c);
- printf("Token 0 = '%s'\n",test5.GetToken().c_str());
+
+ unsigned char addr[] = {0xCC,0xAA,0xCC,0xAA};
+ unsigned char mask[] = {0xCC,0xAA,0xC0,0xAA};
+
+ printf("%d",MatchCIDRBits(addr, mask, 20));
exit(0);
- */
+
try
{
ServerInstance = new InspIRCd(argc, argv);