tcpforward.h 2.25 KB
Newer Older
1
2
3
4
5
6
7
/* tcpforward.h
 *
 * $Id$
 */

/* lsh, an implementation of the ssh protocol
 *
8
 * Copyright (C) 1998 Balázs Scheidler, Niels Möller
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#ifndef LSH_TCPFORWARD_H_INCLUDED
#define LSH_TCPFORWARD_H_INCLUDED

#include "channel.h"
Niels Möller's avatar
Niels Möller committed
29
#include "command.h"
30
31
32
33
#include "io.h"
#include "resource.h"
#include "xalloc.h"

34
#define GABA_DECLARE
35
#include "tcpforward.h.x"
36
#undef GABA_DECLARE
Niels Möller's avatar
Niels Möller committed
37
38
39
40
41
42
43
44

/* GABA:
   (class
     (name forwarded_port)
     (vars
       ; this could store the type of this forward
       ; tcp, udp etc. Or we could invent relevant methods
       ; and subclasses.
Niels Möller's avatar
Niels Möller committed
45
       ; (type . int)
Niels Möller's avatar
Niels Möller committed
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
       
       (listen object address_info)))
*/

/* GABA:
   (class
     (name local_port)
     (super forwarded_port)
     (vars
       ; socket == NULL means that we are setting up a forward for this port,
       ; but are not done yet.
       (socket object lsh_fd)))
*/

/* Used by the client to keep track of remotely forwarded ports */
/* GABA:
   (class
     (name remote_port)
     (super forwarded_port)
     (vars
       ; Invoked when a forwarded_tcpip request is received.
       ; Called with the struct address_info *peer as argument.
       (callback object command)))
*/

struct remote_port *
make_remote_port(struct address_info *listen,
		 struct command *callback);
74

Niels Möller's avatar
Niels Möller committed
75
76
struct channel_open *
make_channel_open_direct_tcpip(struct command *callback);
77

78
extern struct channel_open channel_open_forwarded_tcpip;
79

80
81
struct global_request *
make_tcpip_forward_request(struct command *callback);
82

Niels Möller's avatar
Niels Möller committed
83
extern struct global_request tcpip_cancel_forward;
84

85
#endif /* LSH_TCPFORWARD_H_INCLUDED */