diff options
author | Damien Miller <djm@mindrot.org> | 2014-07-18 14:11:24 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2014-07-18 14:11:24 +1000 |
commit | 7acefbbcbeab725420ea07397ae35992f505f702 (patch) | |
tree | bfb07917715d425438dab987a47ccd7a8d7f118b /misc.h | |
parent | 6262d760e00714523633bd989d62e273a3dca99a (diff) |
- millert@cvs.openbsd.org 2014/07/15 15:54:14
[PROTOCOL auth-options.c auth-passwd.c auth-rh-rsa.c auth-rhosts.c]
[auth-rsa.c auth.c auth1.c auth2-hostbased.c auth2-kbdint.c auth2-none.c]
[auth2-passwd.c auth2-pubkey.c auth2.c canohost.c channels.c channels.h]
[clientloop.c misc.c misc.h monitor.c mux.c packet.c readconf.c]
[readconf.h servconf.c servconf.h serverloop.c session.c ssh-agent.c]
[ssh.c ssh_config.5 sshconnect.c sshconnect1.c sshconnect2.c sshd.c]
[sshd_config.5 sshlogin.c]
Add support for Unix domain socket forwarding. A remote TCP port
may be forwarded to a local Unix domain socket and vice versa or
both ends may be a Unix domain socket. This is a reimplementation
of the streamlocal patches by William Ahern from:
http://www.25thandclement.com/~william/projects/streamlocal.html
OK djm@ markus@
Diffstat (limited to 'misc.h')
-rw-r--r-- | misc.h | 25 |
1 files changed, 24 insertions, 1 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: misc.h,v 1.53 2014/05/02 03:27:54 djm Exp $ */ | 1 | /* $OpenBSD: misc.h,v 1.54 2014/07/15 15:54:14 millert Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
@@ -15,6 +15,25 @@ | |||
15 | #ifndef _MISC_H | 15 | #ifndef _MISC_H |
16 | #define _MISC_H | 16 | #define _MISC_H |
17 | 17 | ||
18 | /* Data structure for representing a forwarding request. */ | ||
19 | struct Forward { | ||
20 | char *listen_host; /* Host (address) to listen on. */ | ||
21 | int listen_port; /* Port to forward. */ | ||
22 | char *listen_path; /* Path to bind domain socket. */ | ||
23 | char *connect_host; /* Host to connect. */ | ||
24 | int connect_port; /* Port to connect on connect_host. */ | ||
25 | char *connect_path; /* Path to connect domain socket. */ | ||
26 | int allocated_port; /* Dynamically allocated listen port */ | ||
27 | int handle; /* Handle for dynamic listen ports */ | ||
28 | }; | ||
29 | |||
30 | /* Common server and client forwarding options. */ | ||
31 | struct ForwardOptions { | ||
32 | int gateway_ports; /* Allow remote connects to forwarded ports. */ | ||
33 | mode_t streamlocal_bind_mask; /* umask for streamlocal binds */ | ||
34 | int streamlocal_bind_unlink; /* unlink socket before bind */ | ||
35 | }; | ||
36 | |||
18 | /* misc.c */ | 37 | /* misc.c */ |
19 | 38 | ||
20 | char *chop(char *); | 39 | char *chop(char *); |
@@ -37,6 +56,7 @@ void ms_subtract_diff(struct timeval *, int *); | |||
37 | void ms_to_timeval(struct timeval *, int); | 56 | void ms_to_timeval(struct timeval *, int); |
38 | time_t monotime(void); | 57 | time_t monotime(void); |
39 | void lowercase(char *s); | 58 | void lowercase(char *s); |
59 | int unix_listener(const char *, int, int); | ||
40 | 60 | ||
41 | void sock_set_v6only(int); | 61 | void sock_set_v6only(int); |
42 | 62 | ||
@@ -68,6 +88,9 @@ int tun_open(int, int); | |||
68 | #define SSH_TUNID_ERR (SSH_TUNID_ANY - 1) | 88 | #define SSH_TUNID_ERR (SSH_TUNID_ANY - 1) |
69 | #define SSH_TUNID_MAX (SSH_TUNID_ANY - 2) | 89 | #define SSH_TUNID_MAX (SSH_TUNID_ANY - 2) |
70 | 90 | ||
91 | /* Fake port to indicate that host field is really a path. */ | ||
92 | #define PORT_STREAMLOCAL -2 | ||
93 | |||
71 | /* Functions to extract or store big-endian words of various sizes */ | 94 | /* Functions to extract or store big-endian words of various sizes */ |
72 | u_int64_t get_u64(const void *) | 95 | u_int64_t get_u64(const void *) |
73 | __attribute__((__bounded__( __minbytes__, 1, 8))); | 96 | __attribute__((__bounded__( __minbytes__, 1, 8))); |