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 @@
#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 <iomanip>
#include <array>
......@@ -197,12 +209,7 @@ public:
};
static constexpr 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
}}};
static constexpr const InfoHash zeroes {};
struct NodeExport {
InfoHash id;
......
......@@ -24,8 +24,6 @@
#include "utils.h"
#include "infohash.h"
#include <arpa/inet.h>
#include <list>
namespace dht {
......
......@@ -26,18 +26,6 @@
#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 <sstream>
#include <bitset>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment