OSUtils.cpp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at https://mozilla.org/MPL/2.0/.
  4. *
  5. * (c) ZeroTier, Inc.
  6. * https://www.zerotier.com/
  7. */
  8. #include "../node/Constants.hpp"
  9. #include "../node/Utils.hpp"
  10. #include <inttypes.h>
  11. #include <stdarg.h>
  12. #include <stdio.h>
  13. #include <stdlib.h>
  14. #include <string.h>
  15. #include <sys/stat.h>
  16. #ifdef __UNIX_LIKE__
  17. #include <dirent.h>
  18. #include <errno.h>
  19. #include <fcntl.h>
  20. #include <netdb.h>
  21. #include <sys/socket.h>
  22. #include <sys/stat.h>
  23. #include <sys/types.h>
  24. #include <sys/uio.h>
  25. #include <unistd.h>
  26. #endif
  27. #ifdef __WINDOWS__
  28. #include <iphlpapi.h>
  29. #include <netioapi.h>
  30. #include <shlobj.h>
  31. #include <wincrypt.h>
  32. #include <windows.h>
  33. #endif
  34. #include "OSUtils.hpp"
  35. #ifdef __GCC__
  36. #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
  37. #endif
  38. namespace ZeroTier {
  39. unsigned int OSUtils::ztsnprintf(char* buf, unsigned int len, const char* fmt, ...)
  40. {
  41. va_list ap;
  42. va_start(ap, fmt);
  43. int n = (int)vsnprintf(buf, len, fmt, ap);
  44. va_end(ap);
  45. if ((n >= (int)len) || (n < 0)) {
  46. if (len)
  47. buf[len - 1] = (char)0;
  48. throw std::length_error("buf[] overflow");
  49. }
  50. return (unsigned int)n;
  51. }
  52. std::string OSUtils::networkIDStr(const uint64_t nwid)
  53. {
  54. char tmp[32] = {};
  55. ztsnprintf(tmp, sizeof(tmp), "%.16" PRIx64, nwid);
  56. return std::string(tmp);
  57. }
  58. std::string OSUtils::nodeIDStr(const uint64_t nid)
  59. {
  60. char tmp[32] = {};
  61. ztsnprintf(tmp, sizeof(tmp), "%.10" PRIx64, nid);
  62. return std::string(tmp);
  63. }
  64. #ifdef __UNIX_LIKE__
  65. bool OSUtils::redirectUnixOutputs(const char* stdoutPath, const char* stderrPath) throw()
  66. {
  67. int fdout = ::open(stdoutPath, O_WRONLY | O_CREAT, 0600);
  68. if (fdout > 0) {
  69. int fderr;
  70. if (stderrPath) {
  71. fderr = ::open(stderrPath, O_WRONLY | O_CREAT, 0600);
  72. if (fderr <= 0) {
  73. ::close(fdout);
  74. return false;
  75. }
  76. }
  77. else
  78. fderr = fdout;
  79. ::close(STDOUT_FILENO);
  80. ::close(STDERR_FILENO);
  81. ::dup2(fdout, STDOUT_FILENO);
  82. ::dup2(fderr, STDERR_FILENO);
  83. return true;
  84. }
  85. return false;
  86. }
  87. #endif // __UNIX_LIKE__
  88. std::vector<std::string> OSUtils::listDirectory(const char* path, bool includeDirectories)
  89. {
  90. std::vector<std::string> r;
  91. #ifdef __WINDOWS__
  92. HANDLE hFind;
  93. WIN32_FIND_DATAA ffd;
  94. if ((hFind = FindFirstFileA((std::string(path) + "\\*").c_str(), &ffd)) != INVALID_HANDLE_VALUE) {
  95. do {
  96. if ((strcmp(ffd.cFileName, ".")) && (strcmp(ffd.cFileName, "..")) && (((ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) || (((ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) && (includeDirectories))))
  97. r.push_back(std::string(ffd.cFileName));
  98. } while (FindNextFileA(hFind, &ffd));
  99. FindClose(hFind);
  100. }
  101. #else
  102. struct dirent de;
  103. struct dirent* dptr;
  104. DIR* d = opendir(path);
  105. if (! d)
  106. return r;
  107. dptr = (struct dirent*)0;
  108. for (;;) {
  109. if (readdir_r(d, &de, &dptr))
  110. break;
  111. if (dptr) {
  112. if ((strcmp(dptr->d_name, ".")) && (strcmp(dptr->d_name, "..")) && ((dptr->d_type != DT_DIR) || (includeDirectories)))
  113. r.push_back(std::string(dptr->d_name));
  114. }
  115. else
  116. break;
  117. }
  118. closedir(d);
  119. #endif
  120. return r;
  121. }
  122. long OSUtils::cleanDirectory(const char* path, const int64_t olderThan)
  123. {
  124. long cleaned = 0;
  125. #ifdef __WINDOWS__
  126. HANDLE hFind;
  127. WIN32_FIND_DATAA ffd;
  128. LARGE_INTEGER date, adjust;
  129. adjust.QuadPart = 11644473600000 * 10000;
  130. char tmp[4096];
  131. if ((hFind = FindFirstFileA((std::string(path) + "\\*").c_str(), &ffd)) != INVALID_HANDLE_VALUE) {
  132. do {
  133. if ((strcmp(ffd.cFileName, ".")) && (strcmp(ffd.cFileName, "..")) && ((ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)) {
  134. date.HighPart = ffd.ftLastWriteTime.dwHighDateTime;
  135. date.LowPart = ffd.ftLastWriteTime.dwLowDateTime;
  136. if (date.QuadPart > 0) {
  137. date.QuadPart -= adjust.QuadPart;
  138. if ((int64_t)((date.QuadPart / 10000000) * 1000) < olderThan) {
  139. ztsnprintf(tmp, sizeof(tmp), "%s\\%s", path, ffd.cFileName);
  140. if (DeleteFileA(tmp))
  141. ++cleaned;
  142. }
  143. }
  144. }
  145. } while (FindNextFileA(hFind, &ffd));
  146. FindClose(hFind);
  147. }
  148. #else
  149. struct dirent de;
  150. struct dirent* dptr;
  151. struct stat st;
  152. char tmp[4096];
  153. DIR* d = opendir(path);
  154. if (! d)
  155. return -1;
  156. dptr = (struct dirent*)0;
  157. for (;;) {
  158. if (readdir_r(d, &de, &dptr))
  159. break;
  160. if (dptr) {
  161. if ((strcmp(dptr->d_name, ".")) && (strcmp(dptr->d_name, "..")) && (dptr->d_type == DT_REG)) {
  162. ztsnprintf(tmp, sizeof(tmp), "%s/%s", path, dptr->d_name);
  163. if (stat(tmp, &st) == 0) {
  164. int64_t mt = (int64_t)(st.st_mtime);
  165. if ((mt > 0) && ((mt * 1000) < olderThan)) {
  166. if (unlink(tmp) == 0)
  167. ++cleaned;
  168. }
  169. }
  170. }
  171. }
  172. else
  173. break;
  174. }
  175. closedir(d);
  176. #endif
  177. return cleaned;
  178. }
  179. bool OSUtils::rmDashRf(const char* path)
  180. {
  181. #ifdef __WINDOWS__
  182. HANDLE hFind;
  183. WIN32_FIND_DATAA ffd;
  184. if ((hFind = FindFirstFileA((std::string(path) + "\\*").c_str(), &ffd)) != INVALID_HANDLE_VALUE) {
  185. do {
  186. if ((strcmp(ffd.cFileName, ".") != 0) && (strcmp(ffd.cFileName, "..") != 0)) {
  187. if ((ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) {
  188. if (DeleteFileA((std::string(path) + ZT_PATH_SEPARATOR_S + ffd.cFileName).c_str()) == FALSE)
  189. return false;
  190. }
  191. else {
  192. if (! rmDashRf((std::string(path) + ZT_PATH_SEPARATOR_S + ffd.cFileName).c_str()))
  193. return false;
  194. }
  195. }
  196. } while (FindNextFileA(hFind, &ffd));
  197. FindClose(hFind);
  198. }
  199. return (RemoveDirectoryA(path) != FALSE);
  200. #else
  201. struct dirent de;
  202. struct dirent* dptr;
  203. DIR* d = opendir(path);
  204. if (! d)
  205. return true;
  206. dptr = (struct dirent*)0;
  207. for (;;) {
  208. if (readdir_r(d, &de, &dptr) != 0)
  209. break;
  210. if (! dptr)
  211. break;
  212. if ((strcmp(dptr->d_name, ".") != 0) && (strcmp(dptr->d_name, "..") != 0) && (strlen(dptr->d_name) > 0)) {
  213. std::string p(path);
  214. p.push_back(ZT_PATH_SEPARATOR);
  215. p.append(dptr->d_name);
  216. if (unlink(p.c_str()) != 0) { // unlink first will remove symlinks instead of recursing them
  217. if (! rmDashRf(p.c_str()))
  218. return false;
  219. }
  220. }
  221. }
  222. closedir(d);
  223. return (rmdir(path) == 0);
  224. #endif
  225. }
  226. void OSUtils::lockDownFile(const char* path, bool isDir)
  227. {
  228. #ifdef __UNIX_LIKE__
  229. chmod(path, isDir ? 0700 : 0600);
  230. #else
  231. #ifdef __WINDOWS__
  232. {
  233. STARTUPINFOA startupInfo;
  234. PROCESS_INFORMATION processInfo;
  235. startupInfo.cb = sizeof(startupInfo);
  236. memset(&startupInfo, 0, sizeof(STARTUPINFOA));
  237. memset(&processInfo, 0, sizeof(PROCESS_INFORMATION));
  238. if (CreateProcessA(NULL, (LPSTR)(std::string("C:\\Windows\\System32\\icacls.exe \"") + path + "\" /inheritance:d /Q").c_str(), NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, NULL, &startupInfo, &processInfo)) {
  239. WaitForSingleObject(processInfo.hProcess, INFINITE);
  240. CloseHandle(processInfo.hProcess);
  241. CloseHandle(processInfo.hThread);
  242. }
  243. startupInfo.cb = sizeof(startupInfo);
  244. memset(&startupInfo, 0, sizeof(STARTUPINFOA));
  245. memset(&processInfo, 0, sizeof(PROCESS_INFORMATION));
  246. if (CreateProcessA(NULL, (LPSTR)(std::string("C:\\Windows\\System32\\icacls.exe \"") + path + "\" /remove *S-1-5-32-545 /Q").c_str(), NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, NULL, &startupInfo, &processInfo)) {
  247. WaitForSingleObject(processInfo.hProcess, INFINITE);
  248. CloseHandle(processInfo.hProcess);
  249. CloseHandle(processInfo.hThread);
  250. }
  251. // Remove 'Everyone' group from R/RX access
  252. startupInfo.cb = sizeof(startupInfo);
  253. memset(&startupInfo, 0, sizeof(STARTUPINFOA));
  254. memset(&processInfo, 0, sizeof(PROCESS_INFORMATION));
  255. if (CreateProcessA(NULL, (LPSTR)(std::string("C:\\Windows\\System32\\icacls.exe \"") + path + "\" /remove:g Everyone /t /c /Q").c_str(), NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, NULL, &startupInfo, &processInfo)) {
  256. WaitForSingleObject(processInfo.hProcess, INFINITE);
  257. CloseHandle(processInfo.hProcess);
  258. CloseHandle(processInfo.hThread);
  259. }
  260. }
  261. #endif
  262. #endif
  263. }
  264. uint64_t OSUtils::getLastModified(const char* path)
  265. {
  266. struct stat s;
  267. if (stat(path, &s))
  268. return 0;
  269. return (((uint64_t)s.st_mtime) * 1000ULL);
  270. }
  271. bool OSUtils::fileExists(const char* path, bool followLinks)
  272. {
  273. struct stat s;
  274. #ifdef __UNIX_LIKE__
  275. if (! followLinks)
  276. return (lstat(path, &s) == 0);
  277. #endif
  278. return (stat(path, &s) == 0);
  279. }
  280. int64_t OSUtils::getFileSize(const char* path)
  281. {
  282. struct stat s;
  283. if (stat(path, &s))
  284. return -1;
  285. #ifdef __WINDOWS__
  286. return s.st_size;
  287. #else
  288. if (S_ISREG(s.st_mode))
  289. return s.st_size;
  290. #endif
  291. return -1;
  292. }
  293. bool OSUtils::readFile(const char* path, std::string& buf)
  294. {
  295. char tmp[16384];
  296. FILE* f = fopen(path, "rb");
  297. if (f) {
  298. for (;;) {
  299. long n = (long)fread(tmp, 1, sizeof(tmp), f);
  300. if (n > 0)
  301. buf.append(tmp, n);
  302. else
  303. break;
  304. }
  305. fclose(f);
  306. return true;
  307. }
  308. return false;
  309. }
  310. bool OSUtils::writeFile(const char* path, const void* buf, unsigned int len)
  311. {
  312. FILE* f = fopen(path, "wb");
  313. if (f) {
  314. if ((long)fwrite(buf, 1, len, f) != (long)len) {
  315. fclose(f);
  316. return false;
  317. }
  318. else {
  319. fclose(f);
  320. return true;
  321. }
  322. }
  323. return false;
  324. }
  325. std::vector<std::string> OSUtils::split(const char* s, const char* const sep, const char* esc, const char* quot)
  326. {
  327. std::vector<std::string> fields;
  328. std::string buf;
  329. if (! esc)
  330. esc = "";
  331. if (! quot)
  332. quot = "";
  333. bool escapeState = false;
  334. char quoteState = 0;
  335. while (*s) {
  336. if (escapeState) {
  337. escapeState = false;
  338. buf.push_back(*s);
  339. }
  340. else if (quoteState) {
  341. if (*s == quoteState) {
  342. quoteState = 0;
  343. fields.push_back(buf);
  344. buf.clear();
  345. }
  346. else
  347. buf.push_back(*s);
  348. }
  349. else {
  350. const char* quotTmp;
  351. if (strchr(esc, *s))
  352. escapeState = true;
  353. else if ((buf.size() <= 0) && ((quotTmp = strchr(quot, *s))))
  354. quoteState = *quotTmp;
  355. else if (strchr(sep, *s)) {
  356. if (! buf.empty()) {
  357. fields.push_back(buf);
  358. buf.clear();
  359. } // else skip runs of separators
  360. }
  361. else
  362. buf.push_back(*s);
  363. }
  364. ++s;
  365. }
  366. if (buf.size())
  367. fields.push_back(buf);
  368. return fields;
  369. }
  370. std::string OSUtils::platformDefaultHomePath()
  371. {
  372. #ifdef __QNAP__
  373. char* cmd = "/sbin/getcfg zerotier Install_Path -f /etc/config/qpkg.conf";
  374. char buf[128];
  375. FILE* fp;
  376. if ((fp = popen(cmd, "r")) == NULL) {
  377. printf("Error opening pipe!\n");
  378. return NULL;
  379. }
  380. while (fgets(buf, 128, fp) != NULL) {}
  381. if (pclose(fp)) {
  382. printf("Command not found or exited with error status\n");
  383. return NULL;
  384. }
  385. std::string homeDir = std::string(buf);
  386. homeDir.erase(std::remove(homeDir.begin(), homeDir.end(), '\n'), homeDir.end());
  387. return homeDir;
  388. #endif
  389. #ifdef __UBIQUITI__
  390. // Only persistent location after firmware upgrades
  391. return std::string("/config/zerotier-one");
  392. #endif
  393. // Check for user-defined environment variable before using defaults
  394. #ifdef __WINDOWS__
  395. DWORD bufferSize = 65535;
  396. std::string userDefinedPath;
  397. bufferSize = GetEnvironmentVariable("ZEROTIER_HOME", &userDefinedPath[0], bufferSize);
  398. if (bufferSize) {
  399. return userDefinedPath;
  400. }
  401. #else
  402. if (const char* userDefinedPath = getenv("ZEROTIER_HOME")) {
  403. return std::string(userDefinedPath);
  404. }
  405. #endif
  406. // Finally, resort to using default paths if no user-defined path was provided
  407. #ifdef __UNIX_LIKE__
  408. #ifdef __APPLE__
  409. // /Library/... on Apple
  410. return std::string("/Library/Application Support/ZeroTier/One");
  411. #else
  412. #ifdef __BSD__
  413. // BSD likes /var/db instead of /var/lib
  414. return std::string("/var/db/zerotier-one");
  415. #else
  416. // Use /var/lib for Linux and other *nix
  417. return std::string("/var/lib/zerotier-one");
  418. #endif
  419. #endif
  420. #else // not __UNIX_LIKE__
  421. #ifdef __WINDOWS__
  422. // Look up app data folder on Windows, e.g. C:\ProgramData\...
  423. char buf[16384];
  424. if (SUCCEEDED(SHGetFolderPathA(NULL, CSIDL_COMMON_APPDATA, NULL, 0, buf)))
  425. return (std::string(buf) + "\\ZeroTier\\One");
  426. else
  427. return std::string("C:\\ZeroTier\\One");
  428. #else
  429. return (std::string(ZT_PATH_SEPARATOR_S) + "ZeroTier" + ZT_PATH_SEPARATOR_S + "One"); // UNKNOWN PLATFORM
  430. #endif
  431. #endif // __UNIX_LIKE__ or not...
  432. }
  433. #ifndef OMIT_JSON_SUPPORT
  434. // Inline these massive JSON operations in one place only to reduce binary footprint and compile time
  435. nlohmann::json OSUtils::jsonParse(const std::string& buf)
  436. {
  437. return nlohmann::json::parse(buf.c_str());
  438. }
  439. std::string OSUtils::jsonDump(const nlohmann::json& j, int indentation)
  440. {
  441. return j.dump(indentation);
  442. }
  443. uint64_t OSUtils::jsonInt(const nlohmann::json& jv, const uint64_t dfl)
  444. {
  445. try {
  446. if (jv.is_number()) {
  447. return (uint64_t)jv;
  448. }
  449. else if (jv.is_string()) {
  450. std::string s = jv;
  451. return Utils::strToU64(s.c_str());
  452. }
  453. else if (jv.is_boolean()) {
  454. return ((bool)jv ? 1ULL : 0ULL);
  455. }
  456. }
  457. catch (...) {
  458. }
  459. return dfl;
  460. }
  461. double OSUtils::jsonDouble(const nlohmann::json& jv, const double dfl)
  462. {
  463. try {
  464. if (jv.is_number()) {
  465. return (double)jv;
  466. }
  467. else if (jv.is_string()) {
  468. std::string s = jv;
  469. return Utils::strToDouble(s.c_str());
  470. }
  471. else if (jv.is_boolean()) {
  472. return (double)jv;
  473. }
  474. }
  475. catch (...) {
  476. }
  477. return dfl;
  478. }
  479. uint64_t OSUtils::jsonIntHex(const nlohmann::json& jv, const uint64_t dfl)
  480. {
  481. try {
  482. if (jv.is_number()) {
  483. return (uint64_t)jv;
  484. }
  485. else if (jv.is_string()) {
  486. std::string s = jv;
  487. return Utils::hexStrToU64(s.c_str());
  488. }
  489. else if (jv.is_boolean()) {
  490. return ((bool)jv ? 1ULL : 0ULL);
  491. }
  492. }
  493. catch (...) {
  494. }
  495. return dfl;
  496. }
  497. bool OSUtils::jsonBool(const nlohmann::json& jv, const bool dfl)
  498. {
  499. try {
  500. if (jv.is_boolean()) {
  501. return (bool)jv;
  502. }
  503. else if (jv.is_number()) {
  504. return ((uint64_t)jv > 0ULL);
  505. }
  506. else if (jv.is_string()) {
  507. std::string s = jv;
  508. if (s.length() > 0) {
  509. switch (s[0]) {
  510. case 't':
  511. case 'T':
  512. case '1':
  513. return true;
  514. }
  515. }
  516. return false;
  517. }
  518. }
  519. catch (...) {
  520. }
  521. return dfl;
  522. }
  523. std::string OSUtils::jsonString(const nlohmann::json& jv, const char* dfl)
  524. {
  525. try {
  526. if (jv.is_string()) {
  527. return jv;
  528. }
  529. else if (jv.is_number()) {
  530. char tmp[64];
  531. ztsnprintf(tmp, sizeof(tmp), "%llu", (uint64_t)jv);
  532. return tmp;
  533. }
  534. else if (jv.is_boolean()) {
  535. return ((bool)jv ? std::string("1") : std::string("0"));
  536. }
  537. }
  538. catch (...) {
  539. }
  540. return std::string((dfl) ? dfl : "");
  541. }
  542. std::string OSUtils::jsonBinFromHex(const nlohmann::json& jv)
  543. {
  544. std::string s(jsonString(jv, ""));
  545. if (s.length() > 0) {
  546. unsigned int buflen = (unsigned int)((s.length() / 2) + 1);
  547. char* buf = new char[buflen];
  548. try {
  549. unsigned int l = Utils::unhex(s.c_str(), buf, buflen);
  550. std::string b(buf, l);
  551. delete[] buf;
  552. return b;
  553. }
  554. catch (...) {
  555. delete[] buf;
  556. }
  557. }
  558. return std::string();
  559. }
  560. #endif // OMIT_JSON_SUPPORT
  561. // Used to convert HTTP header names to ASCII lower case
  562. const unsigned char OSUtils::TOLOWER_TABLE[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c,
  563. 0x1d, 0x1e, 0x1f, ' ', '!', '"', '#', '$', '%', '&', 0x27, '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
  564. ':', ';', '<', '=', '>', '?', '@', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
  565. 'w', 'x', 'y', 'z', '{', '|', '}', '~', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
  566. 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~', 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90,
  567. 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad,
  568. 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca,
  569. 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
  570. 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff };
  571. } // namespace ZeroTier