libcosmos
Linux C++ System Programming Library
Loading...
Searching...
No Matches
network.hxx
1#pragma once
2
3// C++
4#include <utility>
5
6// cosmos
7#include <cosmos/SysString.hxx>
8#include <cosmos/net/UnixConnection.hxx>
9#include <cosmos/net/UnixDatagramSocket.hxx>
10#include <cosmos/net/types.hxx>
11
12namespace cosmos::net {
13
15COSMOS_API std::pair<UnixConnection, UnixConnection> create_stream_socket_pair(
16 const SocketFlags flags = SocketFlags{SocketFlag::CLOEXEC});
18COSMOS_API std::pair<UnixConnection, UnixConnection> create_seqpacket_socket_pair(
19 const SocketFlags flags = SocketFlags{SocketFlag::CLOEXEC});
21COSMOS_API std::pair<UnixDatagramSocket, UnixDatagramSocket> create_dgram_socket_pair(
22 const SocketFlags flags = SocketFlags{SocketFlag::CLOEXEC});
23
25
30COSMOS_API InterfaceIndex name_to_index(const SysString name);
31
33
36COSMOS_API std::string index_to_name(const InterfaceIndex index);
37
39
43COSMOS_API std::string get_hostname();
44
45} // end ns
InterfaceIndex
A network device interface index.
Definition types.hxx:119