forked from sony/nmos-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhost_utils.h
40 lines (32 loc) · 1.53 KB
/
host_utils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef CPPREST_HOST_UTILS_H
#define CPPREST_HOST_UTILS_H
#include <vector>
#include "cpprest/details/basic_types.h"
// Extensions to provide the current host name, network interface details, and name resolution services
namespace web
{
namespace hosts
{
namespace experimental
{
utility::string_t host_name();
struct host_interface
{
uint32_t index;
utility::string_t name;
utility::string_t physical_address;
std::vector<utility::string_t> addresses;
utility::string_t domain;
host_interface(uint32_t index = {}, const utility::string_t& name = {}, const utility::string_t& physical_address = {}, const std::vector<utility::string_t>& addresses = {}, const utility::string_t& domain = {})
: index(index), name(name), physical_address(physical_address), addresses(addresses), domain(domain)
{}
};
std::vector<host_interface> host_interfaces();
std::vector<utility::string_t> host_names(const utility::string_t& address);
std::vector<utility::string_t> host_addresses(const utility::string_t& host_name);
// get the associated network interface name from an IP address
utility::string_t get_interface_name(const utility::string_t& address, const std::vector<web::hosts::experimental::host_interface>& host_interfaces = web::hosts::experimental::host_interfaces());
}
}
}
#endif