Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2488)

Unified Diff: crypto/include/rdb.h

Issue 2344973002: Update libsrtp to version 2.0 (Closed)
Patch Set: Add '.' back to include_dirs Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « crypto/include/null_cipher.h ('k') | crypto/include/rdbx.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/include/rdb.h
diff --git a/srtp/crypto/include/rdb.h b/crypto/include/rdb.h
similarity index 62%
rename from srtp/crypto/include/rdb.h
rename to crypto/include/rdb.h
index 300c569f7040cab1bd13b9671207840319c108fa..69b0aa09b84a9bbbcee056a82709083684ea5169 100644
--- a/srtp/crypto/include/rdb.h
+++ b/crypto/include/rdb.h
@@ -49,7 +49,11 @@
#include "integers.h" /* for uint32_t */
#include "datatypes.h" /* for v128_t */
-#include "err.h" /* for err_status_t */
+#include "err.h" /* for srtp_err_status_t */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
/*
* if the ith least significant bit is one, then the packet index
@@ -57,74 +61,69 @@
*/
typedef struct {
- uint32_t window_start; /* packet index of the first bit in bitmask */
- v128_t bitmask;
-} rdb_t;
+ uint32_t window_start; /* packet index of the first bit in bitmask */
+ v128_t bitmask;
+} srtp_rdb_t;
-#define rdb_bits_in_bitmask (8*sizeof(v128_t))
+#define rdb_bits_in_bitmask (8 * sizeof(v128_t))
/*
- * rdb init
+ * srtp_rdb_init
*
* initalizes rdb
*
- * returns err_status_ok on success, err_status_t_fail otherwise
+ * returns srtp_err_status_ok on success, srtp_err_status_t_fail otherwise
*/
-
-err_status_t
-rdb_init(rdb_t *rdb);
+srtp_err_status_t srtp_rdb_init(srtp_rdb_t *rdb);
/*
- * rdb_check
+ * srtp_rdb_check
*
* checks to see if index appears in rdb
*
- * returns err_status_fail if the index already appears in rdb,
- * returns err_status_ok otherwise
+ * returns srtp_err_status_fail if the index already appears in rdb,
+ * returns srtp_err_status_ok otherwise
*/
-
-err_status_t
-rdb_check(const rdb_t *rdb, uint32_t rdb_index);
+srtp_err_status_t srtp_rdb_check(const srtp_rdb_t *rdb, uint32_t rdb_index);
/*
- * rdb_add_index
+ * srtp_rdb_add_index
*
- * adds index to rdb_t (and does *not* check if index appears in db)
+ * adds index to srtp_rdb_t (and does *not* check if index appears in db)
*
- * returns err_status_ok on success, err_status_fail otherwise
+ * returns srtp_err_status_ok on success, srtp_err_status_fail otherwise
*
*/
-
-err_status_t
-rdb_add_index(rdb_t *rdb, uint32_t rdb_index);
+srtp_err_status_t srtp_rdb_add_index(srtp_rdb_t *rdb, uint32_t rdb_index);
/*
- * the functions rdb_increment() and rdb_get_value() are for use by
+ * the functions srtp_rdb_increment() and srtp_rdb_get_value() are for use by
* senders, not receivers - DO NOT use these functions on the same
- * rdb_t upon which rdb_add_index is used!
+ * srtp_rdb_t upon which srtp_rdb_add_index is used!
*/
/*
- * rdb_increment(db) increments the sequence number in db, if it is
+ * srtp_rdb_increment(db) increments the sequence number in db, if it is
* not too high
*
* return values:
- *
- * err_status_ok no problem
- * err_status_key_expired sequence number too high
+ *
+ * srtp_err_status_ok no problem
+ * srtp_err_status_key_expired sequence number too high
*
*/
-err_status_t
-rdb_increment(rdb_t *rdb);
+srtp_err_status_t srtp_rdb_increment(srtp_rdb_t *rdb);
/*
- * rdb_get_value(db) returns the current sequence number of db
+ * srtp_rdb_get_value(db) returns the current sequence number of db
*/
+uint32_t srtp_rdb_get_value(const srtp_rdb_t *rdb);
-uint32_t
-rdb_get_value(const rdb_t *rdb);
+#ifdef __cplusplus
+}
+#endif
-#endif /* REPLAY_DB_H */
+#endif /* REPLAY_DB_H */
« no previous file with comments | « crypto/include/null_cipher.h ('k') | crypto/include/rdbx.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698