int buflen;
};
-static int pfd_closing(Plug plug, char *error_msg, int error_code,
+static int pfd_closing(Plug plug, const char *error_msg, int error_code,
int calling_back)
{
struct PFwdPrivate *pr = (struct PFwdPrivate *) plug;
}
if (pr->dynamic == 0x5001) {
- int atype, alen;
+ int atype, alen = 0;
if (pr->port < 6) continue;
atype = (unsigned char)pr->hostname[3];
if (atype == 1) /* IPv4 address */
/*
* Called when receiving a PORT OPEN from the server
*/
-char *pfd_newconnect(Socket *s, char *hostname, int port, void *c,
- const Config *cfg)
+const char *pfd_newconnect(Socket *s, char *hostname, int port,
+ void *c, const Config *cfg)
{
static const struct plug_function_table fn_table = {
pfd_closing,
};
SockAddr addr;
- char *err, *dummy_realhost;
+ const char *err;
+ char *dummy_realhost;
struct PFwdPrivate *pr;
/*
pr->ready = 1;
pr->c = c;
pr->backhandle = NULL; /* we shouldn't need this */
+ pr->dynamic = 0;
pr->s = *s = new_connection(addr, dummy_realhost, port,
0, 1, 0, (Plug) pr, cfg);
called when someone connects to the local port
*/
-static int pfd_accepting(Plug p, void *sock)
+static int pfd_accepting(Plug p, OSSocket sock)
{
static const struct plug_function_table fn_table = {
pfd_closing,
};
struct PFwdPrivate *pr, *org;
Socket s;
- char *err;
+ const char *err;
org = (struct PFwdPrivate *)p;
pr = snew(struct PFwdPrivate);
pr->port = 0; /* hostname buffer is so far empty */
sk_set_frozen(s, 0); /* we want to receive SOCKS _now_! */
} else {
+ pr->dynamic = 0;
strcpy(pr->hostname, org->hostname);
pr->port = org->port;
pr->c = new_sock_channel(org->backhandle, s);
/* Add a new forwarding from port -> desthost:destport
sets up a listener on the local machine on (srcaddr:)port
*/
-char *pfd_addforward(char *desthost, int destport, char *srcaddr, int port,
- void *backhandle, const Config *cfg)
+const char *pfd_addforward(char *desthost, int destport, char *srcaddr,
+ int port, void *backhandle, const Config *cfg)
{
static const struct plug_function_table fn_table = {
pfd_closing,
pfd_accepting
};
- char *err;
+ const char *err;
struct PFwdPrivate *pr;
Socket s;