From 4acf155fb2ced327495fe95e64bf62117f5d307a Mon Sep 17 00:00:00 2001 From: Yonit Halperin Date: Tue, 6 Apr 2010 18:07:49 +0300 Subject: server configuration: make network redirection support optional By default it is disabled. To enable: configure --enable-tunnel. When active, requires libslirp. --- server/Makefile.am | 12 ++++++++++-- server/reds.c | 8 +++++++- 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'server') diff --git a/server/Makefile.am b/server/Makefile.am index 0fe1c0e6..d09e2d20 100644 --- a/server/Makefile.am +++ b/server/Makefile.am @@ -50,6 +50,15 @@ libspice_server_la_LIBADD = \ $(LIBRT) \ $(NULL) +if SUPPORT_TUNNEL + TUNNEL_SRCS = \ + red_tunnel_worker.c \ + red_tunnel_worker.h \ + $(NULL) +else + TUNNEL_SRCS = +endif + libspice_server_la_SOURCES = \ glz_encoder.c \ glz_encoder_config.h \ @@ -73,10 +82,9 @@ libspice_server_la_SOURCES = \ snd_worker.h \ red_channel.h \ red_channel.c \ - red_tunnel_worker.c \ - red_tunnel_worker.h \ spice.h \ vd_interface.h \ + $(TUNNEL_SRCS) \ $(COMMON_SRCS) \ $(NULL) diff --git a/server/reds.c b/server/reds.c index ef088f0d..675db619 100644 --- a/server/reds.c +++ b/server/reds.c @@ -46,11 +46,13 @@ #include "red_common.h" #include "red_dispatcher.h" #include "snd_worker.h" -#include "red_tunnel_worker.h" #include #include "stat.h" #include "ring.h" #include "config.h" +#ifdef HAVE_SLIRP +#include "red_tunnel_worker.h" +#endif CoreInterface *core = NULL; static MigrationInterface *mig = NULL; @@ -5162,6 +5164,7 @@ static void interface_change_notifier(void *opaque, VDInterface *interface, } attach_to_red_agent((VDIPortInterface *)interface); } else if (strcmp(interface->type, VD_INTERFACE_NET_WIRE) == 0) { +#ifdef HAVE_SLIRP NetWireInterface * net_wire = (NetWireInterface *)interface; red_printf("VD_INTERFACE_NET_WIRE"); if (red_tunnel) { @@ -5174,6 +5177,9 @@ static void interface_change_notifier(void *opaque, VDInterface *interface, return; } red_tunnel = red_tunnel_attach(core, net_wire); +#else + red_printf("unsupported net wire interface"); +#endif } break; case VD_INTERFACE_REMOVING: -- cgit