libfilezilla
Loading...
Searching...
No Matches
iputils.hpp
Go to the documentation of this file.
1#ifndef LIBFILEZILLA_IPUTILS_HEADER
2#define LIBFILEZILLA_IPUTILS_HEADER
3
4#include "libfilezilla.hpp"
5#include <optional>
6
11namespace fz {
12
19std::string FZ_PUBLIC_SYMBOL get_ipv6_long_form(std::string_view const& short_address);
20std::wstring FZ_PUBLIC_SYMBOL get_ipv6_long_form(std::wstring_view const& short_address);
21
38bool FZ_PUBLIC_SYMBOL is_routable_address(std::string_view const& address);
39bool FZ_PUBLIC_SYMBOL is_routable_address(std::wstring_view const& address);
40
41enum class address_type
42{
43 unknown,
44 ipv4,
45 ipv6,
46 unix
47};
48
50address_type FZ_PUBLIC_SYMBOL get_address_type(std::string_view const& address);
51address_type FZ_PUBLIC_SYMBOL get_address_type(std::wstring_view const& address);
52
54{
55 native_string name;
56 std::string mac;
57 std::vector<std::string> addresses;
58};
59
60std::optional<std::vector<network_interface>> FZ_PUBLIC_SYMBOL get_network_interfaces();
61}
62
63#endif
Sets some global macros and further includes string.hpp.
The namespace used by libfilezilla.
Definition apply.hpp:17
address_type get_address_type(std::string_view const &address)
Gets the type of the passed IP address.
std::wstring native_string
A string in the system's native character type and encoding. Note: This typedef changes depending on...
Definition string.hpp:34
bool dispatch(event_base const &ev, F &&f)
Dispatch for simple_event<> based events to simple functors.
Definition event_handler.hpp:199
std::string get_ipv6_long_form(std::string_view const &short_address)
Given a shortened IPv6 address, returns the full, unshortened address.
bool is_routable_address(std::string_view const &address)
Tests whether the passed IP address is routable on the public Internet.
Definition iputils.hpp:54