135 Commits

Author SHA1 Message Date
Sadie Powell
579a17df38 Clean up a bunch of contructors and destructors. 2020-11-01 02:22:41 +00:00
Sadie Powell
1b181b42b8 Convert ConfigTag from reference<> to std::shared_ptr<>. 2020-10-31 23:21:15 +00:00
Sadie Powell
e1ed9b275f Merge branch 'insp3' into master. 2020-04-09 18:06:50 +01:00
Sadie Powell
9ebda853f5 Fix various documentation and formatting issues. 2020-03-30 17:24:12 +01:00
Sadie Powell
1de6f5b4a9 Merge branch 'insp3' into master. 2020-01-17 12:36:09 +00:00
InspIRCd Robot
aa692dc103 Update copyright headers. 2020-01-11 22:14:43 +00:00
Sadie Powell
f856d5ab8a Merge branch 'insp3' into master. 2020-01-01 12:33:10 +01:00
Peter Powell
ce7979bd7d Extract port binding code to a function and improve output. 2019-12-12 14:37:38 +00:00
Sadie Powell
cd8b456f97 Merge branch 'insp3' into master. 2019-07-16 16:48:18 +01:00
Peter Powell
33932b95e4 Add irc::sockets::isunix for checking if a file is a UNIX socket. 2019-05-29 17:50:49 +01:00
Sadie Powell
e75f03d32f Merge branch 'insp3' into master. 2019-02-15 16:24:02 +00:00
Peter Powell
499121036c Add irc::sockets::untosa() for creating AF_UNIX sockaddrs.
Also fix an overly long albeit harmless memcpy when creating UNIX
socket listeners. Thanks to @psychon for reporting this.
2019-02-07 15:38:44 +00:00
Sadie Powell
c78ecdf579 Replace the override macro with the override keyword. 2019-01-25 02:52:11 +00:00
Sadie Powell
fb17bba197 Replace the TR1NS macro with the std namespace. 2019-01-25 02:49:03 +00:00
Peter Powell
b7716ed577 Initial support for listening on UNIX socket endpoints. 2018-07-18 19:22:17 +01:00
Peter Powell
87e328a1fb Add the family() member to the sockaddrs union. 2018-07-18 19:21:45 +01:00
Peter Powell
36040be295 Fix a ton of -Wsign-conversion warnings. 2017-11-17 15:33:01 +00:00
Peter Powell
5a378e8954 Change FailedPortList to store a sockaddrs/int instead of string. 2017-09-12 15:05:24 +01:00
Peter Powell
fb13dca410 Store the server endpoint as a sockaddrs in ListenSocket. 2017-09-12 15:05:24 +01:00
Peter Powell
3b595d39a5 Get rid of irc::sockets::satoap().
This function is being misused in all but one scenario. It isn't
really worth keeping IMO.
2017-09-12 15:05:24 +01:00
Attila Molnar
8dbd80610a Keep multiple IOHookProvider references in class ListenSocket
This adds the <bind:hook> config option which works together with <bind:ssl>
2016-08-08 15:10:43 +02:00
Attila Molnar
2b3b0ce142 Change return type of ListenSocket::ResetIOHookProvider() to void
No code was using the return value
2016-08-08 15:06:41 +02:00
Attila Molnar
019914b67d Predeclare IOHookProvider, remove iohook.h include from socket.h 2016-08-08 14:24:40 +02:00
Attila Molnar
612384b3d4 Dispatch EventHandler events to dedicated virtual functions
Remove enum EventType
2015-04-12 16:20:13 +02:00
Attila Molnar
99f79a4e5c Split IOHook into IOHook and IOHookProvider
Create one IOHook instance for each hooked socket which contains all the
hook specific data and read/write/close functions, removing the need for
the "issl_session" array in SSL modules.

Register instances of the IOHookProvider class in the core and use them to
create specialized IOHook instances (OnConnect/OnAccept).

Remove the OnHookIO hook, add a dynamic reference to ListenSocket that
points to the hook provider (if any) to use for incoming connections on
that socket.

For outgoing connections modules still have to find the IOHookProvider
they want to use themselves but instead of calling AddIOHook(hookprov),
now they have to call IOHookProvider::OnConnect() after the connection
has been established.
2014-01-22 19:10:01 +01:00
Peter Powell
07d0d8f52f Remove some pointless code:
- Remove the CHARSET entry from ISUPPORT.

  CHARSET was removed in draft-brocklesby-irc-isupport-03 and we
  always used the default value anyway. This has also been removed
  in the latest version of Charybdis.

- Remove irc::sockets::satouser.

  This helper method was longer than the code it replaced.
2013-12-15 06:46:44 +00:00
Adam
8428bbb387 Modularize DNS
The DNS modules are temporarily in commands/ so they're loaded automatically

Thanks to Attila for helping with much of this.
2013-04-26 16:59:29 -05:00
Peter Powell
11cafc12d5 Tidy up source files:
- Use #pragma once instead of include guards.
- Move header files in src/modules to include/modules.
- Fixed various spacing issues.
2013-04-12 17:03:05 +01:00
ChrisTX
5b9682275e Windows: In-depth cleanup (see details)
-Fix x64 builds for Windows. Now all configurations compile.
-Remove the non-working rebase stuff.
-Remove the Windows fork hack and instead use FreeConsole() to emulate the behavior. This directly allows us to compile with ASLR, which is turned on now.
-Remove the old IPC mechanism for the removed GUI. This is not needed anymore as the GUI wasn't ever supported on anything newer than 1.2
-Remove the WIN32/WINDOWS macros. _WIN32 is supported on all x86-based VC++ targets, so that's what we need.
-Enable optimizations for release builds.
-De-duplicate printf_c(), it was previously copy-pasted into colors.h for configure
-Add the VC++ specific bad files in .gitignore
-Disable PID writing on Windows. This is only making sense for *nix builds.
-Replace the CPU usage retrieval with an algorithm analogous to the *nix behavior. Also supports separated now/total values. (Tested with a dummy busy loop - seems working)
-Removed certain unused functions and variables
-Remove stdint defines from the windows wrapper
-Remove CRT debug alloc. This is a bad idea as it would define a macro to replace free which breaks builds.
-Re-evaluated the warnings list, commented it.
-Moved inspircd_config/_version to include/ to match *nix
-Removed the creation of inspircd_se_config, as it isn't used at all.
-Made non-git builds show as "r0" instead of "r" (thanks to @SaberUK for pointing this out)
-Fixed up m_spanningtree's project paths. Now all configurations (debug/release x86/x64) have been tested and build properly.
-Moved FindDNS out of the wrapper and matched its log behavior with *nix. (It's pointless having it in the wrapper after the recent slimming down)
-Replaced random/srandom wrappers with a mechanism that tries to use Windows' Random API first is no SSL module is loaded.
-Removed more old junk from support for compilers older than VC++ 2010 (we don't have project files for these, so compiling them would be hard anyways)
-Removed the unused ClearConsole()
-Removed unused includes from the wrapper. Also, do not include psapi.h here if we don't link psapi.lib. This should be done where appropriate.
-Made inet_aton an inline function for increased performance
-C4800, performance warning about bool forcing, resolved at all occurrences.
-C4701, uninitialized variable 'cached', resolved at all occurrences.
-dlerror() was migrated out of the wrapper for more thread safety (no global buffer being shared) and increased performance.
-Removed the wrong CRT debug flags. This drains a lot of performance.
-Removed the clock_gettime/gettimeofday wrappers
-Replaced all TCHAR/ANSI mix-ups of functions with the correct respective function.
-Added a block of C4355 for < VS2012
-Update project files for c870714
2012-10-12 22:31:38 +02:00
Adam
c4a53990f0 Fix bug #291 - fix rehashing bind tags not changing them between servers/clients and ssl/nonssl 2012-09-12 16:56:47 -04:00
Peter Powell
808a0a0957 Fix Doxygen syntax errors. 2012-07-05 21:00:35 +01:00
Robby-
46a3904619 Replace copyright headers with headers granting specific authors copyright 2012-04-19 20:58:29 +02:00
Daniel De Graaf
dc203f9f20 Define comparator for irc::sockets::sockaddrs
This only compares IP/port, which ignores IPv6 flow information and
scope ID, which aren't important in testing for equality.
2010-04-26 19:08:43 -05:00
danieldg
d29ca254a4 Remove unneeded save of errno
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12309 e03df62e-2008-0410-955e-edbf42e46eb7
2010-01-21 20:47:02 +00:00
brain
cd712c40e1 ...because every now and again, i have to do a massive commit.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12248 e03df62e-2008-0410-955e-edbf42e46eb7
2010-01-11 03:07:32 +00:00
danieldg
800f02e759 Get rid of socklen_t parameter to Bind, we are using C++ here and can do it other ways
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12129 e03df62e-2008-0410-955e-edbf42e46eb7
2009-11-13 20:23:11 +00:00
danieldg
9c67795e73 Get rid of OpenTCPSocket
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11969 e03df62e-2008-0410-955e-edbf42e46eb7
2009-10-24 20:04:15 +00:00
danieldg
9fad3ecb92 Create irc::sockets::cidr_mask
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11968 e03df62e-2008-0410-955e-edbf42e46eb7
2009-10-24 20:04:05 +00:00
danieldg
6b2ea83367 Move forward declarations to typedefs.h
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11967 e03df62e-2008-0410-955e-edbf42e46eb7
2009-10-24 20:03:53 +00:00
danieldg
efc75198de Make ConfigTag::items private
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11956 e03df62e-2008-0410-955e-edbf42e46eb7
2009-10-22 22:29:35 +00:00
danieldg
b43fc66c17 Make irc::sockets::* parameters consistent, add irc::sockets::mask
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11953 e03df62e-2008-0410-955e-edbf42e46eb7
2009-10-22 21:49:39 +00:00
danieldg
d221de8827 Kill ListenSocketBase, use OnAcceptConnection for all new connections
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11950 e03df62e-2008-0410-955e-edbf42e46eb7
2009-10-21 23:46:33 +00:00
danieldg
b6a5e2bd14 Add server ports to ServerInstance->ports, enable SSL on them using OnHookIO
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11810 e03df62e-2008-0410-955e-edbf42e46eb7
2009-10-09 19:00:09 +00:00
danieldg
de25d94673 Get rid of a bunch of memory-wasting C-style strings
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11796 e03df62e-2008-0410-955e-edbf42e46eb7
2009-10-03 01:52:59 +00:00
danieldg
6d03943426 Remove InspIRCd* parameters and fields
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11763 e03df62e-2008-0410-955e-edbf42e46eb7
2009-09-26 14:13:13 +00:00
danieldg
e2af2347fc Create StreamSocket for IO hooking implementation
Fixes the SSL SendQ bug
Removes duplicate code between User and BufferedSocket
Simplify SSL module API
Simplify EventHandler API (Readable/Writeable moved to SE)
Add hook for culled objects to invoke callbacks prior to destructor
 Replace SocketCull with GlobalCull now that sockets can close themselves
Shorten common case of user read/parse/write path:
 User::Write is now zero-copy up to syscall/SSL invocation
 User::Read has only two copy/scan passes from read() to ProcessCommand

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11752 e03df62e-2008-0410-955e-edbf42e46eb7
2009-09-21 13:26:31 +00:00
danieldg
c32734fb23 Fix some ICC-found warnings and remove unused #define
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11639 e03df62e-2008-0410-955e-edbf42e46eb7
2009-09-02 00:50:35 +00:00
danieldg
06e0d5c7f0 Use a set to mark client SSL ports rather than going by textual IP/port pairs
This theoretically speeds up accepting connections. Visible changes are proper
IPv6 port text in 005 output and no possibility of incorrect SSL on addresses
that mismatch an incoming port (possible with IPv4 wildcard SSL and IPv6
plaintext on the same port, not that anyone would do such a thing). Bind ports
also now tell which SSL module they use in /stats p.

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11629 e03df62e-2008-0410-955e-edbf42e46eb7
2009-09-02 00:48:32 +00:00
danieldg
ca749a589a Add irc::sockets::satouser for user-readable IP/port pairs
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11627 e03df62e-2008-0410-955e-edbf42e46eb7
2009-09-02 00:48:16 +00:00
danieldg
16b8e22615 Use a bool return type for boolean return
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11585 e03df62e-2008-0410-955e-edbf42e46eb7
2009-09-01 15:08:30 +00:00