diff --git a/proximac-cli/jconf.c b/proximac-cli/jconf.c index 78ac799..405d1a4 100644 --- a/proximac-cli/jconf.c +++ b/proximac-cli/jconf.c @@ -18,7 +18,10 @@ void read_conf(char* configfile, conf_t* conf) char* configbuf = NULL; char localport_buf[6] = { 0 }; char proximac_port_buf[6] = { 0 }; + char vpn_mode_buf[6] = { 0 }; int vlen = 0; + + /* need to reset these bufs to zero */ FILE* f = fopen(configfile, "rb"); if (f == NULL) { @@ -60,25 +63,38 @@ void read_conf(char* configfile, conf_t* conf) pid_to_insert->name[vlen] = '\0'; pid_to_insert->pid = hash(pid_to_insert->name); RB_INSERT(pid_tree, &pid_list, pid_to_insert); - LOGI("%d. %s hash %x", index, pid_to_insert->name, pid_to_insert->pid); + LOGI("%d. %s hash %d", index, pid_to_insert->name, pid_to_insert->pid); } conf->total_process_num = index; } - JSONPARSE("proximac_listen_address") - { - conf->proximac_listen_address = (char*)malloc(vlen + 1); - memcpy(conf->proximac_listen_address, val, vlen); - conf->proximac_listen_address[vlen] = '\0'; - } - JSONPARSE("proximac_port") { memcpy(proximac_port_buf, val, vlen); conf->proximac_port = atoi(proximac_port_buf); } + + JSONPARSE("VPN_mode") + { + memcpy(vpn_mode_buf, val, vlen); + conf->vpn_mode = atoi(vpn_mode_buf); + } + JSONPARSE("proxyapp_name") + { + struct pid* proxyapp_hash = malloc(sizeof(struct pid)); + proxyapp_hash->name = calloc(1, vlen + 1); + memcpy(proxyapp_hash->name, val, vlen); + proxyapp_hash->name[vlen] = '\0'; + proxyapp_hash->pid = hash(proxyapp_hash->name); + LOGI("Proxy App name is %s", proxyapp_hash->name); + LOGD("Proxy App name is %s, hash %d", proxyapp_hash->name, proxyapp_hash->pid); + + conf->proxyapp_hash = proxyapp_hash->pid; + free(proxyapp_hash); + } + JSONPARSE("local_port") { memcpy(localport_buf, val, vlen); diff --git a/proximac-cli/jconf.h b/proximac-cli/jconf.h index 47c7583..981a422 100644 --- a/proximac-cli/jconf.h +++ b/proximac-cli/jconf.h @@ -25,6 +25,8 @@ typedef struct { uint16_t proximac_port; int pid; int total_process_num; + int vpn_mode; + int proxyapp_hash; } conf_t; extern void read_conf(char* configfile, conf_t* conf); diff --git a/proximac-cli/local.c b/proximac-cli/local.c index 9c94281..61c80a3 100644 --- a/proximac-cli/local.c +++ b/proximac-cli/local.c @@ -118,8 +118,7 @@ static void remote_read_cb(uv_stream_t* stream, ssize_t nread, const uv_buf_t* b wr->req.data = server_ctx; unsigned char username_len = strlen(conf.username); unsigned char password_len = strlen(conf.password); - int len = 1 /* fixed 1 byte */ + 2 /* two bytes indicate the length of username and password */ + username_len + password_len; - int offset = 0; + int len = 1 /* fixed 1 byte */ + 2 /* 2 bytes for username and password */ + username_len + password_len; char* socks5req = malloc(len); socks5req[0] = 0x01; /* version of auth */ socks5req[1] = username_len; @@ -297,13 +296,12 @@ static void server_read_cb(uv_stream_t* stream, ssize_t nread, const uv_buf_t* b server_ctx->buf = tmpbuf; } else { - server_ctx->buf_len = NULL; + server_ctx->buf_len = 0; server_ctx->buf = NULL; } free(buf->base); - LOGD("server_ctx %x addrlen = %d addr = %s port = %d", server_ctx, server_ctx->addrlen, server_ctx->remote_addr, server_ctx->port); struct sockaddr_in remote_addr; memset(&remote_addr, 0, sizeof(remote_addr)); @@ -353,11 +351,10 @@ int tell_kernel_to_hook() struct ctl_info ctl_info; struct sockaddr_ctl sc; errno_t retval = 0; - LOGI("tell kernel"); gSocket = socket(PF_SYSTEM, SOCK_DGRAM, SYSPROTO_CONTROL); if (gSocket < 0) { - LOGE("socket SYSPROTO_CONTROL"); + LOGI("socket() failed."); exit(EXIT_FAILURE); } @@ -377,16 +374,28 @@ int tell_kernel_to_hook() sc.sc_unit = 0; if (connect(gSocket, (struct sockaddr*)&sc, sizeof(struct sockaddr_ctl))) { - LOGE("connect"); + LOGI("Connection to kernel failed. The kernel module may not be correctly loaded."); exit(EXIT_FAILURE); } - int tmp = 0; - retval = setsockopt(gSocket, SYSPROTO_CONTROL, PROXIMAC_ON, &tmp, sizeof(tmp)); + + int vpn_mode = 0; + if (conf.vpn_mode == 1) + vpn_mode = 1; + + retval = setsockopt(gSocket, SYSPROTO_CONTROL, PROXIMAC_ON, &vpn_mode, sizeof(vpn_mode)); if (retval) { LOGE("setsockopt failure PROXIMAC_ON"); return retval; } + + if (vpn_mode == 1) { + retval = setsockopt(gSocket, SYSPROTO_CONTROL, NOT_TO_HOOK, &conf.proxyapp_hash, sizeof(conf.proxyapp_hash)); + if (retval) { + LOGE("setsockopt failure NOT_TO_HOOK"); + return retval; + } + } struct pid* pid_tmp = NULL; int pidset_checksum = 0; @@ -422,7 +431,10 @@ int tell_kernel_to_hook() return retval; } - LOGI("pid_num = %d", pid_num); + if (conf.vpn_mode == 1) + LOGI("All traffic will be redirected to this SOCKS5 proxy"); + else + LOGI("The total number of process that will be hooked = %d", pid_num); return retval; } @@ -451,7 +463,7 @@ int main(int argc, char** argv) { int c, option_index = 0, daemon = 0; char* configfile = NULL; - char* logfile_path = "/tmp/proximac.log"; + char* logfile_path = "./proximac.log"; RB_INIT(&pid_list); opterr = 0; static struct option long_options[] = { @@ -481,6 +493,10 @@ int main(int argc, char** argv) usage(); exit(EXIT_FAILURE); } + + if (log_to_file) { + USE_LOGFILE(logfile_path); + } if (configfile) { read_conf(configfile, &conf); @@ -497,8 +513,7 @@ int main(int argc, char** argv) if (daemon == 1) init_daemon(); - if (log_to_file) - USE_LOGFILE(logfile_path); + struct sockaddr_in bind_addr; loop = malloc(sizeof *loop); @@ -508,16 +523,16 @@ int main(int argc, char** argv) uv_tcp_init(loop, &listener->handle); uv_tcp_nodelay(&listener->handle, 1); - r = uv_ip4_addr(conf.proximac_listen_address, conf.proximac_port, &bind_addr); + r = uv_ip4_addr("127.0.0.1", conf.proximac_port, &bind_addr); if (r) - LOGE("address error"); + LOGE("Translate address error"); r = uv_tcp_bind(&listener->handle, (struct sockaddr*)&bind_addr, 0); if (r) - LOGI("bind error"); + LOGI("Bind error"); r = uv_listen((uv_stream_t*)&listener->handle, 128 /*backlog*/, server_accept_cb); if (r) - LOGI("listen error port"); - LOGI("Listening on %s:%d", conf.proximac_listen_address, conf.proximac_port); + LOGI("Listen error"); + LOGI("Listening on %d", conf.proximac_port); signal(SIGPIPE, SIG_IGN); uv_signal_t sigint, sigstp, sigkil; diff --git a/proximac-cli/local.h b/proximac-cli/local.h index 1dc739c..dda9be1 100644 --- a/proximac-cli/local.h +++ b/proximac-cli/local.h @@ -7,6 +7,8 @@ #define CTL_INIT 0x01 #define CTL_NORMAL 0 +#define LOCALHOST "127.0.0.1" + // packet related MACROs #define MAX_PKT_SIZE 8192 #define ID_LEN 4 @@ -30,6 +32,7 @@ #define HOOK_PID 2 #define PIDLIST_STATUS 3 #define PROXIMAC_OFF 4 +#define NOT_TO_HOOK 5 #include "tree.h" diff --git a/proximac-cli/utils.h b/proximac-cli/utils.h index 2812c09..3613a95 100644 --- a/proximac-cli/utils.h +++ b/proximac-cli/utils.h @@ -7,6 +7,7 @@ #include #include #include + extern FILE * logfile; #if __GNUC__ >= 3 @@ -47,102 +48,15 @@ extern FILE * logfile; assert(0); \ } while(0) -#ifdef XCODE_DEBUG -#define LOGI(format, ...) \ -do { \ - time_t now = time(NULL); \ - char timestr[20]; \ - strftime(timestr, 20, TIME_FORMAT, localtime(&now)); \ - fprintf(stderr, " %s INFO: " format "\n", timestr, \ - ## __VA_ARGS__); \ - fflush(stderr); \ -} \ -while (0) -#else -#define LOGI(format, ...) \ -do { \ - time_t now = time(NULL); \ - char timestr[20]; \ - strftime(timestr, 20, TIME_FORMAT, localtime(&now)); \ - fprintf(stderr, "\x1b[32m %s INFO: \e[0m" format "\n", \ - timestr,## __VA_ARGS__); \ - fflush(stderr); \ -} \ -while (0) -#endif -#ifdef XCODE_DEBUG -#define LOGW(format, ...) \ -do { \ - time_t now = time(NULL); \ - char timestr[20]; \ - strftime(timestr, 20, TIME_FORMAT, localtime(&now)); \ - fprintf(stderr, " %s WARN: " format "\n", \ - timestr,## __VA_ARGS__); \ - fflush(stderr); \ -} \ -while (0) -#else -#define LOGW(format, ...) \ -do { \ - time_t now = time(NULL); \ - char timestr[20]; \ - strftime(timestr, 20, TIME_FORMAT, localtime(&now)); \ - if (logfile != NULL) { \ - fprintf(logfile, " %s WARN: " format "\n", \ - timestr,## __VA_ARGS__); \ - fflush(logfile); \ - } \ - else { \ - fprintf(stderr, "\x1b[33m %s WARN: \e[0m" format "\n", \ - timestr,## __VA_ARGS__); \ - fflush(stderr); \ - } \ -} \ -while (0) -#endif -#ifdef XCODE_DEBUG -#define LOGD(format, ...) \ -do { \ - time_t now = time(NULL); \ - char timestr[20]; \ - strftime(timestr, 20, TIME_FORMAT, localtime(&now)); \ - fprintf(stderr, " %s INFO: " format "\n", timestr, \ - ## __VA_ARGS__); \ - fflush(stderr); \ - } \ -while (0) -#else -#define LOGD(format, ...) \ -do { \ - if (logfile != NULL) { \ - time_t now = time(NULL); \ - char timestr[20]; \ - strftime(timestr, 20, TIME_FORMAT, localtime(&now)); \ - fprintf(logfile, " %s INFO: " format "\n", timestr, \ - ## __VA_ARGS__); \ - fflush(logfile); \ - } \ - else { \ - time_t now = time(NULL); \ - char timestr[20]; \ - strftime(timestr, 20, TIME_FORMAT, localtime(&now)); \ - fprintf(stderr, "\x1b[32m %s INFO: \e[0m" format "\n", timestr, \ - ## __VA_ARGS__); \ - fflush(stderr); \ - } \ -} \ -while (0) -#endif - -#define FATAL(format, ...) \ +#define _LOG(color, tag, format, ...) \ do { \ if (logfile != NULL) { \ time_t now = time(NULL); \ char timestr[20]; \ strftime(timestr, 20, TIME_FORMAT, localtime(&now)); \ - fprintf(logfile, " %s FATAL: " format "\n", timestr, \ + fprintf(logfile, " %s " tag ": " format "\n", timestr, \ ## __VA_ARGS__); \ fflush(logfile); \ } \ @@ -150,32 +64,29 @@ do { \ time_t now = time(NULL); \ char timestr[20]; \ strftime(timestr, 20, TIME_FORMAT, localtime(&now)); \ - fprintf(stderr, "\x1b[31m %s FATAL: \e[0m" format "\n", timestr, \ + fprintf(stderr, color " %s " tag ": \e[0m" format "\n", timestr, \ ## __VA_ARGS__); \ fflush(stderr); \ } \ - exit(EXIT_FAILURE); \ } \ while (0) -#define LOGE(format, ...) \ -do { \ - time_t now = time(NULL); \ - char timestr[20]; \ - strftime(timestr, 20, TIME_FORMAT, localtime(&now)); \ - if (logfile != NULL) { \ - fprintf(logfile, " %s ERROR: " format "\n", \ - timestr,## __VA_ARGS__); \ - fflush(logfile); \ - } \ - else { \ - fprintf(stderr, "\x1b[31m %s ERROR: \e[0m" format "\n", \ - timestr,## __VA_ARGS__); \ - fflush(stderr); \ - } \ -} \ +#define LOGI(format, ...) \ +do { \ + time_t now = time(NULL); \ + char timestr[20]; \ + strftime(timestr, 20, TIME_FORMAT, localtime(&now)); \ + fprintf(stderr, "\x1b[32m" " %s INFO: \e[0m" format "\n", timestr, \ + ## __VA_ARGS__); \ + fflush(stderr); \ +} \ while (0) +#define LOGD(format, ...) _LOG("\x1b[32m", "Debug", format, ##__VA_ARGS__) +#define LOGW(format, ...) _LOG("\x1b[33m", "Warning", format, ##__VA_ARGS__) +#define LOGE(format, ...) _LOG("\x1b[31m", "Error", format, ##__VA_ARGS__) +#define FATAL(format, ...) _LOG("\x1b[31m", "Fatal", format, ##__VA_ARGS__) + #define SHOW_BUFFER(buf, len) \ do { \ for (int i = 0; iIDESourceControlProjectOriginsDictionary 8BD223DEF30FBE5E513BC5235F66567CE49ADFB9 - https://github.com/csujedihy/proximac + github.com:csujedihy/proximac.git IDESourceControlProjectPath proximac.xcodeproj @@ -21,7 +21,7 @@ ../.. IDESourceControlProjectURL - https://github.com/csujedihy/proximac + github.com:csujedihy/proximac.git IDESourceControlProjectVersion 111 IDESourceControlProjectWCCIdentifier diff --git a/proximac.xcodeproj/project.xcworkspace/xcuserdata/jedihy.xcuserdatad/UserInterfaceState.xcuserstate b/proximac.xcodeproj/project.xcworkspace/xcuserdata/jedihy.xcuserdatad/UserInterfaceState.xcuserstate index 0798a24..6db5713 100644 Binary files a/proximac.xcodeproj/project.xcworkspace/xcuserdata/jedihy.xcuserdatad/UserInterfaceState.xcuserstate and b/proximac.xcodeproj/project.xcworkspace/xcuserdata/jedihy.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/proximac.xcodeproj/xcuserdata/jedihy.xcuserdatad/xcschemes/proximac-cli.xcscheme b/proximac.xcodeproj/xcuserdata/jedihy.xcuserdatad/xcschemes/proximac-cli.xcscheme index 7d9ac29..b8577d8 100644 --- a/proximac.xcodeproj/xcuserdata/jedihy.xcuserdatad/xcschemes/proximac-cli.xcscheme +++ b/proximac.xcodeproj/xcuserdata/jedihy.xcuserdatad/xcschemes/proximac-cli.xcscheme @@ -42,14 +42,14 @@ - + - + diff --git a/proximac/proximac.c b/proximac/proximac.c index bbb2ed3..40e8a8e 100644 --- a/proximac/proximac.c +++ b/proximac/proximac.c @@ -35,6 +35,7 @@ static kern_ctl_ref g_proximac_ctl_ref = NULL; static int g_pid_num = 0; static int g_proximac_mode = PROXIMAC_MODE_OFF; +static int g_proxy_hash = 0; static bool g_proximac_tcp_filter_registered = false; static bool g_proximac_tcp_unreg_started = false; @@ -227,7 +228,7 @@ static struct kern_ctl_reg proximac_ctl_reg = { MYBUNDLEID, /* use a reverse dns name which includes a name unique to your comany */ 0, /* set to 0 for dynamically assigned control ID - CTL_FLAG_REG_ID_UNIT not set */ 0, /* ctl_unit - ignored when CTL_FLAG_REG_ID_UNIT not set */ - CTL_FLAG_PRIVILEGED, /* privileged access required to access this filter */ + 0, /* privileged access required to access this filter */ 0, /* use default send size buffer */ 0, /* use default receive size buffer */ proximac_ctl_connect_cb, /* called when a connection request is accepted (requied field)*/ @@ -296,6 +297,7 @@ static errno_t proximac_ctl_connect_cb( #define HOOK_PID 2 #define PIDLIST_STATUS 3 #define PROXIMAC_OFF 4 +#define NOT_TO_HOOK 5 static errno_t proximac_ctl_setopt_cb( kern_ctl_ref kctlref, @@ -309,6 +311,7 @@ static errno_t proximac_ctl_setopt_cb( int intval; switch (opt) { case PROXIMAC_ON: + { lck_rw_lock_exclusive(g_pidlist_lock); if (g_pid_num != 0) { @@ -335,6 +338,8 @@ static errno_t proximac_ctl_setopt_cb( lck_rw_unlock_exclusive(g_pidlist_lock); lck_rw_lock_exclusive(g_mode_lock); + + // install socket filters if (g_proximac_mode == PROXIMAC_MODE_OFF) { retval = install_proximac_tcp_filter(); @@ -343,10 +348,16 @@ static errno_t proximac_ctl_setopt_cb( lck_rw_unlock_exclusive(g_mode_lock); return retval; } - g_proximac_mode = PROXIMAC_MODE_ON; + intval = *(int *)data; + if(intval == 1){ + g_proximac_mode = PROXIMAC_MODE_ALL; + LOGI("In VPN mode"); + } + else + g_proximac_mode = PROXIMAC_MODE_ON; } lck_rw_unlock_exclusive(g_mode_lock); - + } break; // case PROXIMAC_OFF: // lck_rw_lock_exclusive(g_mode_lock); @@ -357,11 +368,12 @@ static errno_t proximac_ctl_setopt_cb( // return retval; // break; case HOOK_PID: + { if (len < sizeof(int)) { retval = EINVAL; break; } - intval = *(int *)data; + intval = *(int*)data; lck_rw_lock_exclusive(g_pidlist_lock); struct pid *pid_to_insert = _MALLOC(sizeof(struct pid), M_TEMP, M_WAITOK| M_ZERO); pid_to_insert->pid = intval; @@ -370,7 +382,22 @@ static errno_t proximac_ctl_setopt_cb( g_pid_num++; lck_rw_unlock_exclusive(g_pidlist_lock); break; + } + case NOT_TO_HOOK: + { + if (len < sizeof(int)) { + retval = EINVAL; + break; + } + intval = *(int*)data; + lck_rw_lock_exclusive(g_mode_lock); + g_proxy_hash = intval; + LOGI("proxy's hash has been set to %d", g_proxy_hash); + lck_rw_unlock_exclusive(g_mode_lock); + break; + + } default: break; } @@ -443,6 +470,8 @@ typedef struct proximac_cookie { struct sockaddr_in6 addr6; /* ipv6 remote addr */ } remote_addr; int protocol; /* IPv4 or IPv6 */ + int forward_flag; /* Forward Flag */ + int pid; } proximac_cookie_t; const static struct sflt_filter proximac_tcp_filter = { @@ -495,6 +524,8 @@ proximac_tcp_connect_out_cb( const struct sockaddr * to) { proximac_cookie_t * proximac_cookie = (proximac_cookie_t *)cookie; + assert(cookie); + lck_rw_lock_shared(g_mode_lock); if (g_proximac_mode == PROXIMAC_MODE_OFF) { @@ -503,30 +534,53 @@ proximac_tcp_connect_out_cb( } lck_rw_unlock_shared(g_mode_lock); - assert(cookie); - - // Make sure address family is correct assert(to->sa_family == AF_INET); assert(sizeof(struct sockaddr_in) <= to->sa_len); - assert((to->sa_family == AF_INET) || (to->sa_family == AF_INET6)); /*verify that the address is AF_INET/AF_INET6 */ - + assert((to->sa_family == AF_INET) || (to->sa_family == AF_INET6)); /* verify that the address is AF_INET/AF_INET6 */ assert (sizeof(proximac_cookie->remote_addr.addr4) >= to->sa_len); /* verify that there is enough room to store data */ + /* save the remote address in the tli_remote field */ bcopy(to, &(proximac_cookie->remote_addr.addr4), to->sa_len); struct sockaddr_in *remote_addr; remote_addr = (struct sockaddr_in*)to; proximac_cookie->remote_addr.addr4.sin_port = ntohs(proximac_cookie->remote_addr.addr4.sin_port); + + /* see if this is a local stream, then we just ignore */ + int local_tcp_flag = 0; + if (remote_addr->sin_addr.s_addr == LOCALHOST) + return 0; + + /* do not forward any traffic from proximac-cli or SOCKS5 proxy. Otherwise, traffic will be trapped in a loop */ + if (proximac_cookie->pid == 0 || proximac_cookie->pidhash_value == pid_hash(MYAPPNAME) || proximac_cookie->pidhash_value == g_proxy_hash) { + LOGI("Traffic from this process is not allowed to be forwarded. PID = %d", proximac_cookie->pid); + return 0; + } + + /* see if we're in forward all mode which is like VPN */ + if (g_proximac_mode == PROXIMAC_MODE_ALL) { + if (proximac_cookie->pid != 0 && local_tcp_flag == 0) { + proximac_cookie->forward_flag = 1; + LOGI("A process is now hooked"); + remote_addr->sin_port = htons(8558); + remote_addr->sin_addr.s_addr = LOCALHOST; + LOGI("forward flag has been set to 1"); + } + return 0; + } + struct pid find_pid; find_pid.pid = proximac_cookie->pidhash_value; lck_rw_lock_exclusive(g_pidlist_lock); struct pid *exist = RB_FIND(pid_tree, &pid_list, &find_pid); LOGI("after RB_FIND pid = %d pid_num %d\n", find_pid.pid, g_pid_num); lck_rw_unlock_exclusive(g_pidlist_lock); + if (exist != NULL) { - LOGI("found existed PID\n"); + proximac_cookie->forward_flag = 1; + LOGI("A process is now hooked"); remote_addr->sin_port = htons(8558); - remote_addr->sin_addr.s_addr = 0x100007f; + remote_addr->sin_addr.s_addr = LOCALHOST; } return 0; @@ -553,10 +607,13 @@ proximac_tcp_attach_cb(void ** cookie, socket_t so) } proximac_cookie_t * proximac_cookie = (proximac_cookie_t *)(*cookie); + proximac_cookie->forward_flag = 0; + char proc_name[64] = {0}; proc_selfname(proc_name, 63); + proximac_cookie->pid = proc_selfpid(); proximac_cookie->pidhash_value = pid_hash(proc_name); - LOGI("pid hash value = %d\n", proximac_cookie->pidhash_value); + LOGI("pid hash value = %d proc_name = %s\n", proximac_cookie->pidhash_value, proc_name); LOGI("Proximac TCP filter has been attached to a socket"); return 0; } @@ -575,14 +632,9 @@ proximac_tcp_notify_cb(void *cookie, socket_t so, sflt_event_t event, void *para inet_ntop(AF_INET, remoteAddr, (char*)addrString, sizeof(addrString)); // added prepend proximac_hdr for proximac - struct pid find_pid; - find_pid.pid = proximac_cookie->pidhash_value; - lck_rw_lock_exclusive(g_pidlist_lock); - struct pid *exist = RB_FIND(pid_tree, &pid_list, &find_pid); - LOGI("notify_cb -- after RB_FIND pid = %d pid_num = %d\n", find_pid.pid, g_pid_num); - lck_rw_unlock_exclusive(g_pidlist_lock); - if (exist != NULL) { - LOGI("notify_cb -- do hook operations to pid = %d\n", find_pid.pid); + + if (proximac_cookie->forward_flag == 1) { + LOGI("notify_cb -- do hook operations to pid"); mbuf_t proximac_hdr_data = NULL; mbuf_t proximac_hdr_control = NULL; errno_t retval; diff --git a/proximac/proximac.h b/proximac/proximac.h index 513d666..3658153 100644 --- a/proximac/proximac.h +++ b/proximac/proximac.h @@ -11,7 +11,10 @@ #define MYBUNDLEID "com.proximac.kext" #define PROXIMAC_TCP_FILTER_HANDLE 0x2e33677d -#define PROXIMAC_MODE_ON 1 #define PROXIMAC_MODE_OFF 0 +#define PROXIMAC_MODE_ON 1 +#define PROXIMAC_MODE_ALL 2 +#define LOCALHOST 0x100007f +#define MYAPPNAME "proximac-cli" #endif