OSUtils.cpp 16 KB

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