rewrite rcsocks.c and tunnel.c