OSUtils.cpp 16 KB

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