aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/osmo-pcap/osmo_pcap_server.h15
-rw-r--r--include/osmo-pcap/osmo_tls.h10
2 files changed, 25 insertions, 0 deletions
diff --git a/include/osmo-pcap/osmo_pcap_server.h b/include/osmo-pcap/osmo_pcap_server.h
index 6facbe3..89c3df2 100644
--- a/include/osmo-pcap/osmo_pcap_server.h
+++ b/include/osmo-pcap/osmo_pcap_server.h
@@ -24,6 +24,7 @@
#define OSMO_PCAP_SERVER_H
#include "wireformat.h"
+#include "osmo_tls.h"
#include <osmocom/core/select.h>
#include <osmocom/core/linuxlist.h>
@@ -35,6 +36,7 @@
#include <pcap.h>
+#include <stdbool.h>
#include <time.h>
struct rate_ctr_group;
@@ -94,6 +96,12 @@ struct osmo_pcap_conn {
/* statistics */
struct rate_ctr_group *ctrg;
+
+ /* tls */
+ bool tls_use;
+ bool direct_read;
+ size_t tls_limit_read;
+ struct osmo_tls_session tls_session;
};
struct osmo_pcap_server {
@@ -109,6 +117,13 @@ struct osmo_pcap_server {
void *zmq_ctx;
void *zmq_publ;
+ /* tls base */
+ unsigned tls_log_level;
+ char *tls_priority;
+ char *tls_capath;
+ char *tls_server_cert;
+ char *tls_server_key;
+
char *base_path;
off_t max_size;
diff --git a/include/osmo-pcap/osmo_tls.h b/include/osmo-pcap/osmo_tls.h
index bfc813e..54fea4d 100644
--- a/include/osmo-pcap/osmo_tls.h
+++ b/include/osmo-pcap/osmo_tls.h
@@ -24,10 +24,13 @@
#include <gnutls/abstract.h>
#include <stdbool.h>
+#include <stdint.h>
struct osmo_fd;
struct osmo_wqueue;
struct osmo_pcap_client;
+struct osmo_pcap_conn;
+struct osmo_pcap_server;
struct osmo_tls_session {
bool in_use;
@@ -38,6 +41,8 @@ struct osmo_tls_session {
/* any credentials */
bool anon_alloc;
gnutls_anon_client_credentials_t anon_cred;
+ bool anon_serv_alloc;
+ gnutls_anon_server_credentials_t anon_serv_cred;
/* a x509 cert credential */
bool cert_alloc;
@@ -53,6 +58,7 @@ struct osmo_tls_session {
struct osmo_wqueue *wqueue;
+ int (*read)(struct osmo_tls_session *session);
void (*error)(struct osmo_tls_session *session);
void (*handshake_done)(struct osmo_tls_session *session);
};
@@ -60,6 +66,10 @@ struct osmo_tls_session {
void osmo_tls_init(void);
bool osmo_tls_init_client_session(struct osmo_pcap_client *client);
+
+bool osmo_tls_init_server_session(struct osmo_pcap_conn *conn, struct osmo_pcap_server *server);
void osmo_tls_release(struct osmo_tls_session *);
int osmo_tls_client_bfd_cb(struct osmo_fd *fd, unsigned int what);
+
+size_t osmo_tls_pending(struct osmo_tls_session *session);