summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/misc.h
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2014-07-15 15:54:16 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2014-07-15 15:54:16 +0000
commit4df827c87d1c22d7bcf04fafb8776788ec3d8cd3 (patch)
treeaf30b0dad78b066b92a3edfa64f54d2b1fff5c9e /usr.bin/ssh/misc.h
parent00d4c61e8e8d1537cb67af4fdfe0e319d81277a8 (diff)
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 'usr.bin/ssh/misc.h')
-rw-r--r--usr.bin/ssh/misc.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/usr.bin/ssh/misc.h b/usr.bin/ssh/misc.h
index 693fff8e4a8..53d469bc4ea 100644
--- a/usr.bin/ssh/misc.h
+++ b/usr.bin/ssh/misc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.h,v 1.53 2014/05/02 03:27:54 djm Exp $ */
+/* $OpenBSD: misc.h,v 1.54 2014/07/15 15:54:14 millert Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -15,6 +15,25 @@
#ifndef _MISC_H
#define _MISC_H
+/* Data structure for representing a forwarding request. */
+struct Forward {
+ char *listen_host; /* Host (address) to listen on. */
+ int listen_port; /* Port to forward. */
+ char *listen_path; /* Path to bind domain socket. */
+ char *connect_host; /* Host to connect. */
+ int connect_port; /* Port to connect on connect_host. */
+ char *connect_path; /* Path to connect domain socket. */
+ int allocated_port; /* Dynamically allocated listen port */
+ int handle; /* Handle for dynamic listen ports */
+};
+
+/* Common server and client forwarding options. */
+struct ForwardOptions {
+ int gateway_ports; /* Allow remote connects to forwarded ports. */
+ mode_t streamlocal_bind_mask; /* umask for streamlocal binds */
+ int streamlocal_bind_unlink; /* unlink socket before bind */
+};
+
/* misc.c */
char *chop(char *);
@@ -37,6 +56,7 @@ void ms_subtract_diff(struct timeval *, int *);
void ms_to_timeval(struct timeval *, int);
time_t monotime(void);
void lowercase(char *s);
+int unix_listener(const char *, int, int);
struct passwd *pwcopy(struct passwd *);
const char *ssh_gai_strerror(int);
@@ -66,6 +86,9 @@ int tun_open(int, int);
#define SSH_TUNID_ERR (SSH_TUNID_ANY - 1)
#define SSH_TUNID_MAX (SSH_TUNID_ANY - 2)
+/* Fake port to indicate that host field is really a path. */
+#define PORT_STREAMLOCAL -2
+
/* Functions to extract or store big-endian words of various sizes */
u_int64_t get_u64(const void *)
__attribute__((__bounded__( __minbytes__, 1, 8)));