159 Commits

Author SHA1 Message Date
Sadie Powell
dad3eaa2da Add a helper method for determining if a sockaddrs is an IP endpoint. 2023-01-17 02:46:53 +00:00
Sadie Powell
a99a38a3ad Allow creating a FailedPort without a bindspec. 2023-01-17 00:37:14 +00:00
Sadie Powell
612e1a3027 Store the actual error in FailedPort instead of an error code. 2023-01-16 22:54:02 +00:00
Sadie Powell
8856210499 Add support for SCTP listeners. 2023-01-16 21:15:55 +00:00
Sadie Powell
1b2916c845 Avoid copying shared_ptr<ConfigTag> when not necessary. 2023-01-10 21:27:18 +00:00
Sadie Powell
d048778f78 Merge branch 'insp3' into master. 2023-01-01 13:19:45 +00:00
InspIRCd Robot
2b810b412a Update copyright headers. 2022-12-30 11:31:28 +00:00
Sadie Powell
2ddb623198 Use in_port_t instead of int/unsigned int/long. 2022-12-18 18:47:28 +00:00
Sadie Powell
3588a46e6f We actually want ADDRESS_FAMILY not SOCKET_ADDRESS for sa_family_t.
Apparently I can not read headers properly.
2022-12-18 13:44:45 +00:00
Sadie Powell
cf3466963b Add is_local to the sockaddrs union. 2022-12-18 01:13:47 +00:00
Sadie Powell
55c1974da3 Use SOCKET_ADDRESS instead of u_short.
These are typedefs but the former is more correct.
2022-12-18 00:50:40 +00:00
Sadie Powell
c4fa62c9ca Add a typedef for sa_family_t on Windows. 2022-11-16 17:00:08 +00:00
Sadie Powell
89537ed2ab Fix various cases of the &* being next to the name instead of type. 2022-09-29 12:36:01 +01:00
Sadie Powell
6c34d4e8ea Update some code that uses "endpoint" to use "socket address" instead. 2022-09-01 11:53:47 +01:00
Sadie Powell
f88fbaa2fe Move aptosa/untosa into the sockaddrs union and add from/from_ip.
The struct will also now always be zero-initialized by default which
removes the footgun which has happened previously where the union has
been accessed before being initialized leading to it containing weird
values.
2022-08-11 15:40:57 +01:00
Sadie Powell
19efaf163c Clean up the sockaddrs documentation comments. 2022-08-10 22:43:23 +01:00
Sadie Powell
648f813f8c Switch from NULL to nullptr. 2022-07-22 18:53:21 +01:00
Sadie Powell
af1d0f6a4b Slim down the globally included files. 2022-04-30 17:48:12 +01:00
Sadie Powell
0e83e79974 Enable support for UNIX socket listeners on Windows. 2022-04-30 16:26:31 +01:00
Sadie Powell
d79147e7af Abolish the infernal space before accessibility keywords. 2022-01-25 14:02:36 +00:00
Sadie Powell
421e8c8c79 Add the final keyword to all remaining classes that can have it. 2021-12-20 20:19:40 +00:00
Sadie Powell
7d84e4900f Fix a ton of pedantic compiler warnings. 2021-04-04 23:42:15 +01:00
Sadie Powell
1e1cf527d2 Merge branch 'insp3' into master. 2021-03-05 02:32:35 +00:00
InspIRCd Robot
7b1ab06a95 Update copyright headers. 2021-03-05 02:16:11 +00:00
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