config TCPSVD
bool "tcpsvd"
default y
- depends on PLATFORM_LINUX
help
tcpsvd listens on a TCP port and runs a program for each new
connection.
config UDPSVD
bool "udpsvd"
default y
- depends on PLATFORM_LINUX
help
udpsvd listens on an UDP port and runs a program for each new
connection.
*/
#include "libbb.h"
+
/* Wants <limits.h> etc, thus included after libbb.h: */
+#ifdef __linux__
#include <linux/types.h> /* for __be32 etc */
#include <linux/netfilter_ipv4.h>
+#endif
// TODO: move into this file:
#include "tcpudp_perhost.h"
/* setup ucspi env */
const char *proto = tcp ? "TCP" : "UDP";
+#ifdef SO_ORIGINAL_DST
/* Extract "original" destination addr:port
* from Linux firewall. Useful when you redirect
* an outbond connection to local handler, and it needs
xsetenv_plain("TCPORIGDSTADDR", addr);
free(addr);
}
+#endif
xsetenv_plain("PROTO", proto);
xsetenv_proto(proto, "LOCALADDR", local_addr);
xsetenv_proto(proto, "REMOTEADDR", remote_addr);