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;
|
|
|
|
using asio::steady_timer;
|
|
|
|
using ircd::string;
|
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 &);
|
|
|
|
std::string string(const ip::address &);
|
|
|
|
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>
|
|
|
|
#include <ircd/net/resolver.h>
|
|
|
|
|
2017-11-01 23:51:24 +01:00
|
|
|
namespace ircd
|
|
|
|
{
|
|
|
|
using net::string;
|
|
|
|
using net::addr;
|
|
|
|
using net::host;
|
|
|
|
using net::port;
|
|
|
|
}
|