2018-01-22 12:32:15 +01:00
|
|
|
// Matrix Construct
|
|
|
|
//
|
|
|
|
// Copyright (C) Matrix Construct Developers, Authors & Contributors
|
2019-07-12 05:27:59 +02:00
|
|
|
// Copyright (C) 2016-2019 Jason Volk <jason@zemos.net>
|
2018-01-22 12:32:15 +01:00
|
|
|
//
|
|
|
|
// Permission to use, copy, modify, and/or distribute this software for any
|
|
|
|
// purpose with or without fee is hereby granted, provided that the above
|
|
|
|
// copyright notice and this permission notice is present in all copies. The
|
|
|
|
// full license for this software is available in the LICENSE file.
|
|
|
|
|
|
|
|
#pragma once
|
2019-07-12 05:27:59 +02:00
|
|
|
#define HAVE_IRCD_M_FED_H
|
2018-01-22 12:32:15 +01:00
|
|
|
|
2020-06-08 20:19:29 +02:00
|
|
|
#include "well_known.h"
|
2020-03-08 02:15:58 +01:00
|
|
|
#include "request.h"
|
2018-02-19 23:34:34 +01:00
|
|
|
#include "version.h"
|
2018-05-07 23:46:53 +02:00
|
|
|
#include "key.h"
|
2018-02-25 08:53:32 +01:00
|
|
|
#include "query.h"
|
2018-04-03 03:24:57 +02:00
|
|
|
#include "user.h"
|
2019-02-08 06:04:52 +01:00
|
|
|
#include "user_keys.h"
|
2018-01-22 12:32:15 +01:00
|
|
|
#include "make_join.h"
|
2018-01-22 19:05:45 +01:00
|
|
|
#include "send_join.h"
|
2018-04-03 21:58:18 +02:00
|
|
|
#include "invite.h"
|
2019-07-12 05:32:32 +02:00
|
|
|
#include "invite2.h"
|
2018-01-22 12:32:15 +01:00
|
|
|
#include "event.h"
|
2022-06-20 03:12:09 +02:00
|
|
|
#include "event_near.h"
|
2018-04-08 20:27:59 +02:00
|
|
|
#include "event_auth.h"
|
2019-02-16 23:24:56 +01:00
|
|
|
#include "query_auth.h"
|
2018-01-22 12:32:15 +01:00
|
|
|
#include "state.h"
|
|
|
|
#include "backfill.h"
|
2018-06-04 03:43:17 +02:00
|
|
|
#include "frontfill.h"
|
2018-04-08 22:27:18 +02:00
|
|
|
#include "public_rooms.h"
|
2020-04-06 03:35:48 +02:00
|
|
|
#include "rooms.h"
|
2018-01-22 19:05:45 +01:00
|
|
|
#include "send.h"
|
2018-03-28 10:00:08 +02:00
|
|
|
#include "groups.h"
|
2022-06-19 22:46:33 +02:00
|
|
|
#include "hierarchy.h"
|
2020-03-06 05:10:55 +01:00
|
|
|
|
2020-10-14 15:59:30 +02:00
|
|
|
/// Federation Interface
|
|
|
|
namespace ircd::m::fed
|
|
|
|
{
|
|
|
|
// Utils
|
|
|
|
net::hostport matrix_service(net::hostport remote) noexcept;
|
|
|
|
string_view server(const mutable_buffer &out, const string_view &name, const well_known::opts & = {});
|
|
|
|
|
|
|
|
// Observers
|
|
|
|
bool errant(const string_view &server_name);
|
|
|
|
bool linked(const string_view &server_name);
|
|
|
|
bool exists(const string_view &server_name);
|
|
|
|
bool avail(const string_view &server_name);
|
|
|
|
|
|
|
|
// Control panel
|
2020-10-16 09:37:56 +02:00
|
|
|
bool prelink(const string_view &server_name);
|
2020-10-14 15:59:30 +02:00
|
|
|
bool clear_error(const string_view &server_name);
|
|
|
|
}
|
|
|
|
|
2020-03-06 05:10:55 +01:00
|
|
|
inline ircd::net::hostport
|
|
|
|
ircd::m::fed::matrix_service(net::hostport remote)
|
2020-04-26 04:40:46 +02:00
|
|
|
noexcept
|
2020-03-06 05:10:55 +01:00
|
|
|
{
|
2020-04-26 23:53:00 +02:00
|
|
|
if(!net::port(remote) && !net::service(remote))
|
|
|
|
net::service(remote) = m::canon_service;
|
2020-04-26 04:40:46 +02:00
|
|
|
|
2020-03-06 05:10:55 +01:00
|
|
|
return remote;
|
|
|
|
}
|