0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-26 05:48:20 +02:00
construct/include/ircd/net/addrs.h

40 lines
968 B
C++

// 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
{
struct addr;
using closure = std::function<bool (const addr &)>;
using raw_closure = std::function<bool (const struct ::ifaddrs *const &)>;
bool for_each(const raw_closure &);
bool for_each(const closure &);
bool has_usable_ipv6_interface();
}
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};
};