0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-08 03:28:40 +02:00
Commit graph

778 commits

Author SHA1 Message Date
Jason Volk 625fb277ca Add root exception + basic utilities. 2016-07-25 19:43:26 -07:00
Jason Volk 73297c988b Preliminary defaults/paths namespacing.
The namespace is inline to mimic the C namespace for now.
2016-07-25 16:49:00 -07:00
Jason Volk 4796bec441 Activate PCH for position independent code.
Cuts compilation time by 30%+
2016-07-25 00:54:38 -07:00
Jason Volk d1edbc0e58 Complete the C++ linkage with flex/bison. 2016-07-25 00:54:38 -07:00
Jason Volk 78ad65f386 ircd/rb: Move some remaining macros to rb. 2016-07-24 21:15:47 -07:00
Jason Volk 02119375b1 Add --disable-pch configuration option. 2016-07-23 19:40:18 -07:00
Jason Volk 31f4d0d699 Fix rb.h.gch compilation flags. 2016-07-23 19:40:18 -07:00
Jason Volk 404239eb60 Build system cleanup. 2016-07-22 19:46:28 -07:00
Jason Volk 1a8ed13747 ircd: Make Chm::mode_type unsigned long. 2016-07-22 19:46:28 -07:00
Jason Volk e7e7f8ff9f Convert bison.
NOTE: This only has "C" linkage right now.
2016-07-22 19:46:27 -07:00
Jason Volk 834964c659 Convert IRCd to C++
Happy 28th birthday. You're all grown up.
2016-07-22 19:46:27 -07:00
Jason Volk 7cea4c784d ircd: Merge the defaults/ircd_defs stuff for now.
ircd/rb: Move some lowish level macros down to rb.
2016-07-21 20:51:02 -07:00
Jason Volk ffb2f63850 ircd: newconf: Fix const correctness. 2016-07-21 20:51:02 -07:00
Jason Volk ea53aab823 Refactor repository layout.
* librb is no longer a separately configured subproject.
* charybdis is now a standalone directory with a binary.
* Include path layout now requires a directory ircd/ rb/ etc.
2016-07-21 20:51:02 -07:00
Jason Volk 007c6bf496 ircd/librb: Move "AFP" macro from ircd to rb. 2016-07-19 22:38:56 -07:00
Jason Volk acd516444a Fix header compatibility with c++ dialects.
This allows the option of at least -std=gnu++14 for new translation units.
Changes are trivial.
2016-07-19 22:38:56 -07:00
Jason Volk e8355cb7be MAPI Version 3
This version leverages a flexible, cleaner key-value strategy
reducing the need to design entire new headers for every feature
addition, change, etc.

* A friendly declaration for the module authors, with minimal
requirements to fill in, and explicit labels of what the fields are.
* Repetition of keys, removing references to (and the requirement to
build) a clist, hlist and hfnlist and caplist and whatever the future
holds.
* Safe deterministic loading and unloading. Keys are evaluated in
order, errors can be recognized, and unloading occurs in reverse
order.

ircd: Refactor internal half of modules.c, with some V3 additions.
Provides better delegation for versions, a cleaner stack with better
error handling, and some functionality deduping. V1 and V2 handlers
are still somewhat unaltered, just factored in.
2016-06-28 20:14:09 -07:00
Jason Volk 97a4adae40 ircd/librb: epoch needs a john hancock 2016-06-28 20:14:09 -07:00
Jason Volk c5698b0276 librb: Move bool type stuff from ircd stdinc to rb. 2016-06-28 17:00:14 -07:00
Jason Volk 3073c2fa3a ircd: Add slog(), a log function that takes both an L_ argument and
a SNO_ argument to smash the pattern of having an ilog() followed by
sendto_realops_snomask() with the same message.
2016-06-27 14:32:53 -07:00
Jason Volk 6357ad5fd9 Add a reason pointer to hook_data_privmsg_channel. When set, the reason is appended to the text of ERR_CANNOTSENDTOCHAN. The pointer will not be free()'ed. 2016-06-25 22:57:04 -05:00
William Pitcock 7e1bb8ad0d Proper channel mode classification. Fixes existing ad hoc
channel mode classification which is required by RPL_MYINFO indicating arity,
and RPL_ISUPPORT indicating an enumerated class. The content of these replies
had previously been generated by hardcoded strings of some letters.

Channel modes require classification which corresponds to the
CHANMODES= data in RPL_ISUPPORT. Classes A,B,C can then be
listed in the unary column of RPL_MYINFO. cflag_add() is updated
for this. Additional cleanup of chmode.h and channel.h
circularity is also proffered within.

Submitted-by: Jason Volk <jason@zemos.net>
2016-06-25 22:54:37 -05:00
William Pitcock e55a9d6abc modules: serious cleanups 2016-06-18 00:52:16 -05:00
William Pitcock 92dad4831d modules: cleanups 2016-06-18 00:38:40 -05:00
William Pitcock 8e30e3def4 messages: fix format string warning reported by latest clang 2016-06-17 23:39:19 -05:00
Aaron Jones aa7b99eb77
restart: functions that call exit(3) should be marked noreturn 2016-06-01 20:54:12 +00:00
Aaron Jones df3db5d99b
ircd: functions that call exit(3) should be marked noreturn 2016-06-01 20:54:12 +00:00
Aaron Jones 341560ecf2
getopt: a function that calls exit(3) should be marked noreturn 2016-06-01 20:54:12 +00:00
Simon Arlott da20854e83
random_ping: stop producing negative values that become 16 chars 2016-05-02 21:14:16 +01:00
Simon Arlott f018ed844d
certfp: Move method name/prefix strings to a separate header file 2016-04-26 20:33:18 +01:00
Simon Arlott 5adde7a4ed
getopt: don't modify argv as it breaks restart() 2016-04-25 23:32:18 +01:00
Simon Arlott 762468f85d
authd: wait until the ssl connection is "open" before reading
It's useful to allow authd to run in parallel with ssl negotiation,
but if the ssld connection has plaintext data ready for reading
there's a race condition between authd calling read_packet() and
ssl_process_certfp() storing the certificate fingerprint. This
scenario would be bad for a server connecting because fingerprint
verification will fail.

Allow either operation to complete first, but wait until
ssl_process_open_fd() calls the ssl open callback before calling
read_packet().
2016-04-25 21:43:21 +01:00
Simon Arlott 53789fddda
sslproc: simplify ssl open callback
Don't use the librb callback type as we're always passing client_p.

Provide a return value so that the connect handler can exit_client()
and the accept handler can opt to use the default dead handler.
2016-04-25 21:12:44 +01:00
Simon Arlott f7b0c4b3d8
sslproc: use global ServerInfo configuration
There's no need to pass information around that sslproc already has access
to, so use ServerInfo directly. Remove the extra NULL checks as these are
already performed before setting ircd_ssl_ok = true.
2016-04-25 19:20:45 +01:00
Simon Arlott d4214e9445
ircd: server connection configuration
Fix the server connection configuration so that it can simultaneously
handle a hostname/IPv4/IPv6 for connecting and a hostname/IPv4/IPv6
for binding. Maintains backwards compatibility for matching a hostname
with a mask.

Multiple host/vhost entries can be specified and the last value for
each address family is stored. Hostnames that resolve automatically
overwrite the IP address.

Server connections can now be made to either IPv4 or IPv6 at random
as well as preferring a specific address family.
2016-04-24 17:06:24 +01:00
Simon Arlott 4fbb736202
ssld: add a callback when the connection is opened
This allows us to wait until we have the fingerprint information before
continuing with a server connect process.
2016-04-24 11:48:35 +01:00
Simon Arlott 3085734104
m_stats: display certificate fingerprint in STATS C 2016-04-24 01:06:51 +01:00
Elizabeth Myers 7445ece1d1
Revert "Implement the netsplit batch type."
This needs more work, see
https://github.com/ircv3/ircv3-specifications/issues/253

This reverts commit 2373891299.
2016-04-16 11:05:00 -05:00
Elizabeth Myers 2373891299
Implement the netsplit batch type.
This also lays the groundwork for the netjoin batch type, but that isn't
implemented yet. I don't like how some of this is implemented but it'll
have to do for now...

Compile tested, needs more testing.
2016-04-15 16:50:43 -05:00
Elizabeth Myers 4f2b9a4fd1
Don't use key member of dictionary iter objects after deletion 2016-04-12 09:43:50 -05:00
Elizabeth Myers 5e9a3f8674
Change the way authd configures opm
It's a bit of a hack, but better than before. Rather than rehashing
(which could get us into an endless loop), we now segregate the
configuration phase (creating entries ircd-side in case we restart authd
later) and sending phases (when configure_authd() is called). Since we
have to call configure_authd() no matter what (to send timeouts etc.)
and we have to send this data to configure authd anyway, and sending
duplicate data is bad, this is the only way I can think of for now.
2016-04-12 09:36:09 -05:00
Mantas Mikulėnas 9d07a42d7a
m_sasl: rate-limit SASL REAUTH usage 2016-04-11 21:45:10 +03:00
Mantas Mikulėnas 37289346cd
m_sasl: temporarily reject clients after many failed attempts 2016-04-11 20:02:09 +03:00
Elizabeth Myers ce58d2dc61 Remove extraneous whitespace [ci skip] 2016-04-10 09:23:14 -05:00
Elizabeth Myers 154dc91ef0 Wrap up authd preclient stuff in its own struct 2016-04-10 09:20:51 -05:00
Elizabeth Myers 4eafa9e62f ipv4_from_ipv6: move to librb 2016-04-08 03:49:23 -05:00
Elizabeth Myers 5a22e9259b Fix overzealotry in flags fixing.
These flags are for oper confs, not for client flags.
2016-04-07 07:48:50 -05:00
Elizabeth Myers 66f7fe673b Get rid of flags2.
It seems to come from an era where long long didn't exist and 64-bit
machines weren't common. 32-bit machines are still common but I can't
imagine this will have much performance impact there.

This "fixes" #179 in title only, but see comments within.
2016-04-07 07:40:55 -05:00
Elizabeth Myers 9057170ce8 Cleanup defaults.h config file.
Clean up spaces/tabs mixing mess (bleh), add some defaults for authd
stuff, and get rid of CHARYBDIS_SOMAXCONN (just define SOMAXCONN if it's
available...).
2016-04-07 04:47:48 -05:00
Elizabeth Myers 78946542bb modules: move module loading/unloading commands to dedicated module.
There's no reason to really have these in the main ircd anymore, static
modules are dead and aren't coming back.

To ensure people don't do something hopelessly retarded, this is a core
module.
2016-04-07 04:00:25 -05:00