summaryrefslogtreecommitdiff
path: root/modules/gzrtp/srtp.h
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gzrtp/srtp.h')
-rw-r--r--modules/gzrtp/srtp.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/modules/gzrtp/srtp.h b/modules/gzrtp/srtp.h
new file mode 100644
index 0000000..d42f4cf
--- /dev/null
+++ b/modules/gzrtp/srtp.h
@@ -0,0 +1,46 @@
+/**
+ * @file srtp.h GNU ZRTP: SRTP processing
+ *
+ * Copyright (C) 2010 - 2017 Creytiv.com
+ */
+#ifndef __SRTP_H
+#define __SRTP_H
+
+
+#include <libzrtpcpp/ZrtpCallback.h>
+
+
+#ifdef GZRTP_USE_RE_SRTP
+struct srtp;
+#else
+class CryptoContext;
+class CryptoContextCtrl;
+#endif
+
+
+class Srtp {
+public:
+ Srtp(int& err, const SrtpSecret_t *secrets, EnableSecurity part);
+ ~Srtp();
+
+ int protect(struct mbuf *mb);
+ int protect_ctrl(struct mbuf *mb);
+ int unprotect(struct mbuf *mb);
+ int unprotect_ctrl(struct mbuf *mb);
+
+private:
+ int protect_int(struct mbuf *mb, bool control);
+ int unprotect_int(struct mbuf *mb, bool control);
+
+#ifdef GZRTP_USE_RE_SRTP
+ int32_t m_auth_tag_len;
+ struct srtp *m_srtp;
+#else
+ CryptoContext *m_cc;
+ CryptoContextCtrl *m_cc_ctrl;
+#endif
+};
+
+
+#endif // __SRTP_H
+