0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-04 20:52:45 +01:00
construct/include/ircd/m/fed/fed.h

63 lines
1.6 KiB
C
Raw Normal View History

// 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>
//
// 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
#include "well_known.h"
#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"
#include "query.h"
#include "user.h"
#include "user_keys.h"
#include "make_join.h"
#include "send_join.h"
2018-04-03 21:58:18 +02:00
#include "invite.h"
#include "invite2.h"
#include "event.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"
#include "state.h"
#include "backfill.h"
2018-06-04 03:43:17 +02:00
#include "frontfill.h"
#include "public_rooms.h"
#include "rooms.h"
#include "send.h"
#include "groups.h"
/// 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
bool prelink(const string_view &server_name);
bool clear_error(const string_view &server_name);
}
inline ircd::net::hostport
ircd::m::fed::matrix_service(net::hostport remote)
noexcept
{
if(!net::port(remote) && !net::service(remote))
net::service(remote) = m::canon_service;
return remote;
}