summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2001-12-05 17:25:44 +0000
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2001-12-05 17:25:44 +0000
commitc393fd8a48c256b7d7cd087190a66dbc87c048e6 (patch)
tree64bca7e167b543c4af0e1cab92937a274e58deb0 /lib
parentc3bb0dca4238ef75893b00d73a883a8b3f2c7ce3 (diff)
downloadgnutls-c393fd8a48c256b7d7cd087190a66dbc87c048e6.tar.gz
Changes in function names concerning _db_ handling and _session_ handling.
Diffstat (limited to 'lib')
-rw-r--r--lib/gnutls.h.in24
-rw-r--r--lib/gnutls_db.c40
-rw-r--r--lib/gnutls_db.h4
-rw-r--r--lib/gnutls_session.c16
-rw-r--r--lib/gnutls_session.h4
5 files changed, 45 insertions, 43 deletions
diff --git a/lib/gnutls.h.in b/lib/gnutls.h.in
index 5a666f5f47..b3998bc868 100644
--- a/lib/gnutls.h.in
+++ b/lib/gnutls.h.in
@@ -127,14 +127,15 @@ int gnutls_set_protocol_priority( GNUTLS_STATE state, GNUTLS_LIST);
/* set our version - 0 for TLS 1.0 and 1 for SSL3 */
GNUTLS_Version gnutls_get_current_version(GNUTLS_STATE state);
+
const char *gnutls_version_get_name(GNUTLS_Version version);
/* get/set session */
-int gnutls_set_current_session( GNUTLS_STATE state, void* session, int session_size);
-int gnutls_get_current_session( GNUTLS_STATE state, void* session, int *session_size);
+int gnutls_session_set_data( GNUTLS_STATE state, void* session, int session_size);
+int gnutls_session_get_data( GNUTLS_STATE state, void* session, int *session_size);
/* returns the session ID */
-int gnutls_get_current_session_id( GNUTLS_STATE state, void* session, int *session_size);
+int gnutls_session_get_id( GNUTLS_STATE state, void* session, int *session_size);
typedef int (*DB_STORE_FUNC)(void*, gnutls_datum key, gnutls_datum data);
typedef int (*DB_REMOVE_FUNC)(void*, gnutls_datum key);
@@ -142,13 +143,14 @@ typedef gnutls_datum (*DB_RETR_FUNC)(void*, gnutls_datum key);
void gnutls_set_lowat( GNUTLS_STATE state, int num);
void gnutls_set_cache_expiration( GNUTLS_STATE state, int seconds);
-int gnutls_set_db_name( GNUTLS_STATE state, char* filename);
-int gnutls_clean_db( GNUTLS_STATE state);
-void gnutls_set_db_retrieve_func( GNUTLS_STATE, DB_RETR_FUNC);
-void gnutls_set_db_remove_func( GNUTLS_STATE, DB_REMOVE_FUNC);
-void gnutls_set_db_store_func( GNUTLS_STATE, DB_STORE_FUNC);
-void gnutls_set_db_ptr( GNUTLS_STATE, void* db_ptr);
-int gnutls_check_db_entry( GNUTLS_STATE state, gnutls_datum session_entry);
+
+int gnutls_db_set_name( GNUTLS_STATE state, char* filename);
+int gnutls_db_clean( GNUTLS_STATE state);
+void gnutls_db_set_retrieve_func( GNUTLS_STATE, DB_RETR_FUNC);
+void gnutls_db_set_remove_func( GNUTLS_STATE, DB_REMOVE_FUNC);
+void gnutls_db_set_store_func( GNUTLS_STATE, DB_STORE_FUNC);
+void gnutls_db_set_ptr( GNUTLS_STATE, void* db_ptr);
+int gnutls_db_check_entry( GNUTLS_STATE state, gnutls_datum session_entry);
void gnutls_set_max_handshake_data_buffer_size( GNUTLS_STATE state, int max);
@@ -165,7 +167,7 @@ int gnutls_set_cred( GNUTLS_STATE, CredType type, void* cred);
* TLS extension. (draft-ietf-tls-extensions)
*/
const void* gnutls_ext_get_name_ind( GNUTLS_STATE state, GNUTLS_NAME_IND ind);
-int gnutls_ext_set_name_ind( GNUTLS_STATE state, GNUTLS_NAME_IND ind, const void* name);
+ int gnutls_ext_set_name_ind( GNUTLS_STATE state, GNUTLS_NAME_IND ind, const void* name);
/* This will set the Common Name field in case of X509PKI
* authentication. This will be used while verifying the
diff --git a/lib/gnutls_db.c b/lib/gnutls_db.c
index 7e68afd101..5815a67dbb 100644
--- a/lib/gnutls_db.c
+++ b/lib/gnutls_db.c
@@ -38,7 +38,7 @@
#endif
/**
- * gnutls_set_db_retrieve_function - Sets the function that will be used to get data
+ * gnutls_db_set_retrieve_function - Sets the function that will be used to get data
* @state: is a &GNUTLS_STATE structure.
* @retr_func: is the function.
*
@@ -48,16 +48,16 @@
* This function should only be used if you do
* not plan to use the included gdbm backend.
*
- * The first argument to store_func() will be null unless gnutls_set_db_ptr()
+ * The first argument to store_func() will be null unless gnutls_db_set_ptr()
* has been called.
*
**/
-void gnutls_set_db_retrieve_function( GNUTLS_STATE state, DB_RETR_FUNC retr_func) {
+void gnutls_db_set_retrieve_function( GNUTLS_STATE state, DB_RETR_FUNC retr_func) {
state->gnutls_internals.db_retrieve_func = retr_func;
}
/**
- * gnutls_set_db_remove_function - Sets the function that will be used to remove data
+ * gnutls_db_set_remove_function - Sets the function that will be used to remove data
* @state: is a &GNUTLS_STATE structure.
* @rem_func: is the function.
*
@@ -66,16 +66,16 @@ void gnutls_set_db_retrieve_function( GNUTLS_STATE state, DB_RETR_FUNC retr_func
* This function should only be used if you do
* not plan to use the included gdbm backend.
*
- * The first argument to rem_func() will be null unless gnutls_set_db_ptr()
+ * The first argument to rem_func() will be null unless gnutls_db_set_ptr()
* has been called.
*
**/
-void gnutls_set_db_remove_function( GNUTLS_STATE state, DB_REMOVE_FUNC rem_func) {
+void gnutls_db_set_remove_function( GNUTLS_STATE state, DB_REMOVE_FUNC rem_func) {
state->gnutls_internals.db_remove_func = rem_func;
}
/**
- * gnutls_set_db_store_function - Sets the function that will be used to put data
+ * gnutls_db_set_store_function - Sets the function that will be used to put data
* @state: is a &GNUTLS_STATE structure.
* @store_func: is the function
*
@@ -84,16 +84,16 @@ void gnutls_set_db_remove_function( GNUTLS_STATE state, DB_REMOVE_FUNC rem_func)
* This function should only be used if you do
* not plan to use the included gdbm backend.
*
- * The first argument to store_func() will be null unless gnutls_set_db_ptr()
+ * The first argument to store_func() will be null unless gnutls_db_set_ptr()
* has been called.
*
**/
-void gnutls_set_db_store_function( GNUTLS_STATE state, DB_STORE_FUNC store_func) {
+void gnutls_db_set_store_function( GNUTLS_STATE state, DB_STORE_FUNC store_func) {
state->gnutls_internals.db_store_func = store_func;
}
/**
- * gnutls_set_db_ptr - Sets a pointer to be sent to db functions
+ * gnutls_db_set_ptr - Sets a pointer to be sent to db functions
* @state: is a &GNUTLS_STATE structure.
* @ptr: is the pointer
*
@@ -101,7 +101,7 @@ void gnutls_set_db_store_function( GNUTLS_STATE state, DB_STORE_FUNC store_func)
* the first argument. Should only be called if not using the gdbm backend.
*
**/
-void gnutls_set_db_ptr( GNUTLS_STATE state, void* ptr) {
+void gnutls_db_set_ptr( GNUTLS_STATE state, void* ptr) {
state->gnutls_internals.db_ptr = ptr;
}
@@ -118,7 +118,7 @@ void gnutls_set_cache_expiration( GNUTLS_STATE state, int seconds) {
}
/**
- * gnutls_set_db_name - Sets the name of the database that holds TLS sessions.
+ * gnutls_db_set_name - Sets the name of the database that holds TLS sessions.
* @state: is a &GNUTLS_STATE structure.
* @filename: is the filename for the database
*
@@ -126,10 +126,10 @@ void gnutls_set_cache_expiration( GNUTLS_STATE state, int seconds) {
* the sessions to be resumed. This function also creates the database
* - if it does not exist - and opens it for reading.
* You should not call this function if using an other backend
- * than gdbm (ie. called function gnutls_set_db_store_func() etc.)
+ * than gdbm (ie. called function gnutls_db_set_store_func() etc.)
*
**/
-int gnutls_set_db_name( GNUTLS_STATE state, char* filename) {
+int gnutls_db_set_name( GNUTLS_STATE state, char* filename) {
#ifdef HAVE_LIBGDBM
GDBM_FILE dbf;
@@ -166,7 +166,7 @@ GDBM_FILE dbf;
}
/**
- * gnutls_check_db_entry - checks if the given db entry has expired
+ * gnutls_db_check_entry - checks if the given db entry has expired
* @state: is a &GNUTLS_STATE structure.
* @session_entry: is the session data (not key)
*
@@ -177,7 +177,7 @@ GDBM_FILE dbf;
* backend.
*
**/
-int gnutls_check_db_entry( GNUTLS_STATE state, gnutls_datum session_entry) {
+int gnutls_db_check_entry( GNUTLS_STATE state, gnutls_datum session_entry) {
time_t timestamp;
timestamp = time(0);
@@ -190,7 +190,7 @@ time_t timestamp;
}
/**
- * gnutls_clean_db - removes expired and invalid sessions from the database
+ * gnutls_db_clean - removes expired and invalid sessions from the database
* @state: is a &GNUTLS_STATE structure.
*
* This function Deletes all expired records in the resumed sessions' database.
@@ -199,7 +199,7 @@ time_t timestamp;
* be called if using the gdbm backend.
*
**/
-int gnutls_clean_db( GNUTLS_STATE state) {
+int gnutls_db_clean( GNUTLS_STATE state) {
#ifdef HAVE_LIBGDBM
GDBM_FILE dbf;
int ret;
@@ -220,7 +220,7 @@ gnutls_datum _key;
_key.size = key.dsize;
while( _key.data != NULL) {
- if ( gnutls_check_db_entry( state, _key)==GNUTLS_E_EXPIRED) {
+ if ( gnutls_db_check_entry( state, _key)==GNUTLS_E_EXPIRED) {
/* delete expired entry */
gdbm_delete( dbf, key);
}
@@ -290,7 +290,7 @@ int ret;
}
/* expiration check is performed inside */
- ret = gnutls_set_current_session( state, data.data, data.size);
+ ret = gnutls_session_set_data( state, data.data, data.size);
/* Note: Data is not allocated with gnutls_malloc
*/
diff --git a/lib/gnutls_db.h b/lib/gnutls_db.h
index a547a49a2e..b62cd13161 100644
--- a/lib/gnutls_db.h
+++ b/lib/gnutls_db.h
@@ -19,10 +19,10 @@
*/
void gnutls_set_cache_expiration( GNUTLS_STATE state, int seconds);
-int gnutls_set_db_name( GNUTLS_STATE state, char* filename);
+int gnutls_db_set_name( GNUTLS_STATE state, char* filename);
int _gnutls_server_register_current_session( GNUTLS_STATE state);
int _gnutls_server_restore_session( GNUTLS_STATE state, uint8* session_id, int session_id_size);
-int gnutls_clean_db( GNUTLS_STATE state);
+int gnutls_db_clean( GNUTLS_STATE state);
int _gnutls_db_remove_session( GNUTLS_STATE state, uint8* session_id, int session_id_size);
int _gnutls_store_session( GNUTLS_STATE state, gnutls_datum session_id, gnutls_datum session_data);
gnutls_datum _gnutls_retrieve_session( GNUTLS_STATE state, gnutls_datum session_id);
diff --git a/lib/gnutls_session.c b/lib/gnutls_session.c
index 8e98641e60..43cca3e1ab 100644
--- a/lib/gnutls_session.c
+++ b/lib/gnutls_session.c
@@ -25,19 +25,19 @@
#define SESSION_SIZE _gnutls_session_size( state)
/**
- * gnutls_get_current_session - Returns all session parameters.
+ * gnutls_session_get_data - Returns all session parameters.
* @state: is a &GNUTLS_STATE structure.
* @session: is a pointer to space to hold the session.
* @session_size: is the session's size, or it will be set by the function.
*
* Returns all session parameters - in order to support resuming.
* The client should call this - and keep the returned session - if he wants to
- * resume that current version later by calling gnutls_set_current_session()
+ * resume that current version later by calling gnutls_session_set_data()
* This function must be called after a successful handshake.
*
* Resuming sessions is really useful and speedups connections after a succesful one.
**/
-int gnutls_get_current_session( GNUTLS_STATE state, opaque* session, int *session_size) {
+int gnutls_session_get_data( GNUTLS_STATE state, opaque* session, int *session_size) {
gnutls_datum psession;
int ret;
@@ -67,7 +67,7 @@ int gnutls_get_current_session( GNUTLS_STATE state, opaque* session, int *sessio
/**
- * gnutls_get_current_session_id - Returns session id.
+ * gnutls_session_get_id - Returns session id.
* @state: is a &GNUTLS_STATE structure.
* @session: is a pointer to space to hold the session id.
* @session_size: is the session id's size, or it will be set by the function.
@@ -79,7 +79,7 @@ int gnutls_get_current_session( GNUTLS_STATE state, opaque* session, int *sessio
* Session id is some data set by the server, that identify the current session.
* In TLS 1.0 session id should not be more than 32 bytes.
**/
-int gnutls_get_current_session_id( GNUTLS_STATE state, void* session, int *session_size) {
+int gnutls_session_get_id( GNUTLS_STATE state, void* session, int *session_size) {
*session_size = state->security_parameters.session_id_size;
@@ -93,19 +93,19 @@ int gnutls_get_current_session_id( GNUTLS_STATE state, void* session, int *sessi
}
/**
- * gnutls_set_current_session - Sets all session parameters
+ * gnutls_session_set_data - Sets all session parameters
* @state: is a &GNUTLS_STATE structure.
* @session: is a pointer to space to hold the session.
* @session_size: is the session's size
*
* Sets all session parameters - in order to support resuming
- * session must be the one returned by gnutls_get_current_session();
+ * session must be the one returned by gnutls_session_get_data();
* This function should be called before gnutls_handshake().
* Keep in mind that session resuming is advisory. The server may
* choose not to resume the session, thus a full handshake will be
* performed.
**/
-int gnutls_set_current_session( GNUTLS_STATE state, opaque* session, int session_size) {
+int gnutls_session_set_data( GNUTLS_STATE state, opaque* session, int session_size) {
int ret;
gnutls_datum psession = { session, session_size };
diff --git a/lib/gnutls_session.h b/lib/gnutls_session.h
index ce456afefc..9ed5b5cbf5 100644
--- a/lib/gnutls_session.h
+++ b/lib/gnutls_session.h
@@ -18,5 +18,5 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-int gnutls_set_current_session( GNUTLS_STATE state, opaque* session, int session_size);
-int gnutls_get_current_session( GNUTLS_STATE state, opaque* session, int *session_size);
+int gnutls_session_set_data( GNUTLS_STATE state, opaque* session, int session_size);
+int gnutls_session_get_data( GNUTLS_STATE state, opaque* session, int *session_size);