#include <fcntl.h>
#include <string.h>
-#include <stropts.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/socket.h>
#include <errno.h>
#include <arpa/inet.h>
#include <stdint.h>
+#include <stdlib.h>
#include <linux/if.h>
#include <linux/if_tun.h>
#include <assert.h>
#include <atomic>
#include <chrono>
#include <thread>
+#include <string>
#if __has_include(<sys/random.h>)
#include <sys/random.h>
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, };
-uint32_t hex_to_num(const char* buf) {
- const char* pbegin = buf;
+uint32_t hex_to_num(const unsigned char* buf) {
+ const unsigned char* pbegin = buf;
while (p_util_hexdigit[*buf] != -1)
buf++;
buf--;