Implement promiscuous (dumb) mode by binding port on outgoing socket

This mode is useful for services which cannot handle multiple clients.
Also useful for NAT traversal.

All outgoing packets would be transmitted from a single "client" (UDP port).
Moreover, only one (latest) proxy client receives the reply.
This commit is contained in:
ValdikSS
2017-04-13 00:59:14 +03:00
parent 1f8f9b591b
commit b750cefb00
3 changed files with 21 additions and 12 deletions

2
net.h
View File

@@ -56,7 +56,7 @@ void handle_inside(int inside, host_t *listen_h, host_t *bind_h, host_t *dst_h);
void handle_outside(int inside, int outside, host_t *outside_h);
int main_loop(int listensocket, host_t *listen_h, host_t *bind_h, host_t *dst_h);
int start_listener (char *inip, char *inpt, char *srcip, char *dstip,
int start_listener (char *inip, char *inpt, char *srcip, char *srcpt, char *dstip,
char *dstpt, char *pidfile, char *chrootdir, char *user);
int daemonize(char *pidfile);
int drop_privileges(char *user, char *chrootdir);