27 lines
668 B
C++
27 lines
668 B
C++
#pragma once
|
|
|
|
namespace Chattr {
|
|
|
|
struct Address {
|
|
Address();
|
|
Address(int type, gsl::czstring presentationAddr, std::uint16_t port);
|
|
|
|
void zeroFill();
|
|
void set(int type, gsl::czstring presentationAddr, std::uint16_t port);
|
|
void set(int type, in_addr_t addr, std::uint16_t port);
|
|
void set(int type, in_addr addr, std::uint16_t port);
|
|
void set(int type, in6_addr addr, std::uint16_t port);
|
|
void setType(int type);
|
|
|
|
operator std::string();
|
|
std::optional<std::uint16_t> getPort();
|
|
|
|
union {
|
|
struct sockaddr addr;
|
|
struct sockaddr_in addr_in;
|
|
struct sockaddr_in6 addr_in6;
|
|
};
|
|
socklen_t length;
|
|
};
|
|
|
|
} |