Skip to content
Snippets Groups Projects
Commit 22958342 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

headers: move inclusion of networking APIs to Infohash

parent e9094f8f
No related branches found
No related tags found
No related merge requests found
...@@ -21,6 +21,18 @@ ...@@ -21,6 +21,18 @@
#include <msgpack.hpp> #include <msgpack.hpp>
#ifndef _WIN32
#include <netinet/in.h>
#include <netdb.h>
#ifdef __ANDROID__
typedef uint16_t in_port_t;
#endif
#else
#include <ws2tcpip.h>
typedef uint16_t sa_family_t;
typedef uint16_t in_port_t;
#endif
#include <iostream> #include <iostream>
#include <iomanip> #include <iomanip>
#include <array> #include <array>
...@@ -197,12 +209,7 @@ public: ...@@ -197,12 +209,7 @@ public:
}; };
static constexpr InfoHash zeroes {}; static constexpr const InfoHash zeroes {};
static constexpr InfoHash ones = {std::array<uint8_t, HASH_LEN>{{
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF
}}};
struct NodeExport { struct NodeExport {
InfoHash id; InfoHash id;
......
...@@ -24,8 +24,6 @@ ...@@ -24,8 +24,6 @@
#include "utils.h" #include "utils.h"
#include "infohash.h" #include "infohash.h"
#include <arpa/inet.h>
#include <list> #include <list>
namespace dht { namespace dht {
......
...@@ -26,18 +26,6 @@ ...@@ -26,18 +26,6 @@
#include <msgpack.hpp> #include <msgpack.hpp>
#ifndef _WIN32
#include <netinet/in.h>
#include <netdb.h>
#ifdef __ANDROID__
typedef uint16_t in_port_t;
#endif
#else
#include <ws2tcpip.h>
typedef uint16_t sa_family_t;
typedef uint16_t in_port_t;
#endif
#include <string> #include <string>
#include <sstream> #include <sstream>
#include <bitset> #include <bitset>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment