2018-02-04 03:22:01 +01:00
|
|
|
// Matrix Construct
|
|
|
|
//
|
|
|
|
// Copyright (C) Matrix Construct Developers, Authors & Contributors
|
|
|
|
// Copyright (C) 2016-2018 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.
|
2017-11-01 23:51:24 +01:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#define HAVE_IRCD_NET_ASIO_H
|
|
|
|
|
|
|
|
// This file is not included with the IRCd standard include stack because
|
|
|
|
// it requires symbols we can't forward declare without boost headers. It
|
|
|
|
// is part of the <ircd/asio.h> stack which can be included in your
|
|
|
|
// definition file if you need low level access to this socket API. The
|
|
|
|
// <ircd/net/net.h> still offers higher level access to sockets without
|
|
|
|
// requiring boost headers; please check that for satisfaction before
|
|
|
|
// including this.
|
|
|
|
|
|
|
|
namespace ircd::net
|
|
|
|
{
|
2018-01-01 10:39:17 +01:00
|
|
|
namespace ip = asio::ip;
|
2019-10-09 03:14:10 +02:00
|
|
|
using asio::deadline_timer;
|
2018-01-01 10:39:17 +01:00
|
|
|
using asio::steady_timer;
|
|
|
|
using ircd::string;
|
2017-11-01 23:51:24 +01:00
|
|
|
|
2019-03-25 02:27:49 +01:00
|
|
|
string_view string(const mutable_buffer &, const ip::address_v6 &);
|
|
|
|
string_view string(const mutable_buffer &, const ip::address_v4 &);
|
|
|
|
string_view string(const mutable_buffer &, const ip::address &);
|
|
|
|
std::string string(const ip::address_v6 &);
|
|
|
|
std::string string(const ip::address_v4 &);
|
|
|
|
std::string string(const ip::address &);
|
|
|
|
|
2017-11-01 23:51:24 +01:00
|
|
|
uint16_t port(const ip::tcp::endpoint &);
|
|
|
|
ip::address addr(const ip::tcp::endpoint &);
|
|
|
|
std::string host(const ip::tcp::endpoint &);
|
2019-03-25 02:27:49 +01:00
|
|
|
string_view string(const mutable_buffer &, const ip::tcp::endpoint &);
|
2017-11-01 23:51:24 +01:00
|
|
|
std::string string(const ip::tcp::endpoint &);
|
2017-12-30 06:38:00 +01:00
|
|
|
|
|
|
|
ipport make_ipport(const boost::asio::ip::tcp::endpoint &);
|
2018-01-28 23:18:47 +01:00
|
|
|
ipport make_ipport(const boost::asio::ip::udp::endpoint &);
|
2017-12-30 06:38:00 +01:00
|
|
|
ip::tcp::endpoint make_endpoint(const ipport &);
|
2018-01-28 23:18:47 +01:00
|
|
|
ip::udp::endpoint make_endpoint_udp(const ipport &);
|
2017-11-01 23:51:24 +01:00
|
|
|
}
|
|
|
|
|
2018-01-28 18:37:13 +01:00
|
|
|
#include <ircd/net/socket.h>
|
|
|
|
#include <ircd/net/acceptor.h>
|
2019-03-10 22:07:56 +01:00
|
|
|
#include <ircd/net/acceptor_udp.h>
|
2019-10-03 19:47:33 +02:00
|
|
|
#include <ircd/net/dns_resolver.h>
|
2018-01-28 18:37:13 +01:00
|
|
|
|
2017-11-01 23:51:24 +01:00
|
|
|
namespace ircd
|
|
|
|
{
|
|
|
|
using net::string;
|
|
|
|
using net::addr;
|
|
|
|
using net::host;
|
|
|
|
using net::port;
|
|
|
|
}
|