Net++
A class-based C++ encapsulation over the POSIX Sockets API
Loading...
Searching...
No Matches
networking.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <netdb.h>
4
#include <sys/socket.h>
5
#include <cstddef>
6
7
namespace
networking
{
8
inline
namespace
constants {
9
namespace
invalid_values {
10
constexpr
int32_t
invalid_socket_fd
{ -1 };
11
}
// namespace invalid_values
12
13
namespace
flags {
14
constexpr
int
binding_socket
= AI_PASSIVE;
15
}
16
17
namespace
domain {
18
constexpr
int
ipv4
= AF_INET;
19
constexpr
int
ipv6
= AF_INET6;
20
constexpr
int32_t
unspecified_domain
= AF_UNSPEC;
21
}
// namespace domain
22
23
namespace
socket_type {
24
constexpr
int
tcp
= SOCK_STREAM;
25
constexpr
int
udp
= SOCK_DGRAM;
26
constexpr
int
raw
= SOCK_RAW;
27
}
// namespace socket_type
28
}
// namespace constants
29
}
// namespace networking
networking::constants::domain::ipv4
constexpr int ipv4
Definition
networking.hpp:18
networking::constants::domain::unspecified_domain
constexpr int32_t unspecified_domain
Definition
networking.hpp:20
networking::constants::domain::ipv6
constexpr int ipv6
Definition
networking.hpp:19
networking::constants::flags::binding_socket
constexpr int binding_socket
Definition
networking.hpp:14
networking::constants::invalid_values::invalid_socket_fd
constexpr int32_t invalid_socket_fd
Definition
networking.hpp:10
networking::constants::socket_type::raw
constexpr int raw
Definition
networking.hpp:26
networking::constants::socket_type::udp
constexpr int udp
Definition
networking.hpp:25
networking
Definition
networking.hpp:7
tcp
Definition
tcp.hpp:10
include
networking.hpp
Generated by
1.9.8