summaryrefslogtreecommitdiff
path: root/lib/socket.h
diff options
context:
space:
mode:
authorJan Moskyto Matejka <mq@ucw.cz>2016-12-07 15:30:46 +0100
committerJan Moskyto Matejka <mq@ucw.cz>2016-12-07 15:30:46 +0100
commitad88b94bca78e010357a6c7806e1d5e01701d4a7 (patch)
tree9c06e9c1b0c87f372dcf27cc832d5692db112e80 /lib/socket.h
parentd15b0b0a1b494c14b139d2d28706d82cd6e2f139 (diff)
parentaf62c0f9f1f6382fe88c8ae5e514f70c0b5b6d05 (diff)
Merge branch 'int-new-rpki-squashed' (early part) into int-new
Diffstat (limited to 'lib/socket.h')
-rw-r--r--lib/socket.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/lib/socket.h b/lib/socket.h
index 43db3cab..d5281b83 100644
--- a/lib/socket.h
+++ b/lib/socket.h
@@ -12,6 +12,29 @@
#include <errno.h>
#include "lib/resource.h"
+#ifdef HAVE_LIBSSH
+#define LIBSSH_LEGACY_0_4
+#include <libssh/libssh.h>
+#endif
+
+#ifdef HAVE_LIBSSH
+struct ssh_sock {
+ const char *username; /* (Required) SSH user name */
+ const char *server_hostkey_path; /* (Optional) Filepath to the SSH public key of remote side, can be knownhost file */
+ const char *client_privkey_path; /* (Optional) Filepath to the SSH private key of BIRD */
+ const char *subsystem; /* (Optional) Name of SSH subsytem */
+ ssh_session session; /* Internal */
+ ssh_channel channel; /* Internal */
+ int state; /* Internal */
+#define SK_SSH_CONNECT 0 /* Start state */
+#define SK_SSH_SERVER_KNOWN 1 /* Internal */
+#define SK_SSH_USERAUTH 2 /* Internal */
+#define SK_SSH_CHANNEL 3 /* Internal */
+#define SK_SSH_SESSION 4 /* Internal */
+#define SK_SSH_SUBSYSTEM 5 /* Internal */
+#define SK_SSH_ESTABLISHED 6 /* Final state */
+};
+#endif
typedef struct birdsock {
resource r;
@@ -20,6 +43,7 @@ typedef struct birdsock {
int subtype; /* Socket subtype */
void *data; /* User data */
ip_addr saddr, daddr; /* IPA_NONE = unspecified */
+ const char *host; /* Alternative to daddr, NULL = unspecified */
uint sport, dport; /* 0 = unspecified (for IP: protocol type) */
int tos; /* TOS / traffic class, -1 = default */
int priority; /* Local socket priority, -1 = default */
@@ -52,7 +76,8 @@ typedef struct birdsock {
node n;
void *rbuf_alloc, *tbuf_alloc;
char *password; /* Password for MD5 authentication */
- char *err; /* Error message */
+ const char *err; /* Error message */
+ struct ssh_sock *ssh; /* Used in SK_SSH */
} sock;
sock *sock_new(pool *); /* Allocate new socket */
@@ -115,6 +140,8 @@ extern int sk_priority_control; /* Suggested priority for control traffic, shou
#define SK_MAGIC 7 /* Internal use by sysdep code */
#define SK_UNIX_PASSIVE 8
#define SK_UNIX 9
+#define SK_SSH_ACTIVE 10 /* - - * * - ? - DA = host */
+#define SK_SSH 11
/*
* Socket subtypes