summaryrefslogtreecommitdiff
path: root/lib/socket.h
diff options
context:
space:
mode:
authorPavel TvrdĂ­k <pawel.tvrdik@gmail.com>2015-09-17 17:15:30 +0200
committerJan Moskyto Matejka <mq@ucw.cz>2016-12-07 09:35:24 +0100
commit65d2a88dd2aaef7344cfa62918e3ddf4c72ca50a (patch)
tree26da08ceb1c12c4b5fd37d9a4fd51cfc5b70b301 /lib/socket.h
parent2706747f66ab0e7a7f2b8acc6bd7fbd376647258 (diff)
RPKI protocol with one cache server per protocol
The RPKI protocol (RFC 6810) using the RTRLib (http://rpki.realmv6.org/) that is integrated inside the BIRD's code. Implemeted transports are: - unprotected transport over TCP - secure transport over SSHv2 Example configuration of bird.conf: ... roa4 table r4; roa6 table r6; protocol rpki { debug all; # Import both IPv4 and IPv6 ROAs roa4 { table r4; }; roa6 { table r6; }; # Set cache server (validator) address, # overwrite default port 323 remote "rpki-validator.realmv6.org" port 8282; # Overwrite default time intervals retry 10; # Default 600 seconds refresh 60; # Default 3600 seconds expire 600; # Default 7200 seconds } protocol rpki { debug all; # Import only IPv4 routes roa4 { table r4; }; # Set cache server address to localhost, # use default ports tcp => 323 or ssh => 22 remote 127.0.0.1; # Use SSH transport instead of unprotected transport over TCP ssh encryption { bird private key "/home/birdgeek/.ssh/id_rsa"; remote public key "/home/birdgeek/.ssh/known_hosts"; user "birdgeek"; }; } ...
Diffstat (limited to 'lib/socket.h')
-rw-r--r--lib/socket.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/lib/socket.h b/lib/socket.h
index 7d1aa7ef..ce06a19c 100644
--- a/lib/socket.h
+++ b/lib/socket.h
@@ -12,6 +12,24 @@
#include <errno.h>
#include "lib/resource.h"
+#include "lib/libssh.h"
+
+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 */
+};
typedef struct birdsock {
resource r;
@@ -20,6 +38,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 +71,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 +135,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