summaryrefslogtreecommitdiff
path: root/modules/dtls_srtp/dtls_srtp.h
diff options
context:
space:
mode:
authorAlfred E. Heggestad <aeh@db.org>2014-02-09 11:50:07 +0100
committerAlfred E. Heggestad <aeh@db.org>2014-02-09 11:50:07 +0100
commit98bf08bdcf2edd9d397f32650a8bfe62186fbecf (patch)
treeebc6ec71f44bff8c42e4eefced61948623df02fc /modules/dtls_srtp/dtls_srtp.h
parente6ad5cf4401b860ba402d4b7b3c7c254bc87a019 (diff)
baresip 0.4.10
Diffstat (limited to 'modules/dtls_srtp/dtls_srtp.h')
-rw-r--r--modules/dtls_srtp/dtls_srtp.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/modules/dtls_srtp/dtls_srtp.h b/modules/dtls_srtp/dtls_srtp.h
new file mode 100644
index 0000000..6f85bf3
--- /dev/null
+++ b/modules/dtls_srtp/dtls_srtp.h
@@ -0,0 +1,59 @@
+/**
+ * @file dtls_srtp.h DTLS-SRTP Internal api
+ *
+ * Copyright (C) 2010 Creytiv.com
+ */
+
+
+enum {
+ LAYER_SRTP = 20,
+ LAYER_DTLS = 20, /* must be above zero */
+};
+
+struct sock {
+ const struct dtls_srtp *ds;
+ struct dtls_flow *dtls;
+ struct srtp_stream *tx;
+ struct srtp_stream *rx;
+ struct udp_helper *uh_srtp;
+ void *app_sock;
+ bool negotiated;
+ bool is_rtp;
+};
+
+struct key {
+ uint8_t key[256];
+ size_t key_len;
+ uint8_t salt[256];
+ size_t salt_len;
+};
+
+
+/* dtls.c */
+int dtls_alloc_selfsigned(struct tls **tlsp, const char *aor,
+ const char *srtp_profile);
+int dtls_print_sha1_fingerprint(struct re_printf *pf, const struct tls *tls);
+int dtls_print_sha256_fingerprint(struct re_printf *pf, const struct tls *tls);
+
+
+/* srtp.c */
+int srtp_stream_add(struct srtp_stream **sp, const char *profile,
+ const struct key *key, bool tx);
+int srtp_install(struct sock *sock);
+
+
+/* tls_udp.c */
+struct dtls_flow;
+
+typedef void (dtls_estab_h)(int err, struct dtls_flow *tc,
+ const char *profile,
+ const struct key *client_key,
+ const struct key *server_key,
+ void *arg);
+
+int dtls_flow_alloc(struct dtls_flow **flowp, struct tls *tls,
+ struct udp_sock *us, dtls_estab_h *estabh, void *arg);
+int dtls_flow_start(struct dtls_flow *flow, const struct sa *peer,
+ bool active);
+int dtls_get_remote_fingerprint(const struct dtls_flow *flow, const char *type,
+ struct tls_fingerprint *fp);