2019-03-25 21:29:46 +01:00
|
|
|
// Matrix Construct
|
|
|
|
//
|
|
|
|
// Copyright (C) Matrix Construct Developers, Authors & Contributors
|
|
|
|
// 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
|
|
|
|
#define HAVE_IRCD_NET_ADDRS_H
|
|
|
|
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
struct ifaddrs;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace ircd::net::addrs
|
|
|
|
{
|
2019-03-25 22:54:35 +01:00
|
|
|
struct addr;
|
|
|
|
using closure = std::function<bool (const addr &)>;
|
2019-04-10 04:07:45 +02:00
|
|
|
using raw_closure = std::function<bool (const struct ::ifaddrs *const &)>;
|
2019-03-25 21:29:46 +01:00
|
|
|
|
|
|
|
bool for_each(const raw_closure &);
|
|
|
|
bool for_each(const closure &);
|
2019-03-25 23:12:34 +01:00
|
|
|
|
|
|
|
bool has_usable_ipv6_interface();
|
2019-03-25 21:29:46 +01:00
|
|
|
}
|
2019-03-25 22:54:35 +01:00
|
|
|
|
|
|
|
struct ircd::net::addrs::addr
|
|
|
|
{
|
|
|
|
string_view name;
|
|
|
|
ipport address;
|
|
|
|
uint32_t flags {0};
|
|
|
|
uint32_t flowinfo {0};
|
|
|
|
uint32_t scope_id {0};
|
|
|
|
uint16_t family {0};
|
|
|
|
};
|