2018-01-22 03:32:15 -08:00
|
|
|
// Matrix Construct
|
|
|
|
//
|
|
|
|
// Copyright (C) Matrix Construct Developers, Authors & Contributors
|
2019-07-11 20:27:59 -07:00
|
|
|
// Copyright (C) 2016-2019 Jason Volk <jason@zemos.net>
|
2018-01-22 03:32:15 -08: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-11 20:27:59 -07:00
|
|
|
#define HAVE_IRCD_M_FED_H
|
2018-01-22 03:32:15 -08:00
|
|
|
|
2020-06-08 11:19:29 -07:00
|
|
|
#include "well_known.h"
|
2020-03-07 17:15:58 -08:00
|
|
|
#include "request.h"
|
2018-02-19 14:34:34 -08:00
|
|
|
#include "version.h"
|
2018-05-07 14:46:53 -07:00
|
|
|
#include "key.h"
|
2018-02-24 23:53:32 -08:00
|
|
|
#include "query.h"
|
2018-04-02 18:24:57 -07:00
|
|
|
#include "user.h"
|
2019-02-07 21:04:52 -08:00
|
|
|
#include "user_keys.h"
|
2018-01-22 03:32:15 -08:00
|
|
|
#include "make_join.h"
|
2018-01-22 10:05:45 -08:00
|
|
|
#include "send_join.h"
|
2018-04-03 12:58:18 -07:00
|
|
|
#include "invite.h"
|
2019-07-11 20:32:32 -07:00
|
|
|
#include "invite2.h"
|
2018-01-22 03:32:15 -08:00
|
|
|
#include "event.h"
|
2018-04-08 11:27:59 -07:00
|
|
|
#include "event_auth.h"
|
2019-02-16 14:24:56 -08:00
|
|
|
#include "query_auth.h"
|
2018-01-22 03:32:15 -08:00
|
|
|
#include "state.h"
|
|
|
|
#include "backfill.h"
|
2018-06-03 18:43:17 -07:00
|
|
|
#include "frontfill.h"
|
2018-04-08 13:27:18 -07:00
|
|
|
#include "public_rooms.h"
|
2020-04-05 18:35:48 -07:00
|
|
|
#include "rooms.h"
|
2018-01-22 10:05:45 -08:00
|
|
|
#include "send.h"
|
2018-03-28 01:00:08 -07:00
|
|
|
#include "groups.h"
|
2020-03-05 20:10:55 -08:00
|
|
|
|
2020-10-14 06:59:30 -07: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 00:37:56 -07:00
|
|
|
bool prelink(const string_view &server_name);
|
2020-10-14 06:59:30 -07:00
|
|
|
bool clear_error(const string_view &server_name);
|
|
|
|
}
|
|
|
|
|
2020-03-05 20:10:55 -08:00
|
|
|
inline ircd::net::hostport
|
|
|
|
ircd::m::fed::matrix_service(net::hostport remote)
|
2020-04-25 19:40:46 -07:00
|
|
|
noexcept
|
2020-03-05 20:10:55 -08:00
|
|
|
{
|
2020-04-26 14:53:00 -07:00
|
|
|
if(!net::port(remote) && !net::service(remote))
|
|
|
|
net::service(remote) = m::canon_service;
|
2020-04-25 19:40:46 -07:00
|
|
|
|
2020-03-05 20:10:55 -08:00
|
|
|
return remote;
|
|
|
|
}
|